diff --git a/Build/AtlasBuildScripts/checkout_atlasexternals.sh b/Build/AtlasBuildScripts/checkout_atlasexternals.sh index 0fa33c4f5661dfd04c4a2b8c28e5de65c7ca5dfd..b0857902590482264f5f64946434baa8281085ad 100755 --- a/Build/AtlasBuildScripts/checkout_atlasexternals.sh +++ b/Build/AtlasBuildScripts/checkout_atlasexternals.sh @@ -111,9 +111,9 @@ fi # check whether the source directory points to the right repository RECLONE=false pushd ${SOURCEDIR} -SOURCEURL=$(git remote get-url origin) +SOURCEURL=$(git ls-remote --get-url origin) if [ "${SOURCEURL}" != "${EXTERNALSURL}" ] ; then - echo "${SOURCEURL} wasn't cloned from ${EXTERNALSURL}, deleting" + echo "checkout_externals: Warning! ${SOURCEURL} wasn't cloned from ${EXTERNALSURL}, deleting" RECLONE=true fi popd diff --git a/Commission/CommissionRec/CMakeLists.txt b/Commission/CommissionRec/CMakeLists.txt index 4fb77c0f1b5d08d8abd55059d083fbea72ec3990..b498027aa21e1fa93698f641c65498e335467c1c 100644 --- a/Commission/CommissionRec/CMakeLists.txt +++ b/Commission/CommissionRec/CMakeLists.txt @@ -22,7 +22,7 @@ atlas_add_component( CommissionRec src/*.cxx src/components/*.cxx INCLUDE_DIRS ${CLHEP_INCLUDE_DIRS} - LINK_LIBRARIES ${CLHEP_LIBRARIES} CommissionUtilsLib AthenaBaseComps GaudiKernel CommissionEvent ) + LINK_LIBRARIES ${CLHEP_LIBRARIES} CommissionUtilsLib AthenaBaseComps GaudiKernel CommissionEvent TrackRecordLib ) # Install files from the package: atlas_install_headers( CommissionRec ) diff --git a/Control/AthLinksSA/AthLinks/DataLink.h b/Control/AthLinksSA/AthLinks/DataLink.h index ca3c39b6c2f8986c94ed9829246e207f463120b5..63580224585c5ec3dbc67882ebb9888a5dc41f0a 100644 --- a/Control/AthLinksSA/AthLinks/DataLink.h +++ b/Control/AthLinksSA/AthLinks/DataLink.h @@ -160,35 +160,18 @@ private: */ ENTER_ROOT_SELECTION_NS template< class STORABLE > -class DataLink -#if ROOT_VERSION_CODE >= ROOT_VERSION( 6, 0, 2 ) - : public SelectNoInstance -#endif // ROOT_VERSION +class DataLink : public SelectNoInstance { public: /// Convenience declaration of this structure's type typedef DataLink< STORABLE > self; -#if ROOT_VERSION_CODE < ROOT_VERSION( 5, 99, 0 ) - - /// Do not generate such dictionaries automatically - ROOT_SELECTION_NS::NO_SELF_AUTOSELECT dummy; - - /// Declare m_object as transient - ROOT_SELECTION_NS::TRANSIENT m_object; - /// Declare m_event as transient - ROOT_SELECTION_NS::TRANSIENT m_event; - -#else - /// Declare m_object as transient ROOT_SELECTION_NS::MemberAttributes< kTransient > m_object; /// Declare m_event as transient ROOT_SELECTION_NS::MemberAttributes< kTransient > m_event; -#endif // ROOT_VERSION - }; EXIT_ROOT_SELECTION_NS diff --git a/Control/AthLinksSA/AthLinks/ElementLink.h b/Control/AthLinksSA/AthLinks/ElementLink.h index e5b9d36f5f9325e7f41ed2fac2cd9a9fe4f2e57b..f782e342df2ea1795029ae1153a26337da7625eb 100644 --- a/Control/AthLinksSA/AthLinks/ElementLink.h +++ b/Control/AthLinksSA/AthLinks/ElementLink.h @@ -216,37 +216,19 @@ private: */ ENTER_ROOT_SELECTION_NS template< typename STORABLE > -class ElementLink -#if ROOT_VERSION_CODE >= ROOT_VERSION( 6, 0, 2 ) - : public SelectNoInstance -#endif // ROOT_VERSION +class ElementLink : public SelectNoInstance { public: /// Helper definition typedef ElementLink< STORABLE > self; -#if ROOT_VERSION_CODE < ROOT_VERSION( 5, 99, 0 ) - - /// Don't generate such dictionaries automatically - ROOT_SELECTION_NS::NO_SELF_AUTOSELECT dummy; - - /// Mark all transient members: - ROOT_SELECTION_NS::TRANSIENT m_container; - ROOT_SELECTION_NS::TRANSIENT m_element; - ROOT_SELECTION_NS::TRANSIENT m_elementCached; - ROOT_SELECTION_NS::TRANSIENT m_event; - -#else - /// Mark all transient members: ROOT_SELECTION_NS::MemberAttributes< kTransient > m_container; ROOT_SELECTION_NS::MemberAttributes< kTransient > m_element; ROOT_SELECTION_NS::MemberAttributes< kTransient > m_elementCached; ROOT_SELECTION_NS::MemberAttributes< kTransient > m_event; -#endif // ROOT_VERSION - }; EXIT_ROOT_SELECTION_NS diff --git a/Control/AthLinksSA/AthLinks/ElementLinkVector.h b/Control/AthLinksSA/AthLinks/ElementLinkVector.h index d2452193e01db76e5614dc3bcb75edb0c4cffa0c..e4bad5bb7cea3a2e2bf7619b891be90ea65efd9c 100644 --- a/Control/AthLinksSA/AthLinks/ElementLinkVector.h +++ b/Control/AthLinksSA/AthLinks/ElementLinkVector.h @@ -194,31 +194,16 @@ private: */ ENTER_ROOT_SELECTION_NS template< class CONTAINER > -class ElementLinkVector -#if ROOT_VERSION_CODE >= ROOT_VERSION( 6, 0, 2 ) - : public SelectNoInstance -#endif // ROOT_VERSION +class ElementLinkVector : public SelectNoInstance { public: /// Helper definition typedef ElementLinkVector< CONTAINER > self; -#if ROOT_VERSION_CODE < ROOT_VERSION( 5, 99, 0 ) - - /// Don't generate such dictionaries automatically - ROOT_SELECTION_NS::NO_SELF_AUTOSELECT dummy; - - /// Mark all transient members: - ROOT_SELECTION_NS::TRANSIENT m_elVec; - -#else - /// Mark all transient members: ROOT_SELECTION_NS::MemberAttributes< kTransient > m_elVec; -#endif // ROOT_VERSION - }; EXIT_ROOT_SELECTION_NS diff --git a/Control/AthLinksSA/AthLinks/tools/selection_ns.h b/Control/AthLinksSA/AthLinks/tools/selection_ns.h index b9016fe473778b1712563234faff5d2a839adc59..5fca0a7d03c8cfe2e665e2bcfc2fb970fc754716 100644 --- a/Control/AthLinksSA/AthLinks/tools/selection_ns.h +++ b/Control/AthLinksSA/AthLinks/tools/selection_ns.h @@ -15,58 +15,8 @@ #define ATHLINKS_TOOLS_SELECTION_NS // ROOT include(s): -#include "RVersion.h" -// Include the correct "selection header": -#if ROOT_VERSION_CODE < ROOT_VERSION( 5, 99, 00 ) -# include <Reflex/Builder/DictSelection.h> -#else -# include <RootMetaSelection.h> -#endif // ROOT 5 - -#if ROOT_VERSION_CODE < ROOT_VERSION( 5, 19, 0 ) - -// -// Definitions for *really* old ROOT versions: -// - -#ifndef ROOT_SELECTION_NS -# define ROOT_SELECTION_NS ROOT::Reflex::Selection -#endif - -#ifndef ENTER_ROOT_SELECTION_NS -# define ENTER_ROOT_SELECTION_NS \ - namespace ROOT { namespace Reflex { namespace Selection { -#endif - -#ifndef EXIT_ROOT_SELECTION_NS -# define EXIT_ROOT_SELECTION_NS }}} -#endif - -#elif ROOT_VERSION_CODE < ROOT_VERSION( 5, 99, 0 ) - -// -// Definitions for ROOT 5: -// - -#ifndef ROOT_SELECTION_NS -# define ROOT_SELECTION_NS Reflex::Selection -#endif - -#ifndef ENTER_ROOT_SELECTION_NS -# define ENTER_ROOT_SELECTION_NS \ - namespace Reflex { namespace Selection { -#endif - -#ifndef EXIT_ROOT_SELECTION_NS -# define EXIT_ROOT_SELECTION_NS }} -#endif - -#else - -// -// Definitions for ROOT 6: -// +#include <RootMetaSelection.h> #ifndef ROOT_SELECTION_NS # define ROOT_SELECTION_NS ROOT::Meta::Selection @@ -81,6 +31,4 @@ # define EXIT_ROOT_SELECTION_NS }}} #endif -#endif // ROOT_VERSION - #endif // not ATHLINKS_TOOLS_SELECTION_NS diff --git a/Control/AthenaMonitoring/share/Run3DQTestingDriver.py b/Control/AthenaMonitoring/share/Run3DQTestingDriver.py index 251ff59a5a37201ab710e8dae4e6bf42ef7e4f19..9842008ee26286d0b5fedf333a0975332b41aa73 100755 --- a/Control/AthenaMonitoring/share/Run3DQTestingDriver.py +++ b/Control/AthenaMonitoring/share/Run3DQTestingDriver.py @@ -1,6 +1,6 @@ #!/usr/bin/env python # -# Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration +# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration # '''@file DQTestingDriver.py @@ -63,6 +63,19 @@ if __name__=='__main__': log.info('Executing preExec: %s', args.preExec) exec(args.preExec) + if hasattr(ConfigFlags, "DQ") and hasattr(ConfigFlags.DQ, "Steering") and hasattr(ConfigFlags, "Detector"): + if hasattr(ConfigFlags.DQ.Steering, "InDet"): + if ((ConfigFlags.DQ.Steering.InDet, "doAlignMon") and ConfigFlags.DQ.Steering.InDet.doAlignMon) or \ + ((ConfigFlags.DQ.Steering.InDet, "doGlobalMon") and ConfigFlags.DQ.Steering.InDet.doGlobalMon) or \ + ((ConfigFlags.DQ.Steering.InDet, "doPerfMon") and ConfigFlags.DQ.Steering.InDet.doPerfMon): + ConfigFlags.Detector.GeometryID = True + if hasattr(ConfigFlags.DQ.Steering, "doPixelMon") and ConfigFlags.DQ.Steering.doPixelMon: + ConfigFlags.Detector.GeometryPixel = True + if hasattr(ConfigFlags.DQ.Steering, "doSCTMon") and ConfigFlags.DQ.Steering.doSCTMon: + ConfigFlags.Detector.GeometrySCT = True + if hasattr(ConfigFlags.DQ.Steering, "doTRTMon") and ConfigFlags.DQ.Steering.doTRTMon: + ConfigFlags.Detector.GeometryTRT = True + log.info('FINAL CONFIG FLAGS SETTINGS FOLLOW') ConfigFlags.dump() diff --git a/Control/AthenaMonitoring/test/test_run3dq_r21_aod.sh b/Control/AthenaMonitoring/test/test_run3dq_r21_aod.sh index ea6b6a39a4fa5bd39fe8c14c93cf72e64a6c9dfa..f47143ea2aa75c1b3f1aed5b0f9f8375d027009d 100755 --- a/Control/AthenaMonitoring/test/test_run3dq_r21_aod.sh +++ b/Control/AthenaMonitoring/test/test_run3dq_r21_aod.sh @@ -5,12 +5,13 @@ # art-output: ExampleMonitorOutput.root # art-output: log* -Run3DQTestingDriver.py 'Input.Files=["/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/ASG/data16_13TeV.00311321.physics_Main.recon.AOD.r9264/AOD.11038520._000001.pool.root.1"]' DQ.Steering.doHLTMon=False DQ.Environment=AOD > log.HIST_Creation 2>&1 +Run3DQTestingDriver.py 'Input.Files=["/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/AthenaMonitoring/data18_13TeV.00354309.physics_Main.recon.AOD.f946._lb0130._0001.1"]' DQ.Steering.doHLTMon=False DQ.Environment=AOD > log.HIST_Creation 2>&1 echo "art-result: $? HIST_Creation" ArtPackage=$1 ArtJobName=$2 art.py download ${ArtPackage} ${ArtJobName} -hist_diff.sh ExampleMonitorOutput.root ./ref-*/ExampleMonitorOutput.root -x TIME_execute -i > log.HIST_Diff 2>&1 +REFFILE=(./ref-*/ExampleMonitorOutput.root) +hist_diff.sh ExampleMonitorOutput.root $REFFILE -x TIME_execute -i > log.HIST_Diff 2>&1 echo "art-result: $? HIST_Diff" diff --git a/Control/AthenaMonitoring/test/test_run3dq_r21_aod_mt_t8.sh b/Control/AthenaMonitoring/test/test_run3dq_r21_aod_mt_t8.sh index f6313af06c511c9ee50f15c8735f842696ab9696..25c9c06b64b4242ae80054fb7221254ea97960ff 100755 --- a/Control/AthenaMonitoring/test/test_run3dq_r21_aod_mt_t8.sh +++ b/Control/AthenaMonitoring/test/test_run3dq_r21_aod_mt_t8.sh @@ -6,16 +6,17 @@ # art-output: log* # art-athena-mt: 8 -Run3DQTestingDriver.py 'Input.Files=["/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/ASG/data16_13TeV.00311321.physics_Main.recon.AOD.r9264/AOD.11038520._000001.pool.root.1"]' DQ.Steering.doHLTMon=False Concurrency.NumThreads=8 Concurrency.NumConcurrentEvents=8 DQ.Environment=AOD > log.HIST_Creation 2>&1 +Run3DQTestingDriver.py 'Input.Files=["/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/AthenaMonitoring/data18_13TeV.00354309.physics_Main.recon.AOD.f946._lb0130._0001.1"]' DQ.Steering.doHLTMon=False Concurrency.NumThreads=8 Concurrency.NumConcurrentEvents=8 DQ.Environment=AOD > log.HIST_Creation 2>&1 echo "art-result: $? HIST_Creation" ArtPackage=$1 ArtJobName=$2 art.py download ${ArtPackage} ${ArtJobName} -hist_diff.sh ExampleMonitorOutput.root ./ref-*/ExampleMonitorOutput.root -x TIME_execute -i -t > log.HIST_Diff 2>&1 +REFFILE=(./ref-*/ExampleMonitorOutput.root) +hist_diff.sh ExampleMonitorOutput.root $REFFILE -x TIME_execute -i -t > log.HIST_Diff 2>&1 echo "art-result: $? HIST_Diff" art.py download AthenaMonitoring test_run3dq_r21_aod.sh -hist_diff.sh ExampleMonitorOutput.root ./ref-*/ExampleMonitorOutput.root -x TIME_execute -i -t > log.HIST_Diff_Serial 2>&1 +hist_diff.sh ExampleMonitorOutput.root $REFFILE -x TIME_execute -i -t > log.HIST_Diff_Serial 2>&1 echo "art-result: $? HIST_Diff_Serial" diff --git a/Control/AthenaMonitoring/test/test_run3dq_r21_esd.sh b/Control/AthenaMonitoring/test/test_run3dq_r21_esd.sh index 1b19984ac4b6e6b8c7682443ca357fd12fc49551..e169d04cb2a02138aa1697f414cc415b18d14947 100755 --- a/Control/AthenaMonitoring/test/test_run3dq_r21_esd.sh +++ b/Control/AthenaMonitoring/test/test_run3dq_r21_esd.sh @@ -5,12 +5,13 @@ # art-output: ExampleMonitorOutput.root # art-output: log* -Run3DQTestingDriver.py 'Input.Files=["/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/Tier0ChainTests/q431/21.0/myESD.pool.root"]' DQ.Steering.doHLTMon=False --postExec 'cfg.getEventAlgo("LArCollisionTimeAlg").cutIteration=False' > log.HIST_Creation 2>&1 +Run3DQTestingDriver.py 'Input.Files=["/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/AthenaMonitoring/q431/21.0/f946/myESD.pool.root"]' DQ.Steering.doHLTMon=False --postExec 'cfg.getEventAlgo("LArCollisionTimeAlg").cutIteration=False' > log.HIST_Creation 2>&1 echo "art-result: $? HIST_Creation" ArtPackage=$1 ArtJobName=$2 art.py download ${ArtPackage} ${ArtJobName} -hist_diff.sh ExampleMonitorOutput.root ./ref-*/ExampleMonitorOutput.root -x TIME_execute -i > log.HIST_Diff 2>&1 +REFFILE=(./ref-*/ExampleMonitorOutput.root) +hist_diff.sh ExampleMonitorOutput.root $REFFILE -x TIME_execute -i > log.HIST_Diff 2>&1 echo "art-result: $? HIST_Diff" diff --git a/Control/AthenaMonitoring/test/test_run3dq_r21_esd_mc.sh b/Control/AthenaMonitoring/test/test_run3dq_r21_esd_mc.sh index 810e377c3065210941df0f025b383d4fddcaeba2..10bf62a18ea4d05d1e730ff21c5f6e8437b8f06e 100755 --- a/Control/AthenaMonitoring/test/test_run3dq_r21_esd_mc.sh +++ b/Control/AthenaMonitoring/test/test_run3dq_r21_esd_mc.sh @@ -12,5 +12,6 @@ echo "art-result: $? HIST_Creation" ArtPackage=$1 ArtJobName=$2 art.py download ${ArtPackage} ${ArtJobName} -hist_diff.sh ExampleMonitorOutput.root ./ref-*/ExampleMonitorOutput.root -x TIME_execute -i > log.HIST_Diff 2>&1 +REFFILE=(./ref-*/ExampleMonitorOutput.root) +hist_diff.sh ExampleMonitorOutput.root $REFFILE -x TIME_execute -i > log.HIST_Diff 2>&1 echo "art-result: $? HIST_Diff" diff --git a/Control/AthenaMonitoring/test/test_run3dq_r21_esd_mt.sh b/Control/AthenaMonitoring/test/test_run3dq_r21_esd_mt.sh index e9863e934ae4b210bb23be0f1a81812b42a52d6d..b758be28ca0ffbf347a409ef355c81f9b2336ac9 100755 --- a/Control/AthenaMonitoring/test/test_run3dq_r21_esd_mt.sh +++ b/Control/AthenaMonitoring/test/test_run3dq_r21_esd_mt.sh @@ -5,18 +5,19 @@ # art-output: ExampleMonitorOutput.root # art-output: log* -Run3DQTestingDriver.py 'Input.Files=["/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/Tier0ChainTests/q431/21.0/myESD.pool.root"]' DQ.Steering.doHLTMon=False Concurrency.NumThreads=1 Concurrency.NumConcurrentEvents=1 --postExec 'cfg.getEventAlgo("LArCollisionTimeAlg").cutIteration=False' > log.HIST_Creation 2>&1 +Run3DQTestingDriver.py 'Input.Files=["/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/AthenaMonitoring/q431/21.0/f946/myESD.pool.root"]' DQ.Steering.doHLTMon=False Concurrency.NumThreads=1 Concurrency.NumConcurrentEvents=1 --postExec 'cfg.getEventAlgo("LArCollisionTimeAlg").cutIteration=False' > log.HIST_Creation 2>&1 echo "art-result: $? HIST_Creation" ArtPackage=$1 ArtJobName=$2 art.py download ${ArtPackage} ${ArtJobName} -hist_diff.sh ExampleMonitorOutput.root ./ref-*/ExampleMonitorOutput.root -x TIME_execute -i > log.HIST_Diff 2>&1 +REFFILE=(./ref-*/ExampleMonitorOutput.root) +hist_diff.sh ExampleMonitorOutput.root $REFFILE -x TIME_execute -i > log.HIST_Diff 2>&1 echo "art-result: $? HIST_Diff" rm -rf ref-* art.py download AthenaMonitoring test_run3dq_r21_esd.sh -hist_diff.sh ExampleMonitorOutput.root ./ref-*/ExampleMonitorOutput.root -x TIME_execute -i > log.HIST_Diff_Serial 2>&1 +hist_diff.sh ExampleMonitorOutput.root $REFFILE -x TIME_execute -i > log.HIST_Diff_Serial 2>&1 echo "art-result: $? HIST_Diff_Serial" diff --git a/Control/AthenaMonitoring/test/test_run3dq_r22_aod.sh b/Control/AthenaMonitoring/test/test_run3dq_r22_aod.sh index 139fd1bc6fc1d58202de0e8e5c8e42e193f9f303..c02c8b00a59ae33dd5efaf61d2725d08c52b8b45 100755 --- a/Control/AthenaMonitoring/test/test_run3dq_r22_aod.sh +++ b/Control/AthenaMonitoring/test/test_run3dq_r22_aod.sh @@ -15,5 +15,6 @@ rm -rf ref-* ArtPackage=$1 ArtJobName=$2 art.py download ${ArtPackage} ${ArtJobName} -hist_diff.sh ExampleMonitorOutput.root ./ref-*/ExampleMonitorOutput.root -x TIME_execute -i > log.HIST_Diff 2>&1 +REFFILE=(./ref-*/ExampleMonitorOutput.root) +hist_diff.sh ExampleMonitorOutput.root $REFFILE -x TIME_execute -i > log.HIST_Diff 2>&1 echo "art-result: $? HIST_Diff" diff --git a/Control/AthenaMonitoring/test/test_run3dq_r22_aod_trigger.sh b/Control/AthenaMonitoring/test/test_run3dq_r22_aod_trigger.sh index fa4c0d4fc608986f4e2f7fa4f6e1e51292549d75..eab4b4943d7a86c858a74bee2fb07031a227d688 100755 --- a/Control/AthenaMonitoring/test/test_run3dq_r22_aod_trigger.sh +++ b/Control/AthenaMonitoring/test/test_run3dq_r22_aod_trigger.sh @@ -15,5 +15,6 @@ rm -rf ref-* ArtPackage=$1 ArtJobName=$2 art.py download ${ArtPackage} ${ArtJobName} -hist_diff.sh ExampleMonitorOutput.root ./ref-*/ExampleMonitorOutput.root -i > log.HIST_Diff 2>&1 +REFFILE=(./ref-*/ExampleMonitorOutput.root) +hist_diff.sh ExampleMonitorOutput.root $REFFILE -i > log.HIST_Diff 2>&1 echo "art-result: $? HIST_Diff" diff --git a/Control/AthenaMonitoring/test/test_run3dq_r22_aod_trigger_mt.sh b/Control/AthenaMonitoring/test/test_run3dq_r22_aod_trigger_mt.sh index 3d7a0243c4d7a0494f94620572980bbf0cf4351a..0d24b33513d4bdc491a491625de9a6bb5089d8d9 100755 --- a/Control/AthenaMonitoring/test/test_run3dq_r22_aod_trigger_mt.sh +++ b/Control/AthenaMonitoring/test/test_run3dq_r22_aod_trigger_mt.sh @@ -15,9 +15,10 @@ rm -rf ref-* ArtPackage=$1 ArtJobName=$2 art.py download ${ArtPackage} ${ArtJobName} -hist_diff.sh ExampleMonitorOutput.root ./ref-*/ExampleMonitorOutput.root -i > log.HIST_Diff 2>&1 +REFFILE=(./ref-*/ExampleMonitorOutput.root) +hist_diff.sh ExampleMonitorOutput.root $REFFILE -i > log.HIST_Diff 2>&1 echo "art-result: $? HIST_Diff" art.py download AthenaMonitoring test_run3dq_r22_aod_trigger.sh -hist_diff.sh ExampleMonitorOutput.root ./ref-*/ExampleMonitorOutput.root -i > log.HIST_Diff_Serial 2>&1 +hist_diff.sh ExampleMonitorOutput.root $REFFILE -i > log.HIST_Diff_Serial 2>&1 echo "art-result: $? HIST_Diff_Serial" diff --git a/Control/AthenaMonitoring/test/test_run3dq_r22_esd.sh b/Control/AthenaMonitoring/test/test_run3dq_r22_esd.sh index 805b63b6136462e6002b0e187a7b72aa515a1e44..6d4175434fd1aa027802aef1bbcbc0c248ded9cd 100755 --- a/Control/AthenaMonitoring/test/test_run3dq_r22_esd.sh +++ b/Control/AthenaMonitoring/test/test_run3dq_r22_esd.sh @@ -15,5 +15,6 @@ rm -rf ref-* ArtPackage=$1 ArtJobName=$2 art.py download ${ArtPackage} ${ArtJobName} -hist_diff.sh ExampleMonitorOutput.root ./ref-*/ExampleMonitorOutput.root -x TIME_execute -i > log.HIST_Diff 2>&1 +REFFILE=(./ref-*/ExampleMonitorOutput.root) +hist_diff.sh ExampleMonitorOutput.root $REFFILE -x TIME_execute -i > log.HIST_Diff 2>&1 echo "art-result: $? HIST_Diff" diff --git a/Control/AthenaMonitoringKernel/python/GenericMonitoringTool.py b/Control/AthenaMonitoringKernel/python/GenericMonitoringTool.py index c36d1dbf2184b48b50d85c4149da444050b58793..4ff51d73642572aea9d70bfc8311b8e793e0098b 100644 --- a/Control/AthenaMonitoringKernel/python/GenericMonitoringTool.py +++ b/Control/AthenaMonitoringKernel/python/GenericMonitoringTool.py @@ -27,20 +27,21 @@ class GenericMonitoringTool(_GenericMonitoringTool): self._defaultDuration = kwargs.pop('defaultDuration', None) super(GenericMonitoringTool, self).__init__(name, *args, **kwargs) - def __new__( cls, name=None, *args, **kwargs ): - if not Configurable.configurableRun3Behavior: - if name is None: name = cls.__name__ - - # GenericMonitoringTool is always private. To avoid the user having - # to ensure a unique instance name, always create a new instance. - b = Configurable.configurableRun3Behavior - Configurable.configurableRun3Behavior = 1 - try: - conf = super(GenericMonitoringTool, cls).__new__( cls, name, *args, **kwargs ) - finally: - Configurable.configurableRun3Behavior = b - - return conf + if not isRun3Cfg(): + def __new__( cls, name=None, *args, **kwargs ): + if not Configurable.configurableRun3Behavior: + if name is None: name = cls.__name__ + + # GenericMonitoringTool is always private. To avoid the user having + # to ensure a unique instance name, always create a new instance. + b = Configurable.configurableRun3Behavior + Configurable.configurableRun3Behavior = 1 + try: + conf = super(GenericMonitoringTool, cls).__new__( cls, name, *args, **kwargs ) + finally: + Configurable.configurableRun3Behavior = b + + return conf @property def convention(self): diff --git a/Control/CxxUtils/CxxUtils/Array.h b/Control/CxxUtils/CxxUtils/Array.h index ea8c5d030c8c5f21329df9cb27644e6e25af383d..01fb6bf5f961c649470b380717b7baa4166a70e6 100644 --- a/Control/CxxUtils/CxxUtils/Array.h +++ b/Control/CxxUtils/CxxUtils/Array.h @@ -1,10 +1,9 @@ // This file's extension implies that it's C, but it's really -*- C++ -*-. /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ -// $Id: Array.h,v 1.2 2009-04-07 04:26:22 ssnyder Exp $ /** * @file Array.h * @author scott snyder <snyder@bnl.gov> @@ -40,6 +39,7 @@ #include "CxxUtils/Arrayrep.h" +#include "CxxUtils/concepts.h" #include <iterator> @@ -220,6 +220,16 @@ public: const_iterator end () const; + /** + * @brief Creates a text representation of the array content. + * @param std::ostream where the text should be written + * + * Writes the content of the array to a ostream. The sub-arrays are + * enclosed by square-brackets and separated by commas. + */ + void write_array (std::ostream& stream) const; + + // Protected, not private, so that they can be accessed by @c WritableArray. protected: /** @@ -323,6 +333,16 @@ public: int asint () const; + /** + * @brief Creates a text representation of the array content. + * @param std::ostream where the text should be written + * + * Writes the content of the array to a ostream. The sub-arrays are + * enclosed by square-brackets and separated by commas. + */ + void write_array (std::ostream& stream) const; + + // Protected, not private, so that they can be accessed by @c WritableArray. protected: /** @@ -345,6 +365,10 @@ protected: }; +template <unsigned int N> +std::ostream& operator<< (std::ostream& s, const Array<N>& a); + + //********************************************************************** @@ -740,7 +764,7 @@ private: /** - * @class Array<N> + * @class WritableArrayData<N> * @brief A @c WriteableArray together with an @c Arrayrep. * * This is a convenient way of creating from scratch an array @@ -772,6 +796,25 @@ public: }; +/** + * @brief Helper to convert from an @x Arrayrep to a scalar type. + * @param rep Representation object to convert. + * @param x[out] Result of the conversion. + */ +template <class T> + ATH_REQUIRES(std::assignable_from<T&, float>) +void fromArrayrep (const CaloRec::Arrayrep& rep, T& x); + + +/** + * @brief Helper to convert from an @x Arrayrep to an @c Array. + * @param rep Representation object to convert. + * @param x[out] Result of the conversion. + */ +template <unsigned int N> +void fromArrayrep (const CaloRec::Arrayrep& rep, CxxUtils::Array<N>& x); + + } // namespace CxxUtils diff --git a/Control/CxxUtils/CxxUtils/Array.icc b/Control/CxxUtils/CxxUtils/Array.icc index 3aafac70152fc933f4bd0ca8eb1273e996e3366e..345deff3a9bac49d8c919d5398f06d30d6447069 100644 --- a/Control/CxxUtils/CxxUtils/Array.icc +++ b/Control/CxxUtils/CxxUtils/Array.icc @@ -1,10 +1,9 @@ // This file's extension implies that it's C, but it's really -*- C++ -*-. /* - Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ -// $Id: Array.icc,v 1.1 2009-03-20 20:44:22 ssnyder Exp $ /** * @file Array.icc * @author scott snyder <snyder@bnl.gov> @@ -14,6 +13,7 @@ #include "CxxUtils/unused.h" +#include <ostream> #include <cassert> @@ -191,6 +191,26 @@ typename Array<N>::const_iterator Array<N>::end () const } +/** + * @brief Creates a text representation of the array content. + * @param std::ostream where the text should be written + * + * Writes the content of the array to a ostream. The sub-arrays are + * enclosed by square-brackets and separated by commas. + */ +template <unsigned int N> +inline +void Array<N>::write_array (std::ostream& stream) const +{ + if (!m_rep) { + stream << "\"\""; + } + else { + m_rep->write_array (stream); + } +} + + /** * @brief Private constructor for array indexing. * @param rep @c Arrayrep from which to initialize the array. @@ -307,6 +327,20 @@ int Array<0>::asint() const } +/** + * @brief Creates a text representation of the array content. + * @param std::ostream where the text should be written + * + * Writes the content of the array to a ostream. The sub-arrays are + * enclosed by square-brackets and separated by commas. + */ +inline +void Array<0>::write_array (std::ostream& stream) const +{ + stream << *m_elt; +} + + /** * @brief Private constructor for array indexing. * @param rep @c Arrayrep from which to initialize the array. @@ -323,6 +357,14 @@ Array<0>::Array (const Arrayrep& rep, unsigned int offs) } +template <unsigned int N> +std::ostream& operator<< (std::ostream& s, const Array<N>& a) +{ + a.write_array (s); + return s; +} + + //********************************************************************** @@ -789,4 +831,29 @@ WritableArrayData<N>::WritableArrayData(const std::vector<unsigned int>& shape) } +/** + * @brief Helper to convert from an @x Arrayrep to a scalar type. + * @param rep Representation object to convert. + * @param x[out] Result of the conversion. + */ +template <class T> + ATH_REQUIRES(std::assignable_from<T&, float>) +void fromArrayrep (const CaloRec::Arrayrep& rep, T& x) +{ + x = rep.m_data[0]; +} + + +/** + * @brief Helper to convert from an @x Arrayrep to an @c Array. + * @param rep Representation object to convert. + * @param x[out] Result of the conversion. + */ +template <unsigned int N> +void fromArrayrep (const CaloRec::Arrayrep& rep, CxxUtils::Array<N>& x) +{ + x = CxxUtils::Array<N> (rep); +} + + } // namespace CxxUtils diff --git a/Control/CxxUtils/CxxUtils/Arrayrep.h b/Control/CxxUtils/CxxUtils/Arrayrep.h index ba40bb3356ec7824bc58b3e11d099789e5c7ee93..a0b3e8a03cedf876fcf23b65a2ffe7f5ec7db654 100644 --- a/Control/CxxUtils/CxxUtils/Arrayrep.h +++ b/Control/CxxUtils/CxxUtils/Arrayrep.h @@ -1,10 +1,8 @@ // This file's extension implies that it's C, but it's really -*- C++ -*-. /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ - -// $Id: Arrayrep.h,v 1.2 2009-04-07 04:26:22 ssnyder Exp $ /** * @file Arrayrep.h * @author scott snyder <snyder@bnl.gov> diff --git a/Control/CxxUtils/test/Array_test.cxx b/Control/CxxUtils/test/Array_test.cxx index d2e5c446a2e6005ec7bc4ac11543bf4f3ae34a1f..450f1dc8c43063b60188d3c56e88d6a249ff6e5a 100644 --- a/Control/CxxUtils/test/Array_test.cxx +++ b/Control/CxxUtils/test/Array_test.cxx @@ -1,8 +1,6 @@ /* - Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ - -// $Id: Array_test.cxx,v 1.2 2009-04-08 21:12:45 ssnyder Exp $ /** * @file Array_test.cxx * @author scott snyder <snyder@bnl.gov> @@ -16,6 +14,8 @@ #include "CxxUtils/Array.h" #include <cassert> +#include <iostream> +#include <sstream> using namespace CxxUtils; @@ -223,6 +223,52 @@ void test5() } +// Test fromArrayrep +void test6() +{ + Arrayrep rep; + rep.m_shape.assign ({3}); + rep.m_data.assign ({1.5, 2.5, 3.5}); + rep.init_sizes(); + float f; + fromArrayrep (rep, f); + assert (f == 1.5); + int i; + fromArrayrep (rep, i); + assert (i == 1); + bool b; + fromArrayrep (rep, b); + assert (b == true); + Array<1> a; + fromArrayrep (rep, a); + assert (a.size() == 3); + assert (a[0] == 1.5); + assert (a[1] == 2.5); + assert (a[2] == 3.5); +} + + +// Test operator<< +void test7() +{ + Arrayrep ar1 (" [[ 1.5, 2.5], [3.5, 4.5]] "); + Array<2> a1 (ar1); + std::ostringstream ss1; + ss1 << a1; + assert (ss1.str() == "[\n" + " [1.5, 2.5],\n" + " [3.5, 4.5]\n" + " ]\n"); + + Arrayrep rep0; + rep0.m_data.push_back (101); + Array<0> a0a (rep0); + std::ostringstream ss2; + ss2 << a0a; + assert (ss2.str() == "101"); +} + + int main() { test1(); @@ -230,5 +276,7 @@ int main() test3(); test4(); test5(); + test6(); + test7(); return 0; } diff --git a/DataQuality/DQUtils/python/db.py b/DataQuality/DQUtils/python/db.py index 0dda0bf3d4b24819006100f5261a51f20fa3bb4b..96c8aa4747ec7f57a8d111191431993ec559cf3c 100755 --- a/DataQuality/DQUtils/python/db.py +++ b/DataQuality/DQUtils/python/db.py @@ -118,17 +118,6 @@ def fetch_iovs(folder_name, since=None, until=None, channels=None, tag="", short_folder = folder.fullPath().split("/")[-1] - detstatus_names = "DQMFOFL", "DCSOFL", "DQMFONL", "SHIFTOFL", "SHIFTONL", "LBSUMM" - if any(short_folder.endswith(x) for x in detstatus_names): - channel_mapping = None # get channel mapping from channel_mapping.py - else: - _, _, channelmap = get_channel_ids_names(folder) - cm_reversed = dict((value, key) for key, value in six.iteritems(channelmap)) - channelmap.update(cm_reversed) - channel_mapping = channelmap - - channels = make_channelselection(channels, channel_mapping) - time_based_folder = "<timeStamp>time</timeStamp>" in folder.description() coracool_folder = "<coracool>" in folder.description() iov_key_type = TimestampType if time_based_folder else RunLumiType @@ -153,6 +142,17 @@ def fetch_iovs(folder_name, since=None, until=None, channels=None, tag="", else: return IOVSet() + detstatus_names = "DQMFOFL", "DCSOFL", "DQMFONL", "SHIFTOFL", "SHIFTONL", "LBSUMM" + if any(short_folder.endswith(x) for x in detstatus_names): + channel_mapping = None # get channel mapping from channel_mapping.py + else: + _, _, channelmap = get_channel_ids_names(folder) + cm_reversed = dict((value, key) for key, value in six.iteritems(channelmap)) + channelmap.update(cm_reversed) + channel_mapping = channelmap + + channels = make_channelselection(channels, channel_mapping) + field_name = "%s_VAL" % short_folder if not coracool_folder: diff --git a/DataQuality/DataQualityInterfaces/DataQualityInterfaces/LinkDefdqmp.h b/DataQuality/DataQualityInterfaces/DataQualityInterfaces/LinkDefdqmp.h index 0ece5797277f9ed1ed9aee8cd942921afef7ceb8..152991b52f9b1b9bd9276cc2662eae8ee0ba456f 100644 --- a/DataQuality/DataQualityInterfaces/DataQualityInterfaces/LinkDefdqmp.h +++ b/DataQuality/DataQualityInterfaces/DataQualityInterfaces/LinkDefdqmp.h @@ -20,10 +20,6 @@ #pragma link C++ class std::map<std::string, std::string>; #pragma link C++ class std::map<std::string, std::vector<float> > ; -#if ROOT_VERSION_CODE < ROOT_VERSION(6,0,0) -#pragma link C++ class std::pair<std::string, std::string> ; -#endif - #pragma link C++ class std::vector<std::pair<std::string,float> > ; #pragma link C++ class std::vector<dqm_persistency::PParameter*> ; #pragma link C++ class dqm_persistency::PAlgorithm+ ; diff --git a/DataQuality/DataQualityTools/src/DQTDetSynchMonAlg.cxx b/DataQuality/DataQualityTools/src/DQTDetSynchMonAlg.cxx index 73fb2a17bf24be595a5540f2a2f15ef768e86aca..4c7a007417d597fc439b8e4e023e2b93bfe48041 100644 --- a/DataQuality/DataQualityTools/src/DQTDetSynchMonAlg.cxx +++ b/DataQuality/DataQualityTools/src/DQTDetSynchMonAlg.cxx @@ -28,12 +28,6 @@ #include "TProfile.h" #include "AthenaMonitoringKernel/Monitored.h" -#if ROOT_VERSION_CODE >= ROOT_VERSION(6,0,0) -# define CAN_REBIN(hist) hist->SetCanExtend(TH1::kAllAxes) -#else -# define CAN_REBIN(hist) hist->SetBit(TH1::kCanRebin) -#endif - //---------------------------------------------------------------------------------- DQTDetSynchMonAlg::DQTDetSynchMonAlg( const std::string& name, ISvcLocator* pSvcLocator ) diff --git a/DataQuality/DataQualityTools/src/DQTDetSynchMonTool.cxx b/DataQuality/DataQualityTools/src/DQTDetSynchMonTool.cxx index 52a02adc5053fd507dbe6b9961e96e20c01bdda7..6eaf4893e62d7eab0ee8fb8ee6ed0f406f8df3c4 100644 --- a/DataQuality/DataQualityTools/src/DQTDetSynchMonTool.cxx +++ b/DataQuality/DataQualityTools/src/DQTDetSynchMonTool.cxx @@ -26,12 +26,6 @@ #include "TProfile.h" -#if ROOT_VERSION_CODE >= ROOT_VERSION(6,0,0) -# define CAN_REBIN(hist) hist->SetCanExtend(TH1::kAllAxes) -#else -# define CAN_REBIN(hist) hist->SetBit(TH1::kCanRebin) -#endif - //---------------------------------------------------------------------------------- DQTDetSynchMonTool::DQTDetSynchMonTool(const std::string & type, const std::string & name, @@ -324,12 +318,12 @@ bool DQTDetSynchMonTool::bookBCID() failure = failure |registerHist(fullPathBCID, m_diff_CTP_Tile_BCID_lumi = new TProfile("m_diff_CTP_Tile_BCID_lumi", "BCID difference between CTP and Tile detectors as a function of the LumiBlock", 30, 0., 30,-4096.,4096 )).isFailure(); failure = failure |registerHist(fullPathBCID, m_diff_CTP_RPC_BCID_lumi = new TProfile("m_diff_CTP_RPC_BCID_lumi", "BCID difference between CTP and RPC detectors as a function of the LumiBlock", 30, 0., 30,-4096.,4096)).isFailure(); failure = failure |registerHist(fullPathBCID, m_diff_CTP_Pixel_BCID_lumi = new TProfile("m_diff_CTP_Pixel_BCID_lumi", "BCID difference between CTP and Pixel detectors as a function of the LumiBlock", 30, 0., 30,-4096.,4096)).isFailure(); - CAN_REBIN(m_diff_CTP_RPC_BCID_lumi); - CAN_REBIN(m_diff_CTP_SCT_BCID_lumi); - CAN_REBIN(m_diff_CTP_TRT_BCID_lumi); - CAN_REBIN(m_diff_CTP_LAR_BCID_lumi); - CAN_REBIN(m_diff_CTP_Tile_BCID_lumi); - CAN_REBIN(m_diff_CTP_Pixel_BCID_lumi); + m_diff_CTP_RPC_BCID_lumi->SetCanExtend(TH1::kAllAxes); + m_diff_CTP_SCT_BCID_lumi->SetCanExtend(TH1::kAllAxes); + m_diff_CTP_TRT_BCID_lumi->SetCanExtend(TH1::kAllAxes); + m_diff_CTP_LAR_BCID_lumi->SetCanExtend(TH1::kAllAxes); + m_diff_CTP_Tile_BCID_lumi->SetCanExtend(TH1::kAllAxes); + m_diff_CTP_Pixel_BCID_lumi->SetCanExtend(TH1::kAllAxes); } // Booking subdetectors BCID differences @@ -362,55 +356,55 @@ bool DQTDetSynchMonTool::bookBCID() // Booking subdetectors BCID differences wrt CTP in resizable histograms failure = failure |registerHist(fullPathBCID, m_diff_CTP_SCT_BCID_Rebin = new TH1I("m_diff_CTP_SCT_BCID_Rebin", "BCID difference between CTP and SCT detectors. Full Range.", 51, -25.5, 25.5)).isFailure(); - CAN_REBIN(m_diff_CTP_SCT_BCID_Rebin); + m_diff_CTP_SCT_BCID_Rebin->SetCanExtend(TH1::kAllAxes); failure = failure |registerHist(fullPathBCID, m_diff_CTP_TRT_BCID_Rebin = new TH1I("m_diff_CTP_TRT_BCID_Rebin", "BCID difference between CTP and TRT detectors. Full Range.", 51, -25.5, 25.5)).isFailure(); - CAN_REBIN(m_diff_CTP_TRT_BCID_Rebin); + m_diff_CTP_TRT_BCID_Rebin->SetCanExtend(TH1::kAllAxes); failure = failure |registerHist(fullPathBCID, m_diff_CTP_LAR_BCID_Rebin = new TH1I("m_diff_CTP_LAR_BCID_Rebin", "BCID difference between CTP and LAR detectors. Full Range.", 51, -25.5, 25.5)).isFailure(); - CAN_REBIN(m_diff_CTP_LAR_BCID_Rebin); + m_diff_CTP_LAR_BCID_Rebin->SetCanExtend(TH1::kAllAxes); failure = failure |registerHist(fullPathBCID, m_diff_CTP_Tile_BCID_Rebin = new TH1I("m_diff_CTP_Tile_BCID_Rebin", "BCID difference between CTP and Tile detectors. Full Range.", 51, -25.5, 25.5)).isFailure(); - CAN_REBIN(m_diff_CTP_Tile_BCID_Rebin); + m_diff_CTP_Tile_BCID_Rebin->SetCanExtend(TH1::kAllAxes); failure = failure |registerHist(fullPathBCID, m_diff_CTP_RPC_BCID_Rebin = new TH1I("m_diff_CTP_RPC_BCID_Rebin", "BCID difference between CTP and RPC detectors. Full Range", 51, -25.5, 25.5)).isFailure(); - CAN_REBIN(m_diff_CTP_RPC_BCID_Rebin); + m_diff_CTP_RPC_BCID_Rebin->SetCanExtend(TH1::kAllAxes); // Booking subdetectors BCID differences in resizable histograms, these were missing failure = failure |registerHist(fullPathBCID, m_diff_SCT_TRT_BCID_Rebin = new TH1I("m_diff_SCT_TRT_BCID_Rebin", "BCID difference between SCT and TRT detectors. Full Range", 51, -25.5, 25.5)).isFailure(); - CAN_REBIN(m_diff_SCT_TRT_BCID_Rebin); + m_diff_SCT_TRT_BCID_Rebin->SetCanExtend(TH1::kAllAxes); failure = failure |registerHist(fullPathBCID, m_diff_SCT_LAR_BCID_Rebin = new TH1I("m_diff_SCT_LAR_BCID_Rebin", "BCID difference between SCT and LAR detectors. Full Range", 51, -25.5, 25.5)).isFailure(); - CAN_REBIN(m_diff_SCT_LAR_BCID_Rebin); + m_diff_SCT_LAR_BCID_Rebin->SetCanExtend(TH1::kAllAxes); failure = failure |registerHist(fullPathBCID, m_diff_SCT_Tile_BCID_Rebin = new TH1I("m_diff_SCT_Tile_BCID_Rebin", "BCID difference between SCT and Tile detectors. Full Range", 51, -25.5, 25.5)).isFailure(); - CAN_REBIN(m_diff_SCT_TRT_BCID_Rebin); + m_diff_SCT_TRT_BCID_Rebin->SetCanExtend(TH1::kAllAxes); failure = failure |registerHist(fullPathBCID, m_diff_SCT_RPC_BCID_Rebin = new TH1I("m_diff_SCT_RPC_BCID_Rebin", "BCID difference between SCT and RPC detectors. Full Range", 51, -25.5, 25.5)).isFailure(); - CAN_REBIN(m_diff_SCT_RPC_BCID_Rebin); + m_diff_SCT_RPC_BCID_Rebin->SetCanExtend(TH1::kAllAxes); failure = failure |registerHist(fullPathBCID, m_diff_TRT_LAR_BCID_Rebin = new TH1I("m_diff_TRT_LAR_BCID_Rebin", "BCID difference between TRT and LAR detectors. Full Range", 51, -25.5, 25.5)).isFailure(); - CAN_REBIN(m_diff_TRT_LAR_BCID_Rebin); + m_diff_TRT_LAR_BCID_Rebin->SetCanExtend(TH1::kAllAxes); failure = failure |registerHist(fullPathBCID, m_diff_TRT_Tile_BCID_Rebin = new TH1I("m_diff_TRT_Tile_BCID_Rebin", "BCID difference between TRT and Tile detectors. Full Range", 51, -25.5, 25.5)).isFailure(); - CAN_REBIN(m_diff_TRT_Tile_BCID_Rebin); + m_diff_TRT_Tile_BCID_Rebin->SetCanExtend(TH1::kAllAxes); failure = failure |registerHist(fullPathBCID, m_diff_TRT_RPC_BCID_Rebin = new TH1I("m_diff_TRT_RPC_BCID_Rebin", "BCID difference between TRT and RPC detectors. Full Range", 51, -25.5, 25.5)).isFailure(); - CAN_REBIN(m_diff_TRT_RPC_BCID_Rebin); + m_diff_TRT_RPC_BCID_Rebin->SetCanExtend(TH1::kAllAxes); failure = failure |registerHist(fullPathBCID, m_diff_LAR_Tile_BCID_Rebin = new TH1I("m_diff_LAR_Tile_BCID_Rebin", "BCID difference between LAR and Tile detectors. Full Range", 51, -25.5, 25.5)).isFailure(); - CAN_REBIN(m_diff_LAR_Tile_BCID_Rebin); + m_diff_LAR_Tile_BCID_Rebin->SetCanExtend(TH1::kAllAxes); failure = failure |registerHist(fullPathBCID, m_diff_LAR_RPC_BCID_Rebin = new TH1I("m_diff_LAR_RPC_BCID_Rebin", "BCID difference between LAR and RPC detectors. Full Range", 51, -25.5, 25.5)).isFailure(); - CAN_REBIN(m_diff_LAR_RPC_BCID_Rebin); + m_diff_LAR_RPC_BCID_Rebin->SetCanExtend(TH1::kAllAxes); failure = failure |registerHist(fullPathBCID, m_diff_Tile_RPC_BCID_Rebin = new TH1I("m_diff_Tile_RPC_BCID_Rebin", "BCID difference between Tile and RPC detectors. Full Range", 51, -25.5, 25.5)).isFailure(); - CAN_REBIN(m_diff_Tile_RPC_BCID_Rebin); + m_diff_Tile_RPC_BCID_Rebin->SetCanExtend(TH1::kAllAxes); failure = failure |registerHist(fullPathBCID, m_diff_Pixel_SCT_BCID_Rebin = new TH1I("m_diff_Pixel_SCT_BCID_Rebin", "BCID difference between Pixel and SCT detectors. Full Range.", 51, -25.5, 25.5)).isFailure(); - CAN_REBIN(m_diff_Pixel_SCT_BCID_Rebin); + m_diff_Pixel_SCT_BCID_Rebin->SetCanExtend(TH1::kAllAxes); failure = failure |registerHist(fullPathBCID, m_diff_Pixel_TRT_BCID_Rebin = new TH1I("m_diff_Pixel_TRT_BCID_Rebin", "BCID difference between Pixel and TRT detectors. Full Range.", 51, -25.5, 25.5)).isFailure(); - CAN_REBIN(m_diff_Pixel_TRT_BCID_Rebin); + m_diff_Pixel_TRT_BCID_Rebin->SetCanExtend(TH1::kAllAxes); failure = failure |registerHist(fullPathBCID, m_diff_Pixel_LAR_BCID_Rebin = new TH1I("m_diff_Pixel_LAR_BCID_Rebin", "BCID difference between Pixel and LAR detectors. Full Range.", 51, -25.5, 25.5)).isFailure(); - CAN_REBIN(m_diff_Pixel_LAR_BCID_Rebin); + m_diff_Pixel_LAR_BCID_Rebin->SetCanExtend(TH1::kAllAxes); failure = failure |registerHist(fullPathBCID, m_diff_Pixel_Tile_BCID_Rebin = new TH1I("m_diff_Pixel_Tile_BCID_Rebin", "BCID difference between Pixel and Tile detectors. Full Range.", 51, -25.5, 25.5)).isFailure(); - CAN_REBIN(m_diff_Pixel_Tile_BCID_Rebin); + m_diff_Pixel_Tile_BCID_Rebin->SetCanExtend(TH1::kAllAxes); failure = failure |registerHist(fullPathBCID, m_diff_Pixel_RPC_BCID_Rebin = new TH1I("m_diff_Pixel_RPC_BCID_Rebin", "BCID difference between Pixel and RPC detectors. Full Range", 51, -25.5, 25.5)).isFailure(); - CAN_REBIN(m_diff_Pixel_RPC_BCID_Rebin); + m_diff_Pixel_RPC_BCID_Rebin->SetCanExtend(TH1::kAllAxes); failure = failure |registerHist(fullPathBCID, m_diff_Pixel_CTP_BCID_Rebin = new TH1I("m_diff_Pixel_CTP_BCID_Rebin", "BCID difference between Pixel and CTP detectors. Full Range", 51, -25.5, 25.5)).isFailure(); - CAN_REBIN(m_diff_Pixel_CTP_BCID_Rebin); + m_diff_Pixel_CTP_BCID_Rebin->SetCanExtend(TH1::kAllAxes); } @@ -476,12 +470,12 @@ bool DQTDetSynchMonTool::bookL1ID() failure = failure |registerHist(fullPathL1ID, m_diff_CTP_Tile_L1ID_lumi = new TProfile("m_diff_CTP_Tile_L1ID_lumi", "L1ID difference between CTP and Tile detectors as a function of the LumiBlock", 30, 0., 30,-4096.,4096 )).isFailure(); failure = failure |registerHist(fullPathL1ID, m_diff_CTP_RPC_L1ID_lumi = new TProfile("m_diff_CTP_RPC_L1ID_lumi", "L1ID difference between CTP and RPC detectors as a function of the LumiBlock", 30, 0., 30,-4096.,4096)).isFailure(); failure = failure |registerHist(fullPathL1ID, m_diff_CTP_Pixel_L1ID_lumi = new TProfile("m_diff_CTP_Pixel_L1ID_lumi", "L1ID difference between CTP and Pixel detectors as a function of the LumiBlock", 30, 0., 30,-4096.,4096)).isFailure(); - CAN_REBIN(m_diff_CTP_SCT_L1ID_lumi); - CAN_REBIN(m_diff_CTP_TRT_L1ID_lumi); - CAN_REBIN(m_diff_CTP_LAR_L1ID_lumi); - CAN_REBIN(m_diff_CTP_Tile_L1ID_lumi); - CAN_REBIN(m_diff_CTP_Pixel_L1ID_lumi); - CAN_REBIN(m_diff_CTP_RPC_L1ID_lumi); + m_diff_CTP_SCT_L1ID_lumi->SetCanExtend(TH1::kAllAxes); + m_diff_CTP_TRT_L1ID_lumi->SetCanExtend(TH1::kAllAxes); + m_diff_CTP_LAR_L1ID_lumi->SetCanExtend(TH1::kAllAxes); + m_diff_CTP_Tile_L1ID_lumi->SetCanExtend(TH1::kAllAxes); + m_diff_CTP_Pixel_L1ID_lumi->SetCanExtend(TH1::kAllAxes); + m_diff_CTP_RPC_L1ID_lumi->SetCanExtend(TH1::kAllAxes); } // Add those that were missing @@ -514,51 +508,51 @@ bool DQTDetSynchMonTool::bookL1ID() // Booking subdetectors L1ID differences wrt CTP in resizable histograms failure = failure |registerHist(fullPathL1ID, m_diff_CTP_SCT_L1ID_Rebin = new TH1I("m_diff_CTP_SCT_L1ID_Rebin", "L1ID difference between CTP and SCT detectors. Full Range.", 51, -25.5, 25.5)).isFailure(); - CAN_REBIN(m_diff_CTP_SCT_L1ID_Rebin); + m_diff_CTP_SCT_L1ID_Rebin->SetCanExtend(TH1::kAllAxes); failure = failure |registerHist(fullPathL1ID, m_diff_CTP_TRT_L1ID_Rebin = new TH1I("m_diff_CTP_TRT_L1ID_Rebin", "L1ID difference between CTP and TRT detectors. Full Range.", 51, -25.5, 25.5)).isFailure(); - CAN_REBIN(m_diff_CTP_TRT_L1ID_Rebin); + m_diff_CTP_TRT_L1ID_Rebin->SetCanExtend(TH1::kAllAxes); failure = failure |registerHist(fullPathL1ID, m_diff_CTP_LAR_L1ID_Rebin = new TH1I("m_diff_CTP_LAR_L1ID_Rebin", "L1ID difference between CTP and LAR detectors. Full Range.", 51, -25.5, 25.5)).isFailure(); - CAN_REBIN(m_diff_CTP_LAR_L1ID_Rebin); + m_diff_CTP_LAR_L1ID_Rebin->SetCanExtend(TH1::kAllAxes); failure = failure |registerHist(fullPathL1ID, m_diff_CTP_Tile_L1ID_Rebin = new TH1I("m_diff_CTP_Tile_L1ID_Rebin", "L1ID difference between CTP and Tile detectors. Full Range.", 51, -25.5, 25.5)).isFailure(); - CAN_REBIN(m_diff_CTP_Tile_L1ID_Rebin); + m_diff_CTP_Tile_L1ID_Rebin->SetCanExtend(TH1::kAllAxes); failure = failure |registerHist(fullPathL1ID, m_diff_CTP_RPC_L1ID_Rebin = new TH1I("m_diff_CTP_RPC_L1ID_Rebin", "L1ID difference between CTP and RPC detectors. Full Range", 51, -25.5, 25.5)).isFailure(); - CAN_REBIN(m_diff_CTP_RPC_L1ID_Rebin); + m_diff_CTP_RPC_L1ID_Rebin->SetCanExtend(TH1::kAllAxes); failure = failure |registerHist(fullPathL1ID, m_diff_SCT_TRT_L1ID_Rebin = new TH1I("m_diff_SCT_TRT_L1ID_Rebin", "L1ID difference between SCT and TRT detectors. Full Range", 51, -25.5, 25.5)).isFailure(); - CAN_REBIN(m_diff_SCT_TRT_L1ID_Rebin); + m_diff_SCT_TRT_L1ID_Rebin->SetCanExtend(TH1::kAllAxes); failure = failure |registerHist(fullPathL1ID, m_diff_SCT_LAR_L1ID_Rebin = new TH1I("m_diff_SCT_LAR_L1ID_Rebin", "L1ID difference between SCT and LAR detectors. Full Range", 51, -25.5, 25.5)).isFailure(); - CAN_REBIN(m_diff_SCT_LAR_L1ID_Rebin); + m_diff_SCT_LAR_L1ID_Rebin->SetCanExtend(TH1::kAllAxes); failure = failure |registerHist(fullPathL1ID, m_diff_SCT_Tile_L1ID_Rebin = new TH1I("m_diff_SCT_Tile_L1ID_Rebin", "L1ID difference between SCT and Tile detectors. Full Range", 51, -25.5, 25.5)).isFailure(); - CAN_REBIN(m_diff_SCT_Tile_L1ID_Rebin); + m_diff_SCT_Tile_L1ID_Rebin->SetCanExtend(TH1::kAllAxes); failure = failure |registerHist(fullPathL1ID, m_diff_SCT_RPC_L1ID_Rebin = new TH1I("m_diff_SCT_RPC_L1ID_Rebin", "L1ID difference between SCT and RPC detectors. Full Range", 51, -25.5, 25.5)).isFailure(); - CAN_REBIN(m_diff_SCT_RPC_L1ID_Rebin); + m_diff_SCT_RPC_L1ID_Rebin->SetCanExtend(TH1::kAllAxes); failure = failure |registerHist(fullPathL1ID, m_diff_TRT_LAR_L1ID_Rebin = new TH1I("m_diff_TRT_LAR_L1ID_Rebin", "L1ID difference between TRT and LAR detectors. Full Range", 51, -25.5, 25.5)).isFailure(); - CAN_REBIN(m_diff_TRT_LAR_L1ID_Rebin); + m_diff_TRT_LAR_L1ID_Rebin->SetCanExtend(TH1::kAllAxes); failure = failure |registerHist(fullPathL1ID, m_diff_TRT_Tile_L1ID_Rebin = new TH1I("m_diff_TRT_Tile_L1ID_Rebin", "L1ID difference between TRT and Tile detectors. Full Range", 51, -25.5, 25.5)).isFailure(); - CAN_REBIN(m_diff_TRT_Tile_L1ID_Rebin); + m_diff_TRT_Tile_L1ID_Rebin->SetCanExtend(TH1::kAllAxes); failure = failure |registerHist(fullPathL1ID, m_diff_TRT_RPC_L1ID_Rebin = new TH1I("m_diff_TRT_RPC_L1ID_Rebin", "L1ID difference between TRT and RPC detectors. Full Range", 51, -25.5, 25.5)).isFailure(); - CAN_REBIN(m_diff_TRT_RPC_L1ID_Rebin); + m_diff_TRT_RPC_L1ID_Rebin->SetCanExtend(TH1::kAllAxes); failure = failure |registerHist(fullPathL1ID, m_diff_LAR_Tile_L1ID_Rebin = new TH1I("m_diff_LAR_Tile_L1ID_Rebin", "L1ID difference between LAR and Tile detectors. Full Range", 51, -25.5, 25.5)).isFailure(); - CAN_REBIN(m_diff_LAR_Tile_L1ID_Rebin); + m_diff_LAR_Tile_L1ID_Rebin->SetCanExtend(TH1::kAllAxes); failure = failure |registerHist(fullPathL1ID, m_diff_LAR_RPC_L1ID_Rebin = new TH1I("m_diff_LAR_RPC_L1ID_Rebin", "L1ID difference between LAR and RPC detectors. Full Range", 51, -25.5, 25.5)).isFailure(); - CAN_REBIN(m_diff_LAR_RPC_L1ID_Rebin); + m_diff_LAR_RPC_L1ID_Rebin->SetCanExtend(TH1::kAllAxes); failure = failure |registerHist(fullPathL1ID, m_diff_Tile_RPC_L1ID_Rebin = new TH1I("m_diff_Tile_RPC_L1ID_Rebin", "L1ID difference between Tile and RPC detectors. Full Range", 51, -25.5, 25.5)).isFailure(); - CAN_REBIN(m_diff_Tile_RPC_L1ID_Rebin); + m_diff_Tile_RPC_L1ID_Rebin->SetCanExtend(TH1::kAllAxes); failure = failure |registerHist(fullPathL1ID, m_diff_Pixel_SCT_L1ID_Rebin = new TH1I("m_diff_Pixel_SCT_L1ID_Rebin", "L1ID difference between Pixel and SCT detectors. Full Range.", 51, -25.5, 25.5)).isFailure(); - CAN_REBIN(m_diff_Pixel_SCT_L1ID_Rebin); + m_diff_Pixel_SCT_L1ID_Rebin->SetCanExtend(TH1::kAllAxes); failure = failure |registerHist(fullPathL1ID, m_diff_Pixel_TRT_L1ID_Rebin = new TH1I("m_diff_Pixel_TRT_L1ID_Rebin", "L1ID difference between Pixel and TRT detectors. Full Range.", 51, -25.5, 25.5)).isFailure(); - CAN_REBIN(m_diff_Pixel_TRT_L1ID_Rebin); + m_diff_Pixel_TRT_L1ID_Rebin->SetCanExtend(TH1::kAllAxes); failure = failure |registerHist(fullPathL1ID, m_diff_Pixel_LAR_L1ID_Rebin = new TH1I("m_diff_Pixel_LAR_L1ID_Rebin", "L1ID difference between Pixel and LAR detectors. Full Range.", 51, -25.5, 25.5)).isFailure(); - CAN_REBIN(m_diff_Pixel_LAR_L1ID_Rebin); + m_diff_Pixel_LAR_L1ID_Rebin->SetCanExtend(TH1::kAllAxes); failure = failure |registerHist(fullPathL1ID, m_diff_Pixel_Tile_L1ID_Rebin = new TH1I("m_diff_Pixel_Tile_L1ID_Rebin", "L1ID difference between Pixel and Tile detectors. Full Range.", 51, -25.5, 25.5)).isFailure(); - CAN_REBIN(m_diff_Pixel_Tile_L1ID_Rebin); + m_diff_Pixel_Tile_L1ID_Rebin->SetCanExtend(TH1::kAllAxes); failure = failure |registerHist(fullPathL1ID, m_diff_Pixel_RPC_L1ID_Rebin = new TH1I("m_diff_Pixel_RPC_L1ID_Rebin", "L1ID difference between Pixel and RPC detectors. Full Range", 51, -25.5, 25.5)).isFailure(); - CAN_REBIN(m_diff_Pixel_RPC_L1ID_Rebin); + m_diff_Pixel_RPC_L1ID_Rebin->SetCanExtend(TH1::kAllAxes); failure = failure |registerHist(fullPathL1ID, m_diff_Pixel_CTP_L1ID_Rebin = new TH1I("m_diff_Pixel_CTP_L1ID_Rebin", "L1ID difference between Pixel and CTP detectors. Full Range", 51, -25.5, 25.5)).isFailure(); - CAN_REBIN(m_diff_Pixel_CTP_L1ID_Rebin); + m_diff_Pixel_CTP_L1ID_Rebin->SetCanExtend(TH1::kAllAxes); } diff --git a/DataQuality/DataQualityUtils/scripts/physval_make_web_display.py b/DataQuality/DataQualityUtils/scripts/physval_make_web_display.py index 7aa3064d9e2c1aeb67b677506aa9f935ff25db57..c9dcd60282f9df6c93ff7ece7fd8190ea73f0afe 100755 --- a/DataQuality/DataQualityUtils/scripts/physval_make_web_display.py +++ b/DataQuality/DataQualityUtils/scripts/physval_make_web_display.py @@ -303,7 +303,7 @@ if __name__=="__main__": help='Start from this subdirectory of the file') parser.add_option('--histlistfile', help='text file with a list of regexes/histogram names') - parser.add_option('--scaleref', type=float, default=1, + parser.add_option('--scaleref', type="float", default=1, help='Scale references by this value') parser.add_option('--Kolmogorov', default=False, action='store_true', help='Run Kolmogorov test instead of Chi2 test') @@ -313,9 +313,9 @@ if __name__=="__main__": help='Draw 2D histograms with ratio plots') parser.add_option('--jsRoot',action='store_true', default=False, help="make interactive jsRoot displays") - parser.add_option('--ratiorange', default=None, type=float, + parser.add_option('--ratiorange', default=None, type="float", help='set range for ratio plots (as delta to 1.0)') - parser.add_option('--refmangle', default=None, type=str, + parser.add_option('--refmangle', default=None, type="string", help='provide a Python module to translate histogram names between test and reference files. Module should provide\na function mangle(testhistoname, reflabel)') options, args = parser.parse_args() diff --git a/DataQuality/GoodRunsListsUser/CMakeLists.txt b/DataQuality/GoodRunsListsUser/CMakeLists.txt index 70e4e6d7306432054b7e60c6d7712a8411805a1a..092b549ae1301e041b4a4716716043455c5650fc 100644 --- a/DataQuality/GoodRunsListsUser/CMakeLists.txt +++ b/DataQuality/GoodRunsListsUser/CMakeLists.txt @@ -12,7 +12,6 @@ atlas_depends_on_subdirs( PUBLIC DataQuality/GoodRunsLists Event/EventInfo GaudiKernel - LumiBlock/LumiBlockComps Trigger/TrigAnalysis/TrigDecisionTool Trigger/TrigEvent/TrigDecisionEvent ) @@ -26,7 +25,7 @@ atlas_add_component( GoodRunsListsUser src/*.cxx src/components/*.cxx INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} - LINK_LIBRARIES ${ROOT_LIBRARIES} AthenaBaseComps StoreGateLib SGtests GoodRunsListsLib EventInfo GaudiKernel LumiBlockCompsLib TrigDecisionToolLib TrigDecisionEvent ) + LINK_LIBRARIES ${ROOT_LIBRARIES} AthenaBaseComps StoreGateLib SGtests GoodRunsListsLib EventInfo GaudiKernel TrigDecisionToolLib TrigDecisionEvent ) # Install files from the package: atlas_install_headers( GoodRunsListsUser ) diff --git a/DataQuality/GoodRunsListsUser/GoodRunsListsUser/DummyDumperAlg.h b/DataQuality/GoodRunsListsUser/GoodRunsListsUser/DummyDumperAlg.h index dc082a5b71f1edc3729d96afa2522247097e0e8f..19b963612b81d2d1ce837f790be537b60b44b133 100644 --- a/DataQuality/GoodRunsListsUser/GoodRunsListsUser/DummyDumperAlg.h +++ b/DataQuality/GoodRunsListsUser/GoodRunsListsUser/DummyDumperAlg.h @@ -1,11 +1,11 @@ // -*- C++ -*- /* - Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ -#ifndef LumiBlockComps_DummyDumperAlg_H -#define LumiBlockComps_DummyDumperAlg_H +#ifndef GOODRUNSLISTSUSER_DUMMYDUMPERALG_H +#define GOODRUNSLISTSUSER_DUMMYDUMPERALG_H #include "AthenaBaseComps/AthAlgorithm.h" #include "GaudiKernel/ToolHandle.h" @@ -16,7 +16,6 @@ ///////////////////////////////////////////////////////////////////////////// -class ILumiBlockMetaDataTool; class TTree; class ITHistSvc; @@ -32,7 +31,6 @@ class DummyDumperAlg : public AthAlgorithm private: - ToolHandle< ILumiBlockMetaDataTool > m_LumiBlockMetaDataTool; std::vector<std::string> m_grlname; std::vector<TObjString> m_grlobj; @@ -44,5 +42,5 @@ class DummyDumperAlg : public AthAlgorithm ITHistSvc* m_ths; }; -#endif // LumiBlockComps_DummyDumperAlg_H +#endif diff --git a/DataQuality/GoodRunsListsUser/src/DummyDumperAlg.cxx b/DataQuality/GoodRunsListsUser/src/DummyDumperAlg.cxx index 5e7b02b38dac371645e0b1d6776bc71cd5aff3f7..77a3f0d644a7d2c466dbac7c693802ee4a7aa7aa 100644 --- a/DataQuality/GoodRunsListsUser/src/DummyDumperAlg.cxx +++ b/DataQuality/GoodRunsListsUser/src/DummyDumperAlg.cxx @@ -4,7 +4,6 @@ #include "GoodRunsListsUser/DummyDumperAlg.h" -#include "LumiBlockComps/ILumiBlockMetaDataTool.h" #include "EventInfo/EventInfo.h" #include "EventInfo/EventID.h" @@ -16,7 +15,6 @@ DummyDumperAlg::DummyDumperAlg(const std::string& name, ISvcLocator* pSvcLocator) : AthAlgorithm(name, pSvcLocator) - , m_LumiBlockMetaDataTool("LumiBlockMetaDataTool") , m_tree(0) , m_eventCounter(0) , m_dummyInt(0) @@ -45,18 +43,6 @@ StatusCode DummyDumperAlg::initialize() return StatusCode::FAILURE; } - /// Retrieve the LBMD tool using the ToolHandles - if ( m_LumiBlockMetaDataTool.retrieve().isFailure() ) { - ATH_MSG_FATAL - (m_LumiBlockMetaDataTool.propertyName() << ": Failed to retrieve tool " - << m_LumiBlockMetaDataTool.type()); - return StatusCode::FAILURE; - } else { - ATH_MSG_DEBUG - (m_LumiBlockMetaDataTool.propertyName() << ": Retrieved tool " - << m_LumiBlockMetaDataTool.type()); - } - // make tree m_tree = new TTree("tree","tree"); if (m_ths->regTree (m_tree->GetName(), m_tree).isFailure()) @@ -121,18 +107,6 @@ DummyDumperAlg::execute() StatusCode DummyDumperAlg::finalize() { ATH_MSG_DEBUG ("finalize()"); - - // add grl strings to tree - std::vector<std::string>::const_iterator itr=m_grlname.begin(); - for (; itr!=m_grlname.end(); ++itr) { - const TString grlstring = m_LumiBlockMetaDataTool->getGRLString( *itr ); - if (grlstring.IsNull()) continue; - m_grlobj.push_back( TObjString( grlstring ) ); - m_tree->GetUserInfo()->Add( &(*m_grlobj.rbegin()) ); - } - - ATH_MSG_DEBUG ("finalize() successful"); - return StatusCode::SUCCESS; } diff --git a/DataQuality/dqm_algorithms/tools/AlgorithmHelper.cxx b/DataQuality/dqm_algorithms/tools/AlgorithmHelper.cxx index c4ee85c941160747686b86d09945250378b5771c..b7e5be88b3f22c3ce7d56482b01314191b554518 100644 --- a/DataQuality/dqm_algorithms/tools/AlgorithmHelper.cxx +++ b/DataQuality/dqm_algorithms/tools/AlgorithmHelper.cxx @@ -26,14 +26,6 @@ #include <dqm_core/AlgorithmManager.h> #include <dqm_core/LibraryManager.h> -// MN: ROOT6 is more const-correct -#if ROOT_VERSION_CODE > ROOT_VERSION(6,0,0) -# define ROOT6_CONST const -#else -# define ROOT6_CONST -#endif - - std::map<std::string, double > dqm_algorithms::tools::GetFitParams(const TF1 * func ) { @@ -367,8 +359,8 @@ double dqm_algorithms::tools::GetFirstFromMap(const std::string ¶mName, cons std::vector<int> dqm_algorithms::tools::GetBinRange(const TH1 *h, const std::map<std::string, double > ¶ms) { std::vector<int> range; - ROOT6_CONST TAxis *xAxis = h->GetXaxis(); - ROOT6_CONST TAxis *yAxis = h->GetYaxis(); + const TAxis *xAxis = h->GetXaxis(); + const TAxis *yAxis = h->GetYaxis(); if (h->GetDimension() > 2) { throw dqm_core::BadConfig(ERS_HERE, h->GetName(), "histogram has more than 2 dimensions"); @@ -466,11 +458,11 @@ dqm_algorithms::tools::DivideByHistogram(const TH1* hNumerator, const TH1* hDeno //Handle division for case where denominator has lower dimension than numerator: //There are only a few possibilities, hNdimension = 2 or 3, hDdimension = 1 or 2. - ROOT6_CONST TAxis* xax = hNumerator->GetXaxis(); + const TAxis* xax = hNumerator->GetXaxis(); int nbinsx = xax->GetNbins(); - ROOT6_CONST TAxis* yax = hNumerator->GetYaxis(); + const TAxis* yax = hNumerator->GetYaxis(); int nbinsy = yax->GetNbins(); - ROOT6_CONST TAxis* zax = hNumerator->GetZaxis(); + const TAxis* zax = hNumerator->GetZaxis(); int nbinsz = zax->GetNbins(); if( nbinsx != hDenominator->GetNbinsX() ) { @@ -532,11 +524,11 @@ dqm_algorithms::tools::DivideByHistogram(const TH1* hNumerator, const TH1* hDeno //Handle division for case where the numerator has lower dimension than the denominator //There are only a few possibilities, hNdimension = 1 or 2, hDdimension = 2 or 3. - ROOT6_CONST TAxis* xax = hDenominator->GetXaxis(); + const TAxis* xax = hDenominator->GetXaxis(); int nbinsx = xax->GetNbins(); - ROOT6_CONST TAxis* yax = hDenominator->GetYaxis(); + const TAxis* yax = hDenominator->GetYaxis(); int nbinsy = yax->GetNbins(); - ROOT6_CONST TAxis* zax = hDenominator->GetZaxis(); + const TAxis* zax = hDenominator->GetZaxis(); int nbinsz = zax->GetNbins(); if( nbinsx != hNumerator->GetNbinsX() ) { diff --git a/Database/AthenaPOOL/AthenaPoolCnvSvc/src/AthenaPoolCnvSvc.cxx b/Database/AthenaPOOL/AthenaPoolCnvSvc/src/AthenaPoolCnvSvc.cxx index 70b1404e77730d3e0f85e047c9516beed1e774a7..f1d29b6e665f853324524290d2261f97c0540fbb 100644 --- a/Database/AthenaPOOL/AthenaPoolCnvSvc/src/AthenaPoolCnvSvc.cxx +++ b/Database/AthenaPOOL/AthenaPoolCnvSvc/src/AthenaPoolCnvSvc.cxx @@ -1138,9 +1138,11 @@ void AthenaPoolCnvSvc::handle(const Incident& incident) { } //______________________________________________________________________________ AthenaPoolCnvSvc::AthenaPoolCnvSvc(const std::string& name, ISvcLocator* pSvcLocator) : - ::AthCnvSvc(name, pSvcLocator, POOL_StorageType) { + ::AthCnvSvc(name, pSvcLocator, POOL_StorageType), + m_outputStreamingTool(this) +{ declareProperty("OutputStreamingTool", m_outputStreamingTool); - } +} //______________________________________________________________________________ AthenaPoolCnvSvc::~AthenaPoolCnvSvc() { } diff --git a/Database/AthenaPOOL/RootConversions/src/TConvertingBranchElement.cxx b/Database/AthenaPOOL/RootConversions/src/TConvertingBranchElement.cxx index c7619e2c4c2f3fb452ec0b291fd748e7232ebe2b..2da150e1dafc5f8ae1e028e0e718623915bd41c3 100755 --- a/Database/AthenaPOOL/RootConversions/src/TConvertingBranchElement.cxx +++ b/Database/AthenaPOOL/RootConversions/src/TConvertingBranchElement.cxx @@ -871,15 +871,7 @@ Int_t TConvertingBranchElement::GetEntry(Long64_t entry, Int_t getall) TBranchRef* bref = fTree->GetBranchRef(); if (bref) { bref->SetParent(this, fBranchID); -#if !defined(ROOT_FULL_VERSION) bref->SetRequestedEntry(entry); -#else -# if ROOT_FULL_VERSION_CODE >= ROOT_FULL_VERSION(5,28,0,'e') - bref->SetRequestedEntry(entry); -# else - bref->SetReadEntry(entry); -# endif -#endif } Int_t nbytes = 0; @@ -1104,12 +1096,10 @@ void TConvertingBranchElement::ReadLeavesMemberBranchCountConverting(TBuffer& b) // ReadSequence doesn't work here, since it gets structure offsets // from TConfiguration, and those haven't been adjusted to take // into account the use of the temporary conversion objects. -#if ROOT_VERSION_CODE >= ROOT_VERSION(6,1,0) || (ROOT_VERSION_CODE>=ROOT_VERSION(5,34,22) && ROOT_VERSION_CODE<ROOT_VERSION(6,0,0)) // FIXME! std::abort(); -#else - info->ReadBuffer (b, (char**)&fObject, fID); -#endif + //doesn't work + //info->ReadBuffer (b, (char**)&fObject, fID); } diff --git a/Event/EventOverlay/EventOverlayJobTransforms/share/skeleton.OverlayBS_tf.py b/Event/EventOverlay/EventOverlayJobTransforms/share/skeleton.OverlayBS_tf.py index 4924f3adaaa1a9e8d66546a30c85b7402ac2eef8..66db657a8afc097a82647d61a66a61ef2f03c260 100644 --- a/Event/EventOverlay/EventOverlayJobTransforms/share/skeleton.OverlayBS_tf.py +++ b/Event/EventOverlay/EventOverlayJobTransforms/share/skeleton.OverlayBS_tf.py @@ -151,7 +151,7 @@ if not MuonGeometryFlags.hasSTGC(): DetFlags.sTGC_setOff() if not MuonGeometryFlags.hasMM(): DetFlags.Micromegas_setOff() # TODO: need to do it better -DetFlags.makeRIO.all_setOff() +# DetFlags.makeRIO.all_setOff() # needed for MT TRT conditions DetFlags.pileup.all_setOff() # DetFlags.readRDOBS.all_setOff() ## Needed for BS converters DetFlags.readRDOPool.all_setOff() diff --git a/Event/EventOverlay/EventOverlayJobTransforms/share/skeleton.Overlay_tf.py b/Event/EventOverlay/EventOverlayJobTransforms/share/skeleton.Overlay_tf.py index 75732b5f557a817ac49dafea9ed37d8c60158a56..6f15fd2bf6a22168eac7172d361f92990176b8f6 100644 --- a/Event/EventOverlay/EventOverlayJobTransforms/share/skeleton.Overlay_tf.py +++ b/Event/EventOverlay/EventOverlayJobTransforms/share/skeleton.Overlay_tf.py @@ -115,7 +115,7 @@ if not MuonGeometryFlags.hasSTGC(): DetFlags.sTGC_setOff() if not MuonGeometryFlags.hasMM(): DetFlags.Micromegas_setOff() # TODO: need to do it better -DetFlags.makeRIO.all_setOff() +# DetFlags.makeRIO.all_setOff() # needed for MT TRT conditions DetFlags.pileup.all_setOff() DetFlags.readRDOBS.all_setOff() DetFlags.readRDOPool.all_setOff() diff --git a/Event/xAOD/xAODCore/Root/PerfStats.cxx b/Event/xAOD/xAODCore/Root/PerfStats.cxx index 2de4c34890a5ffc1488ce662503cbf98606d8291..0b66d4697a10cacfce2fc7818067743c8aa0981a 100644 --- a/Event/xAOD/xAODCore/Root/PerfStats.cxx +++ b/Event/xAOD/xAODCore/Root/PerfStats.cxx @@ -198,15 +198,9 @@ namespace xAOD { /// @param complen Not sure. (Not used.) /// @param objlen Not sure. (Not used.) /// -#if ROOT_VERSION_CODE < ROOT_VERSION( 5, 34, 19 ) - void PerfStats::FileUnzipEvent( ::TFile* file, ::Long64_t pos, - ::Double_t start, ::Int_t complen, - ::Int_t objlen ) { -#else void PerfStats::UnzipEvent( ::TObject* tree, ::Long64_t pos, ::Double_t start, ::Int_t complen, ::Int_t objlen ) { -#endif // ROOT_VERSION // Do the calculation without delay: const ::Double_t tnow = TTimeStamp(); @@ -216,7 +210,6 @@ namespace xAOD { ReadStats& stats = IOStats::instance().stats(); stats.setUnzipTime( stats.unzipTime() + dtime ); -#if ROOT_VERSION_CODE >= ROOT_VERSION( 5, 34, 19 ) // Get the cache size from the tree: ::TTree* t = dynamic_cast< ::TTree* >( tree ); if( ! t ) { @@ -224,15 +217,10 @@ namespace xAOD { } else { stats.setCacheSize( t->GetCacheSize() ); } -#endif // ROOT_VERSION // Forward the call if possible: if( m_otherPerfStats ) { -#if ROOT_VERSION_CODE < ROOT_VERSION( 5, 34, 19 ) - m_otherPerfStats->FileUnzipEvent( file, pos, start, complen, objlen ); -#else m_otherPerfStats->UnzipEvent( tree, pos, start, complen, objlen ); -#endif // ROOT_VERSION } return; @@ -311,7 +299,6 @@ namespace xAOD { return 0; } -#if ROOT_VERSION_CODE >= ROOT_VERSION( 6, 14, 0 ) /* Some methods that are pure virtual in the basaclass and need a definition - forwarding them to the actuall ROOT TPerfStats new in ROOT 6.14 @@ -338,8 +325,6 @@ namespace xAOD { FWD_CALL(SetUsed); #undef FWD_CALL -#endif //ROOT_VERSION - /// The constructor needs to do a few things. If there is already /// another TVirtualPerfStats object defined under gPerfStats, then /// it stores that pointer in order to be able to forward monitoring diff --git a/Event/xAOD/xAODCore/Root/TDVCollectionProxy.cxx b/Event/xAOD/xAODCore/Root/TDVCollectionProxy.cxx index 2bd066652bc9eabde2231cf1f19f2fef73dd5757..56c8fedfaee71366aa521ccfc761b7bf085b99d8 100644 --- a/Event/xAOD/xAODCore/Root/TDVCollectionProxy.cxx +++ b/Event/xAOD/xAODCore/Root/TDVCollectionProxy.cxx @@ -290,18 +290,10 @@ namespace xAOD { } /// Not implemented for xAOD -#if ROOT_VERSION_CODE >= ROOT_VERSION( 5, 34, 6 ) static void* collect( void* /*from*/, void* /*to*/ ) { ::Fatal( "xAOD::TDVCollectionProxy", "collect not implemented" ); return 0; } -#else - static void* collect( void* /*env*/ ) { - ::Fatal( "xAOD::TDVCollectionProxy", "collect not implemented" ); - return 0; - } -#endif - }; // class TDVCollectionFuncs /// Constructor. @@ -326,11 +318,7 @@ namespace xAOD { fNext.call = TDVCollectionFuncs::next; fFirst.call = TDVCollectionFuncs::first; fClear.call = TDVCollectionFuncs::clear; -#if ROOT_VERSION_CODE >= ROOT_VERSION(5,34,6) fCollect = TDVCollectionFuncs::collect; -#else - fCollect.call = TDVCollectionFuncs::collect; -#endif fCreateEnv.call = TDVCollectionFuncs::create_env; fResize = TDVCollectionFuncs::resize; fConstruct = TDVCollectionFuncs::construct; @@ -340,12 +328,7 @@ namespace xAOD { // Make sure that TGenCollectionProxy knows that it's not // fully set up yet: if( fValue ) { -#if ROOT_VERSION_CODE > ROOT_VERSION(6,2,5) delete fValue.exchange( 0 ); -#else - delete fValue; - fValue = 0; -#endif // ROOT_VERSION } if( fVal ) { delete fVal; @@ -375,12 +358,7 @@ namespace xAOD { // on the same page... if( ! fInitialized ) { if( fValue ) { -#if ROOT_VERSION_CODE > ROOT_VERSION(6,2,5) delete fValue.exchange( 0 ); -#else - delete fValue; - fValue = 0; -#endif // ROOT_VERSION } if( fVal ) { delete fVal; @@ -479,12 +457,7 @@ namespace xAOD { // Need to override what that set up for fValue and fVal. if( fValue ) { -#if ROOT_VERSION_CODE > ROOT_VERSION(6,2,5) delete fValue.exchange( 0 ); -#else - delete fValue; - fValue = 0; -#endif // ROOT_VERSION } if( fVal ) delete fVal; fValue = new TGenCollectionProxy::Value( eltname.c_str(), false ); @@ -496,10 +469,6 @@ namespace xAOD { // Remember that the initialisation succeeded: fInitialized = kTRUE; -#if ROOT_VERSION_CODE <= ROOT_VERSION( 6, 2, 5 ) - fProperties |= kIsInitialized; -#endif // ROOT_VERSION - return this; } diff --git a/Event/xAOD/xAODCore/xAODCore/AddDVProxy.h b/Event/xAOD/xAODCore/xAODCore/AddDVProxy.h index f3263de027a8e7951dfeee453ef81f53c310d50d..08d8ace099cbba3310b06100d4406d14fbeda053 100644 --- a/Event/xAOD/xAODCore/xAODCore/AddDVProxy.h +++ b/Event/xAOD/xAODCore/xAODCore/AddDVProxy.h @@ -20,8 +20,6 @@ // Local include(s): #include "xAODCore/tools/TDVCollectionProxy.h" -#if ROOT_VERSION_CODE >= ROOT_VERSION( 5, 99, 0 ) - /// Macro for setting up proxying for a specific DataVector<T> type /// /// In the xAOD packages that use DataVector classes, one must attach @@ -78,60 +76,6 @@ register_##NS##_##TYPE##_CollectionProxy(); \ R__UseDummy( _R__UNIQUE_( dummy_##NS##_##TYPE##_Var ) ) -#else - -/// Macro for setting up proxying for a specific DataVector<T> type -/// -/// In the xAOD packages that use DataVector classes, one must attach -/// "collection proxies" to the container dictionaries. This collection -/// proxy describes to ROOT how to navigate the contents of the -/// DataVector container. -/// -/// This is set up by adding a file called -/// "src/dict/CollectionProxies.cxx" to the package (well, all files -/// under "src/dict/" are taken into account in the end...), and for each -/// DataVector type defined by a package, adding a line like: -/// -/// <code> -/// ADD_DV_PROXY( MySuperContainer ); -/// </code> -/// -#define ADD_DV_PROXY( TYPE ) \ - int register_##TYPE##_CollectionProxy() { \ - xAOD::AddDVProxy::add< TYPE >( 0 ); \ - return 1; \ - } \ - static int _R__UNIQUE_( dummy_##TYPE##_Var ) = \ - register_##TYPE##_CollectionProxy(); \ - R__UseDummy( _R__UNIQUE_( dummy_##TYPE##_Var ) ) - -/// Macro for setting up proxying for a specific namespaced DataVector<T> type -/// -/// In the xAOD packages that use DataVector classes, one must attach -/// "collection proxies" to the container dictionaries. This collection -/// proxy describes to ROOT how to navigate the contents of the -/// DataVector container. -/// -/// This is set up by adding a file called -/// "src/dict/CollectionProxies.cxx" to the package (well, all files -/// under "src/dict/" are taken into account in the end...), and for each -/// DataVector type defined by a package, adding a line like: -/// -/// <code> -/// ADD_DV_PROXY( xAOD, MySuperContainer ); -/// </code> -/// -#define ADD_NS_DV_PROXY( NS, TYPE ) \ - int register_##NS##_##TYPE##_CollectionProxy() { \ - xAOD::AddDVProxy::add< NS::TYPE >( 0 ); \ - return 1; \ - } \ - static int _R__UNIQUE_( dummy_##NS##_##TYPE##_Var ) = \ - register_##NS##_##TYPE##_CollectionProxy(); \ - R__UseDummy( _R__UNIQUE_( dummy_##NS##_##TYPE##_Var ) ) - -#endif // ROOT_VERSION - namespace xAOD { /// Set up collection proxy for a @c DataVector class. diff --git a/Event/xAOD/xAODCore/xAODCore/tools/PerfStats.h b/Event/xAOD/xAODCore/xAODCore/tools/PerfStats.h index 010c83453a5a38d083efc50509032efc67711129..a38a8530fa7937166d8dc90a8e3b5f1a19833138 100644 --- a/Event/xAOD/xAODCore/xAODCore/tools/PerfStats.h +++ b/Event/xAOD/xAODCore/xAODCore/tools/PerfStats.h @@ -67,17 +67,10 @@ namespace xAOD { ::Double_t start ); #ifndef __CINT__ -#if ROOT_VERSION_CODE < ROOT_VERSION( 5, 34, 19 ) - /// Function called in general when a file unzipping operation happens - virtual void FileUnzipEvent( ::TFile *file, ::Long64_t pos, - ::Double_t start, ::Int_t complen, - ::Int_t objlen ); -#else /// Function called in general when a file unzipping operation happens virtual void UnzipEvent( ::TObject *tree, ::Long64_t pos, ::Double_t start, ::Int_t complen, ::Int_t objlen ); -#endif // ROOT_VERSION #endif // not __CINT__ /// PROOF specific function, not implemented here @@ -93,9 +86,6 @@ namespace xAOD { /// Function used by PROOF to set the number of processed events correctly virtual ::Long64_t GetNumEvents() const; -#if ROOT_VERSION_CODE >= ROOT_VERSION( 6, 14, 0 ) - // new methods (ROOT 6.14) - need forwarding to the original TPerfStats - /// Print the TTree basket read caching statistics virtual void PrintBasketInfo(Option_t *option = "") const; @@ -118,7 +108,6 @@ namespace xAOD { /// Update the fBranchIndexCache collection to match the current TTree given /// the ordered list of branch names. virtual void UpdateBranchIndices(TObjArray *branches); -#endif /// @} diff --git a/Event/xAOD/xAODJet/Root/JetContainerInfo.cxx b/Event/xAOD/xAODJet/Root/JetContainerInfo.cxx index 54386f5affb7ba9c54b3a7112ea7224d0de36447..2ad0f7af044f569fcd8e11806d05e051959597c8 100644 --- a/Event/xAOD/xAODJet/Root/JetContainerInfo.cxx +++ b/Event/xAOD/xAODJet/Root/JetContainerInfo.cxx @@ -132,6 +132,7 @@ namespace xAOD { { "EMPFlowCSSKTime", EMPFlowCSSKTime }, { "EMPFlowVorSKTime", EMPFlowVorSKTime }, { "HI", HI }, + { "HIClusters", HIClusters }, { c_unCategorized, Uncategorized } }; @@ -181,6 +182,7 @@ namespace xAOD { { EMPFlowCSSKTime, "EMPFlowCSSKTime" }, { EMPFlowVorSKTime, "EMPFlowVorSKTime" }, { HI, "HI" }, + { HIClusters, "HIClusters" }, { Uncategorized, c_unCategorized } }; diff --git a/Event/xAOD/xAODJet/xAODJet/JetContainerInfo.h b/Event/xAOD/xAODJet/xAODJet/JetContainerInfo.h index 6809442a517315cfa10fd28af5783048b28e7f9b..45d48a4fabe9cd7616ecf10a59001d62325ad552 100644 --- a/Event/xAOD/xAODJet/xAODJet/JetContainerInfo.h +++ b/Event/xAOD/xAODJet/xAODJet/JetContainerInfo.h @@ -93,6 +93,7 @@ namespace xAOD { EMPFlowCSSKTime, EMPFlowVorSKTime, HI, + HIClusters, Other = 100, Uncategorized= 1000 }; diff --git a/Event/xAOD/xAODTriggerAthenaPool/src/xAODTrigNavigationAuxInfoCnv.cxx b/Event/xAOD/xAODTriggerAthenaPool/src/xAODTrigNavigationAuxInfoCnv.cxx index 310da676f9952d6dabe90fae3f109d5497d691d6..f06503813e72388afd62a3d4aac3ba65ab4a8337 100644 --- a/Event/xAOD/xAODTriggerAthenaPool/src/xAODTrigNavigationAuxInfoCnv.cxx +++ b/Event/xAOD/xAODTriggerAthenaPool/src/xAODTrigNavigationAuxInfoCnv.cxx @@ -12,6 +12,8 @@ #ifndef XAOD_ANALYSIS #include "AthenaKernel/ITrigNavigationThinningSvc.h" //thinning only possible in full athena +#include "AthenaKernel/getThinningCache.h" +#include "AthenaKernel/ThinningCache.h" #include "GaudiKernel/ThreadLocalContext.h" #endif @@ -38,10 +40,16 @@ createPersistentWithKey( xAOD::TrigNavigationAuxInfo* trans, // see if the ThinningSvc implements an interface capable of slimming the navation xAOD::TrigNavigationAuxInfo* result = new xAOD::TrigNavigationAuxInfo(); #ifndef XAOD_ANALYSIS - ITrigNavigationThinningSvc* thinningSvc = - dynamic_cast<ITrigNavigationThinningSvc*>(IThinningSvc::instance()); + const ITrigNavigationThinningSvc* thinningSvc = nullptr; + if (const SG::ThinningCache* cache = SG::getThinningCache()) { + thinningSvc = cache->trigNavigationThinningSvc(); + } + if (!thinningSvc) { + thinningSvc = + dynamic_cast<const ITrigNavigationThinningSvc*>(IThinningSvc::instance()); + } if ( thinningSvc ) { - ATH_MSG_DEBUG("ThinningSvc is o type TrigNavigationThinningSvc, will request slimmed navigation from it"); + ATH_MSG_DEBUG("Doing TrigNavigation slimming"); xAOD::TrigNavigation wrapper; wrapper.setStore(result); std::vector< unsigned int > temp; @@ -52,7 +60,7 @@ createPersistentWithKey( xAOD::TrigNavigationAuxInfo* trans, wrapper.setSerialized(temp); wrapper.setStore((const SG::IConstAuxStore*)nullptr); } else { - ATH_MSG_DEBUG("Default ThinningSvc, just copy"); + ATH_MSG_DEBUG("No TrigNavigation slimming"); *result = *trans; } #else diff --git a/Event/xAOD/xAODTruthCnv/src/RedoTruthLinksAlg.cxx b/Event/xAOD/xAODTruthCnv/src/RedoTruthLinksAlg.cxx index 1282c44e40b8b13a033ecff610d02dcf5937b099..a6bdb3ba190839a1047ae4549d294d420ea68d04 100644 --- a/Event/xAOD/xAODTruthCnv/src/RedoTruthLinksAlg.cxx +++ b/Event/xAOD/xAODTruthCnv/src/RedoTruthLinksAlg.cxx @@ -64,7 +64,7 @@ namespace xAODMaker { // Create link between HepMC and xAOD truth //truthLinkVec->push_back(new xAODTruthParticleLink(HepMcParticleLink((*par)->barcode(), evt->eventNumber()), par)); /// @todo AB: Truth particle links should only be made to the signal event... hence the 0. Right? - truthLinkVec->push_back(new xAODTruthParticleLink(HepMcParticleLink((*par)->barcode(), 0), par)); + truthLinkVec->push_back(new xAODTruthParticleLink(HepMcParticleLink((*par)->barcode(), 0, EBC_MAINEVCOLL, HepMcParticleLink::IS_POSITION), par)); } } diff --git a/Event/xAOD/xAODTruthCnv/src/xAODTruthCnvAlg.cxx b/Event/xAOD/xAODTruthCnv/src/xAODTruthCnvAlg.cxx index 56ec124fbf121398b9ccff5e45e443e4469d62c0..36d2fdf9b5518270aa9fac8501565c4215342256 100644 --- a/Event/xAOD/xAODTruthCnv/src/xAODTruthCnvAlg.cxx +++ b/Event/xAOD/xAODTruthCnv/src/xAODTruthCnvAlg.cxx @@ -284,7 +284,7 @@ namespace xAODMaker { if (!isSignalProcess) xTruthPileupEvent->addTruthParticleLink(eltp); // Create link between HepMC and xAOD truth - if (isSignalProcess) truthLinkVec->push_back(new xAODTruthParticleLink(HepMcParticleLink((*pitr),0), eltp)); + if (isSignalProcess) truthLinkVec->push_back(new xAODTruthParticleLink(HepMcParticleLink((*pitr),0,EBC_MAINEVCOLL,HepMcParticleLink::IS_POSITION), eltp)); if (!isSignalProcess) truthLinkVec->push_back(new xAODTruthParticleLink(HepMcParticleLink((*pitr),genEvt->event_number()), eltp)); // Is this one of the beam particles? diff --git a/Generators/GeneratorObjects/GeneratorObjects/HepMcParticleLink.h b/Generators/GeneratorObjects/GeneratorObjects/HepMcParticleLink.h index f62074daf4d80f8dfa217446d03e6aff271fed11..b6fb73787bbcfc34b7c6285060fa51937bb23a33 100644 --- a/Generators/GeneratorObjects/GeneratorObjects/HepMcParticleLink.h +++ b/Generators/GeneratorObjects/GeneratorObjects/HepMcParticleLink.h @@ -82,7 +82,7 @@ enum EBC_EVCOLL{ class HepMcParticleLink { public: typedef uint32_t barcode_type; - typedef uint16_t index_type; + typedef uint32_t index_type; enum PositionFlag { diff --git a/Generators/GeneratorObjects/src/HepMcParticleLink.cxx b/Generators/GeneratorObjects/src/HepMcParticleLink.cxx index 21fd8cdd80b58614b762fba6bedd527f6a69f8d2..5a6aa6abfb9a73a464aee9d64a38362bb4355b54 100644 --- a/Generators/GeneratorObjects/src/HepMcParticleLink.cxx +++ b/Generators/GeneratorObjects/src/HepMcParticleLink.cxx @@ -254,10 +254,11 @@ HepMcParticleLink::getEventPositionInCollection (const IProxyDict* sg) const return 0; } + const int intIndex = static_cast<int>(index); const McEventCollection* coll = retrieveMcEventCollection (sg); size_t sz = coll->size(); for (size_t i = 0; i < sz; i++) { - if ((*coll)[i]->event_number() == index) { + if ((*coll)[i]->event_number() == intIndex) { return i; } } diff --git a/Generators/GeneratorObjects/test/HepMcParticleLink_test.cxx b/Generators/GeneratorObjects/test/HepMcParticleLink_test.cxx index 022754721ff5abdab1c3f1114e2d6de16361d3dc..3f33ea31b82122dac032e20f15374fa916bf3ca7 100644 --- a/Generators/GeneratorObjects/test/HepMcParticleLink_test.cxx +++ b/Generators/GeneratorObjects/test/HepMcParticleLink_test.cxx @@ -409,9 +409,9 @@ namespace MCTesting { // Add a dummy GenEvent const int process_id1(20); - const int event_number1(32767); - // 32767 = 2^15 -1 is the largest supported event number by - // HepMcParticleLink as the 16th bit of the unsigned short used to + const int event_number1(2147483647); + // 2147483647 = 2^31 -1 is the largest supported event number by + // HepMcParticleLink as the 32nd bit of the unsigned int used to // hold the eventIndex is used to flag whether the it represents the // position of the GenEvent in the McEventCollection or the // GenEvent::event_number. @@ -424,6 +424,10 @@ namespace MCTesting { const int process_id2(20); const int event_number2(25); inputTestDataHandle->push_back(new HepMC::GenEvent(process_id2, event_number2)); + const HepMcParticleLink::index_type dummyIndex2(1); + const HepMcParticleLink::index_type refEvtNum2 = static_cast<HepMcParticleLink::index_type>(event_number2); + HepMC::GenEvent& ge2 = *(inputTestDataHandle->at(1)); + const HepMC::GenParticle* particle2 = populateGenEvent2(ge2); // Add a third dummy GenEvent const int process_id3(20); const int event_number3(17); @@ -469,6 +473,45 @@ namespace MCTesting { ASSERT_EQ( dummyIndex1, testLink1d.getEventPositionInCollection(sg)); ASSERT_EQ(particle1,testLink1d.cptr()); + //Testing links to the second dummy GenEvent + + // HepMcParticleLink built using a GenParticle pointer and the + // position of the GenEvent. + HepMcParticleLink testLink2a(particle2,1, EBC_MAINEVCOLL, + HepMcParticleLink::IS_POSITION); + ASSERT_TRUE( testLink2a.isValid() ); + ASSERT_EQ( particle2->barcode(), testLink2a.barcode()); + ASSERT_EQ( refEvtNum2, testLink2a.eventIndex()); + ASSERT_EQ( dummyIndex2, testLink2a.getEventPositionInCollection(sg)); + ASSERT_EQ(particle2,testLink2a.cptr()); + // A HepMcParticleLink built using the barcode and the position of + // the GenEvent. + HepMcParticleLink testLink2b(particle2->barcode(),1, EBC_MAINEVCOLL, + HepMcParticleLink::IS_POSITION); + ASSERT_TRUE( testLink2b.isValid() ); + ASSERT_EQ( particle2->barcode(), testLink2b.barcode()); + ASSERT_EQ( refEvtNum2, testLink2b.eventIndex()); + ASSERT_EQ( dummyIndex2, testLink2b.getEventPositionInCollection(sg)); + ASSERT_EQ(particle2,testLink2b.cptr()); + // HepMcParticleLink built using a GenParticle pointer and the + // event_number of the GenEvent. + HepMcParticleLink testLink2c(particle2,event_number2); + ASSERT_TRUE( testLink2c.isValid() ); + ASSERT_EQ( particle2->barcode(), testLink2c.barcode()); + ASSERT_NE( dummyIndex2, testLink2c.eventIndex()); + ASSERT_EQ( refEvtNum2, testLink2c.eventIndex()); + ASSERT_EQ( dummyIndex2, testLink2c.getEventPositionInCollection(sg)); + ASSERT_EQ(particle2,testLink2c.cptr()); + // A HepMcParticleLink built using the barcode and the event_number of + // the GenEvent. + HepMcParticleLink testLink2d(particle2->barcode(),event_number2); + ASSERT_TRUE( testLink2d.isValid() ); + ASSERT_EQ( particle2->barcode(), testLink2d.barcode()); + ASSERT_NE( dummyIndex2, testLink2d.eventIndex()); + ASSERT_EQ( refEvtNum2, testLink2d.eventIndex()); + ASSERT_EQ( dummyIndex2, testLink2d.getEventPositionInCollection(sg)); + ASSERT_EQ(particle2,testLink2d.cptr()); + StoreGateSvc* pStore(nullptr); ASSERT_TRUE(MCTesting::g_svcLoc->service("StoreGateSvc", pStore).isSuccess()); pStore->clearStore(true).ignore(); // forceRemove=true to remove all proxies diff --git a/Generators/GeneratorObjectsTPCnv/src/HepMcParticleLinkCnv_p1.cxx b/Generators/GeneratorObjectsTPCnv/src/HepMcParticleLinkCnv_p1.cxx index 650c9113db3e39b7cc518ff768757d7324e43c99..a1b0d96df2aef5a70769780df608d0d84733490e 100755 --- a/Generators/GeneratorObjectsTPCnv/src/HepMcParticleLinkCnv_p1.cxx +++ b/Generators/GeneratorObjectsTPCnv/src/HepMcParticleLinkCnv_p1.cxx @@ -49,7 +49,7 @@ void HepMcParticleLinkCnv_p1::persToTrans( const HepMcParticleLink_p1* persObj, void HepMcParticleLinkCnv_p1::transToPers( const HepMcParticleLink* transObj, HepMcParticleLink_p1* persObj, - MsgStream &/*msg*/ ) + MsgStream &msg ) { // NB This method assumes that there all GenEvents are stored in a // single McEventCollection, as running with split @@ -57,6 +57,9 @@ void HepMcParticleLinkCnv_p1::transToPers( const HepMcParticleLink* transObj, unsigned short index{0}; if (transObj->getEventPositionInCollection(SG::CurrentEventStore::store())!=0) { index = transObj->eventIndex(); + if(transObj->eventIndex()!=static_cast<HepMcParticleLink::index_type>(index)) { + msg << MSG::WARNING << "Attempting to persistify an eventIndex larger than max unsigned short!" << endmsg; + } } persObj->m_mcEvtIndex = index; persObj->m_barcode = transObj->barcode(); diff --git a/Generators/GeneratorObjectsTPCnv/src/HepMcParticleLinkCnv_p2.cxx b/Generators/GeneratorObjectsTPCnv/src/HepMcParticleLinkCnv_p2.cxx index d0235ef75d408fecab7e2b02f7d5637312f3233b..ea0693b4d5eaf5202228ae1e290f234da2d20fe9 100755 --- a/Generators/GeneratorObjectsTPCnv/src/HepMcParticleLinkCnv_p2.cxx +++ b/Generators/GeneratorObjectsTPCnv/src/HepMcParticleLinkCnv_p2.cxx @@ -39,7 +39,7 @@ void HepMcParticleLinkCnv_p2::persToTrans( const HepMcParticleLink_p2* persObj, void HepMcParticleLinkCnv_p2::transToPers( const HepMcParticleLink* transObj, HepMcParticleLink_p2* persObj, - MsgStream &/*msg*/ ) + MsgStream &msg ) { // In the case that the standard production workflow is being used // then the first event in the McEventCollection is the only one @@ -51,6 +51,9 @@ void HepMcParticleLinkCnv_p2::transToPers( const HepMcParticleLink* transObj, unsigned short index{0}; if (transObj->getEventPositionInCollection(SG::CurrentEventStore::store())!=0) { index = transObj->eventIndex(); + if(transObj->eventIndex()!=static_cast<HepMcParticleLink::index_type>(index)) { + msg << MSG::WARNING << "Attempting to persistify an eventIndex larger than max unsigned short!" << endmsg; + } } persObj->m_mcEvtIndex = index; persObj->m_barcode = transObj->barcode(); diff --git a/Generators/GeneratorObjectsTPCnv/test/HepMcParticleLinkCnv_p1_test.cxx b/Generators/GeneratorObjectsTPCnv/test/HepMcParticleLinkCnv_p1_test.cxx index 39d266e567c913a83e6baeafe5e88a33e6291d4e..937f83451d94de4223aad4ec2d2fb5421cba0122 100644 --- a/Generators/GeneratorObjectsTPCnv/test/HepMcParticleLinkCnv_p1_test.cxx +++ b/Generators/GeneratorObjectsTPCnv/test/HepMcParticleLinkCnv_p1_test.cxx @@ -67,13 +67,16 @@ void createMcEventCollectionInStoreGate(std::vector<HepMC::GenParticle*>& genPar inputTestDataHandle = std::make_unique<McEventCollection>(); // Add a dummy GenEvent const int process_id1(20); - const int event_number1(32767); - // 32767 = 2^15 -1 is the largest supported event number by - // HepMcParticleLink as the 16th bit of the unsigned short used to + const int event_number1(2147483647); + // 2147483647 = 2^31 -1 is the largest supported event number by + // HepMcParticleLink as the 32nd bit of the unsigned int used to // hold the eventIndex is used to flag whether the it represents the // position of the GenEvent in the McEventCollection or the // GenEvent::event_number. - const int event_number2(18); + const int event_number2(std::numeric_limits<unsigned short>::max()); + // 2^16 -1 is the largest event number supported by + // HepMcParticleLink_p2. A workaround is used to suppport larger + // values for the first event in the McEventCollection. const int event_number3(64); inputTestDataHandle->push_back(new HepMC::GenEvent(process_id1, event_number1)); HepMC::GenEvent& ge1 = *(inputTestDataHandle->at(0)); diff --git a/Generators/GeneratorObjectsTPCnv/test/HepMcParticleLinkCnv_p2_test.cxx b/Generators/GeneratorObjectsTPCnv/test/HepMcParticleLinkCnv_p2_test.cxx index 0ad255340d9335180d4176ae96851338cf212c3c..b18f98f5770d1728e4a2551c55df274d94fdb627 100644 --- a/Generators/GeneratorObjectsTPCnv/test/HepMcParticleLinkCnv_p2_test.cxx +++ b/Generators/GeneratorObjectsTPCnv/test/HepMcParticleLinkCnv_p2_test.cxx @@ -67,13 +67,16 @@ void createMcEventCollectionInStoreGate(std::vector<HepMC::GenParticle*>& genPar inputTestDataHandle = std::make_unique<McEventCollection>(); // Add a dummy GenEvent const int process_id1(20); - const int event_number1(32767); - // 32767 = 2^15 -1 is the largest supported event number by - // HepMcParticleLink as the 16th bit of the unsigned short used to + const int event_number1(2147483647); + // 2147483647 = 2^31 -1 is the largest supported event number by + // HepMcParticleLink as the 32nd bit of the unsigned int used to // hold the eventIndex is used to flag whether the it represents the // position of the GenEvent in the McEventCollection or the // GenEvent::event_number. - const int event_number2(18); + const int event_number2(std::numeric_limits<unsigned short>::max()); + // 2^16 -1 is the largest event number supported by + // HepMcParticleLink_p2. A workaround is used to suppport larger + // values for the first event in the McEventCollection. const int event_number3(64); inputTestDataHandle->push_back(new HepMC::GenEvent(process_id1, event_number1)); HepMC::GenEvent& ge1 = *(inputTestDataHandle->at(0)); diff --git a/Generators/TrackRecordGenerator/CMakeLists.txt b/Generators/TrackRecordGenerator/CMakeLists.txt index 1aa5b61bf5174e52a8042a3d90df293e83fd81ce..b6721397072653eb184d4d947fe64149f30fcbae 100644 --- a/Generators/TrackRecordGenerator/CMakeLists.txt +++ b/Generators/TrackRecordGenerator/CMakeLists.txt @@ -23,7 +23,7 @@ atlas_add_library( TrackRecordGeneratorLib INCLUDE_DIRS ${CLHEP_INCLUDE_DIRS} DEFINITIONS ${CLHEP_DEFINITIONS} LINK_LIBRARIES ${CLHEP_LIBRARIES} AtlasHepMCLib GeneratorModulesLib - PRIVATE_LINK_LIBRARIES GaudiKernel ) + PRIVATE_LINK_LIBRARIES GaudiKernel TrackRecordLib ) atlas_add_component( TrackRecordGenerator src/components/*.cxx diff --git a/HLT/Trigger/TrigControl/TrigServices/src/TrigCOOLUpdateHelper.cxx b/HLT/Trigger/TrigControl/TrigServices/src/TrigCOOLUpdateHelper.cxx index 1fe08d85f0efd320b0f0e76e9b4fc5f7f0120bc7..42204dc475bca43c20f6c633951f9929566b8b32 100644 --- a/HLT/Trigger/TrigControl/TrigServices/src/TrigCOOLUpdateHelper.cxx +++ b/HLT/Trigger/TrigControl/TrigServices/src/TrigCOOLUpdateHelper.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ /** @@ -231,6 +231,7 @@ StatusCode TrigCOOLUpdateHelper::hltCoolUpdate(const std::string& folderName, co } auto mon_t = Monitored::Timer("TIME_CoolFolderUpdate"); + Monitored::Group mon(m_monTool, mon_t); // Reset folder and make IOVDbSvc drop objects if (resetFolder(folderName, ctx.eventID().run_number(), true).isFailure()) { diff --git a/HLT/Trigger/TrigMonitoring/TrigOnlineMonitor/src/TrigALFAROBMonitor.cxx b/HLT/Trigger/TrigMonitoring/TrigOnlineMonitor/src/TrigALFAROBMonitor.cxx index ca8b2bd16632879ddd81bd2af0cd20a81d6d40a6..afee948d60eab7500ffac08309a3f1368c1cf559 100755 --- a/HLT/Trigger/TrigMonitoring/TrigOnlineMonitor/src/TrigALFAROBMonitor.cxx +++ b/HLT/Trigger/TrigMonitoring/TrigOnlineMonitor/src/TrigALFAROBMonitor.cxx @@ -38,13 +38,6 @@ #include <TH1F.h> #include <TH2F.h> #include <TProfile2D.h> - - -#if ROOT_VERSION_CODE >= ROOT_VERSION(6,0,0) -# define CAN_REBIN(hist) hist->SetCanExtend(TH1::kAllAxes) -#else -# define CAN_REBIN(hist) hist->SetBit(TH1::kCanRebin) -#endif //////////////////////////////////////////////////////////////////////////// @@ -438,7 +431,7 @@ StatusCode TrigALFAROBMonitor::start() { m_histProp_failedChecksumForALFAROB.value().lowEdge(), m_histProp_failedChecksumForALFAROB.value().highEdge()); if (m_hist_failedChecksumForALFAROB) { - CAN_REBIN(m_hist_failedChecksumForALFAROB); + m_hist_failedChecksumForALFAROB->SetCanExtend(TH1::kAllAxes); if( m_rootHistSvc->regHist(m_pathHisto + "common/" + m_hist_failedChecksumForALFAROB->GetName(), m_hist_failedChecksumForALFAROB).isFailure() ) { ATH_MSG_WARNING("Can not register ALFA ROB checksum monitoring histogram: " << m_hist_failedChecksumForALFAROB->GetName()); } @@ -450,7 +443,7 @@ StatusCode TrigALFAROBMonitor::start() { std::string histTitle = "goodDataAssessment"; m_hist_goodData = new TH1F (histTitle.c_str(), (histTitle + " elastics").c_str(), 10, -0.5, 9.5); if (m_hist_goodData) { - CAN_REBIN(m_hist_goodData); + m_hist_goodData->SetCanExtend(TH1::kAllAxes); if( m_rootHistSvc->regHist(m_pathHisto + "common/" + m_hist_goodData->GetName(), m_hist_goodData).isFailure() ) { ATH_MSG_WARNING("Can not register ALFA ROB good data elastic monitoring histogram: " << m_hist_goodData->GetName()); } diff --git a/HLT/Trigger/TrigMonitoring/TrigOnlineMonitor/src/TrigROBMonitor.cxx b/HLT/Trigger/TrigMonitoring/TrigOnlineMonitor/src/TrigROBMonitor.cxx index 83fcbb590dc7531084b6e5a007c55aa9a9d10904..e2a1b3428db98538eb8371492b771cc867487b2a 100755 --- a/HLT/Trigger/TrigMonitoring/TrigOnlineMonitor/src/TrigROBMonitor.cxx +++ b/HLT/Trigger/TrigMonitoring/TrigOnlineMonitor/src/TrigROBMonitor.cxx @@ -21,12 +21,6 @@ #include <TH2F.h> #include <TProfile.h> -#if ROOT_VERSION_CODE >= ROOT_VERSION(6,0,0) -# define CAN_REBIN(hist) hist->SetCanExtend(TH1::kAllAxes) -#else -# define CAN_REBIN(hist) hist->SetBit(TH1::kCanRebin) -#endif - ///////////////////////////////////////////////////////////////////////////// TrigROBMonitor::TrigROBMonitor(const std::string& name, ISvcLocator* pSvcLocator) : @@ -277,7 +271,7 @@ StatusCode TrigROBMonitor::start() { m_histProp_failedChecksumForROB.value().lowEdge(), m_histProp_failedChecksumForROB.value().highEdge()); if (m_hist_failedChecksumForROB) { - CAN_REBIN(m_hist_failedChecksumForROB); + m_hist_failedChecksumForROB->SetCanExtend(TH1::kAllAxes); if( rootHistSvc->regHist(path + m_hist_failedChecksumForROB->GetName(), m_hist_failedChecksumForROB).isFailure() ) { ATH_MSG_WARNING( "Can not register monitoring histogram: " << m_hist_failedChecksumForROB->GetName() ); } @@ -367,7 +361,7 @@ StatusCode TrigROBMonitor::start() { m_histProp_totalDataVolumeROB.value().lowEdge(), m_histProp_totalDataVolumeROB.value().highEdge()); if (m_hist_totalDataVolumeROB) { - CAN_REBIN(m_hist_totalDataVolumeROB); + m_hist_totalDataVolumeROB->SetCanExtend(TH1::kAllAxes); if( rootHistSvc->regHist(path + m_hist_totalDataVolumeROB->GetName(), m_hist_totalDataVolumeROB).isFailure() ) { ATH_MSG_WARNING( "Can not register monitoring histogram: " << m_hist_totalDataVolumeROB->GetName() ); } diff --git a/InnerDetector/InDetAlignTools/InDetAlignGenTools/CMakeLists.txt b/InnerDetector/InDetAlignTools/InDetAlignGenTools/CMakeLists.txt index 51b0adc9468cefb9a3f1070a88dd638d8f97ada1..73dab69a5dbef3536a664ffff6cc5174da33221b 100644 --- a/InnerDetector/InDetAlignTools/InDetAlignGenTools/CMakeLists.txt +++ b/InnerDetector/InDetAlignTools/InDetAlignGenTools/CMakeLists.txt @@ -55,7 +55,7 @@ atlas_add_component( InDetAlignGenTools src/*.cxx src/components/*.cxx INCLUDE_DIRS ${CORAL_INCLUDE_DIRS} ${HEPPDT_INCLUDE_DIRS} ${CLHEP_INCLUDE_DIRS} ${EIGEN_INCLUDE_DIRS} - LINK_LIBRARIES ${CORAL_LIBRARIES} ${HEPPDT_LIBRARIES} ${CLHEP_LIBRARIES} AtlasHepMCLib ${EIGEN_LIBRARIES} AthenaBaseComps AthenaPoolUtilities GeoPrimitives Identifier EventPrimitives InDetAlignTrkInfo InDetPrepRawData TrkEventPrimitives TrkEventUtils TrkTrack TrkExInterfaces TrkToolInterfaces AthenaKernel AthContainers AtlasDetDescr DetDescrConditions GaudiKernel InDetIdentifier InDetReadoutGeometry PixelReadoutGeometry SCT_ReadoutGeometry TRT_ReadoutGeometry TrkMeasurementBase TrkParameters TrkPrepRawData TrkRIO_OnTrack TrkTrackSummary TrkTruthData TrkFitterInterfaces EventContainers ) + LINK_LIBRARIES ${CORAL_LIBRARIES} ${HEPPDT_LIBRARIES} ${CLHEP_LIBRARIES} AtlasHepMCLib ${EIGEN_LIBRARIES} AthenaBaseComps AthenaPoolUtilities GeoPrimitives Identifier EventPrimitives InDetAlignTrkInfo InDetPrepRawData TrkEventPrimitives TrkEventUtils TrkTrack TrkExInterfaces TrkToolInterfaces AthenaKernel AthContainers AtlasDetDescr DetDescrConditions GaudiKernel InDetIdentifier InDetReadoutGeometry PixelReadoutGeometry SCT_ReadoutGeometry TRT_ReadoutGeometry TrkMeasurementBase TrkParameters TrkPrepRawData TrkRIO_OnTrack TrkTrackSummary TrkTruthData TrkFitterInterfaces EventContainers TrackRecordLib ) # Install files from the package: atlas_install_headers( InDetAlignGenTools ) diff --git a/InnerDetector/InDetDigitization/BCM_Digitization/src/BCM_DigitizationTool.cxx b/InnerDetector/InDetDigitization/BCM_Digitization/src/BCM_DigitizationTool.cxx index b13a9f87abbf1387be89f2dc615321cda64fabae..40821739be5fa40d80d9100024cec72854d55967 100644 --- a/InnerDetector/InDetDigitization/BCM_Digitization/src/BCM_DigitizationTool.cxx +++ b/InnerDetector/InDetDigitization/BCM_Digitization/src/BCM_DigitizationTool.cxx @@ -114,7 +114,9 @@ void BCM_DigitizationTool::processSiHit(const SiHit ¤tHit, double eventTim m_enerVect[moduleNo].push_back(enerDep); m_timeVect[moduleNo].push_back(hitTime); // Create new deposit and add to vector - HepMcParticleLink particleLink(currentHit.trackNumber(), evtIndex); + const EBC_EVCOLL evColl = EBC_MAINEVCOLL; + const HepMcParticleLink::PositionFlag idxFlag = (evtIndex==0) ? HepMcParticleLink::IS_POSITION: HepMcParticleLink::IS_INDEX; + const HepMcParticleLink particleLink{HepMcParticleLink(currentHit.trackNumber(), evtIndex, evColl, idxFlag)}; const int barcode = particleLink.barcode(); if (barcode == 0 || barcode == 10001){ return; diff --git a/InnerDetector/InDetDigitization/PixelDigitization/src/EnergyDepositionTool.cxx b/InnerDetector/InDetDigitization/PixelDigitization/src/EnergyDepositionTool.cxx index 97b5f36ee9b763ec427807a0b967bc2bd7d9dd53..4f108ea9aa254d2054003c515463305c2f2d76a8 100644 --- a/InnerDetector/InDetDigitization/PixelDigitization/src/EnergyDepositionTool.cxx +++ b/InnerDetector/InDetDigitization/PixelDigitization/src/EnergyDepositionTool.cxx @@ -137,10 +137,12 @@ StatusCode EnergyDepositionTool::finalize() { StatusCode EnergyDepositionTool::depositEnergy(const TimedHitPtr<SiHit> &phit, const InDetDD::SiDetectorElement &Module, std::vector<std::pair<double,double> > &trfHitRecord, std::vector<double> &initialConditions, CLHEP::HepRandomEngine *rndmEngine){ ATH_MSG_DEBUG("Deposit energy in sensor volume."); - + //Check if simulated particle or delta ray - const HepMcParticleLink McLink = HepMcParticleLink(phit->trackNumber(),phit.eventId()); - const HepMC::GenParticle* genPart= McLink.cptr(); + const EBC_EVCOLL evColl = EBC_MAINEVCOLL; + const HepMcParticleLink::PositionFlag idxFlag = (phit.eventId()==0) ? HepMcParticleLink::IS_POSITION: HepMcParticleLink::IS_INDEX; + const HepMcParticleLink McLink{HepMcParticleLink(phit->trackNumber(), phit.eventId(), evColl, idxFlag)}; + const HepMC::GenParticle* genPart= McLink.cptr(); bool delta_hit = true; if (genPart) delta_hit = false; double sensorThickness = Module.design().thickness(); diff --git a/InnerDetector/InDetDigitization/PixelDigitization/src/SensorSim3DTool.cxx b/InnerDetector/InDetDigitization/PixelDigitization/src/SensorSim3DTool.cxx index d7cef6302e5abae68dea7968260ec41c1447b60d..2f3474393ed4d5c6cb4438477c904032d92d63b7 100644 --- a/InnerDetector/InDetDigitization/PixelDigitization/src/SensorSim3DTool.cxx +++ b/InnerDetector/InDetDigitization/PixelDigitization/src/SensorSim3DTool.cxx @@ -228,7 +228,9 @@ StatusCode SensorSim3DTool::induceCharge(const TimedHitPtr<SiHit> &phit, SiCharg double pixel_size_y = Module.length()/p_design.columns(); double module_size_x = Module.width(); double module_size_y = Module.length(); - + + const EBC_EVCOLL evColl = EBC_MAINEVCOLL; + const HepMcParticleLink::PositionFlag idxFlag = (phit.eventId()==0) ? HepMcParticleLink::IS_POSITION: HepMcParticleLink::IS_INDEX; if (m_doRadDamage && m_fluence>0) { //**************************************// //*** Now diffuse charges to surface *** // @@ -392,7 +394,7 @@ StatusCode SensorSim3DTool::induceCharge(const TimedHitPtr<SiHit> &phit, SiCharg double y_mod = y_pix + yNeighbor + pixel_size_y * extraNPixY - module_size_y / 2.; SiLocalPosition chargePos = Module.hitLocalToLocal(y_mod, x_mod); - SiSurfaceCharge scharge(chargePos, SiCharge(induced_charge, hitTime(phit), SiCharge::track, HepMcParticleLink(phit->trackNumber(), phit.eventId()))); + SiSurfaceCharge scharge(chargePos, SiCharge(induced_charge, hitTime(phit), SiCharge::track, HepMcParticleLink(phit->trackNumber(), phit.eventId(), evColl, idxFlag))); SiCellId diode = Module.cellIdOfPosition(scharge.position()); SiCharge charge = scharge.charge(); if (diode.isValid()) { @@ -486,7 +488,7 @@ StatusCode SensorSim3DTool::induceCharge(const TimedHitPtr<SiHit> &phit, SiCharg double y_mod = y_neighbor + pixel_size_y/2 + pixel_size_y*nPixY -module_size_y/2.; SiLocalPosition chargePos = Module.hitLocalToLocal(y_mod,x_mod); - SiSurfaceCharge scharge(chargePos,SiCharge(ed,hitTime(phit),SiCharge::track,HepMcParticleLink(phit->trackNumber(),phit.eventId()))); + SiSurfaceCharge scharge(chargePos,SiCharge(ed,hitTime(phit),SiCharge::track,HepMcParticleLink(phit->trackNumber(),phit.eventId(),evColl,idxFlag))); SiCellId diode = Module.cellIdOfPosition(scharge.position()); SiCharge charge = scharge.charge(); if (diode.isValid()) { diff --git a/InnerDetector/InDetDigitization/PixelDigitization/src/SensorSimPlanarTool.cxx b/InnerDetector/InDetDigitization/PixelDigitization/src/SensorSimPlanarTool.cxx index 80a9937ae72108b4d0f7a17a9b33f6efe1a67815..985ac58eebcbad5deace49ca5b680f9de8053551 100644 --- a/InnerDetector/InDetDigitization/PixelDigitization/src/SensorSimPlanarTool.cxx +++ b/InnerDetector/InDetDigitization/PixelDigitization/src/SensorSimPlanarTool.cxx @@ -407,6 +407,9 @@ StatusCode SensorSimPlanarTool::induceCharge(const TimedHitPtr<SiHit> &phit, SiC double tanLorentz = m_lorentzAngleTool->getTanLorentzAngle(Module.identifyHash()); double coLorentz=sqrt(1+pow(tanLorentz,2)); + const EBC_EVCOLL evColl = EBC_MAINEVCOLL; + const HepMcParticleLink::PositionFlag idxFlag = (phit.eventId()==0) ? HepMcParticleLink::IS_POSITION: HepMcParticleLink::IS_INDEX; + //**************************************// //*** Now diffuse charges to surface *** // //**************************************// @@ -621,8 +624,8 @@ StatusCode SensorSimPlanarTool::induceCharge(const TimedHitPtr<SiHit> &phit, SiC SiLocalPosition chargePos = Module.hitLocalToLocal( centreOfPixel_nn.xEta(), centreOfPixel_nn.xPhi() ); //The following lines are adapted from SiDigitization's Inserter class - SiSurfaceCharge scharge_e( chargePos,SiCharge( induced_charge_e,hitTime(phit),SiCharge::track,HepMcParticleLink(phit->trackNumber(),phit.eventId()))); - SiSurfaceCharge scharge_h( chargePos,SiCharge( induced_charge_h,hitTime(phit),SiCharge::track,HepMcParticleLink(phit->trackNumber(),phit.eventId()))); + SiSurfaceCharge scharge_e( chargePos,SiCharge( induced_charge_e,hitTime(phit),SiCharge::track,HepMcParticleLink(phit->trackNumber(),phit.eventId(),evColl,idxFlag))); + SiSurfaceCharge scharge_h( chargePos,SiCharge( induced_charge_h,hitTime(phit),SiCharge::track,HepMcParticleLink(phit->trackNumber(),phit.eventId(),evColl,idxFlag))); SiCellId diode = Module.cellIdOfPosition(scharge_e.position()); SiCharge charge_e = scharge_e.charge(); SiCharge charge_h = scharge_h.charge(); @@ -664,7 +667,7 @@ StatusCode SensorSimPlanarTool::induceCharge(const TimedHitPtr<SiHit> &phit, SiC } //The following lines are adapted from SiDigitization's Inserter class - SiSurfaceCharge scharge(chargePos,SiCharge(ed,hitTime(phit),SiCharge::track,HepMcParticleLink(phit->trackNumber(),phit.eventId()))); + SiSurfaceCharge scharge(chargePos,SiCharge(ed,hitTime(phit),SiCharge::track,HepMcParticleLink(phit->trackNumber(),phit.eventId(),evColl,idxFlag))); SiCellId diode = Module.cellIdOfPosition(scharge.position()); diff --git a/InnerDetector/InDetDigitization/SCT_Digitization/src/SCT_DetailedSurfaceChargesGenerator.cxx b/InnerDetector/InDetDigitization/SCT_Digitization/src/SCT_DetailedSurfaceChargesGenerator.cxx index 287726a9cf67dcd74d3d2633ab38c15e377bd3b6..93c63b2d19ac24a7cf3e64a2f4bad3409b91f1d2 100644 --- a/InnerDetector/InDetDigitization/SCT_Digitization/src/SCT_DetailedSurfaceChargesGenerator.cxx +++ b/InnerDetector/InDetDigitization/SCT_Digitization/src/SCT_DetailedSurfaceChargesGenerator.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ #include "SCT_DetailedSurfaceChargesGenerator.h" @@ -324,7 +324,9 @@ void SCT_DetailedSurfaceChargesGenerator::processSiHit(const SiDetectorElement* //check the status of truth information for this SiHit //some Truth information is cut for pile up events - HepMcParticleLink trklink{HepMcParticleLink(phit.trackNumber(), p_eventId)}; + const EBC_EVCOLL evColl = EBC_MAINEVCOLL; + const HepMcParticleLink::PositionFlag idxFlag = (p_eventId==0) ? HepMcParticleLink::IS_POSITION: HepMcParticleLink::IS_INDEX; + const HepMcParticleLink trklink{HepMcParticleLink(phit.trackNumber(), p_eventId, evColl, idxFlag)}; SiCharge::Process hitproc{SiCharge::track}; if (phit.trackNumber()!=0) { if (not trklink.isValid()) { diff --git a/InnerDetector/InDetDigitization/SCT_Digitization/src/SCT_SurfaceChargesGenerator.cxx b/InnerDetector/InDetDigitization/SCT_Digitization/src/SCT_SurfaceChargesGenerator.cxx index 87dfdab4aef3cab00ad037dc20ce136a61a5d1b3..c1a4d63885f91530eaeec34bf692b7f85f5b88a7 100644 --- a/InnerDetector/InDetDigitization/SCT_Digitization/src/SCT_SurfaceChargesGenerator.cxx +++ b/InnerDetector/InDetDigitization/SCT_Digitization/src/SCT_SurfaceChargesGenerator.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ #include "SCT_SurfaceChargesGenerator.h" @@ -375,7 +375,9 @@ void SCT_SurfaceChargesGenerator::processSiHit(const SiDetectorElement* element, // check the status of truth information for this SiHit // some Truth information is cut for pile up events - const HepMcParticleLink trklink{HepMcParticleLink(phit.trackNumber(), p_eventId)}; + const EBC_EVCOLL evColl = EBC_MAINEVCOLL; + const HepMcParticleLink::PositionFlag idxFlag = (p_eventId==0) ? HepMcParticleLink::IS_POSITION: HepMcParticleLink::IS_INDEX; + const HepMcParticleLink trklink{HepMcParticleLink(phit.trackNumber(), p_eventId, evColl, idxFlag)}; SiCharge::Process hitproc{SiCharge::track}; if (phit.trackNumber() != 0) { if (not trklink.isValid()) { diff --git a/InnerDetector/InDetDigitization/TRT_Digitization/src/TRTDigitizationTool.cxx b/InnerDetector/InDetDigitization/TRT_Digitization/src/TRTDigitizationTool.cxx index 2a2f37804a7d19f0c6ea05032ccaaa2125342af2..5063ecfaf8ef2a37cbe19863c7cc87a766647879 100644 --- a/InnerDetector/InDetDigitization/TRT_Digitization/src/TRTDigitizationTool.cxx +++ b/InnerDetector/InDetDigitization/TRT_Digitization/src/TRTDigitizationTool.cxx @@ -428,10 +428,11 @@ StatusCode TRTDigitizationTool::processStraws(const EventContext& ctx, // Fill a vector of deposits depositVector.clear(); depositVector.reserve(std::distance(i,e)); + const EBC_EVCOLL evColl = EBC_MAINEVCOLL; for (TimedHitCollection<TRTUncompressedHit>::const_iterator hit_iter(i); hit_iter != e; ++hit_iter ) { - + const HepMcParticleLink::PositionFlag idxFlag = (hit_iter->eventId()==0) ? HepMcParticleLink::IS_POSITION: HepMcParticleLink::IS_INDEX; // suspect that we could use evtIndex here rather than hit_iter->eventId() // create a new deposit - InDetSimData::Deposit deposit( HepMcParticleLink((*hit_iter)->GetTrackID(), hit_iter->eventId()), (*hit_iter)->GetEnergyDeposit() ); + InDetSimData::Deposit deposit( HepMcParticleLink((*hit_iter)->GetTrackID(), hit_iter->eventId(), evColl, idxFlag), (*hit_iter)->GetEnergyDeposit() ); if(deposit.first.barcode()==0 || deposit.first.barcode() == m_vetoThisBarcode){ continue; } diff --git a/InnerDetector/InDetEventCnv/InDetSimEventTPCnv/src/InDetHits/SiHitCollectionCnv_p3.cxx b/InnerDetector/InDetEventCnv/InDetSimEventTPCnv/src/InDetHits/SiHitCollectionCnv_p3.cxx index 74e23b8780f557c07acfed47512b0aee226756ab..07f4b1c0992ab006f3d53d2720eaa051463ea9b5 100644 --- a/InnerDetector/InDetEventCnv/InDetSimEventTPCnv/src/InDetHits/SiHitCollectionCnv_p3.cxx +++ b/InnerDetector/InDetEventCnv/InDetSimEventTPCnv/src/InDetHits/SiHitCollectionCnv_p3.cxx @@ -60,7 +60,7 @@ const double SiHitCollectionCnv_p3::m_2bHalfMaximum = pow(2.0, 15.0); const int SiHitCollectionCnv_p3::m_2bMaximum = (unsigned short)(-1); -void SiHitCollectionCnv_p3::transToPers(const SiHitCollection* transCont, SiHitCollection_p3* persCont, MsgStream &/*log*/) +void SiHitCollectionCnv_p3::transToPers(const SiHitCollection* transCont, SiHitCollection_p3* persCont, MsgStream &log) { // Finds hits belonging to a "string" (in which the end point of one hit is the same as the start point of the next) and // persistifies the end point of each hit plus the start point of the first hit in each string. @@ -105,6 +105,9 @@ void SiHitCollectionCnv_p3::transToPers(const SiHitCollection* transCont, SiHitC unsigned short index{0}; if (lastLink->getEventPositionInCollection(SG::CurrentEventStore::store())!=0) { index = lastLink->eventIndex(); + if(lastLink->eventIndex()!=static_cast<HepMcParticleLink::index_type>(index)) { + log << MSG::WARNING << "Attempting to persistify an eventIndex larger than max unsigned short!" << endmsg; + } } persCont->m_mcEvtIndex.push_back(index); persCont->m_evtColl.push_back(lastLink->getEventCollectionAsChar()); diff --git a/InnerDetector/InDetEventCnv/InDetSimEventTPCnv/src/InDetHits/TRT_HitCollectionCnv_p4.cxx b/InnerDetector/InDetEventCnv/InDetSimEventTPCnv/src/InDetHits/TRT_HitCollectionCnv_p4.cxx index 9661e8706836b71bca1ec08dc29540109f19d1c7..4fb8405218da3e3f6af9266202ce809274d0977d 100644 --- a/InnerDetector/InDetEventCnv/InDetSimEventTPCnv/src/InDetHits/TRT_HitCollectionCnv_p4.cxx +++ b/InnerDetector/InDetEventCnv/InDetSimEventTPCnv/src/InDetHits/TRT_HitCollectionCnv_p4.cxx @@ -70,6 +70,9 @@ void TRT_HitCollectionCnv_p4::transToPers(const TRTUncompressedHitCollection* tr unsigned short index{0}; if (lastLink->getEventPositionInCollection(SG::CurrentEventStore::store())!=0) { index = lastLink->eventIndex(); + if(lastLink->eventIndex()!=static_cast<HepMcParticleLink::index_type>(index)) { + log << MSG::WARNING << "Attempting to persistify an eventIndex larger than max unsigned short!" << endmsg; + } } persCont->m_mcEvtIndex.push_back(index); persCont->m_evtColl.push_back(lastLink->getEventCollectionAsChar()); diff --git a/InnerDetector/InDetMonitoring/SCT_Monitoring/python/SCTLorentzMonAlg.py b/InnerDetector/InDetMonitoring/SCT_Monitoring/python/SCTLorentzMonAlg.py index e8a051b1df79634cc076678a9eed1142d4384c5a..d9d46d2e8a0a596768fd9a4b709ad90dd2856e86 100644 --- a/InnerDetector/InDetMonitoring/SCT_Monitoring/python/SCTLorentzMonAlg.py +++ b/InnerDetector/InDetMonitoring/SCT_Monitoring/python/SCTLorentzMonAlg.py @@ -1,5 +1,5 @@ # -# Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration +# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration # '''@file SCTLorentzMonAlg.py @@ -52,8 +52,10 @@ def SCTLorentzMonAlgConfig(inputFlags): # set up geometry / conditions - from AtlasGeoModel.AtlasGeoModelConfig import AtlasGeometryCfg - result.merge(AtlasGeometryCfg(inputFlags)) + from BeamPipeGeoModel.BeamPipeGMConfig import BeamPipeGeometryCfg + result.merge(BeamPipeGeometryCfg(inputFlags)) + from AtlasGeoModel.InDetGMConfig import InDetGeometryCfg + result.merge(InDetGeometryCfg(inputFlags)) # # Then, add a tool that doesn't have its own configuration function. In # # this example, no accumulator is returned, so no merge is necessary. @@ -118,10 +120,10 @@ if __name__ == "__main__": ConfigFlags.Input.isMC = True ConfigFlags.Output.HISTFileName = 'SCTLorentzMonOutput.root' ConfigFlags.GeoModel.Align.Dynamic = False - ConfigFlags.Detector.GeometryID = True ConfigFlags.Detector.GeometryPixel = True ConfigFlags.Detector.GeometrySCT = True ConfigFlags.Detector.GeometryTRT = True + ConfigFlags.Detector.GeometryMuon = False ConfigFlags.lock() # Initialize configuration object, add accumulator, merge, and run. @@ -130,10 +132,6 @@ if __name__ == "__main__": cfg = MainServicesSerialCfg() cfg.merge(PoolReadCfg(ConfigFlags)) - from AtlasGeoModel.AtlasGeoModelConfig import AtlasGeometryCfg - geoCfg=AtlasGeometryCfg(ConfigFlags) - cfg.merge(geoCfg) - sctLorentzMonAcc = SCTLorentzMonAlgConfig(ConfigFlags) cfg.merge(sctLorentzMonAcc) diff --git a/InnerDetector/InDetMonitoring/SCT_Monitoring/python/TrackSummaryToolWorkaround.py b/InnerDetector/InDetMonitoring/SCT_Monitoring/python/TrackSummaryToolWorkaround.py index 26ede2d435b77979ed490c02b09c588b11818cf2..4719887d4af504ed1f90716f2ccca5235a840312 100644 --- a/InnerDetector/InDetMonitoring/SCT_Monitoring/python/TrackSummaryToolWorkaround.py +++ b/InnerDetector/InDetMonitoring/SCT_Monitoring/python/TrackSummaryToolWorkaround.py @@ -1,5 +1,5 @@ # -# Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration +# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration # '''@file TrackingConfigurationWorkaround.py @@ -107,4 +107,12 @@ def TrackSummaryToolWorkaround(flags): PixelToTPIDTool = None) result.setPrivateTools(InDetTrackSummaryTool) ############################## WORKAROUND (END) ############################ + + # To run job only with ID + if hasattr(flags, "Detector") and hasattr(flags.Detector, "GeometryMuon") and hasattr(flags.Detector, "GeometryID"): + TrkEventCnvSuperTool = CompFactory.Trk.EventCnvSuperTool(name = "EventCnvSuperTool", + DoMuons = flags.Detector.GeometryMuon, + DoID = flags.Detector.GeometryID) + result.addPublicTool(TrkEventCnvSuperTool) + return result diff --git a/InnerDetector/InDetMonitoring/SCT_Monitoring/share/SCTErrMonAlg_jobOptions.py b/InnerDetector/InDetMonitoring/SCT_Monitoring/share/SCTErrMonAlg_jobOptions.py index 2e41ba60a7d61c82599833ccb8d93470209a09dd..c652df3e38f1aa76db564c44f19370e64f7069d0 100644 --- a/InnerDetector/InDetMonitoring/SCT_Monitoring/share/SCTErrMonAlg_jobOptions.py +++ b/InnerDetector/InDetMonitoring/SCT_Monitoring/share/SCTErrMonAlg_jobOptions.py @@ -132,6 +132,16 @@ myMonGroup.defineHistogram(varname = "maskedLinksBin;Masked Links", xmax = sctMon.N_REGIONS_INC_GENERAL-0.5, xlabels = ["EndCapC", "Barrel", "EndCapA", "All"]) +# Filled in fillHistograms +myMonGroup.defineHistogram(varname = "flaggedWafersIndices, nFlaggedWafers;FlaggedWafers", + type = "TProfile", + title = "Number of flagged wafers for SCT,ECA,B,ECC", + path = "GENERAL/errors", + xbins = sctMon.N_REGIONS_INC_GENERAL, + xmin = -0.5, + xmax = sctMon.N_REGIONS_INC_GENERAL-0.5, + xlabels = ["EndCapC", "Barrel", "EndCapA", "All"]) + # Filled in fillByteStreamErrors coverageTitles = [ "", # All (not used) diff --git a/InnerDetector/InDetMonitoring/SCT_Monitoring/src/SCTErrMonAlg.cxx b/InnerDetector/InDetMonitoring/SCT_Monitoring/src/SCTErrMonAlg.cxx index 94fd87688e7c988bd8ebecbcf326eee290ddea3b..dac02d6d4b255ced7daece9a4505e94dfa24da4b 100644 --- a/InnerDetector/InDetMonitoring/SCT_Monitoring/src/SCTErrMonAlg.cxx +++ b/InnerDetector/InDetMonitoring/SCT_Monitoring/src/SCTErrMonAlg.cxx @@ -29,6 +29,7 @@ StatusCode SCTErrMonAlg::initialize() { if (m_useDCS) ATH_CHECK(m_dcsTool.retrieve()); else m_dcsTool.disable(); ATH_CHECK(m_pSummaryTool.retrieve()); + ATH_CHECK(m_flaggedTool.retrieve()); // Retrieve geometrical information const InDetDD::SCT_DetectorManager* sctManager{nullptr}; @@ -69,6 +70,25 @@ StatusCode SCTErrMonAlg::fillHistograms(const EventContext& ctx) const { auto sctFlagAcc{Monitored::Scalar<bool>("sctFlag", sctFlag)}; fill("SCTErrMonitor", lumiBlockAcc, is1DAcc, sctFlagAcc); + // Check wafers with many fired strips (event dependent) using SCT_FlaggedConditionTool. + std::array<int, N_REGIONS_INC_GENERAL> flaggedWafersIndices + {ENDCAP_C_INDEX, BARREL_INDEX, ENDCAP_A_INDEX, GENERAL_INDEX}; + std::array<int, N_REGIONS_INC_GENERAL> nFlaggedWafers; + nFlaggedWafers.fill(0); + const unsigned int wafer_hash_max{static_cast<unsigned int>(m_pSCTHelper->wafer_hash_max())}; + for (unsigned int iHash{0}; iHash<wafer_hash_max; iHash++) { + const IdentifierHash hash{iHash}; + if (not m_flaggedTool->isGood(hash)) { + const Identifier wafer_id{m_pSCTHelper->wafer_id(hash)}; + const int barrel_ec{m_pSCTHelper->barrel_ec(wafer_id)}; + nFlaggedWafers[barrel_ec]++; + nFlaggedWafers[GENERAL_INDEX]++; + } + } + auto flaggedWwafersIndicesAcc{Monitored::Collection("flaggedWafersIndices", flaggedWafersIndices)}; + auto nFlaggedWafersAcc{Monitored::Collection("nFlaggedWafers", nFlaggedWafers)}; + fill("SCTErrMonitor", flaggedWwafersIndicesAcc, nFlaggedWafersAcc); + if (sctFlag) { return StatusCode::SUCCESS; } diff --git a/InnerDetector/InDetMonitoring/SCT_Monitoring/src/SCTErrMonAlg.h b/InnerDetector/InDetMonitoring/SCT_Monitoring/src/SCTErrMonAlg.h index 7a24d3c6b56ecf011dd8e986e309f97bf9f63a85..8e07f89dbd60d25bb58d9085a31e46c0e448e935 100644 --- a/InnerDetector/InDetMonitoring/SCT_Monitoring/src/SCTErrMonAlg.h +++ b/InnerDetector/InDetMonitoring/SCT_Monitoring/src/SCTErrMonAlg.h @@ -16,6 +16,7 @@ #include "SCT_ConditionsTools/ISCT_ByteStreamErrorsTool.h" #include "SCT_ConditionsTools/ISCT_ConfigurationConditionsTool.h" #include "SCT_ConditionsTools/ISCT_DCSConditionsTool.h" +#include "SCT_ConditionsTools/ISCT_FlaggedConditionTool.h" #include "TH2F.h" @@ -98,6 +99,7 @@ class SCTErrMonAlg : public AthMonitorAlgorithm { ToolHandle<ISCT_ConfigurationConditionsTool> m_configurationTool{this, "conditionsTool", "SCT_ConfigurationConditionsTool/InDetSCT_ConfigurationConditionsTool", "Tool to retrieve SCT Configuration Tool"}; ToolHandle<ISCT_DCSConditionsTool> m_dcsTool{this, "SCT_DCSConditionsTool", "SCT_DCSConditionsTool/InDetSCT_DCSConditionsTool", "Tool to retrieve SCT DCS information"}; ToolHandle<IInDetConditionsTool> m_pSummaryTool{this, "SCT_ConditionsSummaryTool", "SCT_ConditionsSummaryTool/InDetSCT_ConditionsSummaryTool", "Tool to retrieve SCT Conditions summary"}; + ToolHandle<ISCT_FlaggedConditionTool> m_flaggedTool{this, "SCT_FlaggedConditionTool", "SCT_FlaggedConditionTool/InDetSCT_FlaggedConditionTool", "Tool to retrieve bad wafers with many fired strips"}; const SCT_ID* m_pSCTHelper{nullptr}; diff --git a/InnerDetector/InDetMonitoring/SCT_Monitoring/src/SCTErrMonTool.cxx b/InnerDetector/InDetMonitoring/SCT_Monitoring/src/SCTErrMonTool.cxx index b627a8c3f56819facff400fc5ff4efd92f12a1ee..56d22ab017ab4eb82cae8266689307d22a48e141 100644 --- a/InnerDetector/InDetMonitoring/SCT_Monitoring/src/SCTErrMonTool.cxx +++ b/InnerDetector/InDetMonitoring/SCT_Monitoring/src/SCTErrMonTool.cxx @@ -203,6 +203,7 @@ SCTErrMonTool::bookHistograms() { if (m_useDCS) ATH_CHECK(m_dcsTool.retrieve()); else m_dcsTool.disable(); ATH_CHECK(m_pSummaryTool.retrieve()); + ATH_CHECK(m_flaggedTool.retrieve()); m_initialize = true; return StatusCode::SUCCESS; } @@ -318,6 +319,23 @@ SCTErrMonTool::fillHistograms() { ATH_CHECK(fillByteStreamErrors()); + // Check wafers with many fired strips (event dependent) using SCT_FlaggedConditionTool. + std::array<int, N_REGIONS_INC_GENERAL> nFlaggedWafers; + nFlaggedWafers.fill(0); + const unsigned int wafer_hash_max{static_cast<unsigned int>(m_pSCTHelper->wafer_hash_max())}; + for (unsigned int iHash{0}; iHash<wafer_hash_max; iHash++) { + const IdentifierHash hash{iHash}; + if (not m_flaggedTool->isGood(hash)) { + const Identifier wafer_id{m_pSCTHelper->wafer_id(hash)}; + const int barrel_ec{m_pSCTHelper->barrel_ec(wafer_id)}; + nFlaggedWafers[barrel_ec]++; + nFlaggedWafers[GENERAL_INDEX]++; + } + } + for (int reg{0}; reg<N_REGIONS_INC_GENERAL; reg++) { + m_flaggedWafers->Fill(reg, nFlaggedWafers[reg]); + } + if (sctflag) { return StatusCode::SUCCESS; } @@ -811,7 +829,7 @@ StatusCode SCTErrMonTool::bookErrHistosGen() { if (ManagedMonitorToolBase::newRunFlag()) { MonGroup MaskErrs{this, "SCT/GENERAL/errors", ManagedMonitorToolBase::run, ATTRIB_UNMANAGED}; - m_MaskedAllLinks = new TH1I("Masked Links", "Number of Masked Links for SCT,ECA,B,ECC", 4, -0.5, 3.5); // should reorder to C,B,A,total ? + m_MaskedAllLinks = new TH1I("Masked Links", "Number of Masked Links for SCT,ECA,B,ECC", N_REGIONS_INC_GENERAL, -0.5, N_REGIONS_INC_GENERAL-0.5); m_MaskedAllLinks->GetXaxis()->SetBinLabel(1, "EndCapC"); m_MaskedAllLinks->GetXaxis()->SetBinLabel(2, "Barrel"); m_MaskedAllLinks->GetXaxis()->SetBinLabel(3, "EndCapA"); @@ -819,6 +837,14 @@ SCTErrMonTool::bookErrHistosGen() { if (MaskErrs.regHist(m_MaskedAllLinks).isFailure()) { ATH_MSG_WARNING("Couldn't book MaskedLinks"); } + m_flaggedWafers = new TProfile("FlaggedWafers", "Number of flagged wafers for SCT,ECA,B,ECC", N_REGIONS_INC_GENERAL, -0.5, N_REGIONS_INC_GENERAL-0.5); + m_flaggedWafers->GetXaxis()->SetBinLabel(1, "EndCapC"); + m_flaggedWafers->GetXaxis()->SetBinLabel(2, "Barrel"); + m_flaggedWafers->GetXaxis()->SetBinLabel(3, "EndCapA"); + m_flaggedWafers->GetXaxis()->SetBinLabel(4, "All"); + if (MaskErrs.regHist(m_flaggedWafers).isFailure()) { + ATH_MSG_WARNING("Couldn't book FlaggedWafers"); + } } return StatusCode::SUCCESS; } @@ -969,8 +995,11 @@ SCTErrMonTool::bookConfMapsGen() { // ==================================================================================================== StatusCode SCTErrMonTool::fillCondDBMaps() { - int Flagged[N_REGIONS_INC_GENERAL] = { // Not updated. Always zero. - 0, 0, 0, 0 + double Flagged[N_REGIONS_INC_GENERAL] = { + m_flaggedWafers->GetBinContent(1), + m_flaggedWafers->GetBinContent(2), + m_flaggedWafers->GetBinContent(3), + m_flaggedWafers->GetBinContent(4) }; int MOut[N_REGIONS_INC_GENERAL] = { 0, 0, 0, 0 @@ -1097,7 +1126,7 @@ SCTErrMonTool::fillCondDBMaps() { if (m_makeConfHisto) { m_ConfOutModules->Fill(0., static_cast<double>(MOut[GENERAL_INDEX])); - m_ConfNew->Fill(0., static_cast<double>(Flagged[GENERAL_INDEX])); + m_ConfNew->Fill(0., Flagged[GENERAL_INDEX]); m_ConfNew->Fill(1., static_cast<double>(MaskedAllLinks[GENERAL_INDEX])); m_ConfNew->Fill(2., static_cast<double>(ModErr[GENERAL_INDEX])); m_ConfNew->Fill(3., static_cast<double>(InEffModules[GENERAL_INDEX])); @@ -1105,7 +1134,7 @@ SCTErrMonTool::fillCondDBMaps() { if (m_environment == AthenaMonManager::online) { for (int reg{0}; reg < N_REGIONS_INC_GENERAL; ++reg) { m_ConfOnline[reg]->Fill(0., static_cast<double>(MOut[reg])); - m_ConfOnline[reg]->Fill(1., static_cast<double>(Flagged[reg])); + m_ConfOnline[reg]->Fill(1., Flagged[reg]); m_ConfOnline[reg]->Fill(2., static_cast<double>(MaskedAllLinks[reg])); m_ConfOnline[reg]->Fill(3., static_cast<double>(ModErr[reg])); } diff --git a/InnerDetector/InDetMonitoring/SCT_Monitoring/src/SCTErrMonTool.h b/InnerDetector/InDetMonitoring/SCT_Monitoring/src/SCTErrMonTool.h index a172bc54517ce331a77a374b87a40df33af3addb..626b1aaaef1669478e6038752298247cef036e63 100644 --- a/InnerDetector/InDetMonitoring/SCT_Monitoring/src/SCTErrMonTool.h +++ b/InnerDetector/InDetMonitoring/SCT_Monitoring/src/SCTErrMonTool.h @@ -23,6 +23,7 @@ #include "SCT_ConditionsTools/ISCT_ConfigurationConditionsTool.h" #include "SCT_ConditionsTools/ISCT_ByteStreamErrorsTool.h" #include "SCT_ConditionsTools/ISCT_DCSConditionsTool.h" +#include "SCT_ConditionsTools/ISCT_FlaggedConditionTool.h" #include "StoreGate/ReadHandleKey.h" #include "xAODEventInfo/EventInfo.h" @@ -127,6 +128,7 @@ class SCTErrMonTool : public ManagedMonitorToolBase { ToolHandle<ISCT_ByteStreamErrorsTool> m_byteStreamErrTool{this, "SCT_ByteStreamErrorsTool", "SCT_ByteStreamErrorsTool", "Tool to retrieve SCT ByteStream Errors"}; ToolHandle<ISCT_DCSConditionsTool> m_dcsTool{this, "SCT_DCSConditionsTool", "InDetSCT_DCSConditionsTool", "Tool to retrieve SCT DCS information"}; ToolHandle<IInDetConditionsTool> m_pSummaryTool{this, "SCT_ConditionsSummaryTool", "SCT_ConditionsSummaryTool/InDetSCT_ConditionsSummaryTool", "Tool to retrieve SCT Conditions summary"}; + ToolHandle<ISCT_FlaggedConditionTool> m_flaggedTool{this, "SCT_FlaggedConditionTool", "SCT_FlaggedConditionTool/InDetSCT_FlaggedConditionTool", "Tool to retrieve bad wafers with many fired strips"}; ///SCT Helper class const SCT_ID* m_pSCTHelper{nullptr}; @@ -141,7 +143,8 @@ class SCTErrMonTool : public ManagedMonitorToolBase { TProfile_LW* m_FractionOfSCTFlagErrorsPerLB{}; // Filled in fillHistograms TH1F_LW* m_NumberOfSCTFlagErrorsVsLB{}; // Filled in fillHistograms TH1F_LW* m_NumberOfEventsVsLB{}; // Filled in fillHistograms - TH1I* m_MaskedAllLinks{}; // Filled in fillByteStreamErrorsHelper. + TH1I* m_MaskedAllLinks{}; // Filled in fillByteStreamErrorsHelper + TProfile* m_flaggedWafers{}; // Filled in fillHistograms // maskedLinks or maskedRODs // Unnecessary but necessary to fill necessary m_ConfNew /// Under LB directories diff --git a/InnerDetector/InDetMonitoring/SCT_Monitoring/src/SCTHitsNoiseMonAlg.cxx b/InnerDetector/InDetMonitoring/SCT_Monitoring/src/SCTHitsNoiseMonAlg.cxx index 430ac3b1a1db956a9376bfd1877a6024f77dd3e1..7d856dee7a3467b897fb45306e302a382771c244 100644 --- a/InnerDetector/InDetMonitoring/SCT_Monitoring/src/SCTHitsNoiseMonAlg.cxx +++ b/InnerDetector/InDetMonitoring/SCT_Monitoring/src/SCTHitsNoiseMonAlg.cxx @@ -235,7 +235,7 @@ StatusCode SCTHitsNoiseMonAlg::generalHistsandNoise(const array<unordered_set<Id vector<int> vEtaOnTrack; vector<int> vPhiOnTrack; - vector<float> vBec0p5OnTrack; + vector<float> vSystemIndexOnTrack; vector<bool> vDTbinOnTrack; vector<int> vEta; @@ -303,7 +303,7 @@ StatusCode SCTHitsNoiseMonAlg::generalHistsandNoise(const array<unordered_set<Id vEtaOnTrack.push_back(thisEta); vPhiOnTrack.push_back(thisPhi); vDTbinOnTrack.push_back((tbin == 2) or (tbin == 3)); - vBec0p5OnTrack.push_back(barrel_ec+0.5); + vSystemIndexOnTrack.push_back(systemIndex); } } vEta.push_back(thisEta); @@ -371,7 +371,7 @@ StatusCode SCTHitsNoiseMonAlg::generalHistsandNoise(const array<unordered_set<Id } }// End of Loop on RDO container - auto Bec_TBinFracAllAcc{Monitored::Collection("Bec_TBinFracAll", vBec0p5OnTrack)}; + auto Bec_TBinFracAllAcc{Monitored::Collection("Bec_TBinFracAll", vSystemIndexOnTrack)}; auto TBin_TBinFracAllAcc{Monitored::Collection("TBin_TBinFracAll", vDTbinOnTrack)}; fill("SCTHitsNoiseMonitorGeneral", Bec_TBinFracAllAcc, TBin_TBinFracAllAcc); @@ -382,9 +382,9 @@ StatusCode SCTHitsNoiseMonAlg::generalHistsandNoise(const array<unordered_set<Id fill("SCTHitsNoiseMonitor_" + std::to_string(jReg), lbHits_vsLBAcc, numberOfHitsFromSPsHSPHits_vsLBAcc, numhitsHallHits_vsLBAcc); auto lbHitsTrigger_vsLBAcc{Monitored::Collection("lbh_HitsTrigger_vsLB", vLumiBlockTrigger[jReg])}; - auto numhitsHallHitsTrigger_vsLBAcc{Monitored::Collection("numhitsh_HallHits_vsLB", vNumberOfHitsFromAllRDOsTrigger[jReg])}; + auto numhitsHallHitsTrigger_vsLBAcc{Monitored::Collection("numhitsh_HallHitsTrigger_vsLB", vNumberOfHitsFromAllRDOsTrigger[jReg])}; auto numberOfHitsFromSPsHSPHitsTrigger_vsLBAcc{Monitored::Collection("numberOfHitsFromSPsh_HSPHitsTrigger_vsLB", vNumberOfHitsFromSPsTrigger[jReg])}; - fill("SCTHitsNoiseMonitor_" + std::to_string(jReg), lbHitsTrigger_vsLBAcc, numberOfHitsFromSPsHSPHitsTrigger_vsLBAcc, numhitsHallHits_vsLBAcc); + fill("SCTHitsNoiseMonitor_" + std::to_string(jReg), lbHitsTrigger_vsLBAcc, numberOfHitsFromSPsHSPHitsTrigger_vsLBAcc, numhitsHallHitsTrigger_vsLBAcc); } // if (m_environment!=AthMonitorAlgorithm::Environment_t::online) { // Uncomment this line to turn off cluster hists in online diff --git a/InnerDetector/InDetMonitoring/SCT_Monitoring/src/SCTHitsNoiseMonTool.cxx b/InnerDetector/InDetMonitoring/SCT_Monitoring/src/SCTHitsNoiseMonTool.cxx index 0c04f1f40601b1e972cdd6920b35c822aa8e9084..247c6cfcdbef34528ad1c0340d8a8da5481d37d0 100644 --- a/InnerDetector/InDetMonitoring/SCT_Monitoring/src/SCTHitsNoiseMonTool.cxx +++ b/InnerDetector/InDetMonitoring/SCT_Monitoring/src/SCTHitsNoiseMonTool.cxx @@ -431,7 +431,7 @@ SCTHitsNoiseMonTool::generalHistsandNoise(const EventContext& ctx) { } // Fill the track hits histogram double dTbin{static_cast<double>((tbin == 2) or (tbin == 3))}; - m_tbinfracall->Fill(thisBec+0.5, dTbin); + m_tbinfracall->Fill(systemIndex, dTbin); } } histogram->Fill(thisEta, thisPhi, numberOfStrips); diff --git a/InnerDetector/InDetMonitoring/TRTMonitoringRun3/python/TrackSummaryToolWorkaround.py b/InnerDetector/InDetMonitoring/TRTMonitoringRun3/python/TrackSummaryToolWorkaround.py deleted file mode 100644 index 26ede2d435b77979ed490c02b09c588b11818cf2..0000000000000000000000000000000000000000 --- a/InnerDetector/InDetMonitoring/TRTMonitoringRun3/python/TrackSummaryToolWorkaround.py +++ /dev/null @@ -1,110 +0,0 @@ -# -# Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration -# - -'''@file TrackingConfigurationWorkaround.py -@author Peter Onyisi -@date 2019-12-17 -@brief Centralize the DQ workarounds for setting up ID tracking tools in new-style config, until this is provided centrally -''' - -def TrackSummaryToolWorkaround(flags): - from AthenaConfiguration.ComponentFactory import CompFactory - from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator - result = ComponentAccumulator() - ############################## WORKAROUND (START) ########################## - ############################## TO RUN TRACKSUMMARYTOOL ##################### - - # Taken from InnerDetector/InDetDigitization/PixelDigitization/python/PixelDigitizationConfigNew.py - from PixelConditionsAlgorithms.PixelConditionsConfig import PixelConfigCondAlgCfg - result.merge(PixelConfigCondAlgCfg(flags, - UseCalibConditions=True, - UseDeadmapConditions=True, - UseDCSStateConditions=False, - UseDCSStatusConditions=False, - UseDCSHVConditions=True, - UseDCSTemperatureConditions=True, - UseTDAQConditions=False)) - - from PixelConditionsTools.PixelConditionsSummaryConfig import PixelConditionsSummaryCfg - InDetPixelConditionsSummaryTool = result.popToolsAndMerge(PixelConditionsSummaryCfg(flags)) - - # Taken from Tracking/TrkConfig/python/AtlasExtrapolatorConfig.py - # AtlasExtrapolatorConfig can give only private extrapolator. We need public extrapolator. - from TrkConfig.AtlasTrackingGeometrySvcConfig import TrackingGeometrySvcCfg - trackGeomCfg = TrackingGeometrySvcCfg(flags) - geom_svc = trackGeomCfg.getPrimary() - geom_svc.GeometryBuilder.Compactify = False ######## To avoid crash ######## - result.merge(trackGeomCfg) - from MagFieldServices.MagFieldServicesConfig import MagneticFieldSvcCfg - result.merge(MagneticFieldSvcCfg(flags)) - AtlasNavigator = CompFactory.Trk.Navigator(name = 'AtlasNavigator') - AtlasNavigator.TrackingGeometrySvc = geom_svc - result.addPublicTool(AtlasNavigator) - - # Taken from InnerDetector/InDetExample/InDetRecExample/share/InDetRecLoadTools.py - InDetPropagator = CompFactory.Trk.RungeKuttaPropagator(name = 'InDetPropagator') - InDetPropagator.AccuracyParameter = 0.0001 - InDetPropagator.MaxStraightLineStep = .004 - result.addPublicTool(InDetPropagator) - InDetMaterialUpdator = CompFactory.Trk.MaterialEffectsUpdator(name = "InDetMaterialEffectsUpdator") - result.addPublicTool(InDetMaterialUpdator) - InDetSubPropagators = [] - InDetSubUpdators = [] - # -------------------- set it depending on the geometry ---------------------------------------------------- - # default for ID is (Rk,Mat) - InDetSubPropagators += [ InDetPropagator.name ] - InDetSubUpdators += [ InDetMaterialUpdator.name ] - # default for Calo is (Rk,MatLandau) - InDetSubPropagators += [ InDetPropagator.name ] - InDetSubUpdators += [ InDetMaterialUpdator.name ] - # default for MS is (STEP,Mat) - #InDetSubPropagators += [ InDetStepPropagator.name ] - InDetSubUpdators += [ InDetMaterialUpdator.name ] - #from TrkExTools.TrkExToolsConf import Trk__Extrapolator - InDetExtrapolator = CompFactory.Trk.Extrapolator(name = 'InDetExtrapolator', - Propagators = [ InDetPropagator ], - MaterialEffectsUpdators = [ InDetMaterialUpdator ], - Navigator = AtlasNavigator, - SubPropagators = InDetSubPropagators, - SubMEUpdators = InDetSubUpdators) - result.addPublicTool(InDetExtrapolator) - InDetTestPixelLayerTool = CompFactory.InDet.InDetTestPixelLayerTool(name = "InDetTestPixelLayerTool", - PixelSummaryTool = InDetPixelConditionsSummaryTool, - CheckActiveAreas=True, - CheckDeadRegions=True, - CheckDisabledFEs=True) - result.addPublicTool(InDetTestPixelLayerTool) - InDetHoleSearchTool = CompFactory.InDet.InDetTrackHoleSearchTool(name = "InDetHoleSearchTool", - Extrapolator = InDetExtrapolator, - PixelSummaryTool = InDetPixelConditionsSummaryTool, - usePixel = flags.Detector.GeometryPixel, - useSCT = flags.Detector.GeometrySCT, - CountDeadModulesAfterLastHit = True, - PixelLayerTool = InDetTestPixelLayerTool) - result.addPublicTool(InDetHoleSearchTool) - InDetPrdAssociationTool = CompFactory.InDet.InDetPRD_AssociationToolGangedPixels(name = "InDetPrdAssociationTool", - PixelClusterAmbiguitiesMapName = "PixelClusterAmbiguitiesMap", - SetupCorrect = True, - addTRToutliers = True) - result.addPublicTool(InDetPrdAssociationTool) - InDetTrackSummaryHelperTool = CompFactory.InDet.InDetTrackSummaryHelperTool(name = "InDetSummaryHelper", - AssoTool = InDetPrdAssociationTool, - PixelToTPIDTool = None, - TestBLayerTool = None, - RunningTIDE_Ambi = True, - DoSharedHits = False, - HoleSearch = InDetHoleSearchTool, - usePixel = flags.Detector.GeometryPixel, - useSCT = flags.Detector.GeometrySCT, - useTRT = flags.Detector.GeometryTRT) - InDetTrackSummaryTool = CompFactory.Trk.TrackSummaryTool(name = "InDetTrackSummaryTool", - InDetSummaryHelperTool = InDetTrackSummaryHelperTool, - doSharedHits = False, - doHolesInDet = True, - TRT_ElectronPidTool = None, - TRT_ToT_dEdxTool = None, - PixelToTPIDTool = None) - result.setPrivateTools(InDetTrackSummaryTool) - ############################## WORKAROUND (END) ############################ - return result diff --git a/InnerDetector/InDetMonitoring/TRT_Monitoring/src/TRT_Monitoring_Tool.cxx b/InnerDetector/InDetMonitoring/TRT_Monitoring/src/TRT_Monitoring_Tool.cxx index 303504efefddf89fde26abf89503e863c338e963..8489cc144ad383aabff26161169e3dd41ccbc5a4 100644 --- a/InnerDetector/InDetMonitoring/TRT_Monitoring/src/TRT_Monitoring_Tool.cxx +++ b/InnerDetector/InDetMonitoring/TRT_Monitoring/src/TRT_Monitoring_Tool.cxx @@ -34,13 +34,6 @@ #include "LWHists/TH1D_LW.h" #include "LWHists/LWHist1D.h" -#if ROOT_VERSION_CODE >= ROOT_VERSION(6,0,0) -#define CAN_REBIN(hist) hist->SetCanExtend(TH1::kAllAxes) -#else -#define CAN_REBIN(hist) hist->SetBit(TH1::kCanRebin) -#endif - - #include <sstream> #include <iomanip> #include <memory> @@ -773,9 +766,9 @@ StatusCode TRT_Monitoring_Tool::bookTRTRDOs(bool newLumiBlock, bool newRun) { for (int iside = 0; iside < 2; iside++) { const std::string regionTag = " (" + be_id[ibe] + side_id[iside] + ")"; m_hChipBSErrorsVsLB[ibe][iside] = bookTProfile(rdoShiftSmryRebinned, "hChipBSErrorsVsLB_" + be_id[ibe] + side_id[iside], "Chip Bytestream Errors vs LB" + regionTag, maxLumiBlock + 1, -0.5, maxLumiBlock + 0.5, 0, 150.0, "Luminosity Block", "Fraction of Chips with Errors", scode); - CAN_REBIN(m_hChipBSErrorsVsLB[ibe][iside]); + m_hChipBSErrorsVsLB[ibe][iside]->SetCanExtend(TH1::kAllAxes); m_hRobBSErrorsVsLB[ibe][iside] = bookTProfile(rdoShiftSmryRebinned, "hRobBSErrorsVsLB_" + be_id[ibe] + side_id[iside], "Rob Bytestream Errors vs LB" + regionTag, maxLumiBlock + 1, -0.5, maxLumiBlock + 0.5, 0, 150.0, "Luminosity Block", "Fraction of RODs with Errors", scode); - CAN_REBIN(m_hRobBSErrorsVsLB[ibe][iside]); + m_hRobBSErrorsVsLB[ibe][iside]->SetCanExtend(TH1::kAllAxes); } } @@ -1033,11 +1026,11 @@ StatusCode TRT_Monitoring_Tool::bookTRTShiftTracks(bool newLumiBlock, bool newRu m_hNumSwLLWoT_B = bookTH1F_LW(trackShiftTH1, "hNumSwLLWoT", "Number of Straws with Hits on Track in Time Window" + regionTag, 150, 0, 150, "Number of LL Hits per Track", "Norm. Entries", scode); m_hAvgTroTDetPhi_B = bookTProfile_LW(trackShift, "hAvgTroTDetPhi", "Avg. Trailing Edge on Track vs #phi (2D) for Xenon" + regionTag, m_nphi_bins, 0, 360, 0, 75., "#phi (deg)", "Trailing Edge (ns)", scode); m_hNTrksperLB_B = bookTProfile(trackShiftRebinned, "hNTrksperLB", "Avg. Number of Reconstructed Tracks per Event" + regionTag, maxLumiblock, -0.5, maxLumiblock - 0.5, 0, 150.0, "Luminosity Block", "Number of Tracks", scode); - CAN_REBIN(m_hNTrksperLB_B); + m_hNTrksperLB_B->SetCanExtend(TH1::kAllAxes); m_hNHitsperLB_B = bookTProfile(trackShiftRebinned, "hNHitsperLB", "Avg. Occupancy" + regionTag, maxLumiblock, -0.5, maxLumiblock - 0.5, 0, 150.0, "Luminosity Block", "Occupancy", scode); - CAN_REBIN(m_hNHitsperLB_B); + m_hNHitsperLB_B->SetCanExtend(TH1::kAllAxes); m_hNHLHitsperLB_B = bookTProfile(trackShiftRebinned, "hNHLHitsperLB", "Avg. HL Occupancy" + regionTag, maxLumiblock, -0.5, maxLumiblock - 0.5, 0, 150.0, "Luminosity Block", "Occupancy", scode); - CAN_REBIN(m_hNHLHitsperLB_B); + m_hNHLHitsperLB_B->SetCanExtend(TH1::kAllAxes); m_hHLhitOnTrack_B = bookTH1F_LW(trackShiftTH1, "hHLhitOnTrack", "Number of HL Hits per Reconstructed Track" + regionTag, 50, 0, 50, "Number of HL Hits per Track", "Norm. Entries", scode); m_hHtoLRatioOnTrack_B = bookTH1F_LW(trackShiftTH1, "hHtoLRatioOnTrack", "HL/LL Ratio per Reconstructed Track for All" + regionTag, 50, 0, 1, "HL/LL Ratio", "Norm. Entries", scode); m_hHitWonTMap_B = bookTH1F_LW(trackShiftTH1, "hHitWonTMap", "Leading Edge in Time Window per Reconstructed Track" + regionTag, s_Straw_max[0], 0, s_Straw_max[0], "Straw Number", "Norm. Entries", scode); @@ -1074,11 +1067,11 @@ StatusCode TRT_Monitoring_Tool::bookTRTShiftTracks(bool newLumiBlock, bool newRu m_hNumSwLLWoT_E[iside] = bookTH1F_LW(trackShiftTH1, "hNumSwLLWoT_" + side_id[iside], "Number of Straws with Hits on Track in Time Window" + regionTag, 150, 0, 150, "Number of LL Hits per Track", "Norm. Entries", scode); m_hAvgTroTDetPhi_E[iside] = bookTProfile_LW(trackShift, "hAvgTroTDetPhi_" + side_id[iside], "Avg. Trailing Edge on Track vs #phi (2D) for Xenon" + regionTag, m_nphi_bins, 0, 360, 0, 75., "#phi (deg)", "Trailing Edge (ns)", scode); m_hNTrksperLB_E[iside] = bookTProfile(trackShiftRebinned, "hNTrksperLB_" + side_id[iside], "Avg. Number of Reconstructed Tracks per Event" + regionTag, maxLumiblock, -0.5, maxLumiblock - 0.5, 0, 150.0, "Luminosity Block", "Number of Tracks", scode); - CAN_REBIN(m_hNTrksperLB_E[iside]); + m_hNTrksperLB_E[iside]->SetCanExtend(TH1::kAllAxes); m_hNHitsperLB_E[iside] = bookTProfile(trackShiftRebinned, "hNHitsperLB_" + side_id[iside], "Avg. Occupancy" + regionTag, maxLumiblock, -0.5, maxLumiblock - 0.5, 0, 150.0, "Luminosity Block", "Occupancy", scode); - CAN_REBIN(m_hNHitsperLB_E[iside]); + m_hNHitsperLB_E[iside]->SetCanExtend(TH1::kAllAxes); m_hNHLHitsperLB_E[iside] = bookTProfile(trackShiftRebinned, "hNHLHitsperLB_" + side_id[iside], "Avg. HL Occupancy" + regionTag, maxLumiblock, -0.5, maxLumiblock - 0.5, 0, 150.0, "Luminosity Block", "Occupancy", scode); - CAN_REBIN(m_hNHLHitsperLB_E[iside]); + m_hNHLHitsperLB_E[iside]->SetCanExtend(TH1::kAllAxes); m_hHLhitOnTrack_E[iside] = bookTH1F_LW(trackShiftTH1, "hHLhitOnTrack_" + side_id[iside], "Number of HL Hits per Reconstructed Track" + regionTag, 50, 0, 50, "Number of HL Hits per Track", "Norm. Entries", scode); m_hHtoLRatioOnTrack_E[iside] = bookTH1F_LW(trackShiftTH1, "hHtoLRatioOnTrack_" + side_id[iside], "HL/LL Ratio per Reconstructed Track for All" + regionTag, 50, 0, 1.0, "HL/LL Ratio", "Norm. Entries", scode); m_hHitWonTMap_E[iside] = bookTH1F_LW(trackShiftTH1, "hHitWonTMap_" + side_id[iside], "Leading Edge in Time Window per Reconstructed Track" + regionTag, s_Straw_max[1], 0, s_Straw_max[1], "Straw Number", "Norm. Entries", scode); diff --git a/InnerDetector/InDetRecTools/InDetVKalVxInJetTool/CMakeLists.txt b/InnerDetector/InDetRecTools/InDetVKalVxInJetTool/CMakeLists.txt index d56baf5538c9fc5fb8322b147cd1b72969676572..6886eb20050b85fea13affea1efb93de3bf01491 100644 --- a/InnerDetector/InDetRecTools/InDetVKalVxInJetTool/CMakeLists.txt +++ b/InnerDetector/InDetRecTools/InDetVKalVxInJetTool/CMakeLists.txt @@ -12,6 +12,7 @@ atlas_depends_on_subdirs( PUBLIC GaudiKernel InnerDetector/InDetRecTools/InDetRecToolInterfaces PRIVATE + Control/AthenaKernel Tools/PathResolver DetectorDescription/GeoPrimitives PhysicsAnalysis/AnalysisCommon/AnalysisUtils @@ -47,7 +48,7 @@ atlas_add_component( InDetVKalVxInJetTool INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} ${Boost_INCLUDE_DIRS} ${EIGEN_INCLUDE_DIRS} LINK_LIBRARIES ${ROOT_LIBRARIES} ${Boost_LIBRARIES} ${EIGEN_LIBRARIES} AthenaBaseComps xAODTracking PathResolver GaudiKernel InDetRecToolInterfaces Particle TrkVKalVrtFitterLib GeoPrimitives AnalysisUtilsLib TrkNeutralParameters MVAUtils - TrkParticleBase TrkTrackSummary VxSecVertex VxVertex TrkToolInterfaces TrkVertexFitterInterfaces PathResolver ) + TrkParticleBase TrkTrackSummary VxSecVertex VxVertex TrkToolInterfaces TrkVertexFitterInterfaces PathResolver ) # Install files from the package: atlas_install_headers( InDetVKalVxInJetTool ) @@ -56,10 +57,10 @@ atlas_install_joboptions( share/*.txt ) #This test is temporarily commented in order not to slow down magnetic field migration to condition data. #Will be restored later -#atlas_add_test( InDetTrkInJetType_test -# SOURCES test/InDetTrkInJetType_test.cxx -# INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} ${Boost_INCLUDE_DIRS} ${EIGEN_INCLUDE_DIRS} -# LINK_LIBRARIES ${ROOT_LIBRARIES} ${Boost_LIBRARIES} ${EIGEN_LIBRARIES} AthenaBaseComps xAODTracking PathResolver GaudiKernel -# InDetRecToolInterfaces Particle TrkVKalVrtFitterLib GeoPrimitives AnalysisUtilsLib TrkNeutralParameters MVAUtils -# TrkParticleBase TrkTrackSummary VxSecVertex VxVertex TrkToolInterfaces TrkVertexFitterInterfaces PathResolver -# LOG_IGNORE_PATTERN "Booking|AtlasFieldSvc|weight file|create data set info" ) +atlas_add_test( InDetTrkInJetType_test + SOURCES test/InDetTrkInJetType_test.cxx + INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} ${Boost_INCLUDE_DIRS} ${EIGEN_INCLUDE_DIRS} + LINK_LIBRARIES ${ROOT_LIBRARIES} ${Boost_LIBRARIES} ${EIGEN_LIBRARIES} AthenaBaseComps xAODTracking PathResolver GaudiKernel + InDetRecToolInterfaces Particle TrkVKalVrtFitterLib GeoPrimitives AnalysisUtilsLib TrkNeutralParameters MVAUtils + TrkParticleBase TrkTrackSummary VxSecVertex VxVertex TrkToolInterfaces TrkVertexFitterInterfaces PathResolver AthenaKernel + LOG_IGNORE_PATTERN "Booking|ClassIDSvc|weight file|create data set info" ) diff --git a/InnerDetector/InDetRecTools/InDetVKalVxInJetTool/share/InDetTrkInJetType_test.ref b/InnerDetector/InDetRecTools/InDetVKalVxInJetTool/share/InDetTrkInJetType_test.ref index 024f5fe341b7ba3ba3d0d0526b54f81524e4198b..1a1168732ccb2551d5cc58581f578293dd904bcb 100644 --- a/InnerDetector/InDetRecTools/InDetVKalVxInJetTool/share/InDetTrkInJetType_test.ref +++ b/InnerDetector/InDetRecTools/InDetVKalVxInJetTool/share/InDetTrkInJetType_test.ref @@ -13,28 +13,22 @@ ApplicationMgr SUCCESS running on karma on Fri Jul 26 11:39:59 2019 ==================================================================================================================================== ApplicationMgr INFO Application Manager Configured successfully -AtlasFieldSvc INFO initialize() ... -AtlasFieldSvc INFO Currents are set-up by jobOptions - delaying map initialization until BeginRun incident happens -AtlasFieldSvc INFO Added listener to BeginRun incident -AtlasFieldSvc INFO initialize() successful +ClassIDSvc INFO getRegistryEntries: read 1912 CLIDRegistry entries for module ALL EventLoopMgr WARNING Unable to locate service "EventSelector" EventLoopMgr WARNING No events will be processed from external input. -HistogramPersis...WARNING Histograms saving not required. ApplicationMgr INFO Application Manager Initialized successfully ApplicationMgr Ready -AtlasFieldSvc INFO handling incidents ... -AtlasFieldSvc INFO importCurrents() ... -AtlasFieldSvc INFO Initializing the field map (solenoidCurrent=7730 toroidCurrent=20400) -AtlasFieldSvc INFO reading the map from /home/sss/nobackup/atlas/ReleaseData/v20/MagneticFieldMaps/bfieldmap_7730_20400_14m.root -AtlasFieldSvc INFO Initialized the field map from /home/sss/nobackup/atlas/ReleaseData/v20/MagneticFieldMaps/bfieldmap_7730_20400_14m.root -AtlasFieldSvc INFO Currents imported and map initialized -AtlasFieldSvc INFO BeginRun incident handled -AtlasFieldSvc INFO incidents handled successfully - : Booking "BDTG" of type "BDT" from /home/sss/nobackup/atlas/GroupData/InDetVKalVxInJetTool/TrackClassif_3cl.v02.xml. - : Reading weight file: /home/sss/nobackup/atlas/GroupData/InDetVKalVxInJetTool/TrackClassif_3cl.v02.xml +InDetVKalVxInJetTool/InDetTrkInJetType_test initGaudi +InDetVKalVxInJetTool/InDetTrkInJetType_test record +create data set info Default + : Booking "BDTG" of type "BDT" from /cvmfs/atlas.cern.ch/repo/sw/database/GroupData/InDetVKalVxInJetTool/TrackClassif_3cl.v02.xml. + : Reading weight file: /cvmfs/atlas.cern.ch/repo/sw/database/GroupData/InDetVKalVxInJetTool/TrackClassif_3cl.v02.xml <HEADER> DataSetInfo : [Default] : Added class "Signal" <HEADER> DataSetInfo : [Default] : Added class "Fragment" <HEADER> DataSetInfo : [Default] : Added class "Garbage" : Booked classifier "BDTG" of type: "BDT" +ClassIDSvc INFO getRegistryEntries: read 4267 CLIDRegistry entries for module ALL ToolSvc.InDet::... INFO TrkVKalVrtFitter initialize() successful +InDetVKalVxInJetTool/InDetTrkInJetType_test retrieve tool test1 +test1 is OK diff --git a/InnerDetector/InDetRecTools/InDetVKalVxInJetTool/share/InDetVKalVxInJetTool_tests.txt b/InnerDetector/InDetRecTools/InDetVKalVxInJetTool/share/InDetVKalVxInJetTool_tests.txt index ce532aaa3b830d9f4a755d386296875e63b20929..5abb41f84bf467f0fe8fa374fde3d4b12126e28c 100644 --- a/InnerDetector/InDetRecTools/InDetVKalVxInJetTool/share/InDetVKalVxInJetTool_tests.txt +++ b/InnerDetector/InDetRecTools/InDetVKalVxInJetTool/share/InDetVKalVxInJetTool_tests.txt @@ -1,3 +1 @@ -ApplicationMgr.ExtSvc={"MagField::AtlasFieldSvc/AtlasFieldSvc"}; -AtlasFieldSvc.UseDCS=false; -AtlasFieldSvc.UseMapsFromCool=false; +ApplicationMgr.ExtSvc += { "StoreGateSvc/ConditionStore", "CondSvc" }; diff --git a/InnerDetector/InDetRecTools/InDetVKalVxInJetTool/test/InDetTrkInJetType_test.cxx b/InnerDetector/InDetRecTools/InDetVKalVxInJetTool/test/InDetTrkInJetType_test.cxx index 3ce5a83cf99e13a03bf53abae91c6d2c5fadf537..fec643bcd22eae65fe8cdb1484087b89e3183987 100644 --- a/InnerDetector/InDetRecTools/InDetVKalVxInJetTool/test/InDetTrkInJetType_test.cxx +++ b/InnerDetector/InDetRecTools/InDetVKalVxInJetTool/test/InDetTrkInJetType_test.cxx @@ -13,7 +13,7 @@ #include "InDetVKalVxInJetTool/InDetTrkInJetType.h" #include "xAODTracking/Vertex.h" #include "xAODTracking/TrackParticle.h" -#include "MagFieldInterfaces/IMagFieldSvc.h" +#include "MagFieldConditions/AtlasFieldCacheCondObj.h" #include "EventPrimitives/EventPrimitivesHelpers.h" #include "TestTools/initGaudi.h" #include "TestTools/FLOATassert.h" @@ -22,6 +22,7 @@ #include "GaudiKernel/Incident.h" #include "GaudiKernel/IIncidentListener.h" #include "GaudiKernel/SystemOfUnits.h" +#include "AthenaKernel/DummyRCUSvc.h" #include "TInterpreter.h" #include <iostream> #include <cassert> @@ -102,6 +103,26 @@ void test1 (InDet::IInDetTrkInJetType& tool) assert( Athena_test::isEqual (out[0], 0.0946472, 1e-5) ); assert( Athena_test::isEqual (out[1], 0.479743, 1e-5) ); assert( Athena_test::isEqual (out[2], 0.42561, 1e-5) ); + + std::cout << "test1 is OK\n"; +} + +EventIDBase timestamp (int t) +{ + return EventIDBase (EventIDBase::UNDEFNUM, // run + EventIDBase::UNDEFEVT, // event + t); +} + + +EventIDBase runlbn (int run, + int lbn) +{ + return EventIDBase (run, // run + EventIDBase::UNDEFEVT, // event + EventIDBase::UNDEFNUM, // timestamp + 0, // ns offset + lbn); } @@ -110,14 +131,40 @@ int main() std::cout << "InDetVKalVxInJetTool/InDetTrkInJetType_test\n"; CxxUtils::ubsan_suppress ([]() { TInterpreter::Instance(); }); ISvcLocator* svcloc = nullptr; - Athena_test::initGaudi ("InDetVKalVxInJetTool/InDetVKalVxInJetTool_tests.txt", svcloc); + if (!Athena_test::initGaudi("InDetVKalVxInJetTool/InDetVKalVxInJetTool_tests.txt", svcloc)) { + return 1; + } + + + std::cout << "InDetVKalVxInJetTool/InDetTrkInJetType_test initGaudi \n"; + + + EventContext ctx; + ctx.setExtension (Atlas::ExtendedEventContext()); + EventIDBase eid (1, 0, 0, 0, 20); + ctx.setEventID (eid); + + Gaudi::Hive::setCurrentContext(ctx); + + Athena_test::DummyRCUSvc rcu; + DataObjID id ("fieldCondObj"); + auto cc = std::make_unique<CondCont<AtlasFieldCacheCondObj> > (rcu, id); + const EventIDRange range (runlbn (1, 10), runlbn (1, 100)); + assert( cc->insert (range, std::make_unique<AtlasFieldCacheCondObj>(), ctx).isSuccess() ); + + ServiceHandle<StoreGateSvc> conditionStore ("ConditionStore", "test"); + assert( conditionStore->record (std::move (cc), "fieldCondObj") ); + + + std::cout << "InDetVKalVxInJetTool/InDetTrkInJetType_test record \n"; - ServiceHandle<MagField::IMagFieldSvc> field ("MagField::AtlasFieldSvc/AtlasFieldSvc", "test"); - Incident inc_br ("test", IncidentType::BeginRun); - dynamic_cast<IIncidentListener*>(&*field)->handle (inc_br); ToolHandle<InDet::IInDetTrkInJetType> tool ("InDet::InDetTrkInJetType"); assert( tool.retrieve().isSuccess() ); + + + std::cout << "InDetVKalVxInJetTool/InDetTrkInJetType_test retrieve tool \n"; + test1 (*tool); diff --git a/InnerDetector/InDetRecTools/SiCombinatorialTrackFinderTool_xk/src/SiCombinatorialTrackFinder_xk.cxx b/InnerDetector/InDetRecTools/SiCombinatorialTrackFinderTool_xk/src/SiCombinatorialTrackFinder_xk.cxx index f29b9c858593c62df5fb57cea9606a46bbd0d93a..c4fbbd58ba8195795f01a354ed41e9d269d3eeda 100644 --- a/InnerDetector/InDetRecTools/SiCombinatorialTrackFinderTool_xk/src/SiCombinatorialTrackFinder_xk.cxx +++ b/InnerDetector/InDetRecTools/SiCombinatorialTrackFinderTool_xk/src/SiCombinatorialTrackFinder_xk.cxx @@ -677,7 +677,9 @@ bool InDet::SiCombinatorialTrackFinder_xk::spacePointsToClusters const InDetDD::SiDetectorElement* de = (*c)->detectorElement(); - for (++(cn=c); cn!=ce; ++cn) { + cn = c; + ++cn; + for (; cn!=ce; ++cn) { if (de == (*cn)->detectorElement()) return false; } diff --git a/InnerDetector/InDetSimUtils/TRT_TR_Process/CMakeLists.txt b/InnerDetector/InDetSimUtils/TRT_TR_Process/CMakeLists.txt index aa5f3c027bcdd4f26df29cdd514d4f144c3c89e1..1429726810195e9a79ebaa98fb391c13e9a6a87a 100644 --- a/InnerDetector/InDetSimUtils/TRT_TR_Process/CMakeLists.txt +++ b/InnerDetector/InDetSimUtils/TRT_TR_Process/CMakeLists.txt @@ -29,7 +29,7 @@ atlas_add_component( TRT_TR_Process src/*.cxx src/components/*.cxx INCLUDE_DIRS ${Boost_INCLUDE_DIRS} ${XERCESC_INCLUDE_DIRS} ${GEANT4_INCLUDE_DIRS} ${CLHEP_INCLUDE_DIRS} - LINK_LIBRARIES ${Boost_LIBRARIES} ${XERCESC_LIBRARIES} ${GEANT4_LIBRARIES} ${CLHEP_LIBRARIES} GaudiKernel AthenaBaseComps AthenaKernel StoreGateLib SGtests IdDictDetDescr G4AtlasInterfaces GeoMaterial2G4 PathResolver ) + LINK_LIBRARIES ${Boost_LIBRARIES} ${XERCESC_LIBRARIES} ${GEANT4_LIBRARIES} ${CLHEP_LIBRARIES} GaudiKernel AthenaBaseComps AthenaKernel StoreGateLib SGtests IdDictDetDescr G4AtlasInterfaces GeoMaterial2G4 GeoModelInterfaces PathResolver ) # Install files from the package: atlas_install_python_modules( python/*.py ) diff --git a/InnerDetector/InDetValidation/InDetPhysValMonitoring/test/test_ele10GeV_reco.sh b/InnerDetector/InDetValidation/InDetPhysValMonitoring/test/test_ele10GeV_reco.sh index 2fbd1ebb713838c25d32288e5af60ab5f544753c..5794fcf25c984d34308ec0cb6329385449789856 100755 --- a/InnerDetector/InDetValidation/InDetPhysValMonitoring/test/test_ele10GeV_reco.sh +++ b/InnerDetector/InDetValidation/InDetPhysValMonitoring/test/test_ele10GeV_reco.sh @@ -34,7 +34,7 @@ case $ArtProcess in postProcessIDPVMHistos physval.root dcubeXml="/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/InDetPhysValMonitoring/dcube/config/IDPVMPlots_R22.xml" - dcubeRef="/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/InDetPhysValMonitoring/ReferenceHistograms/physval_ele10GeV.root" + dcubeRef="/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/InDetPhysValMonitoring/ReferenceHistograms/physval_ele10GeV_reco_r22.root" echo "compare with R21" $ATLAS_LOCAL_ROOT/dcube/current/DCubeClient/python/dcube.py \ -p -x dcube \ diff --git a/InnerDetector/InDetValidation/InDetPhysValMonitoring/test/test_ele5GeV_reco.sh b/InnerDetector/InDetValidation/InDetPhysValMonitoring/test/test_ele5GeV_reco.sh index e473e61d8bcd9e6683d2b15d6a993fdd1914aee9..bb4f1ff29868ee225c2c74c03e96911d2334063f 100755 --- a/InnerDetector/InDetValidation/InDetPhysValMonitoring/test/test_ele5GeV_reco.sh +++ b/InnerDetector/InDetValidation/InDetPhysValMonitoring/test/test_ele5GeV_reco.sh @@ -34,7 +34,7 @@ case $ArtProcess in postProcessIDPVMHistos physval.root dcubeXml="/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/InDetPhysValMonitoring/dcube/config/IDPVMPlots_R22.xml" - dcubeRef="/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/InDetPhysValMonitoring/ReferenceHistograms/physval_ele5GeV.root" + dcubeRef="/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/InDetPhysValMonitoring/ReferenceHistograms/physval_ele5GeV_reco_r22.root" echo "compare with R21" $ATLAS_LOCAL_ROOT/dcube/current/DCubeClient/python/dcube.py \ -p -x dcube \ diff --git a/InnerDetector/InDetValidation/InDetPhysValMonitoring/test/test_mu100GeV_reco.sh b/InnerDetector/InDetValidation/InDetPhysValMonitoring/test/test_mu100GeV_reco.sh index 7d77449f0124421f904d6c9b98ef603f5a440da7..3224cfe3717d34713f092c8f49ec35d8c3ce4775 100755 --- a/InnerDetector/InDetValidation/InDetPhysValMonitoring/test/test_mu100GeV_reco.sh +++ b/InnerDetector/InDetValidation/InDetPhysValMonitoring/test/test_mu100GeV_reco.sh @@ -34,7 +34,7 @@ case $ArtProcess in postProcessIDPVMHistos physval.root dcubeXml="/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/InDetPhysValMonitoring/dcube/config/IDPVMPlots_R22.xml" - dcubeRef="/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/InDetPhysValMonitoring/ReferenceHistograms/physval_mu100GeV.root" + dcubeRef="/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/InDetPhysValMonitoring/ReferenceHistograms/physval_mu100GeV_reco_r22.root" echo "compare with R21" $ATLAS_LOCAL_ROOT/dcube/current/DCubeClient/python/dcube.py \ -p -x dcube \ diff --git a/InnerDetector/InDetValidation/InDetPhysValMonitoring/test/test_mu10GeV_reco.sh b/InnerDetector/InDetValidation/InDetPhysValMonitoring/test/test_mu10GeV_reco.sh index cc0c4a1b8548401fc4b3dd2108a08f8bd0d0836f..c41c6d5a319d7451d535a4c469b9bef4ee41a3b1 100755 --- a/InnerDetector/InDetValidation/InDetPhysValMonitoring/test/test_mu10GeV_reco.sh +++ b/InnerDetector/InDetValidation/InDetPhysValMonitoring/test/test_mu10GeV_reco.sh @@ -34,7 +34,7 @@ case $ArtProcess in postProcessIDPVMHistos physval.root dcubeXml="/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/InDetPhysValMonitoring/dcube/config/IDPVMPlots_R22.xml" - dcubeRef="/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/InDetPhysValMonitoring/ReferenceHistograms/physval_mu10GeV.root" + dcubeRef="/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/InDetPhysValMonitoring/ReferenceHistograms/physval_mu10GeV_reco_r22.root" echo "compare with R21" $ATLAS_LOCAL_ROOT/dcube/current/DCubeClient/python/dcube.py \ -p -x dcube \ diff --git a/InnerDetector/InDetValidation/InDetPhysValMonitoring/test/test_mu1GeV_reco.sh b/InnerDetector/InDetValidation/InDetPhysValMonitoring/test/test_mu1GeV_reco.sh index 3d5f5d10cf1c66f886f8c1b9cdcd27479cc29c25..d537e6b135dd89194b6a5c36568a4cc0974a47c3 100755 --- a/InnerDetector/InDetValidation/InDetPhysValMonitoring/test/test_mu1GeV_reco.sh +++ b/InnerDetector/InDetValidation/InDetPhysValMonitoring/test/test_mu1GeV_reco.sh @@ -34,7 +34,7 @@ case $ArtProcess in postProcessIDPVMHistos physval.root dcubeXml="/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/InDetPhysValMonitoring/dcube/config/IDPVMPlots_R22.xml" - dcubeRef="/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/InDetPhysValMonitoring/ReferenceHistograms/physval_mu1GeV.root" + dcubeRef="/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/InDetPhysValMonitoring/ReferenceHistograms/physval_mu1GeV_reco_r22.root" echo "compare with R21" $ATLAS_LOCAL_ROOT/dcube/current/DCubeClient/python/dcube.py \ -p -x dcube \ diff --git a/InnerDetector/InDetValidation/InDetPhysValMonitoring/test/test_mu20GeV_reco.sh b/InnerDetector/InDetValidation/InDetPhysValMonitoring/test/test_mu20GeV_reco.sh index 3d19ffd3749edd16c89189398ff464ea3b5d1498..f100b863122ce7b2a3dc346e0e60434819b6fbc7 100755 --- a/InnerDetector/InDetValidation/InDetPhysValMonitoring/test/test_mu20GeV_reco.sh +++ b/InnerDetector/InDetValidation/InDetPhysValMonitoring/test/test_mu20GeV_reco.sh @@ -34,7 +34,7 @@ case $ArtProcess in postProcessIDPVMHistos physval.root dcubeXml="/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/InDetPhysValMonitoring/dcube/config/IDPVMPlots_R22.xml" - dcubeRef="/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/InDetPhysValMonitoring/ReferenceHistograms/physval_mu20GeV.root" + dcubeRef="/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/InDetPhysValMonitoring/ReferenceHistograms/physval_mu20GeV_reco_r22.root" echo "compare with R21" $ATLAS_LOCAL_ROOT/dcube/current/DCubeClient/python/dcube.py \ -p -x dcube \ diff --git a/InnerDetector/InDetValidation/InDetPhysValMonitoring/test/test_ele100GeV_reco.sh b/InnerDetector/InDetValidation/InDetPhysValMonitoring/test/test_piplus1GeV_reco.sh similarity index 94% rename from InnerDetector/InDetValidation/InDetPhysValMonitoring/test/test_ele100GeV_reco.sh rename to InnerDetector/InDetValidation/InDetPhysValMonitoring/test/test_piplus1GeV_reco.sh index bb8cd957d237bb2c738bc24919ee7b08b5718c67..b6b81d3f366a70b961251827104a93f2325671bd 100755 --- a/InnerDetector/InDetValidation/InDetPhysValMonitoring/test/test_ele100GeV_reco.sh +++ b/InnerDetector/InDetValidation/InDetPhysValMonitoring/test/test_piplus1GeV_reco.sh @@ -1,7 +1,7 @@ #!/bin/bash -# art-description: art job for InDetPhysValMonitoring, Single ele 100GeV +# art-description: art job for InDetPhysValMonitoring, Single ele 10GeV # art-type: grid -# art-input: user.keli.mc16_13TeV.422031.ParticleGun_single_ele_Pt100.recon.RDO.e7967_e5984_s3126_r11774_tid20255043_00 +# art-input: user.keli:user.keli.mc16_13TeV.422047.ParticleGun_single_piplus_Pt1.recon.RDO.e7967_e5984_s3126_r11774_tid20255143_00 # art-input-nfiles: 10 # art-cores: 4 # art-include: master/Athena @@ -34,7 +34,7 @@ case $ArtProcess in postProcessIDPVMHistos physval.root dcubeXml="/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/InDetPhysValMonitoring/dcube/config/IDPVMPlots_R22.xml" - dcubeRef="/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/InDetPhysValMonitoring/ReferenceHistograms/physval_ele100GeV.root" + dcubeRef="/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/InDetPhysValMonitoring/ReferenceHistograms/physval_piplus1GeV_reco_r22.root" echo "compare with R21" $ATLAS_LOCAL_ROOT/dcube/current/DCubeClient/python/dcube.py \ -p -x dcube \ diff --git a/InnerDetector/InDetValidation/InDetPhysValMonitoring/test/test_ele1GeV_reco.sh b/InnerDetector/InDetValidation/InDetPhysValMonitoring/test/test_piplus5GeV_reco.sh similarity index 94% rename from InnerDetector/InDetValidation/InDetPhysValMonitoring/test/test_ele1GeV_reco.sh rename to InnerDetector/InDetValidation/InDetPhysValMonitoring/test/test_piplus5GeV_reco.sh index b22612700da9a1bdeb23670d8f360eff201600a2..df420fdb94c2e8af02212dfda60b21d019750e94 100755 --- a/InnerDetector/InDetValidation/InDetPhysValMonitoring/test/test_ele1GeV_reco.sh +++ b/InnerDetector/InDetValidation/InDetPhysValMonitoring/test/test_piplus5GeV_reco.sh @@ -1,7 +1,7 @@ #!/bin/bash -# art-description: art job for InDetPhysValMonitoring, Single ele 1GeV +# art-description: art job for InDetPhysValMonitoring, Single ele 10GeV # art-type: grid -# art-input: user.keli.mc16_13TeV.422027.ParticleGun_single_ele_Pt1.recon.RDO.e7967_e5984_s3126_r11774_tid20254975_00 +# art-input: user.keli:user.keli.mc16_13TeV.422048.ParticleGun_single_piplus_Pt5.recon.RDO.e7967_e5984_s3126_r11774_tid20255160_00 # art-input-nfiles: 10 # art-cores: 4 # art-include: master/Athena @@ -34,7 +34,7 @@ case $ArtProcess in postProcessIDPVMHistos physval.root dcubeXml="/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/InDetPhysValMonitoring/dcube/config/IDPVMPlots_R22.xml" - dcubeRef="/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/InDetPhysValMonitoring/ReferenceHistograms/physval_ele1GeV.root" + dcubeRef="/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/InDetPhysValMonitoring/ReferenceHistograms/physval_piplus5GeV_reco_r22.root" echo "compare with R21" $ATLAS_LOCAL_ROOT/dcube/current/DCubeClient/python/dcube.py \ -p -x dcube \ diff --git a/InnerDetector/InDetValidation/InDetPhysValMonitoring/test/test_ttbarPU0_reco.sh b/InnerDetector/InDetValidation/InDetPhysValMonitoring/test/test_ttbarPU0_reco.sh new file mode 100755 index 0000000000000000000000000000000000000000..ab0c042a208c89226398a5b8ac2475904a0eed4f --- /dev/null +++ b/InnerDetector/InDetValidation/InDetPhysValMonitoring/test/test_ttbarPU0_reco.sh @@ -0,0 +1,67 @@ +#!/bin/bash +# art-description: Standard test for Run2 with ttbar input, PU=0 +# art-type: grid +# art-include: master/Athena +# art-output: *.root +# art-output: *.xml +# art-output: dcube* + +# Fix ordering of output in logfile +exec 2>&1 +run() { (set -x; exec "$@") } + + +artdata=/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art +inputRDO=${artdata}/InDetPhysValMonitoring/inputs/OUT.RDO_ttbar_PU0.pool.root +dcubeXml="/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/InDetPhysValMonitoring/dcube/config/IDPVMPlots_R22.xml" +dcubeRef="/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/InDetPhysValMonitoring/ReferenceHistograms/physval_ttbarPU0_reco_r22.root" + +# Reco step based on test InDetPhysValMonitoring ART setup from Josh Moss. +run Reco_tf.py \ + --inputRDOFile "$inputRDO" \ + --outputAODFile physval.AOD.root \ + --outputNTUP_PHYSVALFile physval.ntuple.root \ + --steering doRAWtoALL \ + --checkEventCount False \ + --ignoreErrors True \ + --maxEvents 1000 \ + --valid True \ + --validationFlags doInDet \ + --preExec 'from InDetRecExample.InDetJobProperties import InDetFlags; \ + InDetFlags.doSlimming.set_Value_and_Lock(False); rec.doTrigger.set_Value_and_Lock(False); \ + from InDetPhysValMonitoring.InDetPhysValJobProperties import InDetPhysValFlags; \ + InDetPhysValFlags.doValidateTightPrimaryTracks.set_Value_and_Lock(True); \ + InDetPhysValFlags.doValidateTracksInJets.set_Value_and_Lock(False); \ + InDetPhysValFlags.doValidateGSFTracks.set_Value_and_Lock(False); \ + rec.doDumpProperties=True; rec.doCalo=False; rec.doEgamma=False; \ + rec.doForwardDet=False; rec.doInDet=True; rec.doJetMissingETTag=False; \ + rec.doLArg=False; rec.doLucid=False; rec.doMuon=False; rec.doMuonCombined=False; \ + rec.doSemiDetailedPerfMon=True; rec.doTau=False; rec.doTile=False;\ + from ParticleBuilderOptions.AODFlags import AODFlags;\ + AODFlags.ThinGeantTruth.set_Value_and_Lock(False); \ + AODFlags.ThinNegativeEnergyCaloClusters.set_Value_and_Lock(False); \ + AODFlags.ThinNegativeEnergyNeutralPFOs.set_Value_and_Lock(False);\ + AODFlags.ThinInDetForwardTrackParticles.set_Value_and_Lock(False) ' +echo "art-result: $? reco" + +if [ rec_tf_exit_code -eq 0 ] ;then + run art.py download --user=artprod --dst="$lastref_dir" "$ArtPackage" "$ArtJobName" + run ls -la "$lastref_dir" + + echo "compare with R21" + $ATLAS_LOCAL_ROOT/dcube/current/DCubeClient/python/dcube.py \ + -p -x dcube \ + -c ${dcubeXml} \ + -r ${dcubeRef} \ + physval.ntuple.root + echo "art-result: $? plots" + + echo "compare with last build" + $ATLAS_LOCAL_ROOT/dcube/current/DCubeClient/python/dcube.py \ + -p -x dcube_last \ + -c ${dcubeXml} \ + -r last_results/physval.ntuple.root \ + physval.ntuple.root + echo "art-result: $? plots" +fi + diff --git a/InnerDetector/InDetValidation/InDetPhysValMonitoring/test/test_ttbarPU40_reco.sh b/InnerDetector/InDetValidation/InDetPhysValMonitoring/test/test_ttbarPU40_reco.sh new file mode 100755 index 0000000000000000000000000000000000000000..e37b34fe0acaa5ed95660b3dbf3d70d40c77f751 --- /dev/null +++ b/InnerDetector/InDetValidation/InDetPhysValMonitoring/test/test_ttbarPU40_reco.sh @@ -0,0 +1,67 @@ +#!/bin/bash +# art-description: Standard test for Run2 with ttbar input, PU=40 +# art-type: grid +# art-include: master/Athena +# art-output: *.root +# art-output: *.xml +# art-output: dcube* + +# Fix ordering of output in logfile +exec 2>&1 +run() { (set -x; exec "$@") } + + +artdata=/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art +inputRDO=${artdata}/InDetPhysValMonitoring/inputs/OUT.RDO_ttbar_PU40.pool.root +dcubeXml="/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/InDetPhysValMonitoring/dcube/config/IDPVMPlots_R22.xml" +dcubeRef="/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/InDetPhysValMonitoring/ReferenceHistograms/physval_ttbarPU40_reco_r22.root" + +# Reco step based on test InDetPhysValMonitoring ART setup from Josh Moss. +run Reco_tf.py \ + --inputRDOFile "$inputRDO" \ + --outputAODFile physval.AOD.root \ + --outputNTUP_PHYSVALFile physval.ntuple.root \ + --steering doRAWtoALL \ + --checkEventCount False \ + --ignoreErrors True \ + --maxEvents 1000 \ + --valid True \ + --validationFlags doInDet \ + --preExec 'from InDetRecExample.InDetJobProperties import InDetFlags; \ + InDetFlags.doSlimming.set_Value_and_Lock(False); rec.doTrigger.set_Value_and_Lock(False); \ + from InDetPhysValMonitoring.InDetPhysValJobProperties import InDetPhysValFlags; \ + InDetPhysValFlags.doValidateTightPrimaryTracks.set_Value_and_Lock(True); \ + InDetPhysValFlags.doValidateTracksInJets.set_Value_and_Lock(False); \ + InDetPhysValFlags.doValidateGSFTracks.set_Value_and_Lock(False); \ + rec.doDumpProperties=True; rec.doCalo=False; rec.doEgamma=False; \ + rec.doForwardDet=False; rec.doInDet=True; rec.doJetMissingETTag=False; \ + rec.doLArg=False; rec.doLucid=False; rec.doMuon=False; rec.doMuonCombined=False; \ + rec.doSemiDetailedPerfMon=True; rec.doTau=False; rec.doTile=False;\ + from ParticleBuilderOptions.AODFlags import AODFlags;\ + AODFlags.ThinGeantTruth.set_Value_and_Lock(False); \ + AODFlags.ThinNegativeEnergyCaloClusters.set_Value_and_Lock(False); \ + AODFlags.ThinNegativeEnergyNeutralPFOs.set_Value_and_Lock(False);\ + AODFlags.ThinInDetForwardTrackParticles.set_Value_and_Lock(False) ' +echo "art-result: $? reco" + +if [ rec_tf_exit_code -eq 0 ] ;then + run art.py download --user=artprod --dst="$lastref_dir" "$ArtPackage" "$ArtJobName" + run ls -la "$lastref_dir" + + echo "compare with R21" + $ATLAS_LOCAL_ROOT/dcube/current/DCubeClient/python/dcube.py \ + -p -x dcube \ + -c ${dcubeXml} \ + -r ${dcubeRef} \ + physval.ntuple.root + echo "art-result: $? plots" + + echo "compare with last build" + $ATLAS_LOCAL_ROOT/dcube/current/DCubeClient/python/dcube.py \ + -p -x dcube_last \ + -c ${dcubeXml} \ + -r last_results/physval.ntuple.root \ + physval.ntuple.root + echo "art-result: $? plots" +fi + diff --git a/LArCalorimeter/LArCalibUtils/src/LArPhysWaveHECTool.cxx b/LArCalorimeter/LArCalibUtils/src/LArPhysWaveHECTool.cxx index 31463bd7f3c4bd804468c7e9de3f4b9dbb205b51..f29e139409f6a1dfc04ef0c9bf87a8377e9e07fa 100755 --- a/LArCalorimeter/LArCalibUtils/src/LArPhysWaveHECTool.cxx +++ b/LArCalorimeter/LArCalibUtils/src/LArPhysWaveHECTool.cxx @@ -15,8 +15,6 @@ #include <TGraphSmooth.h> -#include "RVersion.h" - using std::cout; using std::endl; @@ -644,14 +642,8 @@ Double_t Tp4(Double_t t) b = t; -#if ROOT_VERSION_CODE < ROOT_VERSION(5,99,0) - static Double_t par[1]; - par[0]=t; - return fun4->Integral(a,b,par,epsrel); -#else fun4->SetParameter(0,t); return fun4->Integral(a,b,epsrel); -#endif } // Integrand for the Tp4 function @@ -674,15 +666,9 @@ Double_t Tp5(Double_t t) if(fun5 == NULL) fun5 = new TF1("fun5",&f5_g,0.,NMAX,1); -#if ROOT_VERSION_CODE < ROOT_VERSION(5,99,0) - static Double_t par[1]; - par[0]=t; - return fun5->Integral(a,b,par,epsrel); -#else b = t - tdr; fun5->SetParameter(0,t); return fun5->Integral(a,b,epsrel); -#endif } // Integrand for the Tp5 function diff --git a/LArCalorimeter/LArG4/LArG4EC/CMakeLists.txt b/LArCalorimeter/LArG4/LArG4EC/CMakeLists.txt index 7eb1b312b3b27131afed3ac461a2b469b32c3216..8c2ae22e39291f3eb107dfa9f057f5521f5177d3 100644 --- a/LArCalorimeter/LArG4/LArG4EC/CMakeLists.txt +++ b/LArCalorimeter/LArG4/LArG4EC/CMakeLists.txt @@ -36,6 +36,6 @@ atlas_add_component( LArG4EC PRIVATE_INCLUDE_DIRS ${Boost_INCLUDE_DIRS} ${CORAL_INCLUDE_DIRS} ${CLHEP_INCLUDE_DIRS} PRIVATE_DEFINITIONS ${CLHEP_DEFINITIONS} LINK_LIBRARIES ${XERCESC_LIBRARIES} ${GEANT4_LIBRARIES} GeoSpecialShapes LArG4Code LArGeoCode CaloG4SimLib StoreGateLib SGtests - PRIVATE_LINK_LIBRARIES ${Boost_LIBRARIES} ${CORAL_LIBRARIES} ${CLHEP_LIBRARIES} GeoModelUtilities GaudiKernel LArG4RunControl LArHV PathResolver ) + PRIVATE_LINK_LIBRARIES ${Boost_LIBRARIES} ${CORAL_LIBRARIES} ${CLHEP_LIBRARIES} GeoModelUtilities GaudiKernel LArG4RunControl LArHV PathResolver GeoModelInterfaces RDBAccessSvcLib ) atlas_install_python_modules( python/*.py ) diff --git a/LArCalorimeter/LArG4/LArG4FCAL/CMakeLists.txt b/LArCalorimeter/LArG4/LArG4FCAL/CMakeLists.txt index 67869fbf1e4b6dec2337ec25de709bb6f9061141..ec920e4536635895d9f351e5761d46814c9907c0 100644 --- a/LArCalorimeter/LArG4/LArG4FCAL/CMakeLists.txt +++ b/LArCalorimeter/LArG4/LArG4FCAL/CMakeLists.txt @@ -31,7 +31,7 @@ atlas_add_component( LArG4FCAL PRIVATE_INCLUDE_DIRS ${Boost_INCLUDE_DIRS} ${CORAL_INCLUDE_DIRS} ${XERCESC_INCLUDE_DIRS} ${GEANT4_INCLUDE_DIRS} ${CLHEP_INCLUDE_DIRS} PRIVATE_DEFINITIONS ${CLHEP_DEFINITIONS} LINK_LIBRARIES LArG4Code LArReadoutGeometry CaloG4SimLib StoreGateLib SGtests - PRIVATE_LINK_LIBRARIES ${Boost_LIBRARIES} ${CORAL_LIBRARIES} ${XERCESC_LIBRARIES} ${GEANT4_LIBRARIES} ${CLHEP_LIBRARIES} GaudiKernel LArG4RunControl PathResolver ) + PRIVATE_LINK_LIBRARIES ${Boost_LIBRARIES} ${CORAL_LIBRARIES} ${XERCESC_LIBRARIES} ${GEANT4_LIBRARIES} ${CLHEP_LIBRARIES} GaudiKernel LArG4RunControl PathResolver GeoModelInterfaces RDBAccessSvcLib ) atlas_install_python_modules( python/*.py ) diff --git a/LArCalorimeter/LArG4/LArG4GenShowerLib/CMakeLists.txt b/LArCalorimeter/LArG4/LArG4GenShowerLib/CMakeLists.txt index 0ea158db1feca5f46d61c1d6a97fe484930feb00..9e731829fbf9dec146e3f16a60869a7c26f36310 100644 --- a/LArCalorimeter/LArG4/LArG4GenShowerLib/CMakeLists.txt +++ b/LArCalorimeter/LArG4/LArG4GenShowerLib/CMakeLists.txt @@ -32,8 +32,8 @@ atlas_add_library( LArG4GenShowerLibLib PUBLIC_HEADERS LArG4GenShowerLib PRIVATE_INCLUDE_DIRS ${XERCESC_INCLUDE_DIRS} ${GEANT4_INCLUDE_DIRS} ${ROOT_INCLUDE_DIRS} ${CLHEP_INCLUDE_DIRS} PRIVATE_DEFINITIONS ${CLHEP_DEFINITIONS} - LINK_LIBRARIES AthenaBaseComps AthContainers GaudiKernel G4AtlasToolsLib - PRIVATE_LINK_LIBRARIES ${XERCESC_LIBRARIES} ${GEANT4_LIBRARIES} ${ROOT_LIBRARIES} ${CLHEP_LIBRARIES} GeneratorObjects LArG4Code LArG4ShowerLib ) + LINK_LIBRARIES AthenaBaseComps AthContainers AtlasHepMCLib GaudiKernel G4AtlasToolsLib LArG4Code + PRIVATE_LINK_LIBRARIES ${XERCESC_LIBRARIES} ${GEANT4_LIBRARIES} ${ROOT_LIBRARIES} ${CLHEP_LIBRARIES} GeneratorObjects GeoModelInterfaces LArG4ShowerLib ) atlas_add_component( LArG4GenShowerLib src/components/*.cxx diff --git a/LArCalorimeter/LArG4/LArG4H6SD/CMakeLists.txt b/LArCalorimeter/LArG4/LArG4H6SD/CMakeLists.txt index 26673276dba29e0183aca437f65f601cc5618d14..b0a45222a994d3b0dd1baf8f6f69da67f2e44954 100644 --- a/LArCalorimeter/LArG4/LArG4H6SD/CMakeLists.txt +++ b/LArCalorimeter/LArG4/LArG4H6SD/CMakeLists.txt @@ -46,7 +46,7 @@ atlas_add_component( LArG4H6SD src/*.cc src/components/*.cxx INCLUDE_DIRS ${CORAL_INCLUDE_DIRS} ${Boost_INCLUDE_DIRS} ${XERCESC_INCLUDE_DIRS} ${CLHEP_INCLUDE_DIRS} ${GEANT4_INCLUDE_DIRS} - LINK_LIBRARIES ${CORAL_LIBRARIES} ${Boost_LIBRARIES} ${XERCESC_LIBRARIES} ${CLHEP_LIBRARIES} AtlasHepMCLib ${GEANT4_LIBRARIES} GaudiKernel CaloG4SimLib CaloSimEvent AthenaBaseComps AthenaKernel StoreGateLib SGtests GeoModelUtilities Identifier GeneratorObjects LArG4Code LArG4RunControl LArG4TBSimEvent LArReadoutGeometry LArSimEvent G4AtlasInterfaces G4AtlasToolsLib SimHelpers HitManagement MCTruth TBEvent PathResolver ) + LINK_LIBRARIES ${CORAL_LIBRARIES} ${Boost_LIBRARIES} ${XERCESC_LIBRARIES} ${CLHEP_LIBRARIES} AtlasHepMCLib ${GEANT4_LIBRARIES} GaudiKernel CaloG4SimLib CaloSimEvent AthenaBaseComps AthenaKernel StoreGateLib SGtests GeoModelUtilities Identifier GeneratorObjects LArG4Code LArG4RunControl LArG4TBSimEvent LArReadoutGeometry LArSimEvent G4AtlasInterfaces G4AtlasToolsLib SimHelpers HitManagement MCTruth TBEvent PathResolver GeoModelInterfaces RDBAccessSvcLib ) # Install files from the package: atlas_install_python_modules( python/*.py ) diff --git a/LArCalorimeter/LArG4/LArG4HEC/CMakeLists.txt b/LArCalorimeter/LArG4/LArG4HEC/CMakeLists.txt index ed5aec6204ab7f9cb1876d17265edcd6eb64a8ab..77d9a10c62c88aa3e028e332d4edc85eca150dd4 100644 --- a/LArCalorimeter/LArG4/LArG4HEC/CMakeLists.txt +++ b/LArCalorimeter/LArG4/LArG4HEC/CMakeLists.txt @@ -34,7 +34,7 @@ atlas_add_component( LArG4HEC INCLUDE_DIRS ${XERCESC_INCLUDE_DIRS} ${GEANT4_INCLUDE_DIRS} ${CLHEP_INCLUDE_DIRS} PRIVATE_INCLUDE_DIRS ${Boost_INCLUDE_DIRS} ${CORAL_INCLUDE_DIRS} DEFINITIONS ${CLHEP_DEFINITIONS} - LINK_LIBRARIES ${XERCESC_LIBRARIES} ${GEANT4_LIBRARIES} ${CLHEP_LIBRARIES} AthenaBaseComps LArG4Code LArReadoutGeometry CaloG4SimLib StoreGateLib SGtests - PRIVATE_LINK_LIBRARIES ${Boost_LIBRARIES} ${CORAL_LIBRARIES} AthenaKernel GaudiKernel LArG4RunControl LArHV ) + LINK_LIBRARIES ${XERCESC_LIBRARIES} ${GEANT4_LIBRARIES} ${CLHEP_LIBRARIES} AthenaBaseComps LArG4Code LArReadoutGeometry CaloG4SimLib GeoModelInterfaces StoreGateLib SGtests + PRIVATE_LINK_LIBRARIES ${Boost_LIBRARIES} ${CORAL_LIBRARIES} AthenaKernel GaudiKernel LArG4RunControl LArHV RDBAccessSvcLib ) atlas_install_python_modules( python/*.py ) diff --git a/LArCalorimeter/LArG4/LArG4MiniFCAL/CMakeLists.txt b/LArCalorimeter/LArG4/LArG4MiniFCAL/CMakeLists.txt index a90464572f9aa074e1e64a80c44b245169ec88d3..0d56009e2a53acb388ce329ae5a3cce74caca196 100644 --- a/LArCalorimeter/LArG4/LArG4MiniFCAL/CMakeLists.txt +++ b/LArCalorimeter/LArG4/LArG4MiniFCAL/CMakeLists.txt @@ -32,6 +32,6 @@ atlas_add_component( LArG4MiniFCAL PRIVATE_INCLUDE_DIRS ${Boost_INCLUDE_DIRS} ${CORAL_INCLUDE_DIRS} ${CLHEP_INCLUDE_DIRS} PRIVATE_DEFINITIONS ${CLHEP_DEFINITIONS} LINK_LIBRARIES ${XERCESC_LIBRARIES} ${GEANT4_LIBRARIES} LArG4Code CaloG4SimLib StoreGateLib SGtests - PRIVATE_LINK_LIBRARIES ${Boost_LIBRARIES} ${CORAL_LIBRARIES} ${CLHEP_LIBRARIES} GaudiKernel Identifier LArG4RunControl ) + PRIVATE_LINK_LIBRARIES ${Boost_LIBRARIES} ${CORAL_LIBRARIES} ${CLHEP_LIBRARIES} GaudiKernel Identifier LArG4RunControl GeoModelInterfaces RDBAccessSvcLib ) atlas_install_python_modules( python/*.py ) diff --git a/LArCalorimeter/LArG4/LArG4ShowerLib/CMakeLists.txt b/LArCalorimeter/LArG4/LArG4ShowerLib/CMakeLists.txt index 89ad3036474994120ca905847d8ccd11d3c38580..31f351cd604682f2ce1fc1774e34d238cb4d271b 100644 --- a/LArCalorimeter/LArG4/LArG4ShowerLib/CMakeLists.txt +++ b/LArCalorimeter/LArG4/LArG4ShowerLib/CMakeLists.txt @@ -23,6 +23,6 @@ atlas_add_library( LArG4ShowerLib PUBLIC_HEADERS LArG4ShowerLib PRIVATE_INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} ${XERCESC_INCLUDE_DIRS} ${GEANT4_INCLUDE_DIRS} ${CLHEP_INCLUDE_DIRS} PRIVATE_DEFINITIONS ${CLHEP_DEFINITIONS} - LINK_LIBRARIES AthContainers LArG4Code - PRIVATE_LINK_LIBRARIES ${ROOT_LIBRARIES} ${XERCESC_LIBRARIES} ${GEANT4_LIBRARIES} ${CLHEP_LIBRARIES} AtlasHepMCLib ) + LINK_LIBRARIES AthContainers LArG4Code AtlasHepMCLib + PRIVATE_LINK_LIBRARIES ${ROOT_LIBRARIES} ${XERCESC_LIBRARIES} ${GEANT4_LIBRARIES} ${CLHEP_LIBRARIES} ) diff --git a/LArCalorimeter/LArMonTools/src/LArRODMonTool.cxx b/LArCalorimeter/LArMonTools/src/LArRODMonTool.cxx index d313e59f00667d719cab7e8b5ed3186b41600731..f3ade697549be635c528e13f720aefc1472c70c9 100755 --- a/LArCalorimeter/LArMonTools/src/LArRODMonTool.cxx +++ b/LArCalorimeter/LArMonTools/src/LArRODMonTool.cxx @@ -44,12 +44,6 @@ const int max_dump=100; int ndump=0; -#if ROOT_VERSION_CODE >= ROOT_VERSION(6,0,0) -# define CAN_REBIN(hist) hist->SetCanExtend(TH1::kAllAxes) -#else -# define CAN_REBIN(hist) hist->SetBit(TH1::kCanRebin) -#endif - /*---------------------------------------------------------*/ LArRODMonTool::LArRODMonTool(const std::string& type, const std::string& name, @@ -1143,7 +1137,7 @@ StatusCode LArRODMonTool::compareChannels(const CaloDetDescrManager* ddman, if (keepE) {//Energy histograms: //Partition histogram if (fabs(hg.m_hDE->GetXaxis()->GetXmax()) < fabs(DiffE) && m_IsOnline==true ) { // Set the histo axis - CAN_REBIN(hg.m_hDE); + hg.m_hDE->SetCanExtend(TH1::kAllAxes); hg.m_hDE->RebinAxis(DiffE,hg.m_hDE->GetXaxis()); } hg.m_hDE->Fill(DiffE); @@ -1151,7 +1145,7 @@ StatusCode LArRODMonTool::compareChannels(const CaloDetDescrManager* ddman, //'ALL' histogram if (fabs(m_hE_all->GetXaxis()->GetXmax()) < fabs(DiffE) && m_IsOnline==true ) { - CAN_REBIN(m_hE_all); + m_hE_all->SetCanExtend(TH1::kAllAxes); m_hE_all->RebinAxis(DiffE,m_hE_all->GetXaxis()); } m_hE_all->Fill(DiffE); @@ -1159,11 +1153,11 @@ StatusCode LArRODMonTool::compareChannels(const CaloDetDescrManager* ddman, //online vs offline histograms if (fabs(hg.m_hEon_VS_Eoff->GetXaxis()->GetXmax()) < fabs(maxE1) && m_IsOnline==true) { - CAN_REBIN(hg.m_hEon_VS_Eoff); + hg.m_hEon_VS_Eoff->SetCanExtend(TH1::kAllAxes); hg.m_hEon_VS_Eoff->RebinAxis(maxE1,hg.m_hEon_VS_Eoff->GetXaxis()); } if (fabs(hg.m_hEon_VS_Eoff->GetYaxis()->GetXmax()) < fabs(maxE2) && m_IsOnline==true ) { - CAN_REBIN(hg.m_hEon_VS_Eoff); + hg.m_hEon_VS_Eoff->SetCanExtend(TH1::kAllAxes); hg.m_hEon_VS_Eoff->RebinAxis(maxE2,hg.m_hEon_VS_Eoff->GetYaxis()); } hg.m_hEon_VS_Eoff->Fill(rcDig.energy(),en_fB); @@ -1251,25 +1245,25 @@ StatusCode LArRODMonTool::compareChannels(const CaloDetDescrManager* ddman, if (keepT) { //Time histograms //partition histogram if (fabs(hg.m_hDT->GetXaxis()->GetXmax()) < fabs(DiffT) && m_IsOnline==true ) { // Set the histo axis - CAN_REBIN(hg.m_hDT); + hg.m_hDT->SetCanExtend(TH1::kAllAxes); hg.m_hDT->RebinAxis(DiffT,hg.m_hDT->GetXaxis()); } hg.m_hDT->Fill(DiffT); //'ALL' histogram: if (fabs(m_hT_all->GetXaxis()->GetXmax()) < fabs(DiffT) && m_IsOnline==true) { - CAN_REBIN(m_hT_all); + m_hT_all->SetCanExtend(TH1::kAllAxes); m_hT_all->RebinAxis(DiffT,m_hT_all->GetXaxis()); } m_hT_all->Fill(DiffT); //online vs offline histogram if (fabs(hg.m_hTon_VS_Toff->GetXaxis()->GetXmax()) < fabs(maxT1) && m_IsOnline==true) { - CAN_REBIN(hg.m_hTon_VS_Toff); + hg.m_hTon_VS_Toff->SetCanExtend(TH1::kAllAxes); hg.m_hTon_VS_Toff->RebinAxis(maxT1,hg.m_hTon_VS_Toff->GetXaxis()); } if (fabs(hg.m_hTon_VS_Toff->GetYaxis()->GetXmax()) < fabs(maxT2) && m_IsOnline==true) { - CAN_REBIN(hg.m_hTon_VS_Toff); + hg.m_hTon_VS_Toff->SetCanExtend(TH1::kAllAxes); hg.m_hTon_VS_Toff->RebinAxis(maxT2,hg.m_hTon_VS_Toff->GetYaxis()); } hg.m_hTon_VS_Toff->Fill(timeOffline,t_fB); @@ -1287,25 +1281,25 @@ StatusCode LArRODMonTool::compareChannels(const CaloDetDescrManager* ddman, if (keepQ) { //Quality histograms //Partition histogram if (fabs(hg.m_hDQ->GetXaxis()->GetXmax()) < fabs(DiffQ) && m_IsOnline==true) { // Set the histo axis - CAN_REBIN(hg.m_hDQ); + hg.m_hDQ->SetCanExtend(TH1::kAllAxes); hg.m_hDQ->RebinAxis(DiffQ,hg.m_hDQ->GetXaxis()); } hg.m_hDQ->Fill(DiffQ); //'ALL' histograms if (fabs(m_hQ_all->GetXaxis()->GetXmax()) < fabs(DiffQ) && m_IsOnline==true) { - CAN_REBIN(m_hQ_all); + m_hQ_all->SetCanExtend(TH1::kAllAxes); m_hQ_all->RebinAxis(DiffQ,m_hQ_all->GetXaxis()); } m_hQ_all->Fill(DiffQ); //online vs offline histograms if (fabs(hg.m_hQon_VS_Qoff->GetXaxis()->GetXmax()) < fabs(maxQ1) && m_IsOnline==true) { - CAN_REBIN(hg.m_hQon_VS_Qoff); + hg.m_hQon_VS_Qoff->SetCanExtend(TH1::kAllAxes); hg.m_hQon_VS_Qoff->RebinAxis(maxQ1,hg.m_hQon_VS_Qoff->GetXaxis()); } if (fabs(hg.m_hQon_VS_Qoff->GetYaxis()->GetXmax()) < fabs(maxQ2) && m_IsOnline==true) { - CAN_REBIN(hg.m_hQon_VS_Qoff); + hg.m_hQon_VS_Qoff->SetCanExtend(TH1::kAllAxes); hg.m_hQon_VS_Qoff->RebinAxis(maxQ2,hg.m_hQon_VS_Qoff->GetYaxis()); } hg.m_hQon_VS_Qoff->Fill(rcDig.quality(),q_fB); diff --git a/LumiBlock/LumiBlockComps/LumiBlockComps/ILumiBlockMetaDataTool.h b/LumiBlock/LumiBlockComps/LumiBlockComps/ILumiBlockMetaDataTool.h deleted file mode 100644 index 7b0d58f59676159f4fbf2b79b7ef3745ea19e00f..0000000000000000000000000000000000000000 --- a/LumiBlock/LumiBlockComps/LumiBlockComps/ILumiBlockMetaDataTool.h +++ /dev/null @@ -1,36 +0,0 @@ -/* - Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration -*/ - -#ifndef LumiBlockComps_ILumiBlockMetaDataTool_H -#define LumiBlockComps_ILumiBlockMetaDataTool_H - -/** @file ILumiBlockMetaDataTool.h - * @brief This file contains the class definition for the ILumiBlockMetaDataTool class. - * @author Max Baak, Balint Radics, Marjorie Shapiro, - **/ - -#include "GaudiKernel/IAlgTool.h" -#include "TString.h" - -namespace Root { - class TGRLCollection; -} - -/** @class ILumiBlockMetaDataTool - * @brief This class provides the interface for MetaDataTools. - **/ -class ILumiBlockMetaDataTool : virtual public IAlgTool { - - public: - DeclareInterfaceID(ILumiBlockMetaDataTool, 1, 0); - - /// get grl collection - virtual const Root::TGRLCollection* getGRLCollection() const = 0 ; - virtual const TString& getUniqueGRLString() const = 0 ; - virtual const TString getGRLString( const TString& grlname ) const = 0 ; - -}; - -#endif - diff --git a/LumiBlock/LumiBlockComps/LumiBlockComps/LumiBlockCompsDict.h b/LumiBlock/LumiBlockComps/LumiBlockComps/LumiBlockCompsDict.h index 209c3b8c3be182a37a582bf4ec2a7a679e414f37..bed0888bddf3ecb937e58358527ff61df2b818fe 100644 --- a/LumiBlock/LumiBlockComps/LumiBlockComps/LumiBlockCompsDict.h +++ b/LumiBlock/LumiBlockComps/LumiBlockComps/LumiBlockCompsDict.h @@ -3,5 +3,4 @@ */ #include "LumiBlockComps/ILumiCalcSvc.h" -#include "LumiBlockComps/ILumiBlockMetaDataTool.h" #include "LumiBlockComps/ILumiBlockMuTool.h" diff --git a/LumiBlock/LumiBlockComps/LumiBlockComps/selection.xml b/LumiBlock/LumiBlockComps/LumiBlockComps/selection.xml index af6e6f2e96c8ceaffe3f520a1e923bb3a4ee5ed1..00b20a00f577e5a40b8b570d8162b42c1ba9fef0 100644 --- a/LumiBlock/LumiBlockComps/LumiBlockComps/selection.xml +++ b/LumiBlock/LumiBlockComps/LumiBlockComps/selection.xml @@ -1,7 +1,6 @@ <lcgdict> <class name="ILumiCalcSvc"/> - <class name="ILumiBlockMetaDataTool"/> <class name="ILumiBlockMuTool"/> </lcgdict> diff --git a/LumiBlock/LumiBlockComps/Root/LumiBlockMetaDataTool.cxx b/LumiBlock/LumiBlockComps/Root/LumiBlockMetaDataTool.cxx index faac1be7a1ff83bb4a838e4ff9d2b747964c71d3..ec7f2cd312b582676889a36f6ff6a7698dc165da 100644 --- a/LumiBlock/LumiBlockComps/Root/LumiBlockMetaDataTool.cxx +++ b/LumiBlock/LumiBlockComps/Root/LumiBlockMetaDataTool.cxx @@ -15,7 +15,6 @@ #include "DBDataModel/CollectionMetadata.h" -#include "GoodRunsLists/TGRLCollection.h" #include "GoodRunsLists/TGoodRunsList.h" #include "TROOT.h" @@ -31,11 +30,9 @@ LumiBlockMetaDataTool::LumiBlockMetaDataTool(const std::string& type, const std: m_nfiles(0), m_fileCurrentlyOpened(false), m_CurrentFileName("none"), - m_grlcollection(new Root::TGRLCollection()), m_GoodRunsListSelectorTool("GoodRunsListSelectorTool") { declareInterface<IMetaDataTool>(this); - declareInterface<ILumiBlockMetaDataTool>(this); declareProperty("LBCollName",m_LBColl_name = "LumiBlocks"); declareProperty("unfinishedLBCollName",m_unfinishedLBColl_name = "IncompleteLumiBlocks"); @@ -89,8 +86,6 @@ LumiBlockMetaDataTool::~LumiBlockMetaDataTool() { delete m_cacheOutputRangeAuxContainer; m_cacheOutputRangeAuxContainer = 0; delete m_cacheSuspectOutputRangeContainer; m_cacheSuspectOutputRangeContainer = 0; delete m_cacheSuspectOutputRangeAuxContainer; m_cacheSuspectOutputRangeAuxContainer = 0; - - if (m_grlcollection!=0) { delete m_grlcollection; m_grlcollection=0; } } //___________________________________________________________________________ @@ -377,17 +372,3 @@ StatusCode LumiBlockMetaDataTool::finishUp() { return(StatusCode::SUCCESS); } - -const TString -LumiBlockMetaDataTool::getGRLString( const TString& /*grlname*/ ) const -{ - /* - std::vector< Root::TGoodRunsList >::const_iterator itr = m_grlcollection->find( grlname ); - if (itr!=m_grlcollection->end()) - return m_converter->GetXMLString(*itr); - - ATH_MSG_WARNING("getGRLString() : GoodRunsList with name <" << grlname << "> not found. Return empty string." ); - */ - return ""; -} - diff --git a/LumiBlock/LumiBlockComps/Root/LumiBlockMetaDataTool.h b/LumiBlock/LumiBlockComps/Root/LumiBlockMetaDataTool.h index 05f68664da1592a556c71b0329e93470e24f5701..205fb726e1fc245cb0dd6122a1db381597ed15b1 100644 --- a/LumiBlock/LumiBlockComps/Root/LumiBlockMetaDataTool.h +++ b/LumiBlock/LumiBlockComps/Root/LumiBlockMetaDataTool.h @@ -16,7 +16,6 @@ #include "GaudiKernel/ToolHandle.h" #include "GaudiKernel/ServiceHandle.h" #include "AthenaKernel/IMetaDataTool.h" -#include "LumiBlockComps/ILumiBlockMetaDataTool.h" #include "GaudiKernel/ITHistSvc.h" #include "TTree.h" #include "TString.h" @@ -30,12 +29,7 @@ class StoreGateSvc; class IGoodRunsListSelectorTool; - -namespace Root { - class TGRLCollection; -} - -class LumiBlockMetaDataTool : public AthAlgTool, virtual public IMetaDataTool, virtual public ILumiBlockMetaDataTool { +class LumiBlockMetaDataTool : public AthAlgTool, virtual public IMetaDataTool { public: // Constructor and Destructor /// Standard Service Constructor LumiBlockMetaDataTool(const std::string& type, const std::string& name, const IInterface* parent); @@ -66,11 +60,6 @@ public: /// Function writing the collected metadata to the output virtual StatusCode metaDataStop(const SG::SourceID&) {return this->metaDataStop();} - /// functions from ILumiBlockMetaDataTool - inline const Root::TGRLCollection* getGRLCollection() const { return m_grlcollection; } - inline const TString& getUniqueGRLString() const { return m_grlxmlstring; } - const TString getGRLString( const TString& grlname ) const; - private: /// Fill metaDataStore and ntuples @@ -102,7 +91,6 @@ private: std::string m_version; TString m_DQLBColl_name; TString m_unfinishedDQLBColl_name; - TString m_grlxmlstring; int m_nfiles; bool m_fileCurrentlyOpened; @@ -110,7 +98,6 @@ private: bool m_calcLumi; bool m_storexmlfiles; bool m_applydqcuts; - Root::TGRLCollection* m_grlcollection; ToolHandle< IGoodRunsListSelectorTool > m_GoodRunsListSelectorTool; diff --git a/LumiBlock/LumiBlockComps/share/LumiBlockMuWriter_jobOptions.py b/LumiBlock/LumiBlockComps/share/LumiBlockMuWriter_jobOptions.py new file mode 100644 index 0000000000000000000000000000000000000000..099b06abf935728bc445e4efef7eda125211ecb4 --- /dev/null +++ b/LumiBlock/LumiBlockComps/share/LumiBlockMuWriter_jobOptions.py @@ -0,0 +1,12 @@ +""" Configuration for LumiBlockMuWriter to write mu into xAOD::EventInfo +""" + +from LumiBlockComps.LuminosityCondAlgDefault import LuminosityCondAlgDefault +condalg = LuminosityCondAlgDefault() + +from LumiBlockComps.LumiBlockCompsConf import LumiBlockMuWriter +muWriter = LumiBlockMuWriter("LumiBlockMuWriter",LumiDataKey=condalg.LuminosityOutputKey) + +from AthenaCommon.AlgSequence import AlgSequence +topSequence = AlgSequence() +topSequence += muWriter diff --git a/LumiBlock/LumiBlockComps/src/LumiBlockMuWriter.cxx b/LumiBlock/LumiBlockComps/src/LumiBlockMuWriter.cxx new file mode 100644 index 0000000000000000000000000000000000000000..3f6decf3f3bd9cadf2202664e7a805de9383a9c7 --- /dev/null +++ b/LumiBlock/LumiBlockComps/src/LumiBlockMuWriter.cxx @@ -0,0 +1,56 @@ +/* + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration +*/ + +#include "LumiBlockMuWriter.h" +#include "StoreGate/ReadCondHandle.h" +#include "StoreGate/WriteDecorHandle.h" + +LumiBlockMuWriter::LumiBlockMuWriter(const std::string& name, ISvcLocator* pSvcLocator) + : AthReentrantAlgorithm(name,pSvcLocator) +{ +} + +StatusCode LumiBlockMuWriter::initialize() +{ + ATH_MSG_INFO("LumiBlockMuWriter::initialize()"); + + ATH_CHECK(m_lumiDataKey.initialize()); + ATH_CHECK(m_actIntPerXKey.initialize()); + ATH_CHECK(m_aveIntPerXKey.initialize()); + + return StatusCode::SUCCESS; +} + +StatusCode LumiBlockMuWriter::execute(const EventContext& ctx) const +{ + ATH_MSG_DEBUG("LumiBlockMuWriter::execute()"); + + float actualMu = 0.0; + float muToLumi = 0.0; + SG::ReadCondHandle<LuminosityCondData> lumiData (m_lumiDataKey, ctx); + if (lumiData->lbAverageLuminosity() != 0 || + lumiData->lbAverageInteractionsPerCrossing() != 0) { + muToLumi = lumiData->muToLumi(); + if( std::abs( muToLumi ) > 0.00001 ) { + unsigned int bcid = ctx.eventID().bunch_crossing_id(); + actualMu = lumiData->lbLuminosityPerBCIDVector().at(bcid) / muToLumi; + } + } + + SG::WriteDecorHandle<xAOD::EventInfo,float> actIntPerXDecor(m_actIntPerXKey,ctx); + if (!actIntPerXDecor.isPresent()) { + ATH_MSG_ERROR( "actIntPerXDecor.isPresent check fails" ); + return StatusCode::FAILURE; + } + actIntPerXDecor(0) = actualMu; + + SG::WriteDecorHandle<xAOD::EventInfo,float> aveIntPerXDecor(m_aveIntPerXKey,ctx); + if (!aveIntPerXDecor.isPresent()) { + ATH_MSG_ERROR( "aveIntPerXDecor.isPresent check fails" ); + return StatusCode::FAILURE; + } + aveIntPerXDecor(0) = lumiData->lbAverageInteractionsPerCrossing(); + + return StatusCode::SUCCESS; +} diff --git a/LumiBlock/LumiBlockComps/src/LumiBlockMuWriter.h b/LumiBlock/LumiBlockComps/src/LumiBlockMuWriter.h new file mode 100644 index 0000000000000000000000000000000000000000..d8421df6862a038fd13bb1060f2aec1bf0b4ef7e --- /dev/null +++ b/LumiBlock/LumiBlockComps/src/LumiBlockMuWriter.h @@ -0,0 +1,48 @@ +/* + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration +*/ + +#ifndef LUMIBLOCKCOMPS_LUMIBLOCKMUWRITER_H +#define LUMIBLOCKCOMPS_LUMIBLOCKMUWRITER_H + +/** + * @class LumiBlockMuWriter + * + * @brief Algorithm to write interactions per crossing (mu) into xAOD::EventInfo as decorations + * + **/ + +#include "AthenaBaseComps/AthReentrantAlgorithm.h" +#include "StoreGate/ReadCondHandleKey.h" +#include "LumiBlockData/LuminosityCondData.h" +#include "xAODEventInfo/EventInfo.h" + +#include "StoreGate/WriteDecorHandleKey.h" + +class LumiBlockMuWriter : public AthReentrantAlgorithm +{ + public: + LumiBlockMuWriter(const std::string& name, ISvcLocator* pSvcLocator); + + virtual StatusCode initialize() override; + virtual StatusCode execute(const EventContext& ctx) const override; + + private: + SG::ReadCondHandleKey<LuminosityCondData> m_lumiDataKey {this + ,"LumiDataKey" + ,"LuminosityCondData" + ,"RCHK for LuminosityCondData"}; + + SG::WriteDecorHandleKey<xAOD::EventInfo> m_actIntPerXKey {this + ,"ActIntPerXKey" + ,"EventInfo.ActIntPerXDecor" + ,"Decoration for Actual Interaction Per Crossing"}; + + SG::WriteDecorHandleKey<xAOD::EventInfo> m_aveIntPerXKey {this + ,"AveIntPerXKey" + ,"EventInfo.AveIntPerXDecor" + ,"Decoration for Average Interaction Per Crossing"}; + +}; + +#endif diff --git a/LumiBlock/LumiBlockComps/src/components/LumiBlockComps_entries.cxx b/LumiBlock/LumiBlockComps/src/components/LumiBlockComps_entries.cxx index cdc83968cf40c64779f3e5ded25babd4c77228d9..77ff68ff92db6d1aeaea96cf44484f36383e3991 100644 --- a/LumiBlock/LumiBlockComps/src/components/LumiBlockComps_entries.cxx +++ b/LumiBlock/LumiBlockComps/src/components/LumiBlockComps_entries.cxx @@ -10,8 +10,8 @@ #include "../LuminosityCondAlg.h" #include "../BunchCrossingCondAlg.h" #include "../TrigLiveFractionCondAlg.h" - #include "../BunchCrossingCondTest.h" +#include "../LumiBlockMuWriter.h" #endif DECLARE_COMPONENT( CreateLumiBlockCollectionFromFile ) @@ -24,6 +24,7 @@ DECLARE_COMPONENT( LuminosityCondAlg ) DECLARE_COMPONENT( BunchCrossingCondAlg ) DECLARE_COMPONENT( TrigLiveFractionCondAlg ) DECLARE_COMPONENT ( BunchCrossingCondTest ) +DECLARE_COMPONENT(LumiBlockMuWriter) #endif DECLARE_COMPONENT( LumiBlockMetaDataTool ) diff --git a/MagneticField/MagFieldConditions/MagFieldConditions/AtlasFieldCacheCondObj.h b/MagneticField/MagFieldConditions/MagFieldConditions/AtlasFieldCacheCondObj.h index 0c9238116fadda7693ec4e4c1dea2a6ef8d34c05..74bb2636e4f066175c9fa8cefa2f00cb895524d6 100644 --- a/MagneticField/MagFieldConditions/MagFieldConditions/AtlasFieldCacheCondObj.h +++ b/MagneticField/MagFieldConditions/MagFieldConditions/AtlasFieldCacheCondObj.h @@ -23,9 +23,6 @@ public: ~AtlasFieldCacheCondObj(); - /// Temporary flag for switching between 'old' and 'new' magField usage - bool useNewBfieldCache() { return m_useNewBfieldCache; } - /** get B field cache for evaluation as a function of 2-d (solenoid) or 3-d (toroid) position. Resets cache to an initialized state */ inline void getInitializedCache (MagField::AtlasFieldCache& cache) const; @@ -38,12 +35,9 @@ public: /** set values for field scale and service to be able to build the cache **/ bool initialize(double solFieldScale, double torFieldScale, - const MagField::AtlasFieldMap* fieldMap, - bool useNewBfieldCache); + const MagField::AtlasFieldMap* fieldMap); private: - /// Temporary flag for switching between 'old' and 'new' magField usage - bool m_useNewBfieldCache{false}; double m_solFieldScale{1}; double m_torFieldScale{1}; const MagField::AtlasFieldMap* m_fieldMap{nullptr}; @@ -56,7 +50,7 @@ AtlasFieldCacheCondObj::getInitializedCache (MagField::AtlasFieldCache& cache) c { // setup with field scale and magnetic field service for first access to field */ - cache = MagField::AtlasFieldCache(m_solFieldScale, m_torFieldScale, m_fieldMap, m_useNewBfieldCache); + cache = MagField::AtlasFieldCache(m_solFieldScale, m_torFieldScale, m_fieldMap); } diff --git a/MagneticField/MagFieldConditions/src/AtlasFieldCacheCondObj.cxx b/MagneticField/MagFieldConditions/src/AtlasFieldCacheCondObj.cxx index 4423ac75c0ee2f2ad1a9eb9f06ec3f019727debf..d78140314c8c22c45900b9879d5adb1a5c12d1fd 100644 --- a/MagneticField/MagFieldConditions/src/AtlasFieldCacheCondObj.cxx +++ b/MagneticField/MagFieldConditions/src/AtlasFieldCacheCondObj.cxx @@ -12,11 +12,9 @@ AtlasFieldCacheCondObj::~AtlasFieldCacheCondObj() {} bool AtlasFieldCacheCondObj::initialize(double solFieldScale, double torFieldScale, - const MagField::AtlasFieldMap* fieldMap, - bool useNewBfieldCache) + const MagField::AtlasFieldMap* fieldMap) { // temporary flag - m_useNewBfieldCache = useNewBfieldCache; m_solFieldScale = solFieldScale; m_torFieldScale = torFieldScale; m_fieldMap = fieldMap; diff --git a/MagneticField/MagFieldElements/MagFieldElements/AtlasFieldCache.h b/MagneticField/MagFieldElements/MagFieldElements/AtlasFieldCache.h index f9b6f414cfa7db58edaa5f2d70960cf426ffa359..9a04eee74f3f9a97682100b2288a88810ac32f87 100644 --- a/MagneticField/MagFieldElements/MagFieldElements/AtlasFieldCache.h +++ b/MagneticField/MagFieldElements/MagFieldElements/AtlasFieldCache.h @@ -35,7 +35,6 @@ namespace MagField { * @author R.D.Schaffer -at- cern.ch */ class AtlasFieldCache -// : public ::AthMessaging { public: AtlasFieldCache(); @@ -43,13 +42,12 @@ public: // first access to field */ AtlasFieldCache(double solFieldScale, double torFieldScale, - const AtlasFieldMap* fieldMap, - bool useNewBfieldCache); + const AtlasFieldMap* fieldMap); AtlasFieldCache& operator=(AtlasFieldCache&& other) = default; ~AtlasFieldCache() = default; /// Temporary flag for switching between 'old' and 'new' magField usage - bool useNewBfieldCache() { return m_useNewBfieldCache; } + bool useNewBfieldCache() { return true; } /** get B field value at given position */ /** xyz[3] is in mm, bxyz[3] is in kT */ @@ -62,11 +60,8 @@ public: double* ATH_RESTRICT deriv = nullptr); /** status of the magnets */ - bool solenoidOn() const - { - return m_fieldMap ? m_fieldMap->solenoidOn() : false; - } - bool toroidOn() const { return m_fieldMap ? m_fieldMap->toroidOn() : false; } + bool solenoidOn() const; + bool toroidOn() const; private: AtlasFieldCache(const AtlasFieldCache& other) = delete; @@ -76,9 +71,6 @@ private: bool fillFieldCache(double z, double r, double phi); bool fillFieldCacheZR(double z, double r); - /// Temporary flag for switching between 'old' and 'new' magField usage - bool m_useNewBfieldCache{ false }; - /// magnetic field scales from currents double m_solScale{ 1 }; double m_torScale{ 1 }; diff --git a/MagneticField/MagFieldElements/MagFieldElements/AtlasFieldCache.icc b/MagneticField/MagFieldElements/MagFieldElements/AtlasFieldCache.icc index 4cce8882902607861072dcce1e2e6d0469c7db5d..1ee7397d5c8ebd297fda5e7778ca81bc54b0ac71 100644 --- a/MagneticField/MagFieldElements/MagFieldElements/AtlasFieldCache.icc +++ b/MagneticField/MagFieldElements/MagFieldElements/AtlasFieldCache.icc @@ -53,6 +53,16 @@ MagField::AtlasFieldCache::getField(const double* ATH_RESTRICT xyz, double* ATH_RESTRICT bxyz, double* ATH_RESTRICT deriv) { + // Allow for the case of no map for testing + if ( m_fieldMap == nullptr ) { + // constant ATLAS magnetic field if no map has been set - for testing + constexpr double TEST_BFIELD = 1.997; + bxyz[0] = bxyz[1] = 0; + bxyz[2] = TEST_BFIELD; + if (deriv) for (int i = 0; i < 9; i++) deriv[i] = 0.; + return; + } + const double& x(xyz[0]); const double& y(xyz[1]); const double& z(xyz[2]); @@ -94,6 +104,17 @@ MagField::AtlasFieldCache::getFieldZR(const double* ATH_RESTRICT xyz, double* ATH_RESTRICT bxyz, double* ATH_RESTRICT deriv) { + + // Allow for the case of no map for testing + if ( m_fieldMap == nullptr ) { + // constant ATLAS magnetic field if no map has been set - for testing + constexpr double TEST_BFIELD = 1.997; + bxyz[0] = bxyz[1] = 0; + bxyz[2] = TEST_BFIELD; + if (deriv) for (int i = 0; i < 9; i++) deriv[i] = 0.; + return; + } + const double& x(xyz[0]); const double& y(xyz[1]); const double& z(xyz[2]); @@ -117,3 +138,12 @@ MagField::AtlasFieldCache::getFieldZR(const double* ATH_RESTRICT xyz, } +inline bool +MagField::AtlasFieldCache::solenoidOn() const { + return m_fieldMap ? m_fieldMap->solenoidOn() : false; +} + +inline bool +MagField::AtlasFieldCache::toroidOn() const { + return m_fieldMap ? m_fieldMap->toroidOn() : false; +} diff --git a/MagneticField/MagFieldElements/src/AtlasFieldCache.cxx b/MagneticField/MagFieldElements/src/AtlasFieldCache.cxx index e8ad866929354a8fa28344e36885437dab393758..d21ffee4b7fe0920c77fb48e4e92d80f979f0d4d 100644 --- a/MagneticField/MagFieldElements/src/AtlasFieldCache.cxx +++ b/MagneticField/MagFieldElements/src/AtlasFieldCache.cxx @@ -16,20 +16,18 @@ MagField::AtlasFieldCache::AtlasFieldCache() {} MagField::AtlasFieldCache::AtlasFieldCache(double solFieldScale, double torFieldScale, - const AtlasFieldMap* fieldMap, - bool useNewBfieldCache) - : // temporary flag - m_useNewBfieldCache(useNewBfieldCache) - , m_solScale(solFieldScale) - , m_torScale(torFieldScale) - , - // Get solenoid zone id from field service - m_solZoneId(fieldMap->solenoidZoneId()) - , - // set field service - m_fieldMap(fieldMap) + const AtlasFieldMap* fieldMap) + : + m_solScale(solFieldScale), + m_torScale(torFieldScale), + // set field service + m_fieldMap(fieldMap) { - // save ZR bfield - m_meshZR = m_fieldMap->getBFieldMesh(); + if (m_fieldMap) { + // save ZR bfield + m_meshZR = m_fieldMap->getBFieldMesh() ; + // Get solenoid zone id from field service + m_solZoneId = fieldMap->solenoidZoneId(); + } } diff --git a/MagneticField/MagFieldServices/CMakeLists.txt b/MagneticField/MagFieldServices/CMakeLists.txt index cbcc972cab216cd83ee575ed1592cc03a2e8db58..150469e9ac3411d89c1bcece54f825d6d1e24b0e 100644 --- a/MagneticField/MagFieldServices/CMakeLists.txt +++ b/MagneticField/MagFieldServices/CMakeLists.txt @@ -16,7 +16,9 @@ atlas_depends_on_subdirs( PUBLIC Control/StoreGate Database/AthenaPOOL/AthenaPoolUtilities GaudiKernel - Tools/PathResolver ) + Tools/PathResolver + Event/EventInfo + ) # External dependencies: find_package( CLHEP ) @@ -28,7 +30,8 @@ atlas_add_component( MagFieldServices src/components/*.cxx INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} ${CLHEP_INCLUDE_DIRS} LINK_LIBRARIES ${ROOT_LIBRARIES} ${CLHEP_LIBRARIES} MagFieldElements MagFieldConditions CxxUtils - AthenaBaseComps MagFieldInterfaces StoreGateLib SGtests AthenaPoolUtilities GaudiKernel PathResolver ) + AthenaBaseComps MagFieldInterfaces StoreGateLib SGtests AthenaPoolUtilities GaudiKernel PathResolver + EventInfo ) # Install files from the package: atlas_install_headers( MagFieldServices ) diff --git a/MagneticField/MagFieldServices/MagFieldServices/AtlasFieldCacheCondAlg.h b/MagneticField/MagFieldServices/MagFieldServices/AtlasFieldCacheCondAlg.h index 399c7bacd1c36e7282a8af10a6ed86cf03be106d..c1426976d4076c9abbd189f09d04aad80d99ecf6 100644 --- a/MagneticField/MagFieldServices/MagFieldServices/AtlasFieldCacheCondAlg.h +++ b/MagneticField/MagFieldServices/MagFieldServices/AtlasFieldCacheCondAlg.h @@ -52,10 +52,6 @@ namespace MagField { StatusCode updateCurrentFromParameters(Cache& cache) const; void scaleField(Cache& cache, const MagField::AtlasFieldMap* fieldMap) const; - /// Temporary flag for switching between 'old' and 'new' magField usage - Gaudi::Property<bool> m_useNewBfieldCache {this, - "UseNewBfieldCache", true, "Temporary flag for switching between 'old' and 'new' magField usage. Default = true"}; - // threshold below which currents are considered zero Gaudi::Property<double> m_soleMinCurrent {this, "SoleMinCurrent", 1.0, "Minimum solenoid current (A) for which solenoid is considered ON"}; diff --git a/MagneticField/MagFieldServices/MagFieldServices/AtlasFieldMapCondAlg.h b/MagneticField/MagFieldServices/MagFieldServices/AtlasFieldMapCondAlg.h index 4a43b19701ef4a6730accf31dff773f9871625ba..c87ece15d97f8a0bae48129ca3c5ba2d357459c9 100644 --- a/MagneticField/MagFieldServices/MagFieldServices/AtlasFieldMapCondAlg.h +++ b/MagneticField/MagFieldServices/MagFieldServices/AtlasFieldMapCondAlg.h @@ -16,6 +16,7 @@ #include "StoreGate/WriteCondHandleKey.h" #include "AthenaPoolUtilities/CondAttrListCollection.h" #include "GaudiKernel/ICondSvc.h" +#include "EventInfo/TagInfo.h" // #include "MagFieldInterfaces/IMTMagFieldSvc.h" @@ -93,6 +94,10 @@ namespace MagField { ServiceHandle<ICondSvc> m_condSvc { this, "CondSvc", "CondSvc", "conditions service" }; + // TagInfo object - used to get currents via TagInfoMgr + SG::ReadHandleKey<TagInfo> m_tagInfoKey {this, + "TagInfo", "DetectorStore+ProcessingTags", "tag info key"}; + }; } diff --git a/MagneticField/MagFieldServices/python/MagFieldServicesConfig.py b/MagneticField/MagFieldServices/python/MagFieldServicesConfig.py index 220484c6576bd2ac60d4891673f3cfa66e700932..0544ed4a3f25ee84beb45b51567b9855aa25214b 100644 --- a/MagneticField/MagFieldServices/python/MagFieldServicesConfig.py +++ b/MagneticField/MagFieldServices/python/MagFieldServicesConfig.py @@ -60,7 +60,6 @@ def MagneticFieldSvcCfg(flags, **kwargs): afcArgs.update( LockMapCurrents = True ) else: afcArgs.update( UseDCS = True ) - afcArgs.update( UseNewBfieldCache = True ) if 'UseDCS' in kwargs: afcArgs['UseDCS'] = kwargs['UseDCS'] mag_field_cache_cond_alg = CompFactory.MagField.AtlasFieldCacheCondAlg(**afcArgs) diff --git a/MagneticField/MagFieldServices/python/MagFieldServicesSetup.py b/MagneticField/MagFieldServices/python/MagFieldServicesSetup.py index e327b148f6203a3f876959e634fa414f10cd7789..dc86e0845f832dc0eb2688b22b0c0446d06213ca 100644 --- a/MagneticField/MagFieldServices/python/MagFieldServicesSetup.py +++ b/MagneticField/MagFieldServices/python/MagFieldServicesSetup.py @@ -34,8 +34,6 @@ def AtlasFieldCacheCondAlg(name="AtlasFieldCacheCondAlg",**kwargs): kwargs.setdefault( "LockMapCurrents", True ) else: kwargs.setdefault( "UseDCS", True ) - kwargs.setdefault( "UseNewBfieldCache", True ) - # kwargs.setdefault( "UseNewBfieldCache", False ) # kwargs.setdefault( "UseDCS", False ) # kwargs.setdefault( "UseSoleCurrent", 12000 ) # kwargs.setdefault( "UseToroCurrent", 20400 ) diff --git a/MagneticField/MagFieldServices/src/AtlasFieldCacheCondAlg.cxx b/MagneticField/MagFieldServices/src/AtlasFieldCacheCondAlg.cxx index 3ce18abed0e1515aaedb9c4fd714d8ffad984549..c14001187c99a9552b5e1fd08e464a4eef97d3b9 100644 --- a/MagneticField/MagFieldServices/src/AtlasFieldCacheCondAlg.cxx +++ b/MagneticField/MagFieldServices/src/AtlasFieldCacheCondAlg.cxx @@ -118,8 +118,7 @@ MagField::AtlasFieldCacheCondAlg::execute(const EventContext& ctx) const { // initialize cond obj with current scale factors and the field svc (needed to setup cache) if (!fieldCondObj->initialize(cache.m_solScaleFactor, cache.m_torScaleFactor, - fieldMap, - m_useNewBfieldCache)) { + fieldMap)) { ATH_MSG_ERROR("execute: Could not initialize conditions field object with solenoid/toroid currents " << cache.m_solScaleFactor << "," << cache.m_torScaleFactor); return StatusCode::FAILURE; @@ -136,7 +135,6 @@ MagField::AtlasFieldCacheCondAlg::execute(const EventContext& ctx) const { ATH_MSG_INFO ( "execute: initialized AtlasFieldCacheCondObj and cache with SFs - sol/tor " << cache.m_solScaleFactor << "/" << cache.m_torScaleFactor ); ATH_MSG_INFO ( "execute: solenoid zone id " << fieldMap->solenoidZoneId()); - ATH_MSG_INFO ( "execute: useNewBfieldCache " << m_useNewBfieldCache); return StatusCode::SUCCESS; } diff --git a/MagneticField/MagFieldServices/src/AtlasFieldMapCondAlg.cxx b/MagneticField/MagFieldServices/src/AtlasFieldMapCondAlg.cxx index c12cd47f0c88a6299d5d00c554de6dd91d0e64ff..56fc691ae50152e10706f55c765506774594b913 100644 --- a/MagneticField/MagFieldServices/src/AtlasFieldMapCondAlg.cxx +++ b/MagneticField/MagFieldServices/src/AtlasFieldMapCondAlg.cxx @@ -21,6 +21,9 @@ // PathResolver #include "PathResolver/PathResolver.h" +// TagInfo for special case of turning off toroid or solenoid +#include "EventInfo/TagInfo.h" + // ROOT #include "TFile.h" #include "TTree.h" @@ -42,6 +45,9 @@ MagField::AtlasFieldMapCondAlg::initialize() { // Read Handle for the map ATH_CHECK( m_mapsInputKey.initialize() ); + // Read Handle for tagInfo + ATH_CHECK( m_tagInfoKey.initialize() ); + // Output handle for the field map ATH_CHECK( m_mapCondObjOutputKey.initialize() ); @@ -192,12 +198,44 @@ MagField::AtlasFieldMapCondAlg::updateFieldMap(const EventContext& ctx, Cache& c const EventIDBase::number_type UNDEFNUM = EventIDBase::UNDEFNUM; const EventIDBase::event_number_t UNDEFEVT = EventIDBase::UNDEFEVT; EventIDRange rangeW (EventIDBase (0, UNDEFEVT, UNDEFNUM, 0, 0), - EventIDBase (UNDEFNUM-1, UNDEFEVT, UNDEFNUM, 0, 0)); + EventIDBase (UNDEFNUM-1, UNDEFEVT, UNDEFNUM, UNDEFNUM, 0)); cache.m_mapCondObjOutputRange = rangeW; ATH_MSG_INFO("updateFieldMap: useMapsFromCOOL == false, using default range " << rangeW); } - + // We allow to set currents via the TagInfoMgr which adds tags to the TagInfo object - only allowed for offline + + if (m_useMapsFromCOOL) { + + // TagInfo object - used to get currents via TagInfoMgr + SG::ReadHandle<TagInfo> tagInfoH{m_tagInfoKey, ctx}; + if (tagInfoH.isValid()) { + ATH_MSG_INFO("updateFieldMap: tagInfoH " << tagInfoH.fullKey() << " is valid. "); + int i = 0; + bool resetCurrentsFromTagInfo = false; + for ( auto tag : tagInfoH->getTags() ) { + ATH_MSG_DEBUG("updateFieldMap: i, tags: " << i << " " << tag.first << " " << tag.second); + ++i; + if (tag.first == "MapSoleCurrent") { + cache.m_mapSoleCurrent = std::stof(tag.second); + resetCurrentsFromTagInfo = true; + ATH_MSG_INFO("updateFieldMap: found MapSoleCurrent in TagInfo, setting the solenoid current " << cache.m_mapSoleCurrent); + } + else + if (tag.first == "MapToroCurrent") { + cache.m_mapToroCurrent = std::stof(tag.second); + resetCurrentsFromTagInfo = true; + ATH_MSG_INFO("updateFieldMap: found MapToroCurrent in TagInfo, setting the toroid current " << cache.m_mapToroCurrent); + } + } + if (resetCurrentsFromTagInfo) ATH_MSG_INFO("updateFieldMap: reset currents from TagInfo"); + else ATH_MSG_INFO("updateFieldMap: DID NOT reset currents from TagInfo"); + } + else { + ATH_MSG_INFO("updateFieldMap: tagInfoH " << tagInfoH.fullKey() << " is NOT valid. "); + } + } + // Select map file according to the value of the currents which indicate which map is 'on' // determine the map to load diff --git a/MuonSpectrometer/MuonCalib/CscCalib/CscCalibAlgs/src/BipolarFit.cxx b/MuonSpectrometer/MuonCalib/CscCalib/CscCalibAlgs/src/BipolarFit.cxx index c8fbb9c99f2b82e6314275ba879f25ed95e170b4..19daebf91cc45902f958018bcb28add6daf63107 100644 --- a/MuonSpectrometer/MuonCalib/CscCalib/CscCalibAlgs/src/BipolarFit.cxx +++ b/MuonSpectrometer/MuonCalib/CscCalib/CscCalibAlgs/src/BipolarFit.cxx @@ -27,7 +27,7 @@ BipolarFit::BipolarFit() m_powcachez = -9999.; m_powcachezn= -9999.; m_zmax= m_n+1 - std::sqrt(m_n+1.0); - m_bipolarNormalization = FindPow(m_zmax)*(1-m_zmax/(m_n+1))*exp(-m_zmax); + m_bipolarNormalization = FindPow(m_zmax)*(1-m_zmax/(m_n+1))*std::exp(-m_zmax); m_tsampling = 25.; } @@ -116,7 +116,7 @@ BipolarFit::bipolar(double *x, double *parm) // the bipolar pulse function if(z<0.) return 0.; - return parm[0]*FindPow(z)*(1-z/(m_n+1))*exp(-z)/m_bipolarNormalization; + return parm[0]*FindPow(z)*(1-z/(m_n+1))*std::exp(-z)/m_bipolarNormalization; } void @@ -134,7 +134,7 @@ BipolarFit::Derivative(double A[][3],double fp[][1], double p0[][1],int imeas, i double dFdzNormalized = 0.; if(z>0.) { - repquant = FindPow(z)*exp(-z)/m_bipolarNormalization; + repquant = FindPow(z)*std::exp(-z)/m_bipolarNormalization; dFdzNormalized= repquant*(m_n/z+z/13.-2.); } @@ -234,11 +234,9 @@ The function return an integer representing different exit status. // initial parameter estimates using parabola interpolation double initValues[3]={0.}; - //double FWHM=0.; int imax = -1; initValues[2]=predefinedwidth; double samplemax = FindInitValues(x,initValues,&imax); - //std::cout << " Init " << initValues[0] << " "<<initValues[1] << " "<<initValues[2]<<std::endl; result[0] = initValues[0]; result[1] = initValues[1]; result[2] = initValues[2]; @@ -309,23 +307,11 @@ The function return an integer representing different exit status. ipar++; } - /* std::cout << " Use Meas " <<std::endl; - for(int i =0;i<4;i++) - std::cout << usemeas[i]<< " "; - std::cout<<std::endl << " fit par " <<std::endl; - for(int i=0;i<3;i++) - std::cout << fitpar[i] << " "; - std::cout<<std::endl; - */ int FitStatus = TheFitter(x,ex,initValues,imeas,meas,ipar,par,chi2,result); - //std::cout << "chi2 " << (*chi2) <<std::endl; - //std::cout << result[0] << " " << result[1] << " "<<result[2] <<std::endl; - //std::cout<< initValues[0] << " " << initValues[1] << " "<< initValues[2]<<std::endl; // the parabola interpolated estimate is most of the time a lower bound (for high pulses)! if(result[0]> 10.*ex && result[0]<0.90*initValues[0]) { result[0] = initValues[0]; - // std::cout << "using the lower bound "<<std::endl; return 10; } diff --git a/MuonSpectrometer/MuonCalib/CscCalib/CscCalibAlgs/src/CscCalcSlope.cxx b/MuonSpectrometer/MuonCalib/CscCalib/CscCalibAlgs/src/CscCalcSlope.cxx index 41eeae9457e0f335a7d17f0cf5cf9de83d8980f7..7edb9a57048e2a05802b063b35b4c9cc10d6a175 100644 --- a/MuonSpectrometer/MuonCalib/CscCalib/CscCalibAlgs/src/CscCalcSlope.cxx +++ b/MuonSpectrometer/MuonCalib/CscCalib/CscCalibAlgs/src/CscCalcSlope.cxx @@ -2,25 +2,17 @@ Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ -#include "GaudiKernel/MsgStream.h" -#include "GaudiKernel/ISvcLocator.h" -#include "GaudiKernel/ITHistSvc.h" -#include "GaudiKernel/Chrono.h" - +#include "TH1I.h" #include "TF1.h" #include "TGraphErrors.h" #include "TFile.h" #include "TProfile.h" -#include "StoreGate/StoreGate.h" - -#include "MuonIdHelpers/CscIdHelper.h" - #include "MuonRDO/CscRawData.h" #include "MuonRDO/CscRawDataCollection.h" #include "MuonRDO/CscRawDataContainer.h" #include "CscCalibTools/ICscCalibTool.h" - +#include "GaudiKernel/Chrono.h" #include "MuonCondInterface/CscICoolStrSvc.h" #include "MuonCSC_CnvTools/ICSC_RDO_Decoder.h" @@ -135,9 +127,7 @@ namespace MuonCalib { StatusCode CscCalcSlope::initialize() { - MsgStream mLog( msgSvc(), name() ); - - mLog << MSG::INFO << "CscCalcSlope::initialize() called" << endmsg; + ATH_MSG_INFO("CscCalcSlope::initialize() called"); //*******Register services and tools *********/ // Store Gate active store @@ -154,7 +144,7 @@ namespace MuonCalib { ATH_CHECK(m_cscRdoDecoderTool.retrieve()); - mLog << MSG::INFO <<"Finished initializing services. " << endmsg; + ATH_MSG_INFO("Finished initializing services. "); //*****Initialize internal variables and histograms*******/ m_ampProfs = new std::map<int, TProfile* >(); //Setup lookup table for pulser levels @@ -225,7 +215,7 @@ namespace MuonCalib { if(m_pedFile) { - mLog << MSG::INFO << "Opening pedestal file" << endmsg; + ATH_MSG_INFO("Opening pedestal file"); std::ifstream in(m_pedFileName.c_str()); int stripHash; double ped,noise;//,pedError,noiseError; @@ -237,9 +227,9 @@ namespace MuonCalib { while(!in.eof()) { in >> stripHash >> buff >> buff >> ped >> noise; - mLog << MSG::INFO << stripHash << "\t" << ped << "\t" << noise << endmsg; + ATH_MSG_INFO(stripHash << "\t" << ped << "\t" << noise); if( stripHash < 0 || (unsigned int) stripHash > m_maxStripHash ) { - mLog << MSG::FATAL << "The hash "<< (int) stripHash << " is out of range for the Ped-Vector - Crashing!" << endmsg; + ATH_MSG_FATAL("The hash "<< (int) stripHash << " is out of range for the Ped-Vector - Crashing!"); return StatusCode::FAILURE; } m_peds[stripHash] = ped; @@ -251,7 +241,7 @@ namespace MuonCalib { ATH_CHECK(m_readKey.initialize()); } - mLog << MSG::INFO << "Counted " << m_maxStripHash +1 << " strips." << endmsg; + ATH_MSG_INFO("Counted " << m_maxStripHash +1 << " strips."); m_slopes = new CscCalibResultCollection("pslope"); m_intercepts = new CscCalibResultCollection("pinter"); @@ -266,31 +256,29 @@ namespace MuonCalib { m_pulsedChambers = new std::set<int>; - mLog <<MSG::DEBUG << "End initialize" << endmsg; + ATH_MSG_DEBUG("End initialize"); return StatusCode::SUCCESS; }//end initialize //Execute loops through all strips and fills histograms StatusCode CscCalcSlope::execute() { - MsgStream mLog( msgSvc(), name() ); - mLog << MSG::INFO << "Begin execute" << endmsg; + ATH_MSG_INFO("Begin execute"); //collectEventInfo collects infomation about each event by filling ampHistCollection and peaktHist. StatusCode sc = collectEventInfo(); if(!sc.isSuccess()) { - mLog << MSG::WARNING << "There was an error collecting information from the RDO this event." << endmsg; + ATH_MSG_WARNING("There was an error collecting information from the RDO this event."); return sc; } - mLog << MSG::INFO << "End execute" << endmsg; + ATH_MSG_INFO("End execute"); return StatusCode::SUCCESS; } //end execute() StatusCode CscCalcSlope::finalize() { - MsgStream mLog( msgSvc(), name() ); - mLog << MSG::INFO << "In finalize()" << endmsg; + ATH_MSG_INFO("In finalize()"); StatusCode sc; @@ -301,29 +289,29 @@ namespace MuonCalib { sc =calculateParameters(); if(sc.isFailure()) { - mLog << MSG::WARNING << "Calculation of parameters failed!" << endmsg; + ATH_MSG_WARNING("Calculation of parameters failed!"); } - mLog << MSG::DEBUG << "Finished calculating parameters" << endmsg; + ATH_MSG_DEBUG("Finished calculating parameters"); //writeCalibrationFile() writes the calculated parameters into a calibration fie. sc = writeCalibrationFile(); if(!sc.isSuccess()) { - mLog << MSG::FATAL << "Failed to write parameters to disk!" << endmsg; + ATH_MSG_FATAL("Failed to write parameters to disk!"); thereIsAFatal = true; //Not quiting yet to ensure memory is properly deleted } sc = storeGateRecord(); if(sc.isFailure()) { - mLog <<MSG::FATAL << "Failed to record parameters in StoreGate " << endmsg; + ATH_MSG_FATAL("Failed to record parameters in StoreGate "); thereIsAFatal = true; } delete m_peakTimeProf; delete [] m_crossTalkFix; - mLog <<MSG::DEBUG << "Finished finalize()" << endmsg; + ATH_MSG_DEBUG("Finished finalize()"); if(thereIsAFatal) return StatusCode::FAILURE; @@ -341,13 +329,13 @@ namespace MuonCalib { // bool thereIsAnError = false; Chrono chrono(m_chronoSvc,"collectEventInfo"); - mLog << MSG::DEBUG <<"Collecting event info for event " << m_eventCnt << endmsg; + ATH_MSG_DEBUG("Collecting event info for event " << m_eventCnt); //Below might need to be changed depending on how we get data const CscRawDataContainer* fullRDO; StatusCode sc_read = m_storeGate->retrieve(fullRDO, "CSCRDO"); if (sc_read != StatusCode::SUCCESS) { - mLog << MSG::FATAL << "Could not find event" << endmsg; + ATH_MSG_FATAL("Could not find event"); return StatusCode::FAILURE; } @@ -367,17 +355,17 @@ namespace MuonCalib { uint16_t pulsedWireLayer = rod->calLayer(); int pulserLevel = rod->calAmplitude(); - mLog << MSG::VERBOSE << "Pulser level is " << pulserLevel << endmsg; + ATH_MSG_VERBOSE("Pulser level is " << pulserLevel); if( pulserLevel != m_lastPulserLevel) { - mLog <<MSG::INFO << "New pulser level found. (" << pulserLevel <<")." << endmsg; + ATH_MSG_INFO("New pulser level found. (" << pulserLevel <<")."); std::map<int,TProfile*>::iterator alreadyExistingProfile = m_ampProfs->find(pulserLevel); if(alreadyExistingProfile == m_ampProfs->end()) {//No previous profile for this amplitude exists - mLog << MSG::DEBUG << " creating new amplitude profile" << endmsg; + ATH_MSG_DEBUG(" creating new amplitude profile"); std::stringstream name, title; name << "ampProf_" << pulserLevel; title << m_titlePrefix << "Amplitudes For Pulser Level " << pulserLevel << m_titlePostfix; @@ -385,12 +373,12 @@ namespace MuonCalib { m_maxStripHash+1, 0, m_maxStripHash); m_currentAmpProf->GetXaxis()->SetTitle("Channel (Hash Id)"); m_currentAmpProf->GetYaxis()->SetTitle("Amplitude (ADC value)"); - mLog << MSG::DEBUG << "Adding new amplitude profile" << endmsg; + ATH_MSG_DEBUG("Adding new amplitude profile"); m_ampProfs->insert(std::pair<int, TProfile*>( pulserLevel, m_currentAmpProf)); } else { - mLog << MSG::DEBUG << " using existing amplitude profile" << endmsg; + ATH_MSG_DEBUG(" using existing amplitude profile"); m_currentAmpProf = alreadyExistingProfile->second; } @@ -419,23 +407,22 @@ namespace MuonCalib { IdentifierHash cscChannelHashId; m_idHelperSvc->cscIdHelper().get_channel_hash(stripId, cscChannelHashId); int stripHash = cscChannelHashId; - mLog << MSG::VERBOSE << "The eta of this strip is: " << m_idHelperSvc->cscIdHelper().stationEta(stripId) << endmsg; + ATH_MSG_VERBOSE("The eta of this strip is: " << m_idHelperSvc->cscIdHelper().stationEta(stripId)); int chamberLayer = m_idHelperSvc->cscIdHelper().chamberLayer(stripId); if(chamberLayer != m_expectedChamberLayer) { - mLog << MSG::FATAL << "Cluster includes strip in chamber layer " + ATH_MSG_FATAL("Cluster includes strip in chamber layer " << chamberLayer << ". Only " << m_expectedChamberLayer - << " is valid." << endmsg; - // thereIsAnError = true; + << " is valid."); return StatusCode::FAILURE; } int currentWireLayer = m_idHelperSvc->cscIdHelper().wireLayer(stripId) - 1; if( currentWireLayer < 0 || currentWireLayer > 3) { - mLog << MSG::FATAL << "Problem in getting wire layer! - Current value is " - << m_idHelperSvc->cscIdHelper().wireLayer(stripId) << " while only values between 1-4 are allowed." << endmsg; + ATH_MSG_FATAL("Problem in getting wire layer! - Current value is " + << m_idHelperSvc->cscIdHelper().wireLayer(stripId) << " while only values between 1-4 are allowed."); return StatusCode::FAILURE; } bool isThisLayerPulsed = (pulsedWireLayer >> currentWireLayer)&0x1; @@ -456,21 +443,22 @@ namespace MuonCalib { if(!readCdo->readChannelPed(stripHash, ped).isSuccess()){ ped = 2054; - mLog << (m_ignoreDatabaseError ? MSG::WARNING : MSG::ERROR) - << "Failed at getting pedestal from COOL for hash " << stripHash << endmsg; + if (m_ignoreDatabaseError) ATH_MSG_WARNING("Failed at getting pedestal from COOL for hash " << stripHash); + else ATH_MSG_ERROR("Failed at getting pedestal from COOL for hash " << stripHash); if(!m_ignoreDatabaseError) return StatusCode::RECOVERABLE; - mLog << MSG::WARNING << "Setting to " << ped << endmsg; + ATH_MSG_WARNING("Setting to " << ped); } else - mLog << MSG::VERBOSE << "Got pedestal of " << ped << endmsg; + ATH_MSG_VERBOSE("Got pedestal of " << ped); if(!readCdo->readChannelNoise(stripHash, noise).isSuccess()) { noise = .001; - mLog << (m_ignoreDatabaseError ? MSG::WARNING : MSG::ERROR) << "Failed at getting noise from COOL for hash " << stripHash << endmsg; + if (m_ignoreDatabaseError) ATH_MSG_WARNING("Failed at getting noise from COOL for hash " << stripHash); + else ATH_MSG_ERROR("Failed at getting noise from COOL for hash " << stripHash); if(!m_ignoreDatabaseError) return StatusCode::FAILURE; - mLog << MSG::WARNING << "Setting to " << noise << endmsg; + ATH_MSG_WARNING("Setting to " << noise); } } @@ -488,7 +476,7 @@ namespace MuonCalib { floatSamples.push_back((*sampItr)-ped); if(m_bitHists){ if(!fillBitHist((*m_bitHists)[stripHash],*sampItr)){ - mLog << MSG::WARNING << "Failed recording bits for strip " << stripHash << endmsg; + ATH_MSG_WARNING("Failed recording bits for strip " << stripHash); } } @@ -522,15 +510,11 @@ namespace MuonCalib { } else { - mLog << MSG::WARNING << "Failed at fitting pulse shape. Debug info: " <<endmsg; - mLog << MSG::WARNING << "stripHash " << stripHash << endmsg; - mLog << MSG::WARNING << "strip in chamber " << stripItr << endmsg; - mLog << MSG::WARNING - << " and detailed id " << m_idHelperSvc->cscIdHelper().show_to_string(stripId,&channelContext) - << endmsg; - mLog << "Pulsed layer " << pulsedWireLayer <<endmsg; - mLog << ", Samples: " << samples[0] <<", " << samples[1] << ", " - << samples[2] << ", " << samples[3] << endmsg; + ATH_MSG_WARNING("Failed at fitting pulse shape. Debug info: "); + ATH_MSG_WARNING("stripHash " << stripHash); + ATH_MSG_WARNING("strip in chamber " << stripItr); + ATH_MSG_WARNING(" and detailed id " << m_idHelperSvc->cscIdHelper().show_to_string(stripId,&channelContext)); + ATH_MSG_WARNING("Pulsed layer " << pulsedWireLayer<< ", Samples: " << samples[0] <<", " << samples[1] << ", " << samples[2] << ", " << samples[3]); } }//end if (islayerPulsedand and is precision layer) }//end strip loop @@ -540,7 +524,7 @@ namespace MuonCalib { }//end rod loop - mLog << MSG::DEBUG << "end collectEventInfo()" << endmsg; + ATH_MSG_DEBUG("end collectEventInfo()"); m_eventCnt++; // at this part of the code thereIsAnError is always false - if true it would exit earlier @@ -555,17 +539,16 @@ namespace MuonCalib { //data taken by collectEventData() StatusCode CscCalcSlope::calculateParameters() { - MsgStream mLog( msgSvc(), name() ); Chrono chrono(m_chronoSvc,"calculateParameters"); StatusCode sc; - mLog << MSG::INFO << "Calculating calibration constants." << endmsg; + ATH_MSG_INFO("Calculating calibration constants."); if(!m_ampProfs){ - mLog << MSG::FATAL << "m_ampProfs empty!" << endmsg; + ATH_MSG_FATAL("m_ampProfs empty!"); return StatusCode::FAILURE; } unsigned int numCalibPoints = m_ampProfs->size(); - mLog << MSG::INFO << "There are " << numCalibPoints << " pulser levels to evaluate." << endmsg; + ATH_MSG_INFO("There are " << numCalibPoints << " pulser levels to evaluate."); IdContext channelContext = m_idHelperSvc->cscIdHelper().channel_context(); @@ -578,7 +561,7 @@ namespace MuonCalib { if(true)//stripHash < 50 || stripHash%1000 == 0) { - mLog << MSG::INFO << "Analyzing strip with hash " << stripHash << " out of " << m_maxStripHash << endmsg; + ATH_MSG_INFO("Analyzing strip with hash " << stripHash << " out of " << m_maxStripHash); } //**Now tackle slope calculation @@ -637,35 +620,29 @@ namespace MuonCalib { calGraph->GetYaxis()->SetTitle("ADC counts"); calGraph->GetXaxis()->SetTitle("Attenuation (-db)"); - // - mLog << MSG::DEBUG << " Generating " << title << endmsg; + ATH_MSG_DEBUG(" Generating " << title); bool isGoodStrip = false; //Loop over all attenuation levels, filling the calGraph with the amplitudes //for this strip - //m_ampProfs checked before since already dereferenced earlier - //if(!m_ampProfs){ - // mLog << MSG::FATAL << "m_ampProfs empty!" << endmsg; - // return StatusCode::FAILURE; - //} - mLog << MSG::DEBUG << "Number of ampProfs " << m_ampProfs->size() << endmsg; + ATH_MSG_DEBUG("Number of ampProfs " << m_ampProfs->size()); int calPointItr = 0; std::map<int, TProfile*>::const_iterator ampProfItr = m_ampProfs->begin(); std::map<int, TProfile*>::const_iterator ampProfEnd = m_ampProfs->end(); for(; ampProfItr != ampProfEnd; ampProfItr++) { if(!ampProfItr->second){ - mLog << MSG::FATAL << "Failed at accessing ampProf!" << endmsg; + ATH_MSG_FATAL("Failed at accessing ampProf!"); return StatusCode::FAILURE; } - mLog << MSG::DEBUG << "\tLooking for data for pulser level " - << ampProfItr->first << endmsg; + ATH_MSG_DEBUG("\tLooking for data for pulser level " + << ampProfItr->first); if(ampProfItr->second->GetBinEntries(stripHash+1)) { - mLog << MSG::VERBOSE << "\nHave data for strip " << stripHash<< endmsg; + ATH_MSG_VERBOSE("\nHave data for strip " << stripHash); isGoodStrip = true; @@ -674,7 +651,7 @@ namespace MuonCalib { float adcError = ampProfItr->second->GetBinError(stripHash+1); if(m_doCrossTalkFix) { - mLog <<MSG::VERBOSE << "\tCrosstalk fix " << m_crossTalkFix[crossTalkCnt] << endmsg; + ATH_MSG_VERBOSE("\tCrosstalk fix " << m_crossTalkFix[crossTalkCnt]); adcValue /= m_crossTalkFix[crossTalkCnt]; adcError /= m_crossTalkFix[crossTalkCnt]; } @@ -690,18 +667,18 @@ namespace MuonCalib { else attenValue = db; - mLog << MSG::DEBUG << "\tStoring at db of " << db << " with attenValue " << attenValue << " from pulser level of " << pulserLevel << " and adcValue " << adcValue << endmsg; + ATH_MSG_DEBUG("\tStoring at db of " << db << " with attenValue " << attenValue << " from pulser level of " << pulserLevel << " and adcValue " << adcValue); //See if the last two drops were far down enough if(!foundMin){ thisDrop = lastVal - adcValue; - mLog << MSG::DEBUG << "\tFinding fit min:" + ATH_MSG_DEBUG("\tFinding fit min:" << "\tlastVal = " << lastVal - << ";lastDrop " << lastDrop << "; thisDrop " << thisDrop << endmsg; + << ";lastDrop " << lastDrop << "; thisDrop " << thisDrop); if(thisDrop > m_minDeltaAdc && lastDrop > m_minDeltaAdc){ - mLog << MSG::DEBUG << "Found fitMin!" << endmsg; + ATH_MSG_DEBUG("Found fitMin!"); foundMin = true; fitMinX = attenValue; } @@ -724,14 +701,14 @@ namespace MuonCalib { }//Done ampProfItr loop if(!foundMin && isGoodStrip){ - mLog << MSG::WARNING << "Failed to find minium for " << title << endmsg; + ATH_MSG_WARNING("Failed to find minium for " << title); } //***Do a simple fit to calGraph*** //Here we only fit the linear part of the plot. m_fitCutoff can be set by user. if(isGoodStrip) { - mLog << MSG::INFO << "we have a good stripHash at " << stripHash << endmsg; + ATH_MSG_INFO("we have a good stripHash at " << stripHash); m_pulsedChambers->insert(chamHash); //Programer note: Only gets filled on x-axis. Probably OK. @@ -769,18 +746,18 @@ namespace MuonCalib { float invertedSlope; if(std::abs(slope) < 0.00001 || slope == -999) //watch out for slope==0 { - mLog << MSG::WARNING << "Slope invalid " << endmsg; + ATH_MSG_WARNING("Slope invalid "); continue; } invertedSlope = 1/slope; - mLog << MSG::ERROR << "Inserting calgraph in for hash " << stripHash << endmsg; + ATH_MSG_ERROR("Inserting calgraph in for hash " << stripHash); (*m_calGraphs)[stripHash] = calGraph; - mLog << MSG::DEBUG << "StripHash: " << stripHash << "; slope: " <<slope + ATH_MSG_DEBUG("StripHash: " << stripHash << "; slope: " <<slope << "; intercept: " << intercept - << "; chi^2/ndf: " << chiSquared << "/" << ndf << endmsg; + << "; chi^2/ndf: " << chiSquared << "/" << ndf); CscCalibResult * slopeResult = new CscCalibResult(stripHash,invertedSlope,slopeError,chiSquared,ndf); CscCalibResult * interceptResult = new CscCalibResult(stripHash, intercept, interceptError, chiSquared, ndf); @@ -795,40 +772,38 @@ namespace MuonCalib { crossTalkCnt = 0; else crossTalkCnt++; - mLog << MSG::DEBUG << "Looping over next strip..." << endmsg; + ATH_MSG_DEBUG("Looping over next strip..."); }//end loop over strips - mLog << MSG::INFO << "Completed calculating parameters for each strip" << endmsg; + ATH_MSG_INFO("Completed calculating parameters for each strip"); return StatusCode::SUCCESS; }//End calculateParameters() //writeCalibrationFile() dumps the parameters to disk StatusCode CscCalcSlope::writeCalibrationFile() { - MsgStream mLog( msgSvc(), name() ); Chrono chrono(m_chronoSvc,"writeCalibrationFile"); if(m_calOutputVersion == "00-00"){ - mLog << MSG::INFO << "Printing output file version 00-00" << endmsg; + ATH_MSG_INFO("Printing output file version 00-00"); return calOutput0(); } else if(m_calOutputVersion == "03-00") { - mLog << MSG::INFO << "Printing output file version 03-00" << endmsg; + ATH_MSG_INFO("Printing output file version 03-00"); return calOutput3(); } else{ - mLog << "Don't know how to write calibration file version " << m_calOutputVersion << endmsg; + ATH_MSG_INFO("Don't know how to write calibration file version " << m_calOutputVersion); return StatusCode::RECOVERABLE; } } StatusCode CscCalcSlope::calOutput0(){ - MsgStream mLog( msgSvc(), name() ); //***Take conditions data held in summary histograms and print to the calibration file***// - mLog << MSG::INFO << "Parameters calculated, preparing to outputing to file: " << m_outputFileName << endmsg; + ATH_MSG_INFO("Parameters calculated, preparing to outputing to file: " << m_outputFileName); std::ofstream out; out.open(m_outputFileName.c_str()); if(!out.is_open()) { - mLog << MSG::FATAL << "Can't open file " << m_outputFileName.c_str() << "for writing" << endmsg; + ATH_MSG_FATAL("Can't open file " << m_outputFileName.c_str() << "for writing"); return StatusCode::FAILURE; } //Start by writing file version number (mainly for COOL program to read) @@ -840,7 +815,7 @@ namespace MuonCalib { if(m_findPeakTime) out << "peakt "; out << "END_HEADER\n"; //Now we loop over each strip's parameters and print them out - mLog << MSG::DEBUG << "Begining loop over all " << m_maxStripHash << " hash ids." << endmsg; + ATH_MSG_DEBUG("Begining loop over all " << m_maxStripHash << " hash ids."); //form is: //hashID chamber LayerOrientationStrip parametervalue parametervalue @@ -857,7 +832,7 @@ namespace MuonCalib { { if(m_findPeakTime && (peaktItr == peaktEnd) ) { - mLog << MSG::FATAL << "Peaktimes out of sync with slopes. Quiting write." << endmsg; + ATH_MSG_FATAL("Peaktimes out of sync with slopes. Quiting write."); return StatusCode::FAILURE; } @@ -875,8 +850,8 @@ namespace MuonCalib { Identifier chamberId = m_idHelperSvc->cscIdHelper().elementID(id); if(!m_idHelperSvc->cscIdHelper().valid(chamberId)) { - mLog << MSG::FATAL << chamberId.getString() << " is not a valid id!" << endmsg; - mLog << MSG::FATAL << "identifier is: " << m_idHelperSvc->cscIdHelper().show_to_string(chamberId) << endmsg; + ATH_MSG_FATAL(chamberId.getString() << " is not a valid id!"); + ATH_MSG_FATAL("identifier is: " << m_idHelperSvc->cscIdHelper().show_to_string(chamberId)); return StatusCode::FAILURE; } @@ -899,16 +874,14 @@ namespace MuonCalib { StatusCode CscCalcSlope::storeGateRecord() { - MsgStream mLog( msgSvc(), name() ); - mLog << MSG::INFO << "Recording csc calibration report." << endmsg; + ATH_MSG_INFO("Recording csc calibration report."); StatusCode sc = StatusCode::SUCCESS; bool thereIsAnError = false; std::string histKey = "cscSlopeCalibReport"; - mLog <<MSG::DEBUG << "Recording calibration graphs to TDS with key " - << histKey << endmsg; + ATH_MSG_DEBUG("Recording calibration graphs to TDS with key " << histKey); CscCalibReportSlope * report = new CscCalibReportSlope("calGraphs"); @@ -924,7 +897,7 @@ namespace MuonCalib { sc = m_storeGate->record(repCont, histKey); if(sc.isFailure()) { - mLog << MSG::ERROR << "Failed to record CscCalibReportSlope to storegate" << endmsg; + ATH_MSG_ERROR("Failed to record CscCalibReportSlope to storegate"); thereIsAnError = true; //Since storegate isn't taking ownership, we'll delete it: delete repCont; @@ -939,7 +912,7 @@ namespace MuonCalib { sc = m_storeGate->record(calibResults,"CscCalibResultSlope"); if(sc.isFailure()) { - mLog << MSG::ERROR << "Failed to record results to storegate" << endmsg; + ATH_MSG_ERROR("Failed to record results to storegate"); thereIsAnError = true; //Since storegate isn't taking ownership, we'll delete it delete calibResults; @@ -954,13 +927,11 @@ namespace MuonCalib { StatusCode CscCalcSlope::calOutput3() { - MsgStream mLog( msgSvc(), name() ); - std::ofstream out; out.open(m_outputFileName.c_str()); if(!out.is_open()) { - mLog << MSG::ERROR << "Can't open file " << m_outputFileName.c_str() << endmsg; + ATH_MSG_ERROR("Can't open file " << m_outputFileName.c_str()); return StatusCode::RECOVERABLE; } out << "03-00 <END_HEADER>"; @@ -969,16 +940,14 @@ namespace MuonCalib { out << "\n<END_FILE>"; out.close(); - mLog << MSG::INFO << "Successfully opened file " << m_outputFileName << endmsg; + ATH_MSG_INFO("Successfully opened file " << m_outputFileName); return StatusCode::SUCCESS; } void CscCalcSlope::outputParameter3(const CscCalibResultCollection & results, std::ofstream & out){ - MsgStream mLog( msgSvc(), name() ); - - mLog << MSG::INFO << "Printing out parameter " << results.parName() << endmsg; + ATH_MSG_INFO("Printing out parameter " << results.parName()); SG::ReadCondHandle<CscCondDbData> readHandle{m_readKey}; const CscCondDbData* readCdo{*readHandle}; diff --git a/MuonSpectrometer/MuonCalib/CscCalib/CscCalibAlgs/src/CscCalcSlope.h b/MuonSpectrometer/MuonCalib/CscCalib/CscCalibAlgs/src/CscCalcSlope.h index 0183e48e309928bc2b5a454ad535d52949e510fa..87dd1997c8c419c37efdd033aba5f1473dd84a4c 100644 --- a/MuonSpectrometer/MuonCalib/CscCalib/CscCalibAlgs/src/CscCalcSlope.h +++ b/MuonSpectrometer/MuonCalib/CscCalib/CscCalibAlgs/src/CscCalcSlope.h @@ -29,16 +29,11 @@ so that he can determine the validity of the constants #include <map> #include <set> -#include "TH1.h" - - +class TH1I; class TProfile; class CscICoolStrSvc; class ICscCalibTool; -class cscIdHelper; -class CscCalibResultCollection; class TGraphErrors; -class CscCondDbData; namespace MuonCalib{ /** diff --git a/MuonSpectrometer/MuonCalib/CscCalib/CscCalibEvent/CscCalibEvent/CscCalibDataContainer.h b/MuonSpectrometer/MuonCalib/CscCalib/CscCalibEvent/CscCalibEvent/CscCalibDataContainer.h index 34a147eb7fb16f6dbf70cad9c1bb0d42665bfb76..4c8d84fd9f62d52bf0c985497a11c60780b16e1c 100755 --- a/MuonSpectrometer/MuonCalib/CscCalib/CscCalibEvent/CscCalibEvent/CscCalibDataContainer.h +++ b/MuonSpectrometer/MuonCalib/CscCalib/CscCalibEvent/CscCalibEvent/CscCalibDataContainer.h @@ -28,7 +28,7 @@ class CscCalibDataContainer : public IdentifiableContainer<CscCalibDataCollectio CscCalibDataContainer(int maxHash) ; /** destructor */ - virtual ~CscCalibDataContainer() ; + virtual ~CscCalibDataContainer()=default; /** type definitions */ typedef CscCalibDataCollection::size_type size_type ; diff --git a/MuonSpectrometer/MuonCalib/CscCalib/CscCalibEvent/src/CscCalibDataContainer.cxx b/MuonSpectrometer/MuonCalib/CscCalib/CscCalibEvent/src/CscCalibDataContainer.cxx index f400b767d248bdc0427a3db9f6c6ad2115631f2d..3f29a3a630f38e1984251f92814f21bf6fa54338 100755 --- a/MuonSpectrometer/MuonCalib/CscCalib/CscCalibEvent/src/CscCalibDataContainer.cxx +++ b/MuonSpectrometer/MuonCalib/CscCalib/CscCalibEvent/src/CscCalibDataContainer.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ #include "CscCalibEvent/CscCalibDataContainer.h" @@ -7,30 +7,12 @@ #include <map> #include <cassert> #include <iostream> - -using std::ostream; - -/******************************************** - Implementation of CscCalibDataContainer - Author: Ketevi A. Assamagan -*********************************************/ +#include <TString.h> // for Form CscCalibDataContainer::CscCalibDataContainer(int maxhash) : IdentifiableContainer<CscCalibDataCollection>(maxhash) { - //m_hashFunc.setHelper(helper); - //DataLinkVector<CscCalibDataCollection>::init(m_hashFunc.max(), offset); -} - -/** Destructor */ -CscCalibDataContainer::~CscCalibDataContainer() { } -/** for the default constructor without parameters */ -// void CscCalibDataContainer::setHashFunc (const CscIdHelper* helper, int offset) { -// m_hashFunc.setHelper(helper); -// DataLinkVector<CscCalibDataCollection>::init(m_hashFunc.max(), offset); -// } - /** return the class ID */ const CLID& CscCalibDataContainer::classID() { return ClassID_traits<CscCalibDataContainer>::ID(); @@ -43,20 +25,14 @@ void CscCalibDataContainer::push_back(CscCalibData* calibData) { IdentifierHash channelHash = calibData->idHash(); // I don't think there's any need for this any more. EJWM // Not sure if the "Identifier existing" check is important though -// const CscIdHelper * cscHelper = m_hashFunc.cscIdHelper(); -// IdContext context = cscHelper->channel_context(); -// Identifier channelId; -// if (!cscHelper->get_id(channelHash,channelId,&context)) { -// Identifier elemId = cscHelper->elementID(channelHash); MyBase::const_iterator it = MyBase::indexFind(channelHash); if(it!=MyBase::end()) { const CscCalibDataCollection* const_coll = (*it) ; CscCalibDataCollection * coll = const_cast<CscCalibDataCollection*>(const_coll); coll->push_back(calibData); - } else - std::cout <<"CscCalibDataContainer::ERROR : Collection does not exist "<<std::endl; -// } else std::cout << "CscCalibDataContainer::ERROR : could find Idenitfier for this element " -// << channelHash << std::endl; + } else { + throw std::runtime_error(Form("File: %s, Line: %d\nCscCalibDataContainer::push_back() - ERROR: Collection does not exist", __FILE__, __LINE__)); + } return ; } @@ -73,7 +49,7 @@ CscCalibDataContainer::size_type CscCalibDataContainer::calibData_size() const { /** Output stream - for printing */ -ostream& operator<<(ostream& lhs, const CscCalibDataContainer& rhs) { +std::ostream& operator<<(std::ostream& lhs, const CscCalibDataContainer& rhs) { lhs << "CscDataCollectionContainer has " << rhs.calibData_size() << " CalibData:" << std::endl; typedef SelectAllObject<CscCalibDataContainer> SELECTOR; SELECTOR sel(&rhs); @@ -91,4 +67,3 @@ ostream& operator<<(ostream& lhs, const CscCalibDataContainer& rhs) { return lhs; } - diff --git a/MuonSpectrometer/MuonCalib/CscCalib/CscCalibTools/src/CscCalibTool.cxx b/MuonSpectrometer/MuonCalib/CscCalib/CscCalibTools/src/CscCalibTool.cxx index 05d807d6608a1f6d465dcd0f466a164afa3270c8..95de963a1a9e261809754ae4f94e5409a7a7d31a 100644 --- a/MuonSpectrometer/MuonCalib/CscCalib/CscCalibTools/src/CscCalibTool.cxx +++ b/MuonSpectrometer/MuonCalib/CscCalib/CscCalibTools/src/CscCalibTool.cxx @@ -4,13 +4,10 @@ #include "CscCalibTool.h" #include "StoreGate/DataHandle.h" -#include <sstream> +#include <sstream> #include <cmath> -using std::ostringstream; -using std::setw; - CscCalibTool::CscCalibTool ( const std::string& t, const std::string& n, const IInterface* p ) : base_class(t,n,p) @@ -620,7 +617,7 @@ double CscCalibTool::getZ0() const{ double CscCalibTool::signal( const double z ) const{ double amplitude = (1.0 - z / (1 + m_integrationNumber2)) * std::pow(z, 1.0 * m_integrationNumber) - * exp(-z); + * std::exp(-z); return amplitude; } diff --git a/MuonSpectrometer/MuonCalib/MdtCalib/MdtCalibData/src/MdtSlewCorFuncHardcoded.cxx b/MuonSpectrometer/MuonCalib/MdtCalib/MdtCalibData/src/MdtSlewCorFuncHardcoded.cxx index 5cdeffbe1178cdc806391cffea0827d7a614ce3b..2674b914c311723b9046c01696d1b44ee1e513cd 100644 --- a/MuonSpectrometer/MuonCalib/MdtCalib/MdtCalibData/src/MdtSlewCorFuncHardcoded.cxx +++ b/MuonSpectrometer/MuonCalib/MdtCalib/MdtCalibData/src/MdtSlewCorFuncHardcoded.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ #include "MdtCalibData/MdtSlewCorFuncHardcoded.h" @@ -22,9 +22,7 @@ double MdtSlewCorFuncHardcoded::correction(double /*t*/, double adc) const { } if (new_val<0.1) break; } -// std::cout<<"MdtSlewCorFuncHardcoded: Created LUT with "<<m_LUT.size()<<" entries"<<std::endl; } -// std::cout<<"XXxxXX"<< m_LUT.lower_bound(static_cast<short>(adc))->second - 109./calibrated_p(adc)<<std::endl; return m_LUT.lower_bound(static_cast<short>(adc))->second; } diff --git a/MuonSpectrometer/MuonCalib/MdtCalib/MdtCalibData/src/RtResolutionChebyshev.cxx b/MuonSpectrometer/MuonCalib/MdtCalib/MdtCalibData/src/RtResolutionChebyshev.cxx index f999dba4df3e6107e6814d2a0f4a0e8c7c1ab302..4da0d1769e8658b73e4b5169d120d2e35f53477f 100644 --- a/MuonSpectrometer/MuonCalib/MdtCalib/MdtCalibData/src/RtResolutionChebyshev.cxx +++ b/MuonSpectrometer/MuonCalib/MdtCalib/MdtCalibData/src/RtResolutionChebyshev.cxx @@ -44,16 +44,6 @@ std::string RtResolutionChebyshev::name(void) const { /////////////////// double RtResolutionChebyshev::resolution(double t, double /*bgRate*/) const { -//////////////////////////// -// IGNORE BACKGROUND RATE // -//////////////////////////// -/* if (bgRate>0) { - cerr << "\n" - << "Class RtResolutionChebyshev, method resolution: " - << "WARNING!\n" - << "Given background rate is ignored.\n"; - }*/ - //////////////////////// // INITIAL TIME CHECK // //////////////////////// diff --git a/MuonSpectrometer/MuonCalib/MdtCalib/MdtCalibFitters/src/MuCCaFitter.cxx b/MuonSpectrometer/MuonCalib/MdtCalib/MdtCalibFitters/src/MuCCaFitter.cxx index a1b82acf610fa2107b0b204597cfbabd5af45c29..b875c6d3da8055e9efa1e6d56d55ddf21ceeb142 100644 --- a/MuonSpectrometer/MuonCalib/MdtCalib/MdtCalibFitters/src/MuCCaFitter.cxx +++ b/MuonSpectrometer/MuonCalib/MdtCalib/MdtCalibFitters/src/MuCCaFitter.cxx @@ -3,6 +3,9 @@ */ #include "MdtCalibFitters/MuCCaFitter.h" +#include "GaudiKernel/MsgStream.h" +#include "AthenaKernel/getMessageSvc.h" +#include <cmath> namespace MuonCalib { @@ -12,20 +15,16 @@ void MuCCaFitter::printLevel(int level) { bool MuCCaFitter::fit( MuonCalibSegment& seg ) const { - // select all hits HitSelection selection(seg.mdtHitsOnTrack(),0); - // call fit function return fit(seg,selection); } - bool MuCCaFitter::fit( MuonCalibSegment& seg, HitSelection selection ) const { - // bool m_debug = false; - if(m_debug) std::cout << "New seg: " << std::endl; //<< seg; - + MsgStream log(Athena::getMessageSvc(),"MuCCaFitter"); + if (log.level()<=MSG::DEBUG) log<<MSG::DEBUG<<"fit() New seg:"<<endmsg; int N = seg.mdtHitsOnTrack(); @@ -42,7 +41,7 @@ bool MuCCaFitter::fit( MuonCalibSegment& seg, HitSelection selection ) const if(selection[i] == 0) ++used; } if(used < 2){ - std::cout << "TO FEW HITS SELECTED" << std::endl; + log<<MSG::WARNING<<"fit() TO FEW HITS SELECTED"<<endmsg; return false; } } @@ -78,9 +77,7 @@ bool MuCCaFitter::fit( MuonCalibSegment& seg, HitSelection selection ) const w[ii] = 0.; sr[ii]=0.; } - if(m_debug) - std::cout << "MuCCaFitter: (" << x[ii] << "," << y[ii] << ") R = " << r[ii] - << " W " << w[ii] << std::endl; + if (log.level()<=MSG::DEBUG) log<<MSG::DEBUG<<"fit() MuCCaFitter: (" << x[ii] << "," << y[ii] << ") R = " << r[ii] << " W " << w[ii]<<endmsg; rw[ii] = r[ii]*w[ii]; if(selection[jj]){ ++hit;++jj; @@ -96,22 +93,20 @@ bool MuCCaFitter::fit( MuonCalibSegment& seg, HitSelection selection ) const Yc = Sy/S; MuCCaFitterImplementation *Fitter=new MuCCaFitterImplementation(); - if(m_debug){ + if(log.level()<=MSG::DEBUG){ for (int i = 0; i != ii; i++) { - std::cout<<" MuCCaFitter hits passed to computepam Z=" - <<x[i]<<" phi="<<y[i]<<" zzz="<<z[i]<<" drift="<<r[i]<<" error="<<w[i]<<std::endl; + log<<MSG::DEBUG<<"fit() MuCCaFitter hits passed to computepam Z=" << x[i]<<" phi="<<y[i]<<" zzz="<<z[i]<<" drift="<<r[i]<<" error="<<w[i]<<endmsg; } } Fitter->Computeparam3(ii,z,y,r,sr); - if(m_debug){ - std::cout<<" MuCCaFitter computed track a= "<<Fitter->get_a() - <<" da= "<<Fitter->get_da() - <<" b= "<<Fitter->get_b() - <<" db= "<<Fitter->get_db() - <<" corrab= "<<Fitter->get_corrab() - <<" chi2f= "<<Fitter->get_chi2f() - <<std::endl; + if(log.level()<=MSG::DEBUG){ + log<<MSG::DEBUG<<"fit() MuCCaFitter computed track a=" <<Fitter->get_a() + <<" da= "<<Fitter->get_da() + <<" b= "<<Fitter->get_b() + <<" db= "<<Fitter->get_db() + <<" corrab= "<<Fitter->get_corrab() + <<" chi2f= "<<Fitter->get_chi2f()<<endmsg; } double afit=Fitter->get_a(); @@ -120,14 +115,14 @@ bool MuCCaFitter::fit( MuonCalibSegment& seg, HitSelection selection ) const std::vector<double> dist(N); std::vector<double> ddist(N); double R,dis; - double theta = atan(afit); + double theta = std::atan(afit); if(theta<0.) theta= M_PI+theta; double sinus = std::sin(theta); double cosin = std::cos(theta); double d = -( getZ( pos )-Zc)*sinus+( getY( pos )-Yc)*cosin; - if(m_debug){ - std::cout << "MuCCaFitter>>> theta= " << theta << " sinus= " << sinus << " cosin= " << cosin << std::endl; - std::cout << "MuCCaFitter>>> getZ( pos )= " << getZ( pos ) << " getY( pos )= " << getY( pos ) << " Zc= " << Zc << " Yc= " << Yc<< std::endl; + if(log.level()<=MSG::DEBUG){ + log<<MSG::DEBUG<<"fit() MuCCaFitter>>> theta= " << theta << " sinus= " << sinus << " cosin= " << cosin<<endmsg; + log<<MSG::DEBUG<<"fit() MuCCaFitter>>> getZ( pos )= " << getZ( pos ) << " getY( pos )= " << getY( pos ) << " Zc= " << Zc << " Yc= " << Yc<<endmsg; } double Szz(0),Syy(0),Szy(0),Syyzz(0),Att(0); R=0; @@ -146,20 +141,18 @@ bool MuCCaFitter::fit( MuonCalibSegment& seg, HitSelection selection ) const } Att = Syy + cosin*(2*sinus*Szy - cosin*Syyzz); d = R/S; - if(m_debug) - std::cout << "MuCCaFitter>>> d= " << d << " R= " - << R << " S= " << S << " Att= " << Att << std::endl; + if(log.level()<=MSG::DEBUG) log<<MSG::DEBUG<<"fit() MuCCaFitter>>> d= " << d << " R= " << R << " S= " << S << " Att= " << Att<<endmsg; for(int i=0;i<N;++i){ if(selection[i]) continue; dist[i] = cosin*(y[i]-Yc) - sinus*(z[i]-Zc) - d; double dth = -(sinus*(y[i]-Yc) + cosin*(z[i]-Zc))*(std::sqrt(1./Att)); ddist[i] = std::sqrt( dth*dth + (1./S) ); } - if(m_debug) std::cout << "Transforming back to real world" << std::endl; + if(log.level()<=MSG::DEBUG) log<<MSG::DEBUG<<"fit() Transforming back to real world"<<endmsg; Amg::Vector3D ndir = getVec( 0., sinus, cosin ); Amg::Vector3D npos = getVec( 0., Yc + cosin*d, Zc - sinus*d ); - if(m_debug) std::cout << "New line: position " << npos << " direction " << ndir << " chi2f " << chi2f << std::endl; + if(log.level()<=MSG::DEBUG) log<<MSG::DEBUG<<"fit() New line: position " << npos << " direction " << ndir << " chi2f " << chi2f<<endmsg; seg.set( chi2f/(N-2), npos, ndir ); @@ -174,7 +167,7 @@ bool MuCCaFitter::fit( MuonCalibSegment& seg, HitSelection selection ) const } delete Fitter; - if(m_debug) std::cout << "fit done" << std::endl; + if(log.level()<=MSG::DEBUG) log<<MSG::DEBUG<<"fit() fit done"<<endmsg; return true; } void MuCCaFitterImplementation::Computeparam3(int number_of_hits,std::vector<double> x,std::vector<double> y,std::vector<double> r,std::vector<double> sr) @@ -342,23 +335,23 @@ void MuCCaFitterImplementation::Computelinparnew(double x1, double y1, double r1 int f=1; phi = averagephi+f*dphiex; - if(phi < 0){phi = 6.2831853+(phi);} - angularcoefficient[0] = tan(phi); + if(phi < 0){phi = 2*M_PI+(phi);} + angularcoefficient[0] = std::tan(phi); f=-1; phi = averagephi+f*dphiex; - if(phi < 0){phi = 6.2831853+(phi);} - angularcoefficient[1] = tan(phi); + if(phi < 0){phi = 2*M_PI+(phi);} + angularcoefficient[1] = std::tan(phi); f=1; phi = averagephi+f*dphiin; - if(phi < 0){phi = 6.2831853+(phi);} - angularcoefficient[2] = tan(phi); + if(phi < 0){phi = 2*M_PI+(phi);} + angularcoefficient[2] = std::tan(phi); f=-1; phi = averagephi+f*dphiin; - if(phi < 0){phi = 6.2831853+(phi);} - angularcoefficient[3] = tan(phi); + if(phi < 0){phi = 2*M_PI+(phi);} + angularcoefficient[3] = std::tan(phi); /* Compute b parameters */ for(i=0;i<4;i++){ @@ -416,14 +409,10 @@ void MuCCaFitterImplementation::Computelin(double x1, double y1, double r1, doub double delta; double averagephi,dist,dphiin,dphiex; double bpar[4],phi; - // double distfp[4]; double bfparn[2]; bfparn[0]=0; bfparn[1]=0; double bcand[2][4]; - // int segnobf[4],segnobfn[2]; - // double sol[4]; int segnob[]={1,-1,1,-1}; - // int segnoc[2][4],ncandid[4],ncand; int ncandid[4],ncand; int i,firsttime; double angularcoefficient[4]; @@ -444,23 +433,23 @@ void MuCCaFitterImplementation::Computelin(double x1, double y1, double r1, doub int f=1; phi = averagephi+f*dphiex; - if(phi < 0){phi = 6.2831853+(phi);} - angularcoefficient[0] = tan(phi); + if(phi < 0){phi = 2*M_PI+(phi);} + angularcoefficient[0] = std::tan(phi); f=-1; phi = averagephi+f*dphiex; - if(phi < 0){phi = 6.2831853+(phi);} - angularcoefficient[1] = tan(phi); + if(phi < 0){phi = 2*M_PI+(phi);} + angularcoefficient[1] = std::tan(phi); f=1; phi = averagephi+f*dphiin; - if(phi < 0){phi = 6.2831853+(phi);} - angularcoefficient[2] = tan(phi); + if(phi < 0){phi = 2*M_PI+(phi);} + angularcoefficient[2] = std::tan(phi); f=-1; phi = averagephi+f*dphiin; - if(phi < 0){phi = 6.2831853+(phi);} - angularcoefficient[3] = tan(phi); + if(phi < 0){phi = 2*M_PI+(phi);} + angularcoefficient[3] = std::tan(phi); /* Compute b parameters */ for(i=0;i<4;i++){ diff --git a/MuonSpectrometer/MuonCalib/MdtCalib/MdtCalibInterfaces/CMakeLists.txt b/MuonSpectrometer/MuonCalib/MdtCalib/MdtCalibInterfaces/CMakeLists.txt index c2024790591c80234b5e903bafb28da53704fad3..9a74e600e76e6419ca342fda1488646a4fcb3642 100644 --- a/MuonSpectrometer/MuonCalib/MdtCalib/MdtCalibInterfaces/CMakeLists.txt +++ b/MuonSpectrometer/MuonCalib/MdtCalib/MdtCalibInterfaces/CMakeLists.txt @@ -10,6 +10,11 @@ atlas_depends_on_subdirs( PUBLIC Control/AthenaKernel GaudiKernel ) +atlas_add_library( MdtCalibInterfacesLib + src/*.cxx + PUBLIC_HEADERS MdtCalibInterfaces + LINK_LIBRARIES AthenaKernel GaudiKernel ) + # Install files from the package: atlas_install_headers( MdtCalibInterfaces ) diff --git a/MuonSpectrometer/MuonCalib/MdtCalib/MdtCalibRt/src/RtCalibrationIntegration.cxx b/MuonSpectrometer/MuonCalib/MdtCalib/MdtCalibRt/src/RtCalibrationIntegration.cxx index 5036eccfe74cf0b3beff819e355c6b5febecf027..fb9243ce14be8f524126b0ad379b3ff4c0d0f67f 100644 --- a/MuonSpectrometer/MuonCalib/MdtCalib/MdtCalibRt/src/RtCalibrationIntegration.cxx +++ b/MuonSpectrometer/MuonCalib/MdtCalib/MdtCalibRt/src/RtCalibrationIntegration.cxx @@ -37,7 +37,7 @@ inline Double_t slope_function_C(Double_t *x, Double_t *par) { &b(par[1]), &t_0(par[2]), &back(par[3]); - return back + exp(a+b*(t-t_0)); + return back + std::exp(a+b*(t-t_0)); } inline void update_parameter_on_mttmax(TH1 * h, TF1 *f, const float &b, const float & T, const T0MTSettingsTMax &tmax_settings) { diff --git a/MuonSpectrometer/MuonCalib/MdtCalib/MdtCalibSvc/CMakeLists.txt b/MuonSpectrometer/MuonCalib/MdtCalib/MdtCalibSvc/CMakeLists.txt index 104d00eb1c7308adbf8d6e4aca70b0d9337858c4..4d4c2afd3c98c6362947362658088a0881a4fadb 100644 --- a/MuonSpectrometer/MuonCalib/MdtCalib/MdtCalibSvc/CMakeLists.txt +++ b/MuonSpectrometer/MuonCalib/MdtCalib/MdtCalibSvc/CMakeLists.txt @@ -5,43 +5,14 @@ # Declare the package name: atlas_subdir( MdtCalibSvc ) -# Declare the package's dependencies: -atlas_depends_on_subdirs( PUBLIC - Control/AthenaBaseComps - Control/AthenaKernel - DetectorDescription/GeoPrimitives - DetectorDescription/Identifier - GaudiKernel - MuonSpectrometer/MuonCablings/MuonMDT_Cabling - MuonSpectrometer/MuonCablings/MuonCablingData - MuonSpectrometer/MuonCalib/MdtCalib/MdtCalibData - MuonSpectrometer/MuonCalib/MuonCalibIdentifier - MuonSpectrometer/MuonReconstruction/MuonRecEvent/MuonPrepRawData - PRIVATE - Control/StoreGate - MuonSpectrometer/MuonCalib/MdtCalib/MdtCalibInterfaces - MuonSpectrometer/MuonCalib/MuonCalibEvent - MuonSpectrometer/MuonDetDescr/MuonReadoutGeometry - MuonSpectrometer/MuonIdHelpers - Tools/PathResolver - MagneticField/MagFieldElements - MagneticField/MagFieldConditions - ) - -# External dependencies: -find_package( Eigen ) - # Component(s) in the package: atlas_add_library( MdtCalibSvcLib src/*.cxx PUBLIC_HEADERS MdtCalibSvc - INCLUDE_DIRS ${EIGEN_INCLUDE_DIRS} - LINK_LIBRARIES ${EIGEN_LIBRARIES} AthenaBaseComps AthenaKernel GeoPrimitives Identifier GaudiKernel MuonMDT_CablingLib MdtCalibData MuonCalibIdentifier MuonPrepRawData StoreGateLib SGtests MuonIdHelpersLib PathResolver MagFieldElements MagFieldConditions - PRIVATE_LINK_LIBRARIES MuonCalibEvent MuonReadoutGeometry ) + LINK_LIBRARIES AthenaBaseComps AthenaKernel MuonReadoutGeometry Identifier GaudiKernel MuonMDT_CablingLib MdtCalibData MuonCalibIdentifier MuonPrepRawData StoreGateLib SGtests MuonIdHelpersLib PathResolver MagFieldElements MagFieldConditions MuonCablingData MdtCalibInterfacesLib MuonCalibEvent ) atlas_add_component( MdtCalibSvc src/components/*.cxx - INCLUDE_DIRS ${EIGEN_INCLUDE_DIRS} LINK_LIBRARIES MdtCalibSvcLib ) # Install files from the package: diff --git a/MuonSpectrometer/MuonCalib/MdtCalib/MdtCalibSvc/MdtCalibSvc/MdtCalibrationTool.h b/MuonSpectrometer/MuonCalib/MdtCalib/MdtCalibSvc/MdtCalibSvc/MdtCalibrationTool.h index 9e8ce18a72d56ce0164ed6dc5ffc2fbbeebaeb54..36f833116d2376fccb3864c4033e8e18e1b4e193 100644 --- a/MuonSpectrometer/MuonCalib/MdtCalib/MdtCalibSvc/MdtCalibSvc/MdtCalibrationTool.h +++ b/MuonSpectrometer/MuonCalib/MdtCalib/MdtCalibSvc/MdtCalibSvc/MdtCalibrationTool.h @@ -1,25 +1,26 @@ /* - Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ #ifndef MDTCALIBSVC_MDTCALIBRATIONTOOL_H #define MDTCALIBSVC_MDTCALIBRATIONTOOL_H -#include "AthenaBaseComps/AthService.h" +#include "AthenaBaseComps/AthAlgTool.h" +#include "GaudiKernel/ServiceHandle.h" +#include "GaudiKernel/ToolHandle.h" + #include "GaudiKernel/IInterface.h" -#include "GaudiKernel/EventContext.h" -#include "Identifier/Identifier.h" +#include "MuonIdHelpers/IMuonIdHelperSvc.h" #include "MuonPrepRawData/MdtDriftCircleStatus.h" - -#include "GaudiKernel/AlgTool.h" -#include "AthenaBaseComps/AthAlgTool.h" -// MagField cache #include "MagFieldConditions/AtlasFieldCacheCondObj.h" +#include <string> + class MdtCalibHit; class MdtCalibrationSvcInput; class MdtCalibrationSvcSettings; class MdtCalibrationDbTool; + namespace MuonCalib { class MdtRtRelation; } @@ -122,6 +123,7 @@ private: // must implement this to get the AtlasFieldCache which can then be passed through the call to driftRadiusFromTime // Note: a readhandle must be in a tool or an alg, and so it cannot be in the class Imp.) SG::ReadCondHandleKey<AtlasFieldCacheCondObj> m_fieldCacheCondObjInputKey {this, "AtlasFieldCacheCondObj", "fieldCondObj", "Name of the Magnetic Field conditions object key"}; + ServiceHandle<Muon::IMuonIdHelperSvc> m_idHelperSvc {this, "MuonIdHelperSvc", "Muon::MuonIdHelperSvc/MuonIdHelperSvc"}; }; diff --git a/MuonSpectrometer/MuonCalib/MdtCalib/MdtCalibSvc/src/MdtCalibrationTool.cxx b/MuonSpectrometer/MuonCalib/MdtCalib/MdtCalibSvc/src/MdtCalibrationTool.cxx index bfa5b9e7948c4381ec98d68f4ada38e37b67781b..7a61ab1dd88c5db21bebeb34644b9f891835f5e8 100644 --- a/MuonSpectrometer/MuonCalib/MdtCalib/MdtCalibSvc/src/MdtCalibrationTool.cxx +++ b/MuonSpectrometer/MuonCalib/MdtCalib/MdtCalibSvc/src/MdtCalibrationTool.cxx @@ -2,25 +2,12 @@ Copyright (C) 2020 CERN for the benefit of the ATLAS collaboration */ -#include <fstream> -#include <string> - -#include "GaudiKernel/MsgStream.h" -#include "StoreGate/StoreGateSvc.h" - -// this package -#include "MuonCalibEvent/MdtCalibHit.h" - -#include "MuonIdHelpers/MdtIdHelper.h" -#include "MuonReadoutGeometry/MuonDetectorManager.h" #include "MuonReadoutGeometry/MdtReadoutElement.h" - -// this package -#include "MdtCalibSvc/MdtCalibrationTool.h" +#include "MdtCalibSvc/MdtCalibrationTool.h" // there must be an include issue: if you put this before the MdtReadoutElement, compilation will fail +#include "MuonReadoutGeometry/MuonDetectorManager.h" #include "MdtCalibSvc/MdtCalibrationDbTool.h" #include "MdtCalibSvc/MdtCalibrationSvcInput.h" #include "MdtCalibSvc/MdtCalibrationSvcSettings.h" - #include "MdtCalibData/MdtFullCalibData.h" #include "MdtCalibData/MdtRtRelation.h" #include "MdtCalibData/MdtTubeCalibContainer.h" @@ -34,14 +21,10 @@ #include "MdtCalibData/IRtResolution.h" #include "MdtCalibData/TrRelation.h" #include "MdtCalibData/RtScaleFunction.h" - #include "MdtCalibInterfaces/IShiftMapTools.h" - -#include "GaudiKernel/ServiceHandle.h" -#include "GaudiKernel/ToolHandle.h" #include "GaudiKernel/PhysicalConstants.h" -// MagField cache #include "MagFieldElements/AtlasFieldCache.h" +#include "MuonCalibEvent/MdtCalibHit.h" // // private helper functions @@ -63,19 +46,15 @@ public: const MdtCalibrationSvcSettings &settings, double adcCal, const MuonCalib::MdtCorFuncSet *corrections, - const MuonCalib::IRtRelation *rt ) const; + const MuonCalib::IRtRelation *rt, + MsgStream* msgStr, const MdtIdHelper *idHelp) const; const MuonGM::MuonDetectorManager *m_muonGeoManager; - const MdtIdHelper *m_mdtIdHelper; MdtCalibrationSvcSettings settings; double m_inverseSpeedOfLight; // in ns/mm double m_inversePropagationSpeed; // in ns/mm - MsgStream *m_log; //!< Pointer to MsgStream - MdtCalibrationTool now owns this - bool m_verbose; //!< True if we should print MSG::VERBOSE messages - bool m_debug; //!< True if we should print MSG::DEBUG messages - /* T0 Shift Service -- Per-tube offsets of t0 value */ ServiceHandle<MuonCalib::IShiftMapTools> m_t0ShiftSvc; /* TMax Shift Service -- Per-tube offsets of Tmax */ @@ -94,13 +73,9 @@ public: }; MdtCalibrationTool::Imp::Imp(std::string name) : - m_muonGeoManager(0), - m_mdtIdHelper(0), + m_muonGeoManager(nullptr), m_inverseSpeedOfLight(1./Gaudi::Units::c_light), m_inversePropagationSpeed(m_inverseSpeedOfLight/0.85), - m_log(0), - m_verbose(false), - m_debug(false), m_t0ShiftSvc("MdtCalibrationT0ShiftSvc", name), m_tMaxShiftSvc("MdtCalibrationTMaxShiftSvc", name), m_doT0Shift(false), @@ -147,33 +122,23 @@ StatusCode MdtCalibrationTool::initialize() { m_imp->settings.initialize(); // Read handle for AtlasFieldCacheCondObj - ATH_CHECK( m_fieldCacheCondObjInputKey.initialize() ); + ATH_CHECK(m_fieldCacheCondObjInputKey.initialize()); + + ATH_CHECK(m_idHelperSvc.retrieve()); - // initialize the MdtIdHelper - if ( detStore()->retrieve(m_imp->m_mdtIdHelper, "MDTIDHELPER" ).isFailure() ) { - ATH_MSG_FATAL( "Can't retrieve MdtIdHelper" ); - return StatusCode::FAILURE; - } // assign BMG identifier - m_imp->m_BMGpresent = m_imp->m_mdtIdHelper->stationNameIndex("BMG") != -1; + m_imp->m_BMGpresent = m_idHelperSvc->mdtIdHelper().stationNameIndex("BMG") != -1; if(m_imp->m_BMGpresent){ ATH_MSG_INFO("Processing configuration for layouts with BMG chambers."); - m_imp->m_BMGid = m_imp->m_mdtIdHelper->stationNameIndex("BMG"); + m_imp->m_BMGid = m_idHelperSvc->mdtIdHelper().stationNameIndex("BMG"); } // initialise MuonGeoModel access - if ( detStore()->retrieve( m_imp->m_muonGeoManager ).isFailure() ) { - ATH_MSG_FATAL( "Can't retrieve MuonDetectorManager" ); - return StatusCode::FAILURE; - } + ATH_CHECK(detStore()->retrieve( m_imp->m_muonGeoManager )); if (m_imp->m_doT0Shift) ATH_CHECK( m_imp->m_t0ShiftSvc.retrieve() ); if (m_imp->m_doTMaxShift) ATH_CHECK ( m_imp->m_tMaxShiftSvc.retrieve() ); - m_imp->m_log = &msg(); - m_imp->m_verbose = msgLvl(MSG::VERBOSE); - m_imp->m_debug = msgLvl(MSG::DEBUG); - ATH_MSG_DEBUG("Settings:"); ATH_MSG_DEBUG(" Time window: lower bound " << m_imp->settings.timeWindowLowerBound() << " upper bound " << m_imp->settings.timeWindowUpperBound() ); @@ -261,9 +226,9 @@ bool MdtCalibrationTool::driftRadiusFromTime( MdtCalibHit &hit, // access t0 for the given tube if ( data.tubeCalib ) { - const int ml = m_imp->m_mdtIdHelper->multilayer(id)-1; - const int layer = m_imp->m_mdtIdHelper->tubeLayer(id)-1; - const int tube = m_imp->m_mdtIdHelper->tube(id)-1; + const int ml = m_idHelperSvc->mdtIdHelper().multilayer(id)-1; + const int layer = m_idHelperSvc->mdtIdHelper().tubeLayer(id)-1; + const int tube = m_idHelperSvc->mdtIdHelper().tube(id)-1; if ( ml<0 || layer<0 || tube<0 ){ ATH_MSG_WARNING( "Oops negative index....." ); @@ -292,7 +257,7 @@ bool MdtCalibrationTool::driftRadiusFromTime( MdtCalibHit &hit, if (m_imp->m_doT0Shift) t0 += m_imp->m_t0ShiftSvc->getValue(id); } else { ATH_MSG_WARNING("MdtTubeCalibContainer not found for " - << m_imp->m_mdtIdHelper->print_to_string( id )); + << m_idHelperSvc->mdtIdHelper().print_to_string( id )); ATH_MSG_WARNING( "Tube cannot be calibrated!!!" ); return false; } @@ -345,7 +310,7 @@ bool MdtCalibrationTool::driftRadiusFromTime( MdtCalibHit &hit, fieldCondObj->getInitializedCache (fieldCache); } corTime = m_imp->applyCorrections( fieldCache, hit, inputData, settings, - adcCal, data.corrections, rtRelation->rt()); + adcCal, data.corrections, rtRelation->rt(), &msg(), &m_idHelperSvc->mdtIdHelper()); } // calculate drift radius + error @@ -412,7 +377,7 @@ bool MdtCalibrationTool::driftRadiusFromTime( MdtCalibHit &hit, hit.setDriftRadius( r, reso ); // summary - ATH_MSG_VERBOSE( "driftRadiusFromTime for tube " << m_imp->m_mdtIdHelper->print_to_string(id) + ATH_MSG_VERBOSE( "driftRadiusFromTime for tube " << m_idHelperSvc->mdtIdHelper().print_to_string(id) << (calibOk ? " OK" : "FAILED") ); ATH_MSG_VERBOSE( " raw drift time " << hit.tdcCount() * tdcBinSize(id) << " TriggerOffset " << inputData.triggerOffset << endmsg @@ -487,9 +452,9 @@ bool MdtCalibrationTool::twinPositionFromTwinHits( MdtCalibHit &hit, // access t0 for the give tube if( data.tubeCalib ){ - const int ml = m_imp->m_mdtIdHelper->multilayer(id)-1; - const int layer = m_imp->m_mdtIdHelper->tubeLayer(id)-1; - const int tube = m_imp->m_mdtIdHelper->tube(id)-1; + const int ml = m_idHelperSvc->mdtIdHelper().multilayer(id)-1; + const int layer = m_idHelperSvc->mdtIdHelper().tubeLayer(id)-1; + const int tube = m_idHelperSvc->mdtIdHelper().tube(id)-1; if( ml<0 || layer<0 || tube<0 ){ ATH_MSG_WARNING( "Oops negative index....." ); @@ -512,16 +477,16 @@ bool MdtCalibrationTool::twinPositionFromTwinHits( MdtCalibHit &hit, } } else { ATH_MSG_WARNING( "MdtTubeCalibContainer not found for " - << m_imp->m_mdtIdHelper->print_to_string( id ) ); + << m_idHelperSvc->mdtIdHelper().print_to_string( id ) ); ATH_MSG_WARNING( "Tube cannot be calibrated!!!" ); return false; } // access t0 for the given second tube if ( dataSecond.tubeCalib ){ - const int mlSecond = m_imp->m_mdtIdHelper->multilayer(idSecond)-1; - const int layerSecond = m_imp->m_mdtIdHelper->tubeLayer(idSecond)-1; - const int tubeSecond = m_imp->m_mdtIdHelper->tube(idSecond)-1; + const int mlSecond = m_idHelperSvc->mdtIdHelper().multilayer(idSecond)-1; + const int layerSecond = m_idHelperSvc->mdtIdHelper().tubeLayer(idSecond)-1; + const int tubeSecond = m_idHelperSvc->mdtIdHelper().tube(idSecond)-1; if( mlSecond<0 || layerSecond<0 || tubeSecond<0 ){ ATH_MSG_WARNING( "Oops negative index for second tube....." ); @@ -544,7 +509,7 @@ bool MdtCalibrationTool::twinPositionFromTwinHits( MdtCalibHit &hit, } } else { ATH_MSG_WARNING( "MdtTubeCalibContainer not found for " - << m_imp->m_mdtIdHelper->print_to_string( idSecond ) ); + << m_idHelperSvc->mdtIdHelper().print_to_string( idSecond ) ); ATH_MSG_WARNING( "Second tube cannot be calibrated!!!" ); return false; } @@ -589,7 +554,7 @@ bool MdtCalibrationTool::twinPositionFromTwinHits( MdtCalibHit &hit, || twin_timedif > (tubelength*inversePropSpeed + tubelength*inversePropSpeedSecond + HVdelay + 5.*m_imp->m_resTwin)){ - if ( m_imp->m_debug ) { + if (msgLvl(MSG::DEBUG)) { ATH_MSG_DEBUG( " TIME DIFFERENCE OF TWIN PAIR OUT OF RANGE(" << (HVdelay - 5.*m_imp->m_resTwin) << "-" @@ -613,7 +578,7 @@ bool MdtCalibrationTool::twinPositionFromTwinHits( MdtCalibHit &hit, // Put twin hit always inside acceptance if (z_hit_sign_from_twin < -tubelength/2.) { - if ( m_imp->m_debug ) { + if (msgLvl(MSG::DEBUG)) { ATH_MSG_DEBUG( " TWIN HIT outside acceptance with time difference " << twin_timedif << " Z local hit " << z_hit_sign_from_twin @@ -631,10 +596,10 @@ bool MdtCalibrationTool::twinPositionFromTwinHits( MdtCalibHit &hit, zTwin = z_hit_geo_from_twin; errZTwin = m_imp->m_resTwin*inversePropSpeed; - if ( m_imp->m_verbose ){ + if (msgLvl(MSG::VERBOSE)) { ATH_MSG_VERBOSE( " TWIN TUBE " - << " tube: " << m_imp->m_mdtIdHelper->print_to_string(id) - << " twintube: " << m_imp->m_mdtIdHelper->print_to_string(idSecond) + << " tube: " << m_idHelperSvc->mdtIdHelper().print_to_string(id) + << " twintube: " << m_idHelperSvc->mdtIdHelper().print_to_string(idSecond) ); ATH_MSG_VERBOSE( " prompthit tdc = " << prompthit_tdc//*TDCbinsize << " twinhit tdc = " << twinhit_tdc// *TDCbinsize @@ -652,7 +617,7 @@ bool MdtCalibrationTool::twinPositionFromTwinHits( MdtCalibHit &hit, } // end if(twin_timedif < (tubelength*inversePropSpeed + tubelength*inversePropSpeedSecond + HVdelay + 10.*m_imp->m_resTwin)){ else { - if ( m_imp->m_verbose ){ + if (msgLvl(MSG::VERBOSE)) { ATH_MSG_VERBOSE( " TIME DIFFERENCE OF TWIN PAIR UNPHYSICAL OUT OF RANGE(" << (HVdelay - 5*m_imp->m_resTwin) << "-" << (2*tubelength*inversePropSpeed + HVdelay + 5*m_imp->m_resTwin) @@ -673,12 +638,7 @@ bool MdtCalibrationTool::twinPositionFromTwinHits( MdtCalibHit &hit, double MdtCalibrationTool::tdcBinSize(const Identifier &id) const { //BMG which uses HPTDC instead of AMT, and has 0.2ns TDC ticksize - //if( m_imp->m_mdtIdHelper->stationName(id) == 54 ) //BMG - //return 0.2; -// Alternative method if you don't like hardcoding BMG stationName (54) - // don't do string comparisons! - //if( m_imp->m_mdtIdHelper->stationNameString( m_imp->m_mdtIdHelper->stationName(id) ) == "BMG" ) - if( m_imp->m_mdtIdHelper->stationName(id) == m_imp->m_BMGid && m_imp->m_BMGpresent) + if( m_idHelperSvc->mdtIdHelper().stationName(id) == m_imp->m_BMGid && m_imp->m_BMGpresent) return 0.1953125; // 25/128 return 0.78125; //25/32; exact number: (1000.0/40.079)/32.0 } @@ -688,13 +648,13 @@ double MdtCalibrationTool::Imp::applyCorrections(MagField::AtlasFieldCache& fiel const MdtCalibrationSvcInput &inputData, const MdtCalibrationSvcSettings &settings, double /*adcCal*/, - const MuonCalib::MdtCorFuncSet *corrections, const MuonCalib::IRtRelation *rt) const { + const MuonCalib::MdtCorFuncSet *corrections, const MuonCalib::IRtRelation *rt, MsgStream *msgStr, const MdtIdHelper *idHelp) const { double corTime(0.); // apply corrections if ( corrections ){ - if (m_verbose) *m_log << MSG::VERBOSE << "There are correction functions." << endmsg; + if (msgStr->level()<=MSG::VERBOSE) *msgStr << MSG::VERBOSE << "There are correction functions." << endmsg; // slewing corrections if ( settings.doSlew && corrections->slewing() ){ @@ -721,7 +681,7 @@ double MdtCalibrationTool::Imp::applyCorrections(MagField::AtlasFieldCache& fiel double Bper = B_loc.dot(dir.unit()); hit.setBFieldPerp(Bper); hit.setBFieldPara(Bpar); - if( m_verbose ) *m_log << MSG::VERBOSE << "doing b-field correction" << endmsg; + if(msgStr->level()<=MSG::VERBOSE) *msgStr << MSG::VERBOSE << "doing b-field correction" << endmsg; if(hit.bFieldPara() != MdtCalibHit::kNoValue && hit.bFieldPerp() != MdtCalibHit::kNoValue) { hit.setLorentzTime(corrections->bField()->correction( hit.driftTime(), hit.bFieldPara(), hit.bFieldPerp() )); } else { @@ -747,7 +707,7 @@ double MdtCalibrationTool::Imp::applyCorrections(MagField::AtlasFieldCache& fiel // Scale RT function from Tmax difference if( settings.doTemp && rt && rt->HasTmaxDiff()) { - float scle_time=MuonCalib::RtScaleFunction(hit.driftTime(), m_mdtIdHelper->multilayer(hit.identify())==2, *rt); + float scle_time=MuonCalib::RtScaleFunction(hit.driftTime(), idHelp->multilayer(hit.identify())==2, *rt); hit.setTemperatureTime(scle_time); corTime-=scle_time; } else { @@ -762,43 +722,43 @@ double MdtCalibrationTool::Imp::applyCorrections(MagField::AtlasFieldCache& fiel // wire sag corrections // First some debug output - if (m_verbose) { + if (msgStr->level()<=MSG::VERBOSE) { if ( settings.doWireSag ){ - *m_log << MSG::VERBOSE << "settings.doWireSag == TRUE" << endmsg; + *msgStr << MSG::VERBOSE << "settings.doWireSag == TRUE" << endmsg; } else { - *m_log << MSG::VERBOSE << "settings.doWireSag == FALSE" << endmsg; + *msgStr << MSG::VERBOSE << "settings.doWireSag == FALSE" << endmsg; } if ( corrections->wireSag() ){ - *m_log << MSG::VERBOSE << "corrections->wireSag() == TRUE" << endmsg; + *msgStr << MSG::VERBOSE << "corrections->wireSag() == TRUE" << endmsg; } else { - *m_log << MSG::VERBOSE << "corrections->wireSag() == FALSE" << endmsg; + *msgStr << MSG::VERBOSE << "corrections->wireSag() == FALSE" << endmsg; } } // Wire sag corrections if ( settings.doWireSag && corrections->wireSag() ){ - if (m_verbose) { - *m_log << MSG::VERBOSE << "Performing Rt Corrections due to Wire Sag." << endmsg; + if (msgStr->level()<=MSG::VERBOSE) { + *msgStr << MSG::VERBOSE << "Performing Rt Corrections due to Wire Sag." << endmsg; if (inputData.pointOfClosestApproach) { - *m_log << MSG::VERBOSE << "Have a point of closest approach." << endmsg; + *msgStr << MSG::VERBOSE << "Have a point of closest approach." << endmsg; } else { - *m_log << MSG::VERBOSE << "No point of closest approach!" << endmsg; + *msgStr << MSG::VERBOSE << "No point of closest approach!" << endmsg; } if (inputData.trackDirection) { - *m_log << MSG::VERBOSE << "Have a track direction." << endmsg; + *msgStr << MSG::VERBOSE << "Have a track direction." << endmsg; } else { - *m_log << MSG::VERBOSE << "No track direction!" << endmsg; + *msgStr << MSG::VERBOSE << "No track direction!" << endmsg; } if (inputData.nominalWireSurface) { - *m_log << MSG::VERBOSE << "Have a nominal wire surface." << endmsg; + *msgStr << MSG::VERBOSE << "Have a nominal wire surface." << endmsg; } else { - *m_log << MSG::VERBOSE << "No nominal wire surface!" << endmsg; + *msgStr << MSG::VERBOSE << "No nominal wire surface!" << endmsg; } if (inputData.wireSurface) { - *m_log << MSG::VERBOSE << "Have a sagged wire surface." << endmsg; + *msgStr << MSG::VERBOSE << "Have a sagged wire surface." << endmsg; } else { - *m_log << MSG::VERBOSE << "No sagged wire surface!" << endmsg; + *msgStr << MSG::VERBOSE << "No sagged wire surface!" << endmsg; } } @@ -809,23 +769,22 @@ double MdtCalibrationTool::Imp::applyCorrections(MagField::AtlasFieldCache& fiel // check whether all input data is there if ( !pointOfClosestApproach || !trackDirection || !nominalWireSurface ){ - *m_log << MSG::WARNING << " cannot perform wire sag correction: "; - if( !pointOfClosestApproach ) *m_log << " no pointOfClosestApproach "; - if( !trackDirection ) *m_log << " no trackDirection "; - if( !nominalWireSurface ) *m_log << " no nominalWireSurface "; - *m_log << endmsg; + *msgStr << MSG::WARNING << " cannot perform wire sag correction: " << endmsg; + if( !pointOfClosestApproach ) *msgStr << MSG::WARNING << " no pointOfClosestApproach " << endmsg; + if( !trackDirection ) *msgStr << MSG::WARNING << " no trackDirection " << endmsg; + if( !nominalWireSurface ) *msgStr << MSG::WARNING << " no nominalWireSurface " << endmsg; } else { - if (m_verbose) { - *m_log << MSG::VERBOSE << "All Necessary Wire Sag data available: " << endmsg; - *m_log << MSG::VERBOSE << " pCA = (" + if (msgStr->level()<=MSG::VERBOSE) { + *msgStr << MSG::VERBOSE << "All Necessary Wire Sag data available: " << endmsg; + *msgStr << MSG::VERBOSE << " pCA = (" << pointOfClosestApproach->x() << ", " << pointOfClosestApproach->y() << ", " << pointOfClosestApproach->z() << ")" << endmsg; } // store pointer to sagged surface as we get ownership if we recalculate it - const Trk::StraightLineSurface *tempSaggedSurface = 0; + const Trk::StraightLineSurface *tempSaggedSurface = nullptr; // if wire surface is missing, calculate sagged wire position if ( !wireSurface ){ @@ -835,7 +794,7 @@ double MdtCalibrationTool::Imp::applyCorrections(MagField::AtlasFieldCache& fiel // used for wire sag treatment const Amg::Vector2D *tempLocOnWire = nominalSurf->Trk::Surface::globalToLocal(*pointOfClosestApproach,1000.); if ( !tempLocOnWire ){ - *m_log << MSG::WARNING << "globalToLocal failed! " << endmsg; + *msgStr << MSG::WARNING << "globalToLocal failed! " << endmsg; } else { // sagged surface wireSurface = nominalSurf->correctedSurface(*tempLocOnWire); @@ -843,16 +802,13 @@ double MdtCalibrationTool::Imp::applyCorrections(MagField::AtlasFieldCache& fiel delete tempLocOnWire; } } else { - *m_log << MSG::WARNING - << "Nominal wire surface not a SaggedLineSurface," + *msgStr << MSG::WARNING << "Nominal wire surface not a SaggedLineSurface," << " cannot perform wire sag correction" << endmsg; } } if ( !wireSurface ){ - *m_log << MSG::WARNING - << " cannot perform wire sag correction: no sagged wire surface " - << endmsg; + *msgStr << MSG::WARNING << " cannot perform wire sag correction: no sagged wire surface " << endmsg; } else { // get to transformation matrix from global into the tube frame @@ -922,13 +878,13 @@ Muon::MdtDriftCircleStatus MdtCalibrationTool::driftTimeStatus( double driftTime if( rtRelation && rtRelation->rt() ) { if( driftTime < rtRelation->rt()->tLower() - settings.timeWindowLowerBound() ) { // Will this produce too much output from ROT creators? - if ( m_imp->m_verbose ) + if (msgLvl(MSG::VERBOSE)) ATH_MSG_VERBOSE( " drift time outside time window " << driftTime << ". Mininum time = " << rtRelation->rt()->tLower() - settings.timeWindowLowerBound() ); return Muon::MdtStatusBeforeSpectrum; } else if( driftTime > rtRelation->rt()->tUpper() + settings.timeWindowUpperBound() ) { - if ( m_imp->m_verbose ) + if (msgLvl(MSG::VERBOSE)) ATH_MSG_VERBOSE( " drift time outside time window " << driftTime << ". Maximum time = " << rtRelation->rt()->tUpper() + settings.timeWindowUpperBound() ); diff --git a/MuonSpectrometer/MuonCalib/MdtCalib/MdtCalibT0/exe/T0Fit.cxx b/MuonSpectrometer/MuonCalib/MdtCalib/MdtCalibT0/exe/T0Fit.cxx index 2b51a99b8ce4570344a66f76c92400f35f2ae666..092737575a2ac57671264df9d31f643dbe20da56 100644 --- a/MuonSpectrometer/MuonCalib/MdtCalib/MdtCalibT0/exe/T0Fit.cxx +++ b/MuonSpectrometer/MuonCalib/MdtCalib/MdtCalibT0/exe/T0Fit.cxx @@ -14,6 +14,7 @@ #include "iostream" #include "string" #include "cstdlib" +#include <TString.h> // for Form using namespace MuonCalib; @@ -22,8 +23,7 @@ int main(int argc, char * argv[]) //check command line arguments if(argc!=3) { - cerr<<"Usage: "<<argv[0]<<"<input file> <output file>!"<<endl; - std::exit(1); + throw std::runtime_error(Form("File: %s, Line: %d\nT0Fit::main() - Usage: %s <input file> <output file>!", __FILE__, __LINE__, argv[0])); } @@ -34,10 +34,9 @@ int main(int argc, char * argv[]) T0MTSettings settings; settings.AddFitfun()=true; settings.DrawDebugGraphs()=true; - if (dir==NULL) + if (!dir) { - cerr<<"Cannot find TDirectory 'MT_t0_fitter' in file '"<<argv[1]<<endl; - exit(1); + throw std::runtime_error(Form("File: %s, Line: %d\nT0Fit::main() - Cannot find TDirectory 'MT_t0_fitter' in file %s!", __FILE__, __LINE__, argv[1])); } //loop on all histograms TIter nextkey(dir->GetListOfKeys()); @@ -52,7 +51,6 @@ int main(int argc, char * argv[]) if (hist==NULL) continue; string hname=hist->GetName(); if (hname=="t_spec_Summary") continue; -// if((int)hname.find("t_spec")<0) continue; hist->GetListOfFunctions()->Clear(); T0MTHistos fitter; fitter.SetTSpec(n, hist, &settings); diff --git a/MuonSpectrometer/MuonCalib/MdtCalib/MdtCalibT0/src/HistogramId.cxx b/MuonSpectrometer/MuonCalib/MdtCalib/MdtCalibT0/src/HistogramId.cxx index 158eca79745cfb6edfcafad1d7fb53a81a625c66..63ead61ca6f286148da345157562d5df1ee96dea 100644 --- a/MuonSpectrometer/MuonCalib/MdtCalib/MdtCalibT0/src/HistogramId.cxx +++ b/MuonSpectrometer/MuonCalib/MdtCalib/MdtCalibT0/src/HistogramId.cxx @@ -2,22 +2,22 @@ Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ -//c - c++ +#include "MdtCalibT0/HistogramId.h" +#include "MuonCalibIdentifier/MuonFixedId.h" +#include "GaudiKernel/MsgStream.h" +#include "AthenaKernel/getMessageSvc.h" + #include <algorithm> #include "iostream" #include "sstream" #include "iomanip" -//athena -#include "MdtCalibT0/HistogramId.h" -#include "MuonCalibIdentifier/MuonFixedId.h" - namespace MuonCalib { std::map<std::pair<int, int>, std::string> HistogramId :: s_histogram_names; -void HistogramId :: Initialize(const MuonFixedId &id, int sort_by) +void HistogramId::Initialize(const MuonFixedId &id, int sort_by) { m_id.first=sort_by; static const unsigned int kStationNameShift = 24; @@ -49,9 +49,6 @@ void HistogramId :: Initialize(const MuonFixedId &id, int sort_by) case MULTILAYER: { m_id.second = (id.stationNameIndex()<<kStationNameShift) | (id. etaIndex()<<kStationEtaShift) | (id.phiIndex()<<kStationPhiShift) | (id.mdtMultilayerIndex()<<kMdtMultilayerShift); -// std::cout<<"name"<<id.stationNameIndex()<<std::endl; -// std::cout<<"eta"<<id.etaIndex()<<std::endl; -// std::cout<<"ml"<<id.mdtMultilayerIndex()<<std::endl; break; } case CHAMBER: @@ -67,7 +64,8 @@ void HistogramId :: Initialize(const MuonFixedId &id, int sort_by) } default: { - std::cerr<<"HistogramId :: Initialize: sort_by arguemnt is invalid!"<<std::endl; + MsgStream log(Athena::getMessageSvc(),"HistogramId"); + log<<MSG::WARNING<<"HistogramId :: Initialize: sort_by arguemnt is invalid!"<<endmsg; } } //create histogram name @@ -106,7 +104,8 @@ void HistogramId :: Initialize(const MuonFixedId &id, int sort_by) } //store s_histogram_names[m_id] = os.str(); - std::cout<<sort_by<<" "<<s_histogram_names[m_id]<<std::endl; + MsgStream log(Athena::getMessageSvc(),"HistogramId"); + log<<MSG::INFO<<sort_by<<" "<<s_histogram_names[m_id]<<endmsg; } } diff --git a/MuonSpectrometer/MuonCalib/MdtCalib/MdtCalibT0/src/T0CalibrationClassic.cxx b/MuonSpectrometer/MuonCalib/MdtCalib/MdtCalibT0/src/T0CalibrationClassic.cxx index cd05990d5456c3f1a94cfb904f62b32a363bd0c4..4d6d72ba5a37433cc6d597feb94bc16197cc9d89 100644 --- a/MuonSpectrometer/MuonCalib/MdtCalib/MdtCalibT0/src/T0CalibrationClassic.cxx +++ b/MuonSpectrometer/MuonCalib/MdtCalib/MdtCalibT0/src/T0CalibrationClassic.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ #include "MdtCalibT0/T0CalibrationClassic.h" @@ -28,7 +28,7 @@ namespace MuonCalib { inline Double_t TimeSpectrum_func(Double_t *xx , Double_t *par) { Double_t &x(xx[0]); - return par[0]+(par[1]*(1+par[2]*exp(-(x-par[4])/par[3])))/((1+exp((-x+par[4])/par[6]))*(1+exp((x-par[5])/par[7]))); + return par[0]+(par[1]*(1+par[2]*std::exp(-(x-par[4])/par[3])))/((1+std::exp((-x+par[4])/par[6]))*(1+std::exp((x-par[5])/par[7]))); } T0CalibrationClassic::T0CalibrationClassic( std::string name, const T0ClassicSettings* settings ) : @@ -77,15 +77,6 @@ namespace MuonCalib { float distanceToRO = (*it)->distanceToReadout(); bool ROside = distanceToRO<130000. ; // this means that there is no selection along the tube - // bool ROside = distanceToRO<1300. ; -// bool HVside = distanceToRO>2200. ; - // bool ChamberChop = distanceToRO>100.&&distanceToRO<600. ; - // bool ChamberChop = distanceToRO>600.&&distanceToRO<1100. ; - // bool ChamberChop = distanceToRO>1100.&&distanceToRO<1600. ; - // bool ChamberChop = distanceToRO>1900.&&distanceToRO<2400. ; - // bool ChamberChop = distanceToRO>2400.&&distanceToRO<2900. ; - // bool ChamberChop = distanceToRO>2900.&&distanceToRO<3400. ; - if (ROside) { MuonFixedId id=(*it)->identify(); @@ -93,9 +84,7 @@ namespace MuonCalib { int nML=id.mdtMultilayer(); int nL=id.mdtTubeLayer(); int nT=id.mdtTube(); - // std::cout<<"Accessing Single Tube Calib info found for ML="<<nML<<" L="<<nL<<" T="<<nT<<" mezzanine="<<id.mdtMezzanine()<<std::endl; const MdtTubeFitContainer::SingleTubeCalib * stc=m_result->getCalib(nML-1,nL-1,nT-1); - // double oldT0=0; if(!stc) { std::cout<<"no Single Tube Calib info found for ML="<<nML<<" L="<<nL<<" T="<<nT<<std::endl; std::cout<<"container size "<<m_result->size()<<std::endl; @@ -108,23 +97,11 @@ namespace MuonCalib { T0ClassicHistos* histos = getHistos(id.getIdInt()); // fill histos - // std::cout<<"T0Classic: drifttime "<<(*it)->driftTime()<<" oldt0 "<<oldT0<<" tdc counts "<<(*it)->tdcCount()<<" propagation "<<(*it)->propagationTime()<<" slewing "<<(*it)->slewingTime()<<" flight "<<(*it)->timeOfFlight()<<std::endl; - // float ttime=(((*it)->tdcCount())*(25./32.))-((*it)->propagationTime())-((*it)->slewingTime())-((*it)->timeOfFlight()); - - - //Luca 11/6/2007 - Tolgo il tempo di volo per i cosmici - // float ttime=(((*it)->tdcCount())*(25./32.))-((*it)->propagationTime())-((*it)->timeOfFlight()); - - //M.I. 22/6/2007 - Tolgo il tempo di propagaz per i cosmici sett.5 - //F.R. Always use the drift time, and not the tdc-count. It will be filled correctly bu the CalibNtupleAnalysysAlg - //float ttime=((*it)->tdcCount())*(25./32.); float ttime=((*it)->driftTime()); - // histos->time->Fill((*it)->tdcCount()+oldT0); histos->time->Fill(ttime); histos->adc->Fill((*it)->adcCount()); - //histos.adc_vs_time->Fill((*it)->driftTime(),(*it)->adcCount); // book an additional dummy set of histograms to fit the global T0 T0ClassicHistos* histosAll = getHistos(0); histosAll->time->Fill(ttime); @@ -159,9 +136,7 @@ namespace MuonCalib { MdtTubeFitContainer::SingleTubeFit full; MdtTubeFitContainer::SingleTubeCalib st; int idtube=(*it)->id ; - // if((*it)->id!=0 && (int)(idtube/100000000)!=9 && idtube!=1 && idtube!=2 ) { if((*it)->id!=0 && (int)(idtube/100000000)!=9 ) { - // doTimeFit(*it,full,st); doTimeFit(*it,full,st); doAdcFit(*it,full,st); MuonFixedId fId((*it)->id); @@ -176,11 +151,6 @@ namespace MuonCalib { if(!setInfo) std::cout<<"T0CalibrationClassic::PROBLEM! could not set SingleTubeFullInfo info "<<std::endl; - // DA TOGLIERE !!!! - // - // int headid,lowrun,uprun; - // int ok=m_db->getTubeHead(headid,lowrun,uprun); - // std::cout<<" headid,lowrun,uprun " << headid <<" "<<lowrun<<" "<<uprun <<std::endl; } } } @@ -198,9 +168,6 @@ namespace MuonCalib { void T0CalibrationClassic::doTimeFit(T0ClassicHistos *T0h, MdtTubeFitContainer::SingleTubeFit &fi, MdtTubeFitContainer::SingleTubeCalib &stc) { TMinuit *gMinuit = new TMinuit(); - // THIS SETTINGS VARIABLE HAS TO BE IMPLEMENTED (as of March 7, 2007) : - // int fitMezz = m_settings->fitMezzanine(); - // int fitMezz(123) ; int fitMezz(1) ; const int np=m_settings->numParams(); @@ -225,40 +192,13 @@ namespace MuonCalib { if (( fId.isValid() && fId.is_mdt()) || isMultilayer ) { std::cout<<" STARTING doTimeFit "<< std::endl; - TH1 * h(NULL) ; + TH1* h = nullptr; - // if (!fitMezz || isMultilayer) { //!fitMezz not implemented (see above) if ( isMultilayer) { std::cout<< " DEBUGGGG : " << T0h->id << std::endl ; h=T0h->time; } -// E. Diehl 141211 This code cannot be executed since fitMezz!=1 option never implemented (see above) -// if (fitMezz==123 && !isMultilayer) { // FIT Mixed -// h=T0h->time; -// if (h->GetEntries()<m_settings->entries()) { -// int hIdMezz = fId.mdtMezzanine() ; -// ToString ts; -// std::string HistoId(std::string("time_mezz_") + ts((hIdMezz)%(900000000))); -// TH1F * timeHis=(TH1F*) m_regiondir->Get(HistoId.c_str()); -// if(!timeHis) { -// delete [] pfit ; -// delete [] errfit ; -// for(int i=0; i<np; i++) delete [] matrix[i]; -// delete [] matrix; -// return; -// } -// -// T0ClassicHistos* histosMezz = getHistos(fId.mdtMezzanine()); -// h= histosMezz->time; -// if (h->GetEntries()<m_settings->entries()) { -// int nML=fId.mdtMultilayer(); -// T0ClassicHistos* histosML = getHistos(nML); -// h= histosML->time; -// } -// } -// } - if (fitMezz==1 && !isMultilayer) { // FIT MEZZANINE int hIdMezz = fId.mdtMezzanine() ; @@ -281,13 +221,6 @@ namespace MuonCalib { h= histosMezz->time; } -// E. Diehl 141211 This code cannot be executed since fitMezz!=1 option never implemented (see above) -// if (fitMezz==2 && !isMultilayer) { // FIT MULTILAYER -// int nML=fId.mdtMultilayer(); -// T0ClassicHistos* histosML = getHistos(nML); -// h= histosML->time; -// } - Stat_t entries=h->GetEntries(); fi.statistics=(int)entries; @@ -303,7 +236,6 @@ namespace MuonCalib { // CHECK whether the histogram has been already fitted TF1 * FitFunction = h->GetFunction("TimeSpectrum"); if(FitFunction){ -// double chiquadro = FitFunction->GetChisquare(); for(int i=0; i<np; i++){ pfit[i] = FitFunction->GetParameter(i); errfit[i] = FitFunction->GetParError(i) ; @@ -314,15 +246,12 @@ namespace MuonCalib { TF1 *TimeSpectrum = new TF1("TimeSpectrum", "[0]+([1]*(1+[2]*exp(-(x-[4])/[3])))/((1+exp((-x+[4])/[6]))*(1+exp((x-[5])/[7]))) ", m_settings->minTime(),m_settings->maxTime()); - // if ((int)entries > m_settings->entries()) - // searchParams(h,&pfit[0],np); for(int i=0;i<np;i++) { pfit[i]=*(pdefault++); if(m_settings->printLevel() <= 2) std::cout<<"T0CalibrationClassic::doTimeFit initial parameters" <<i<<"="<<pfit[i]<<std::endl; } - // if ( !m_settings->initParamFlag() ) { searchParams(h,&pfit[0],np); if(m_settings->printLevel() <= 2) { std::cout<<"T0CalibrationClassic::doTimeFit parameters after searchParams "<<std::endl; @@ -359,7 +288,6 @@ namespace MuonCalib { for(int i=0; i<np; i++){ pfit[i] = TimeSpectrum->GetParameter(i); errfit[i] = TimeSpectrum->GetParError(i) ; - // std::cout << " cov(ii) = " << matrix[i][i] << std::endl ; } chi2 = TimeSpectrum->GetChisquare() ; // total chi2 ndof = TimeSpectrum->GetNDF(); // number of degrees of freedom @@ -380,13 +308,7 @@ namespace MuonCalib { // NOW we get rid of the covariance matrix /******************************************************* - int jj=0; - for (int i=0; i<8; i++) { - for (int k=0; k<i+1; k++) { - std::cout << " i k matrix[i][k] = "<<i<<" "<<k<<" "<< matrix[i][k] <<std::endl; - fi.cov[jj++] = matrix[k][i] ; - } - } + *******************************************************/ // NOW we set the the first 8 values of fi.cov to errfit for (int i=0 ; i<np; i++) fi.cov[i]=errfit[i] ; @@ -459,37 +381,6 @@ namespace MuonCalib { TH1 * h = nullptr; -// E. Diehl 141211 This code cannot be executed since fitMezz!=1 option never implemented (see above) -// if (!fitMezz) { -// h=T0h->adc; -// } -// -// if (fitMezz==123) { // FIT Mixed -// h=T0h->adc; -// if (h->GetEntries()<m_settings->entries()) { -// int hIdMezz = fId.mdtMezzanine() ; -// ToString ts; -// std::string HistoId(std::string("time_mezz_") + ts((hIdMezz)%(900000000))); - // std::cout <<" DEBUGG FITTING MEZZANINE "<<fId.mdtTube() - // <<" "<<fId.mdtTubeLayer()<<" "<<fId.mdtMultilayer() - // <<" "<<fId.mdtMezzanine() <<std::endl; - // TH1F * adcHis=(TH1F*) m_regiondir->Get(HistoId.c_str()); - // if(!adcHis) return; - // T0ClassicHistos* histosMezz = getHistos(fId.mdtMezzanine()); - // h= histosMezz->adc; - // if (h->GetEntries()<m_settings->entries()) { - // int nML=fId.mdtMultilayer(); - - // std::cout <<" DEBUGG FITTING MULTILAYER "<<fId.mdtTube() - // <<" "<<fId.mdtTubeLayer()<<" "<<nML - // <<" "<<fId.mdtMezzanine() <<std::endl; - - // T0ClassicHistos* histosML = getHistos(nML); - // h= histosML->adc; - // } - // } - // } //end if fitMezz=123 - if (fitMezz==1) { int hIdMezz = fId.mdtMezzanine() ; ToString ts; @@ -649,8 +540,8 @@ namespace MuonCalib { float cont1=hnew->GetBinContent(ix1); float cont2=hnew->GetBinContent(ix2); if (cont1>0. && cont2>0. ){ - float A1=exp(-(a1-t0guess)/P3); - float A2=exp(-(a2-t0guess)/P3); + float A1=std::exp(-(a1-t0guess)/P3); + float A2=std::exp(-(a2-t0guess)/P3); // do not forget rebinning! P2 = (cont1/cont2-1.)/(A1-cont1/cont2*A2); P1 = cont1/(1+P2*A1); @@ -672,14 +563,11 @@ namespace MuonCalib { T0ClassicHistos* T0CalibrationClassic::getHistos(unsigned int idtube) { ToString ts; - // std::cout<<"T0CalibrationClassic::getHistos "<<idtube<<std::endl; std::string HistoId; if((int)(idtube/100000000)==9){ - // std::cout<<"T0CalibrationClassic::getHistos "<<idtube<<" of tipe mezz(idtube)%(900000000), mezz "<<(idtube)%(900000000)<<std::endl; int mezz=(idtube)%(900000000); HistoId="time_mezz_"+ts(mezz); } else if(idtube==0){ - // std::cout<<"T0CalibrationClassic::getHistos "<<idtube<<" of tipe 0"<<std::endl; HistoId="time"; } else if(idtube==1){ HistoId="time_ML1"; @@ -698,7 +586,6 @@ namespace MuonCalib { } else if(idtube==23){ HistoId="time_ML2_series3"; } else { - // std::string HistoId(std::string("time_") + ts(idtube)); MuonFixedId fId(idtube); int nML=fId.mdtMultilayer(); int nL=fId.mdtTubeLayer(); @@ -709,13 +596,11 @@ namespace MuonCalib { int eta = fId.eta(); int phi = fId.phi(); HistoId="time_"+stationName+"_"+ts(eta)+"_"+ts(phi)+"_"+ts(tubeid); - // std::cout<<"T0CalibrationClassic::getHistos "<<idtube<<" of tipe tube "<<HistoId<<std::endl; } T0ClassicHistos *ret = NULL; TH1F *timeHis = (TH1F*) m_regiondir->Get(HistoId.c_str()); // We will either find the pointer to an existing histogram or create a new one if(!timeHis) { //book histo if it does not exist - // std::cout<<"T0CalibrationClassic::getHistos "<<idtube<<" pointer not found, booking"<<std::endl; ret = bookHistos(idtube); } else { // else loop over m_histos histograms to look for the set of histos of tube idtube for(std::vector<T0ClassicHistos*>::iterator it =m_histos.begin(); it!=m_histos.end();++it) { diff --git a/MuonSpectrometer/MuonCalib/MdtCalib/MdtCalibUtils/MdtCalibUtils/GlobalTimeFitter.h b/MuonSpectrometer/MuonCalib/MdtCalib/MdtCalibUtils/MdtCalibUtils/GlobalTimeFitter.h index 2dd45c9bd711c3e755abeefcd5f87f17471dd677..19d4697841b635d545a27f66a628f83aca9d2ccf 100644 --- a/MuonSpectrometer/MuonCalib/MdtCalib/MdtCalibUtils/MdtCalibUtils/GlobalTimeFitter.h +++ b/MuonSpectrometer/MuonCalib/MdtCalib/MdtCalibUtils/MdtCalibUtils/GlobalTimeFitter.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ #ifndef MUONCALIB_GLOBALTIMEFITTER_H @@ -35,7 +35,7 @@ Provides the operator to fit .... inline void setRtRelation(const IRtRelation * rtRel) {m_rtRel=rtRel ;} ; inline double getDefaultResolution(double r) { - double resolH8 = 0.164*exp(-r/4.43)+0.043 ; // resolution from H8 TestBeam + double resolH8 = 0.164*std::exp(-r/4.43)+0.043 ; // resolution from H8 TestBeam return 2.*resolH8 ; // resolution from Cosmics in the pit // return 2.0 ; // FLAT 2 mm resolution } ; diff --git a/MuonSpectrometer/MuonCalib/MdtCalib/MdtCalibValidation/src/FixRtEnds.cxx b/MuonSpectrometer/MuonCalib/MdtCalib/MdtCalibValidation/src/FixRtEnds.cxx index 5f09be27ca9b42e6c9c8ad72a7ba4dfc975aa292..453103923f5fa78704cd5fd7a0c91eddd7e7c728 100644 --- a/MuonSpectrometer/MuonCalib/MdtCalib/MdtCalibValidation/src/FixRtEnds.cxx +++ b/MuonSpectrometer/MuonCalib/MdtCalib/MdtCalibValidation/src/FixRtEnds.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ //this @@ -69,14 +69,10 @@ bool FixRtEnds::checkMono(const std::vector<SamplePoint> & points, bool & fix_be double last_r(-9e9); fix_begin=false; fix_end=false; for(std::vector<SamplePoint>::const_iterator it=points.begin(); it!=points.end(); it++) { -// std::cout<<last_r<<"<"<<it->x2()<<std::endl; if(it->x2()<last_r) { -// std::cout<<"*"<<std::endl; if(it->x2()<2.0) { -// std::cout<<"*k"<<std::endl; fix_begin=true; } else if(it->x2()>13) { -// std::cout<<"*l"<<std::endl; fix_end=true; } else { //cannot fic if it is in the middle return false; @@ -111,7 +107,7 @@ inline bool FixRtEnds::fixBegin(std::vector<SamplePoint> & points) { fit_gr->Fit("pol2"); fit_gr->Write("fix_begin"); TF1 * fun=fit_gr->GetFunction("pol2"); - if(fun == NULL) return false; + if(!fun) return false; for(int i=0; i<=i_max; i++) { points[i].set_x2(fun->Eval(points[i].x1())); } @@ -123,7 +119,6 @@ inline bool FixRtEnds::fixEnd(std::vector<SamplePoint> & points) { int i_min(10000); for(unsigned int i=0; i<points.size(); i++) { if(points[i].x2()>12 && points[i].x2() <13) { -// std::cout<<"p=("<<points[i].x1()<<", "<<points[i].x2()<<")"<<std::endl; t.push_back(points[i].x1()); r.push_back(points[i].x2()); } @@ -139,11 +134,9 @@ inline bool FixRtEnds::fixEnd(std::vector<SamplePoint> & points) { fit_gr->Fit("pol2"); fit_gr->Write("fix_end"); TF1 * fun=fit_gr->GetFunction("pol2"); - if(fun == NULL) return false; -// std::cout<<i_min<<" "<<points.size()<<std::endl; + if(!fun) return false; for(unsigned int i=i_min; i<points.size(); i++) { points[i].set_x2(fun->Eval(points[i].x1())); -// std::cout<<i<<": ("<<points[i].x1()<<", "<<points[i].x2()<<")"<<std::endl; } return true; } diff --git a/MuonSpectrometer/MuonCalib/MuonCalibAlgs/MuonCalibAlgs/MuonCalibAlg.h b/MuonSpectrometer/MuonCalib/MuonCalibAlgs/MuonCalibAlgs/MuonCalibAlg.h index ad21ab69631f735bd03ce9acfab838a34fb176be..c0e890f6a8e5724e9863c97a5e06d8376f93e556 100644 --- a/MuonSpectrometer/MuonCalib/MuonCalibAlgs/MuonCalibAlgs/MuonCalibAlg.h +++ b/MuonSpectrometer/MuonCalib/MuonCalibAlgs/MuonCalibAlgs/MuonCalibAlg.h @@ -13,8 +13,9 @@ #include "MuonPrdSelector/MuonIdCutTool.h" #include "MuonIdHelpers/IMuonIdHelperSvc.h" #include "MuonReadoutGeometry/MuonDetectorManager.h" - -class ICscStripFitter; +#include "CscClusterization/ICscStripFitter.h" +#include "MuonCalibITools/IMuonCalibTool.h" +#include "MuonCalibITools/IIdToFixedIdTool.h" class TileTBID; @@ -29,8 +30,6 @@ namespace MuonCalib { class MuonCalibTruthCollection; class MuonCalibRawHitCollection; class MuonCalibRawTriggerHitCollection; - class IMuonCalibTool; - class IIdToFixedIdTool; class MuonCalibRawRpcHit; /** @@ -49,7 +48,7 @@ namespace MuonCalib { /** Algorithm destructor (closing the ROOT file) */ - ~MuonCalibAlg(); + ~MuonCalibAlg()=default; /** Algorithm initialize: diff --git a/MuonSpectrometer/MuonCalib/MuonCalibAlgs/src/MuonCalibAlg.cxx b/MuonSpectrometer/MuonCalib/MuonCalibAlgs/src/MuonCalibAlg.cxx index e47b2ff9b65e3b970be671bb075c72138681d0f9..a3f133e3b8e5dc49fc2315d76cecef52984a0aeb 100644 --- a/MuonSpectrometer/MuonCalib/MuonCalibAlgs/src/MuonCalibAlg.cxx +++ b/MuonSpectrometer/MuonCalib/MuonCalibAlgs/src/MuonCalibAlg.cxx @@ -5,7 +5,6 @@ #include "MuonCalibAlgs/MuonCalibAlg.h" // gaudi -#include "GaudiKernel/MsgStream.h" #include "xAODEventInfo/EventInfo.h" #include "EventInfo/TagInfo.h" #include "TrackRecord/TrackRecordCollection.h" @@ -25,19 +24,12 @@ #include "GeneratorObjects/McEventCollection.h" #include "AtlasHepMC/GenEvent.h" #include "CLHEP/Vector/LorentzVector.h" - #include "GeoPrimitives/GeoPrimitives.h" -#include "CscClusterization/ICscStripFitter.h" - - // calibration #include "MuonCalibEvent/MuonCalibPatternCollection.h" - -#include "MuonCalibITools/IMuonCalibTool.h" #include "MuonCalibNtuple/RootFileManager.h" #include "MuonCalibIdentifier/MuonFixedId.h" -#include "MuonCalibITools/IIdToFixedIdTool.h" #include "MuonCalibStl/DeleteObject.h" #include "MuonCalibEventBase/MuonCalibRawMdtHit.h" #include "MuonCalibEventBase/MuonCalibRawRpcHit.h" @@ -60,7 +52,6 @@ #include "MuonCalibEventBase/MuonCalibRawTriggerHitCollection.h" #include "MuonCalibEventBase/MuonCalibPattern.h" - // trigger includes: #include "TrigT1Result/CTP_RDO.h" #include "TrigT1Result/CTP_Decoder.h" @@ -82,7 +73,7 @@ namespace MuonCalib { m_idToFixedIdTool("MuonCalib::IdToFixedIdTool"), m_stripFitter("CalibCscStripFitter/CalibCscStripFitter"), m_muonIdCutTool("MuonIdCutTool/MuonIdCutTool"), - m_tileTBID(NULL), + m_tileTBID(nullptr), m_ntupFileOpen(false) { // Contents in the ntuple: with or without truth? @@ -135,29 +126,22 @@ namespace MuonCalib { m_mbts_warning_printed=false; m_eventNumber=0; } - - MuonCalibAlg::~MuonCalibAlg() { - } StatusCode MuonCalibAlg::initialize() { //----------------------------------------------------- - MsgStream log(msgSvc(), name()); - log << MSG::INFO << "Initialisation started " << endmsg; - - log << MSG::INFO << "================================" << endmsg; - log << MSG::INFO << "= Proprieties are:" << endmsg; - log << MSG::INFO << "= GlobalPatternLocation " << m_globalPatternLocation << endmsg; - log << MSG::INFO << "= MdtCalibTool " << m_muonCalibTool << endmsg; - log << MSG::INFO << "= NtupleName " << m_ntupleName << " write " << m_createRootFile << endmsg; - if(m_doTruth) log << MSG::INFO << "= Truth information stored on ntuple" << endmsg ; - else log << MSG::INFO << "= Truth information NOT stored on ntuple" << endmsg ; - - if(m_doRawData) log << MSG::INFO << "= Raw Hit information stored on ntuple" << endmsg ; - else log << MSG::INFO << "= Raw Hit information NOT stored on ntuple" << endmsg ; - - log << MSG::INFO << "================================" << endmsg; + ATH_MSG_INFO("Initialisation started "); + ATH_MSG_INFO("================================"); + ATH_MSG_INFO("= Proprieties are:"); + ATH_MSG_INFO("= GlobalPatternLocation " << m_globalPatternLocation); + ATH_MSG_INFO("= MdtCalibTool " << m_muonCalibTool); + ATH_MSG_INFO("= NtupleName " << m_ntupleName << " write " << m_createRootFile); + if(m_doTruth) ATH_MSG_INFO("= Truth information stored on ntuple"); + else ATH_MSG_INFO("= Truth information NOT stored on ntuple"); + if(m_doRawData) ATH_MSG_INFO("= Raw Hit information stored on ntuple"); + else ATH_MSG_INFO("= Raw Hit information NOT stored on ntuple"); + ATH_MSG_INFO("================================"); ATH_CHECK(m_idHelperSvc.retrieve()); @@ -179,78 +163,53 @@ namespace MuonCalib { // retrieve TileTBID helper // (The MBTS was added to the Test Beam (TB) list.) if(detStore()->retrieve(m_tileTBID).isFailure()) { - log << MSG::INFO - << "Unable to retrieve TileTBID helper from DetectorStore" << endmsg; + ATH_MSG_WARNING("Unable to retrieve TileTBID helper from DetectorStore"); } // retrieve MuonDetectorManager from the conditions store ATH_CHECK(m_DetectorManagerKey.initialize()); - log << MSG::INFO << "Initialization ended " << endmsg; + ATH_MSG_INFO("Initialization ended "); return StatusCode::SUCCESS; } // Execute StatusCode MuonCalibAlg::execute(){ + if( m_createRootFile ) { + if(!m_ntupFileOpen) { + // create the root file: + // was originally in the constructor - from where it was not possible to + // configure the file name - please let me know if in some use-case + // having it here causes troubles - domizia.orestano@cern.ch + RootFileManager::getInstance()->openFile(m_ntupleName); + m_ntupFileOpen=true; + ATH_CHECK(m_muonCalibTool.retrieve()); + } - MsgStream log(msgSvc(), name()); - //log << MSG::DEBUG << " execute() " << endmsg; - //std::cout<<"execute()"<<std::endl; - if( m_createRootFile ) - { - if(!m_ntupFileOpen) { - // create the root file: - // was originally in the constructor - from where it was not possible to - // configure the file name - please let me know if in some use-case - // having it here causes troubles - domizia.orestano@cern.ch - RootFileManager::getInstance()->openFile(m_ntupleName); - m_ntupFileOpen=true; - - StatusCode ssc = m_muonCalibTool.retrieve(); - if (ssc.isFailure()) { - log << MSG::FATAL << "Could not find tool " << m_muonCalibTool << endmsg; - return ssc; - } else { - log << MSG::INFO << "Retrieved tool " << m_muonCalibTool << endmsg; - } - } - - log<<MSG::INFO<<"Write metadata"<<endmsg; - const TagInfo* tagInfo = 0; - StatusCode sc = detStore()->retrieve(tagInfo); - if (sc.isFailure() || tagInfo==0) { - log << MSG::FATAL - << "No TagInfo in DetectorStore" - << endmsg; - return StatusCode::FAILURE; - } - TagInfo::NameTagPairVec tags; - tagInfo->getTags(tags); - std::map<std::string, std::string> metadata; - for(TagInfo::NameTagPairVec::const_iterator it=tags.begin(); it!=tags.end(); it++) - { - //std::cout<<it->first<<" "<<it->second<<std::endl; - metadata[it->first]=it->second; - } - RootFileManager::getInstance()->WriteMetaData(metadata, m_ntupleName); - m_createRootFile=false; - } - + ATH_MSG_INFO("Write metadata"); + const TagInfo* tagInfo = nullptr; + StatusCode sc = detStore()->retrieve(tagInfo); + if (sc.isFailure() || !tagInfo) { + ATH_MSG_FATAL("No TagInfo in DetectorStore"); + return StatusCode::FAILURE; + } + TagInfo::NameTagPairVec tags; + tagInfo->getTags(tags); + std::map<std::string, std::string> metadata; + for (TagInfo::NameTagPairVec::const_iterator it=tags.begin(); it!=tags.end(); it++) metadata[it->first]=it->second; + RootFileManager::getInstance()->WriteMetaData(metadata, m_ntupleName); + m_createRootFile=false; + } + const MuonCalibEvent* event = retrieveEvent(); - //std::cout<<"got event"<<std::endl; - m_muonCalibTool->handleEvent( event ) ; - //std::cout<<"calib tool handled event"<<std::endl; if (m_doDeleteEvent == true) delete event; else m_events.push_back(event); - - //std::cout<<"done with execute"<<std::endl; return StatusCode::SUCCESS; } StatusCode MuonCalibAlg::finalize(){ - MsgStream log(msgSvc(), name()); - log << MSG::INFO << "Finalisation started " << endmsg; + ATH_MSG_INFO("Finalisation started "); if(m_ntupFileOpen) { // perform analysis @@ -267,23 +226,18 @@ namespace MuonCalib { const MuonCalibEvent::MCPVec MuonCalibAlg::retrievePatterns() const { - MsgStream log(msgSvc(), name()); MuonCalibEvent::MCPVec patternVec; - - // retrieve MuonCalibPatternCollection if (!evtStore()->contains<MuonCalibPatternCollection>(m_globalPatternLocation)) { - log << MSG::DEBUG << "MuonCalibPatternCollection not contained in StoreGate at:" << m_globalPatternLocation << endmsg; - //std::cout<<"MuonCalibPatternCollection not contained in StoreGate at: "<<m_globalPatternLocation <<std::endl; + ATH_MSG_DEBUG("MuonCalibPatternCollection not contained in StoreGate at:" << m_globalPatternLocation); return patternVec; } const MuonCalibPatternCollection* pats = 0; StatusCode sc = evtStore()->retrieve(pats,m_globalPatternLocation); if (sc.isFailure()) { - log << MSG::WARNING << "Could not find MuonCalibPatternCollection at " << m_globalPatternLocation <<endmsg; + ATH_MSG_WARNING("Could not find MuonCalibPatternCollection at " << m_globalPatternLocation); }else{ - log << MSG::DEBUG << "retrieved MuonCalibPatternCollection " << pats->size() << endmsg; - //std::cout<< "retrieved MuonCalibPatternCollection " << pats->size() <<std::endl; + ATH_MSG_DEBUG("retrieved MuonCalibPatternCollection " << pats->size()); patternVec.reserve(pats->size()); MuonCalibPatternCollection::const_iterator pat_it = pats->begin(); @@ -300,122 +254,59 @@ namespace MuonCalib { const MuonCalibTruthCollection* MuonCalibAlg::retrieveTruthCollection() const { - MsgStream log(msgSvc(), name()); - const TrackRecordCollection* truthCollection = 0; - std::string location = "MuonEntryLayer"; // Was "MuonEntryLayer" - bool found = false, filled = false; - StatusCode sc; - if(!found){ - if ( evtStore()->contains<TrackRecordCollection>(location) ) found = true ; - if( found ) { - sc = evtStore()->retrieve(truthCollection,location ); - if( truthCollection->size() == 0 ) filled = false ; - else filled = true ; - } else { - log << MSG::DEBUG << "location " << location << " discarded" << endmsg; - found = false ; + const TrackRecordCollection* truthCollection = nullptr; + std::string location = "MuonEntryLayer"; + bool found = false; + bool filled = false; + if ( evtStore()->contains<TrackRecordCollection>(location) ) found = true ; + if( found ) { + if (evtStore()->retrieve(truthCollection,location).isFailure()) { + ATH_MSG_WARNING("MuonCalibAlg::retrieveTruthCollection: could not retrieve TrackRecordCollection "<<location<<", trying MuonEntryRecord next"); } + if( truthCollection->size() == 0 ) filled = false ; + else filled = true ; + } else { + ATH_MSG_DEBUG("location " << location << " discarded"); } if(!found){ location ="MuonEntryRecord"; if ( evtStore()->contains<TrackRecordCollection>(location) ) found = true ; if( found ) { - sc = evtStore()->retrieve(truthCollection,location ); - if( truthCollection->size() == 0 ) filled = false ; - else filled = true ; + if (evtStore()->retrieve(truthCollection,location).isFailure()) { + ATH_MSG_WARNING("MuonCalibAlg::retrieveTruthCollection: could not retrieve TrackRecordCollection "<<location); + } + if( truthCollection->size() == 0 ) filled = false ; + else filled = true ; } else { - log << MSG::DEBUG << "location " << location << " discarded" << endmsg; - found = false ; + ATH_MSG_DEBUG("location " << location << " discarded"); } } - - if(!found){ - // location ="MuonExitLayer"; - // if ( evtStore()->contains<TrackRecordCollection>(location) ) found = true ; - // if( found ) { - // sc = evtStore()->retrieve(truthCollection,location ); - // if( truthCollection->size() == 0 ) filled = false ; - // else filled = true ; - // } else { - // log << MSG::DEBUG << "location " << location << " discarded" << endmsg; - // found = false ; - // } - } - - if(!found){ - // location ="MuonExitRecord"; - // if ( evtStore()->contains<TrackRecordCollection>(location) ) found = true ; - // if( found ) { - // sc = evtStore()->retrieve(truthCollection,location ); - // if( truthCollection->size() == 0 ) filled = false ; - // else filled = true ; - // } else log << MSG::DEBUG << "location " << location << " discarded" << endmsg; - } - - if(!found){ - // location ="CaloEntryLayer"; - // if ( evtStore()->contains<TrackRecordCollection>(location) ) found = true ; - // if( found ) { - // sc = evtStore()->retrieve(truthCollection,location ); - // if( truthCollection->size() == 0 ) filled = false ; - // else filled = true ; - // } else { - // log << MSG::DEBUG << "location " << location << " discarded" << endmsg; - // found = false ; - // } - } - - if(!found){ - // location ="CaloEntryRecord"; - // if ( evtStore()->contains<TrackRecordCollection>(location) ) found = true ; - // if( found ) { - // sc = evtStore()->retrieve(truthCollection,location ); - // if( truthCollection->size() == 0 ) filled = false ; - // else filled = true; - // } else { - // log << MSG::DEBUG << "location " << location << " discarded" << endmsg; - // found = false; - // } - } - - - if(found && filled){ - log << MSG::DEBUG << "TracksRecordCollections collected at location: " << location << endmsg; + ATH_MSG_DEBUG("TracksRecordCollections collected at location: " << location); } if(!found){ - log << MSG::DEBUG << "TracksRecordCollections nowhere to found in Storegate, nor filled" << endmsg; + ATH_MSG_DEBUG("TracksRecordCollections nowhere to found in Storegate, nor filled"); } if(found && !filled){ - log << MSG::DEBUG << "TracksRecordCollections collected at location: " << location << " are empty " << endmsg; + ATH_MSG_DEBUG("TracksRecordCollections collected at location: " << location << " are empty "); } MuonCalibTruthCollection* MCtruthCollection = new MuonCalibTruthCollection(); - - if (sc.isFailure() ) { - // log << MSG::ERROR << "Could not find TrackRecordCollection at " << location << " trying MuonEntryRecord" << endmsg; - // location = "MuonEntryRecord"; - // sc = evtStore()->retrieve(truthCollection,location ); - // if (sc.isFailure() ) { - // log << MSG::ERROR << "Could not find TrackRecordCollection at " << location <<endmsg; - return 0; - // } - } std::set < int > muonBarCode; bool muonfound = false; - if(!sc.isFailure() && found && filled ){ + if(found && filled ){ const McEventCollection* mcEventCollection = 0; std::string MClocation = "TruthEvent"; if(evtStore()->contains<McEventCollection>(MClocation)) { StatusCode scmc = evtStore()->retrieve(mcEventCollection, MClocation); if (StatusCode::SUCCESS == scmc ){ - log<<MSG::DEBUG << " McEventCollection collection retrieved " <<endmsg; + ATH_MSG_DEBUG(" McEventCollection collection retrieved "); } - log << MSG::DEBUG << "retrieved TrackRecordCollection " << truthCollection->size() << endmsg; + ATH_MSG_DEBUG("retrieved TrackRecordCollection " << truthCollection->size()); //Convert TrackRecordCollection to MuonCalibTruthCollection TrackRecordConstIterator tr_it = truthCollection->begin(); @@ -454,7 +345,6 @@ namespace MuonCalib { } } } - // std::cout << " New BARCODE " << newbarcode << std::endl; } // barcode from TrackRecord MuonCalibTruth* truth = new MuonCalibTruth(); @@ -483,13 +373,13 @@ namespace MuonCalib { bool addmuonatIP = true; if (!muonfound||addmuonatIP) { //retrieve truth track by other means: via McEventCollection... - const McEventCollection* mcEventCollection = 0; + const McEventCollection* mcEventCollection = nullptr; std::string MClocation = "TruthEvent"; if(evtStore()->contains<McEventCollection>(MClocation)) { StatusCode sc = evtStore()->retrieve(mcEventCollection, MClocation); if (StatusCode::SUCCESS == sc ) { - log<<MSG::DEBUG << " McEventCollection collection retrieved " <<endmsg; + ATH_MSG_DEBUG(" McEventCollection collection retrieved "); const HepMC::GenEvent* myGenEvent = *(mcEventCollection -> begin()); HepMC::GenEvent::particle_const_iterator particle = myGenEvent->particles_begin(); @@ -523,7 +413,7 @@ namespace MuonCalib { } } } else { - log<<MSG::WARNING << " McEventCollection collection NOT retrieved "<<endmsg; + ATH_MSG_WARNING(" McEventCollection collection NOT retrieved "); } }//retrieved other MCtruth } @@ -545,27 +435,21 @@ namespace MuonCalib { if(!evtStore()->contains<MuonSimDataCollection>(sdoKey)) { addDummy = true; }else{ - sc = evtStore()->retrieve(sdoContainer,sdoKey); - if (!sc.isSuccess()) { - log << MSG::DEBUG << "No MDT Sdo Container found" << endmsg; + if (!evtStore()->retrieve(sdoContainer,sdoKey).isSuccess()) { + ATH_MSG_DEBUG("No MDT Sdo Container found"); addDummy = true; } } if( addDummy ){ // Store one entry with zero's to recognize it offline - MuonCalibMdtTruthHit* mdtTruth = new MuonCalibMdtTruthHit(); - // MuonFixedId fID = 0; mdtTruth->setBarCode(0) ; - // mdtTruth->setIdentifier(fID) ; mdtTruth->setDriftRadius(0.) ; mdtTruth->setPositionAlongTube(0.); MCtruthCollection->addTruth( mdtTruth ); - // std::cout << " ZEROs added mdtTruth " << std::endl; - // return 0; } else { - log << MSG::DEBUG << "MDT Sdo Container found" << endmsg; + ATH_MSG_DEBUG("MDT Sdo Container found"); MuonSimDataCollection::const_iterator mdt_it = sdoContainer->begin(); MuonSimDataCollection::const_iterator mdt_it_end = sdoContainer->end(); bool drop = false; @@ -576,9 +460,6 @@ namespace MuonCalib { std::vector< MuonSimData::Deposit >::const_iterator deposits_it_end = (*mdt_it).second.getdeposits().end() ; for( ; deposits_it!= deposits_it_end; ++deposits_it) { int barcode = (*deposits_it).first.barcode(); - // Check that deposit is from truth muon ' -// PK 20/12/2009 if (barcode == 0) continue; - // std::cout << " MDT hit barcode " << barcode << std::endl; if (muonBarCode.count(barcode+10000)!=1&&muonBarCode.count(barcode)!=1&&muonBarCode.count(barcode%10000)!=1&&m_doTruthMuonOnly) continue; if (nmdtSDO>999) drop = true; if (!drop || (drop && (*deposits_it).first.barcode() != 0)) { @@ -592,7 +473,6 @@ namespace MuonCalib { mdtTruth->setBarCode( (*deposits_it).first.barcode() ) ; mdtTruth->setIdentifier( mfi ) ; nsdo++; - // std::cout << " Muon SDO Id " << m_idToFixedIdTool->idToFixedId( (*mdt_it).first ) << " Drift Radius " << (*deposits_it).second.firstEntry() << " nsdo " << nsdo << std::endl; mdtTruth->setDriftRadius( (*deposits_it).second.firstEntry() ) ; double posAlongAMDB = (*deposits_it).second.secondEntry(); Amg::Vector3D geoModelLocPos(0.,0.,posAlongAMDB); @@ -601,7 +481,6 @@ namespace MuonCalib { Amg::Vector3D gpos = detEl->localToGlobalCoords(geoModelLocPos,id); Amg::Vector3D localAMDBPos = detEl->GlobalToAmdbLRSTransform()*gpos; posAlongAMDB = localAMDBPos.x(); - // std::cout << " pos sdo " << (*deposits_it).second.secondEntry() << " pos AMDB " << posAlongAMDB << " 3D " << localAMDBPos << std::endl; } mdtTruth->setPositionAlongTube( posAlongAMDB ); mdtTruth->identify(); @@ -620,14 +499,13 @@ namespace MuonCalib { if(!evtStore()->contains<MuonSimDataCollection>(sdoKey)) { addDummy = true; }else{ - sc = evtStore()->retrieve(sdoContainer,sdoKey); - if (!sc.isSuccess()) { + if (!evtStore()->retrieve(sdoContainer,sdoKey).isSuccess()) { addDummy = true; } } if(addDummy) { - log << MSG::DEBUG << "No RPC Sdo Container found" << endmsg; + ATH_MSG_DEBUG("No RPC Sdo Container found"); // Store one entry with zero's to recognize it offline @@ -636,7 +514,7 @@ namespace MuonCalib { rpcTruth->setTime(0.) ; MCtruthCollection->addTruth( rpcTruth ); } else { - log << MSG::DEBUG << "RPC Sdo Container found" << endmsg; + ATH_MSG_DEBUG("RPC Sdo Container found"); MuonSimDataCollection::const_iterator rpc_it = sdoContainer->begin(); MuonSimDataCollection::const_iterator rpc_it_end = sdoContainer->end(); bool drop = false; @@ -675,9 +553,8 @@ namespace MuonCalib { if(!evtStore()->contains<MuonSimDataCollection>(sdoKey)) { addDummy = true; }else{ - sc = evtStore()->retrieve(sdoContainer,sdoKey); - if (!sc.isSuccess()) { - log << MSG::DEBUG << "No TGC Sdo Container found" << endmsg; + if (!evtStore()->retrieve(sdoContainer,sdoKey).isSuccess()) { + ATH_MSG_DEBUG("No TGC Sdo Container found"); addDummy = true; } } @@ -690,7 +567,7 @@ namespace MuonCalib { tgcTruth->setTime(0.) ; MCtruthCollection->addTruth( tgcTruth ); } else { - log << MSG::DEBUG << "Sdo TGC Container found" << endmsg; + ATH_MSG_DEBUG("Sdo TGC Container found"); MuonSimDataCollection::const_iterator tgc_it = sdoContainer->begin(); MuonSimDataCollection::const_iterator tgc_it_end = sdoContainer->end(); bool drop = false; @@ -727,9 +604,8 @@ namespace MuonCalib { sdoKey= "CSC_SDO"; if (evtStore()->contains<MuonSimDataCollection>(sdoKey)) { - sc = evtStore()->retrieve(sdoContainer,sdoKey); - if (sc.isSuccess()) { - log << MSG::DEBUG << "CSC Sdo Container found" << endmsg; + if (evtStore()->retrieve(sdoContainer,sdoKey).isSuccess()) { + ATH_MSG_DEBUG("CSC Sdo Container found"); MuonSimDataCollection::const_iterator csc_it = sdoContainer->begin(); MuonSimDataCollection::const_iterator csc_it_end = sdoContainer->end(); bool drop = false; @@ -757,20 +633,19 @@ namespace MuonCalib { } } } else { - log << MSG::DEBUG << "No CSC MuonSimHit Sdo Container found" << endmsg; + ATH_MSG_DEBUG("No CSC MuonSimHit Sdo Container found"); const CscSimDataCollection* cscSdoContainer; bool addDummy = false; if(!evtStore()->contains<CscSimDataCollection>(sdoKey)) { addDummy = true; }else{ - sc = evtStore()->retrieve(cscSdoContainer,sdoKey); - if (!sc.isSuccess()) { + if (!evtStore()->retrieve(cscSdoContainer,sdoKey).isSuccess()) { addDummy = true; } } if (addDummy) { - log << MSG::DEBUG << "No CSC Sdo Container found" << endmsg; + ATH_MSG_DEBUG("No CSC Sdo Container found"); // Store one entry with zero's to recognize it offline @@ -779,7 +654,7 @@ namespace MuonCalib { cscTruth->setTime(0.) ; MCtruthCollection->addTruth( cscTruth ); } else { - log << MSG::DEBUG << "CSC Sdo Container found" << endmsg; + ATH_MSG_DEBUG("CSC Sdo Container found"); CscSimDataCollection::const_iterator csc_it = cscSdoContainer->begin(); CscSimDataCollection::const_iterator csc_it_end = cscSdoContainer->end(); bool drop = false; @@ -797,8 +672,8 @@ namespace MuonCalib { Identifier id = (*csc_it).first; const MuonGM::CscReadoutElement* detEl = MuonDetMgr->getCscReadoutElement(id); if( !detEl ){ - log << MSG::WARNING << "Found CSC Identifier which seems to have no readout element " - << m_idHelperSvc->mdtIdHelper().print_to_string(id) << endmsg; + ATH_MSG_WARNING("Found CSC Identifier which seems to have no readout element " + << m_idHelperSvc->mdtIdHelper().print_to_string(id)); continue; } MuonFixedId mfi = m_idToFixedIdTool->idToFixedId(id); @@ -822,24 +697,21 @@ namespace MuonCalib { } } // m_doCSCs - log << MSG::DEBUG << "retrieved MCtruthCollection size " << MCtruthCollection->numberOfTruth() << endmsg; + ATH_MSG_DEBUG("retrieved MCtruthCollection size " << MCtruthCollection->numberOfTruth()); return MCtruthCollection; } MuonCalibEventInfo MuonCalibAlg::retrieveEventInfo() const { - MsgStream log(msgSvc(), name()); - const xAOD::EventInfo* eventInfo; - log<<MSG::VERBOSE<<"retrieveEventInfo() called"<<endmsg; - + const xAOD::EventInfo* eventInfo=nullptr; MuonCalibEventInfo MCeventInfo; StatusCode sc = evtStore()->retrieve(eventInfo); if ( sc.isFailure() ) { - log << MSG::ERROR << "Could not find eventInfo " << endmsg; + ATH_MSG_ERROR("Could not find eventInfo "); return MCeventInfo; }else{ - log << MSG::DEBUG << "retrieved eventInfo" << endmsg; + ATH_MSG_DEBUG("retrieved eventInfo"); } //Cast eventID into MuonCalibEventInfo class: @@ -857,27 +729,26 @@ namespace MuonCalib { { if(!m_trigger_waning_printed) { - log<< MSG::INFO; + ATH_MSG_INFO("No trigger info, not added to EventTag"); m_trigger_waning_printed=true; } else { - log<<MSG::DEBUG; + ATH_MSG_DEBUG("No trigger info, not added to EventTag"); } - log << "No trigger info, not added to EventTag" << endmsg; + return MCeventInfo; } if ( evtStore()->retrieve( ctpRDO, "CTP_RDO" ).isFailure() ) { if(!m_trigger_waning_printed) { - log<< MSG::INFO; + ATH_MSG_INFO("CTP_RDO trigger info missing, not added to EventTag"); m_trigger_waning_printed=true; } else { - log<<MSG::DEBUG; + ATH_MSG_DEBUG("CTP_RDO trigger info missing, not added to EventTag"); } - log<<"CTP_RDO trigger info missing, not added to EventTag" << endmsg; return MCeventInfo; } CTP_Decoder ctp; @@ -904,8 +775,6 @@ namespace MuonCalib { /// const MuonCalibTriggerTimeInfo* MuonCalibAlg::retrieveTriggerTimeInfo() const { - - MsgStream log(msgSvc(), name()); MuonCalibTriggerTimeInfo trigTimeInfo; /////////////////////////////////////////////////////// // MBTS word - copied from: @@ -929,7 +798,7 @@ namespace MuonCalib { TileCellContainer::const_iterator itr_end = tileCellCnt->end(); for(; itr != itr_end; ++itr) { charge = (*itr)->energy(); - log << MSG::DEBUG << "Energy =" << charge << "pC" << endmsg; + ATH_MSG_DEBUG("Energy =" << charge << "pC"); if(charge > m_mbts_threshold) { Identifier id=(*itr)->ID(); // cache type, module and channel @@ -950,15 +819,15 @@ namespace MuonCalib { // Catch errors if( std::abs(type_id) != 1 ){ - log << MSG::WARNING << "MBTS identifier type is out of range" << endmsg; + ATH_MSG_WARNING("MBTS identifier type is out of range"); continue; } if( channel_id < 0 || channel_id > 1 ){ - log << MSG::WARNING << "MBTS identifier channel is out of range" << endmsg; + ATH_MSG_WARNING("MBTS identifier channel is out of range"); continue; } if( module_id < 0 || module_id > 7 ){ - log << MSG::WARNING << "MBTS identifier module is out of range" << endmsg; + ATH_MSG_WARNING("MBTS identifier module is out of range"); continue; } bit_pos = 0; // The position of the bit @@ -977,7 +846,7 @@ namespace MuonCalib { { if(!m_mbts_warning_printed) { - log << MSG::INFO << "No MBTS info in store gate" <<endmsg; + ATH_MSG_INFO("No MBTS info in store gate"); m_mbts_warning_printed=true; } } @@ -1001,7 +870,7 @@ namespace MuonCalib { { if(!m_lar_waning_printed) { - log << MSG::INFO << "LArCollisionTime not in store gate." <<endmsg; + ATH_MSG_INFO("LArCollisionTime not in store gate."); m_lar_waning_printed=true; } } @@ -1015,9 +884,7 @@ namespace MuonCalib { } //// - const MuonCalibRawHitCollection* MuonCalibAlg::retrieveRawHits( const MuonCalibEvent::MCPVec &patterns ) const{ - MsgStream log(msgSvc(), name()); - + const MuonCalibRawHitCollection* MuonCalibAlg::retrieveRawHits( const MuonCalibEvent::MCPVec &patterns ) const{ MuonCalibRawHitCollection* rawHits = new MuonCalibRawHitCollection(); //First, construct maps of the hits on segment. They are ordered by MuonFixedId, @@ -1092,12 +959,12 @@ namespace MuonCalib { std::vector<const Muon::MdtPrepDataCollection*> mdtCols; const Muon::MdtPrepDataContainer* mdtPrds = 0; if( !evtStore()->contains<Muon::MdtPrepDataContainer>("MDT_DriftCircles")){ - log << MSG::DEBUG << "MdtPrepDataContainer MDT_DriftCircles not contained in SG" << endmsg; + ATH_MSG_DEBUG("MdtPrepDataContainer MDT_DriftCircles not contained in SG"); }else if( evtStore()->retrieve(mdtPrds,"MDT_DriftCircles").isFailure() ){ - log << MSG::DEBUG << "Cannot retrieve MdtPrepDataContainer MDT_DriftCircles" << endmsg; + ATH_MSG_DEBUG("Cannot retrieve MdtPrepDataContainer MDT_DriftCircles"); }else{ - log << MSG::DEBUG << "Retrieved MdtPrepDataContainer " << endmsg; + ATH_MSG_DEBUG("Retrieved MdtPrepDataContainer "); mdtCols.reserve(mdtPrds->size()); // number of mdt chambers Muon::MdtPrepDataContainer::const_iterator it = mdtPrds->begin(); @@ -1114,7 +981,6 @@ namespace MuonCalib { Amg::Transform3D globalToStation; Muon::MdtPrepDataCollection::const_iterator mdt_it = (*mdtCollection)->begin(); - //Muon::MdtPrepDataCollection::const_iterator mdt_it_begin = (*mdtCollection)->begin(); Muon::MdtPrepDataCollection::const_iterator mdt_it_end = (*mdtCollection)->end(); bool amdbtransform = false; for( ; mdt_it!=mdt_it_end; ++ mdt_it) @@ -1139,12 +1005,8 @@ namespace MuonCalib { rawMdtHit->setGlobalPosition( tubePos ); rawMdtHit->setAdc( (*mdt_it)->adc() ); rawMdtHit->setTdc( (*mdt_it)->tdc() ); - //std::cout<<"raw hit adc: "<<(*mdt_it)->adc()<<", tdc: "<<(*mdt_it)->tdc()<<std::endl; - //printf("raw hit adc: %d, tdc: %d \n",(*mdt_it)->adc(),(*mdt_it)->tdc()); rawMdtHit->setDriftTime( 0. ); rawMdtHit->setDriftRadius( (*mdt_it)->localPosition()[Trk::locR] ); - //std::cout<<"mdt hit locR covariance: "<<(*mdt_it)->localCovariance()(Trk::locR,Trk::locR)<<std::endl; - //printf("mdt hit locR and covariance: %.2f, %.15f \n",(*mdt_it)->localPosition()[Trk::locR],(*mdt_it)->localCovariance()(Trk::locR,Trk::locR)); rawMdtHit->setDriftRadiusError( 1./std::sqrt((*mdt_it)->localCovariance()(Trk::locR,Trk::locR)) ); int occupancy = 0; @@ -1154,8 +1016,6 @@ namespace MuonCalib { occupancy = -1; //ID of RawHit not found on any segment else occupancy = position->second; //ID of RawHit found n times on a segment in this event - //std::cout<<"raw hit occupancy: "<<occupancy<<std::endl; - //printf("raw hit occupancy: %d \n",occupancy); rawMdtHit->setOccupancy(occupancy); rawHits->addMuonCalibRawHit( rawMdtHit ); @@ -1169,12 +1029,11 @@ namespace MuonCalib { std::vector<const Muon::RpcPrepDataCollection*> rpcCols; const Muon::RpcPrepDataContainer* rpcPrds = 0; if( !evtStore()->contains<Muon::RpcPrepDataContainer>("RPC_Measurements") ){ - log << MSG::DEBUG << "RpcPrepDataContainer RPC_Measurements not contained in SG" << endmsg; + ATH_MSG_DEBUG("RpcPrepDataContainer RPC_Measurements not contained in SG"); }else if(evtStore()->retrieve(rpcPrds,"RPC_Measurements").isFailure()) { - log << MSG::DEBUG << "Cannot retrieve RpcPrepDataContainer RPC_Measurements" << endmsg; + ATH_MSG_DEBUG("Cannot retrieve RpcPrepDataContainer RPC_Measurements"); }else{ - - log << MSG::DEBUG << "Retrieved RpcPrepDataContainer " << endmsg; + ATH_MSG_DEBUG("Retrieved RpcPrepDataContainer "); rpcCols.reserve(rpcPrds->size()); // number of rpc chambers Muon::RpcPrepDataContainer::const_iterator it = rpcPrds->begin(); @@ -1211,12 +1070,11 @@ namespace MuonCalib { std::vector<const Muon::CscStripPrepDataCollection*> cscCols; const Muon::CscStripPrepDataContainer* cscPrds = 0; if( !evtStore()->contains<Muon::CscStripPrepDataContainer>("CSC_Measurements") ){ - log << MSG::DEBUG << "CscPrepDataContainer CSC_Measurements not contained in SG" << endmsg; + ATH_MSG_DEBUG("CscPrepDataContainer CSC_Measurements not contained in SG"); }else if(evtStore()->retrieve(cscPrds,"CSC_Measurements").isFailure()) { - log << MSG::DEBUG << "Cannot retrieve CscPrepDataContainer CSC_Measurements" << endmsg; + ATH_MSG_DEBUG("Cannot retrieve CscPrepDataContainer CSC_Measurements"); }else{ - - log << MSG::DEBUG << "Retrieved CscPrepDataContainer " << endmsg; + ATH_MSG_DEBUG("Retrieved CscPrepDataContainer "); cscCols.reserve(cscPrds->size()); Muon::CscStripPrepDataContainer::const_iterator it = cscPrds->begin(); @@ -1241,15 +1099,12 @@ namespace MuonCalib { rawCscHit->setId( fID ); // time of first sample is not very useful. we need fitted time // invoke fitter first and then set the time - //rawCscHit->setT( (*csc_it)->timeOfFirstSample() ); int measuresPhi = m_idHelperSvc->cscIdHelper().measuresPhi((*csc_it)->identify()); int chamberLayer = m_idHelperSvc->cscIdHelper().chamberLayer((*csc_it)->identify()); float stripWidth = (*csc_it)->detectorElement()->cathodeReadoutPitch( chamberLayer, measuresPhi ); rawCscHit->setWidth( stripWidth ); // invoke the strip fitter to fit the time samples (which is a vector of 4 elements) - // fitter outputs the sample charge, time etc. which we can store here - //rawCscHit->setCharge( (*csc_it)->charge() ); - + // fitter outputs the sample charge, time etc. which we can store here ICscStripFitter::Result fitres; // fit result will be here fitres = m_stripFitter->fit(**csc_it); rawCscHit->setCharge(fitres.charge); @@ -1279,12 +1134,11 @@ namespace MuonCalib { << (bcTag==TgcDigit::BC_NEXT ? "NextBC" : ""); if( !evtStore()->contains<Muon::TgcPrepDataContainer>(location.str()) ){ - log << MSG::DEBUG << "Cannot retrieve TgcPrepDataContainer " << location.str() << endmsg; + ATH_MSG_DEBUG("Cannot retrieve TgcPrepDataContainer " << location.str()); }else if(evtStore()->retrieve(tgcPrds[ibc],location.str()).isFailure()) { - log << MSG::DEBUG << "Cannot retrieve TgcPrepDataContainer " << location.str() << endmsg; + ATH_MSG_DEBUG("Cannot retrieve TgcPrepDataContainer " << location.str()); }else{ - - log << MSG::DEBUG << "Retrieved TgcPrepDataContainer " << location.str() << endmsg; + ATH_MSG_DEBUG("Retrieved TgcPrepDataContainer " << location.str()); tgcCols.clear(); tgcCols.reserve(tgcPrds[ibc]->size()); // number of tgc chambers @@ -1364,12 +1218,11 @@ namespace MuonCalib { location << "TrigT1CoinDataCollection" << (bcTag==TgcDigit::BC_PREVIOUS ? "PriorBC" : "") << (bcTag==TgcDigit::BC_NEXT ? "NextBC" : ""); if( !evtStore()->contains<Muon::TgcCoinDataContainer>(location.str()) ){ - log << MSG::DEBUG << "TgcCoinDataContainer not contained in SG at" << location.str() << endmsg; + ATH_MSG_DEBUG("TgcCoinDataContainer not contained in SG at" << location.str()); }else if(evtStore()->retrieve(tgcCoinPrds[ibc],location.str()).isFailure()) { - log << MSG::DEBUG << "Cannot retrieve TgcCoinDataContainer" << location.str() << endmsg; + ATH_MSG_DEBUG("Cannot retrieve TgcCoinDataContainer" << location.str()); }else{ - - log << MSG::DEBUG << "Retrieved TgcCoinDataContainer " << location.str() << endmsg; + ATH_MSG_DEBUG("Retrieved TgcCoinDataContainer " << location.str()); tgcCoinCols.clear(); tgcCoinCols.reserve(tgcCoinPrds[ibc]->size()); // number of tgcCoin chambers @@ -1483,12 +1336,12 @@ namespace MuonCalib { if( m_doRPCCoin ){ const Muon::RpcCoinDataContainer* rpcCoinContainer = 0; if( !evtStore()->contains<Muon::RpcCoinDataContainer>("RPC_triggerHits") ){ - log << MSG::DEBUG << "RpcCoinDataContainer not contained in SG" << endmsg; + ATH_MSG_DEBUG("RpcCoinDataContainer not contained in SG"); }else if(evtStore()->retrieve(rpcCoinContainer,"RPC_triggerHits").isFailure()) { - log << MSG::DEBUG << "Cannot retrieve RpcCoinDataContainer" << endmsg; + ATH_MSG_DEBUG("Cannot retrieve RpcCoinDataContainer"); }else{ - log << MSG::DEBUG << "Retrieved RpcCoinDataContainer " << rpcCoinContainer->numberOfCollections() << endmsg; + ATH_MSG_DEBUG("Retrieved RpcCoinDataContainer " << rpcCoinContainer->numberOfCollections()); Muon::RpcCoinDataContainer::const_iterator it = rpcCoinContainer->begin(); Muon::RpcCoinDataContainer::const_iterator it_end = rpcCoinContainer->end(); @@ -1513,13 +1366,13 @@ namespace MuonCalib { lowPtCm); rawHits->addMuonCalibRawHit(rawRpcCoin); - if( log.level() <= MSG::DEBUG ){ + if(msgLvl(MSG::DEBUG)){ MuonCalibRawRpcCoin& hit = *rawRpcCoin; - log << MSG::DEBUG << " RpcCoinData: sector " << hit.parentSectorId() << " pad " << hit.parentPadId() + ATH_MSG_DEBUG(" RpcCoinData: sector " << hit.parentSectorId() << " pad " << hit.parentPadId() << " CLHEP::cm " << hit.parentCmId() << " ijk " << hit.ijk() << " lowPT " << hit.lowPtCm() << " overlap " << hit.overlap() << " time " << hit.t() << " eta " << hit.globalPosition().eta() - << " phi " << hit.globalPosition().phi() << endmsg; + << " phi " << hit.globalPosition().phi()); } delete rawRpc; } @@ -1531,30 +1384,27 @@ namespace MuonCalib { } const MuonCalibRawTriggerHitCollection* MuonCalibAlg::retrieveRawTriggerHits() const{ - MsgStream log(msgSvc(), name()); // Rpc trigger hits - const RpcPadContainer* rpcRDO = 0; - const RpcPad* rdoColl = 0; + const RpcPadContainer* rpcRDO = nullptr; + const RpcPad* rdoColl = nullptr; MuonCalibRawTriggerHitCollection* rawTriggerHits = new MuonCalibRawTriggerHitCollection(); if( !evtStore()->contains<RpcPadContainer>("RPCPAD") ){ - log << MSG::DEBUG << "RpcPadContainer not contained in SG" << endmsg; + ATH_MSG_DEBUG("RpcPadContainer not contained in SG"); }else if(evtStore()->retrieve(rpcRDO,"RPCPAD").isFailure()) { - log << MSG::DEBUG << "Cannot retrieve RpcPadContainer" << endmsg; + ATH_MSG_DEBUG("Cannot retrieve RpcPadContainer"); }else{ - log << MSG::VERBOSE << "Retrieved RawRpcTriggerDataContainer " << rpcRDO->numberOfCollections() << endmsg; + ATH_MSG_VERBOSE("Retrieved RawRpcTriggerDataContainer " << rpcRDO->numberOfCollections()); for (RpcPadContainer::const_iterator rdoColli = rpcRDO->begin(); rdoColli!=rpcRDO->end(); ++rdoColli){ rdoColl = *rdoColli; // Now loop on the RDO if ( (rdoColl)->size() != 0 ) { // number of cma/pad - //log << MSG::DEBUG << "Number of RpcCoin for this PAD is " << (rdoColl)->size() << endmsg; // for each pad, loop over cma RpcPad::const_iterator it_cma = (rdoColl)->begin(); RpcPad::const_iterator it_cma_end = (rdoColl)->end(); for (; it_cma!=it_cma_end; ++it_cma) { const RpcCoinMatrix * cma = (*it_cma); //for each cma loop over fired channels - //if ( (cma)->size() != 0 ) { // number of channels/cma - log << MSG::DEBUG << "Number of fired channels for this CM is " << (cma)->size() << endmsg; + ATH_MSG_DEBUG("Number of fired channels for this CM is " << (cma)->size()); RpcCoinMatrix::const_iterator it_chan = (*it_cma)->begin(); RpcCoinMatrix::const_iterator it_chan_end = (*it_cma)->end(); for (; it_chan!=it_chan_end; ++it_chan) { @@ -1581,12 +1431,11 @@ namespace MuonCalib { } } //for (RpcPadContainer::const_iterator rdoColli.... } - log << MSG::VERBOSE << "rawTriggerHits for this event has " << rawTriggerHits->numberOfMuonCalibRawRpcTriggerHits() << " RPC trigger hits " << endmsg; + ATH_MSG_VERBOSE("rawTriggerHits for this event has " << rawTriggerHits->numberOfMuonCalibRawRpcTriggerHits() << " RPC trigger hits "); return rawTriggerHits; } const MuonCalibEvent* MuonCalibAlg::retrieveEvent() const { - MsgStream log(msgSvc(), name()); //Retrieve all ingredients needed to build an MuonCalibEvent MuonCalibEventInfo eventInfo = retrieveEventInfo(); @@ -1615,15 +1464,15 @@ namespace MuonCalib { } else event->setMuonCalibTruthCollection( 0 ); if( m_doRpcSectorLogic ){ - const RpcSectorLogicContainer* slLogic = 0; + const RpcSectorLogicContainer* slLogic = nullptr; if( !evtStore()->contains<RpcSectorLogicContainer>("") ){ - log << MSG::DEBUG << " RpcSectorLogicContainer not contained in SG" << endmsg; + ATH_MSG_DEBUG(" RpcSectorLogicContainer not contained in SG"); }else if(evtStore()->retrieve(slLogic).isFailure()) { - log << MSG::DEBUG << "Cannot retrieve RpcSectorLogicContainer" << endmsg; + ATH_MSG_DEBUG("Cannot retrieve RpcSectorLogicContainer"); } event->setRpcSectorLogicContainer(slLogic); - if( /*log.level() <= MSG::DEBUG &&*/ slLogic ){ + if( slLogic ){ const RpcSectorLogicContainer& slContainer = *slLogic; // loop over container RpcSectorLogicContainer::const_iterator slit = slContainer.begin(); @@ -1631,16 +1480,16 @@ namespace MuonCalib { for( ;slit!=slit_end;++slit ){ const RpcSectorLogic& slLogic = **slit; if( slLogic.empty() ) continue; - log << MSG::DEBUG << " RpcSectorLogic: sector " << slLogic.sectorId() + ATH_MSG_DEBUG(" RpcSectorLogic: sector " << slLogic.sectorId() << " felId " << slLogic.fel1Id() << " bcId " << slLogic.bcid() << " errCode " << slLogic.errorCode() - << " crc " << slLogic.crc() << endmsg; + << " crc " << slLogic.crc()); RpcSectorLogic::const_iterator hitIt = slLogic.begin(); RpcSectorLogic::const_iterator hitIt_end = slLogic.end(); for( ;hitIt != hitIt_end; ++hitIt ){ const RpcSLTriggerHit& slHit = **hitIt; - log << MSG::DEBUG<< " hit: rowinBcid " << slHit.rowinBcid() + ATH_MSG_DEBUG(" hit: rowinBcid " << slHit.rowinBcid() << " padId " << slHit.padId() << " ptid " << slHit.ptId() << " roi " << slHit.roi() @@ -1648,7 +1497,7 @@ namespace MuonCalib { << " overlapPhi " << slHit.overlapPhi() << " overlapEta " << slHit.overlapEta() << " triggerBcid " << slHit.triggerBcid() - << " isInput" << slHit.isInput() << endmsg; + << " isInput" << slHit.isInput()); } } } diff --git a/MuonSpectrometer/MuonCalib/MuonCalibDbOperations/src/CoolInserter.cxx b/MuonSpectrometer/MuonCalib/MuonCalibDbOperations/src/CoolInserter.cxx index c3e267ca36a540fde09b34f1c0a110a616708327..efe8779a346f40fac15ff7c22a8da13ae267908d 100644 --- a/MuonSpectrometer/MuonCalib/MuonCalibDbOperations/src/CoolInserter.cxx +++ b/MuonSpectrometer/MuonCalib/MuonCalibDbOperations/src/CoolInserter.cxx @@ -32,7 +32,7 @@ #include "exception" #include <typeinfo> #include "zlib.h" -//using namespace cool; + namespace MuonCalib { CoolInserter::CoolInserter(const std::string& name, ISvcLocator* pSvcLocator) : AthAlgorithm(name, pSvcLocator), m_version("v0.0"), p_reg_sel_svc(NULL), m_cool_connect(false), m_t0_created(false), m_rt_created(false) { @@ -46,7 +46,6 @@ CoolInserter::CoolInserter(const std::string& name, ISvcLocator* pSvcLocator) : declareProperty("RtFolder", m_rt_folder); declareProperty("T0FolderCompress", m_compressed_t0); declareProperty("RtFolderCompress", m_compressed_rt); - declareProperty("CalibrationSources", m_calibration_sources); m_n_tubes_chamber=0; m_n_tubes_added=0; @@ -243,8 +242,6 @@ bool CoolInserter::StoreT0Chamber(const NtupleStationId & id, const std::string m_t0_created = true; } if(m_t0_created) { - std::cout<<"."<<std::flush; - // std::cout<<data_column.str()<<std::endl; for(std::map<bool, coral::AttributeList>::iterator it=m_mdtt0_cool_row.begin(); it!=m_mdtt0_cool_row.end(); it++) { it->second["file"].data<cool::String4k>() = file; it->second["tech"].data<int>() = creation_flags; @@ -330,8 +327,6 @@ bool CoolInserter::StoreRtChamber(const NtupleStationId & id, const std::map<int data_column<<it->second.x2() << "," << it->second.x1() << "," << it->second.error() << ","; } if(m_rt_created) { - std::cout<<"."<<std::flush; -// std::cout<<data_column.str()<<std::endl; for(std::map<bool, coral::AttributeList>::iterator it=m_mdtrt_cool_row.begin(); it!=m_mdtrt_cool_row.end(); it++) { it->second["tech"].data<int>() = creation_flags; it->second["file"].data<cool::String4k>() = file; @@ -377,7 +372,6 @@ inline bool CoolInserter::create_folder(const unsigned int & fldr_nr, const bool if (m_compressed_rt[fldr_nr]) compressed=true; } else { - std::cout<<"XXxxXX "<<m_compressed_t0.size() <<" "<<fldr_nr<<std::endl; if(m_compressed_t0.size()>fldr_nr) if (m_compressed_t0[fldr_nr]) compressed=true; diff --git a/MuonSpectrometer/MuonCalib/MuonCalibEventBase/MuonCalibEventBase/MuonCalibRawHitCollection.h b/MuonSpectrometer/MuonCalib/MuonCalibEventBase/MuonCalibEventBase/MuonCalibRawHitCollection.h index 077e2b8ea33bf7d1f348d3d3ec03972364cd377b..e23b1f47621806cce23f609d0cc30010a089ceba 100644 --- a/MuonSpectrometer/MuonCalib/MuonCalibEventBase/MuonCalibEventBase/MuonCalibRawHitCollection.h +++ b/MuonSpectrometer/MuonCalib/MuonCalibEventBase/MuonCalibEventBase/MuonCalibRawHitCollection.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ //*********************************************************// @@ -202,35 +202,30 @@ namespace MuonCalib { if(rawHit){ m_rawMdtHitVec.push_back(rawHit); } - // else std::cout << "!!!!Refuse to put an empty MuonCalibRawMdtHit in MuonCalibRawHitCollection" << std::endl; } inline void MuonCalibRawHitCollection::addMuonCalibRawHit( MuonCalibRawRpcHit *rawHit ) { if(rawHit){ m_rawRpcHitVec.push_back(rawHit); } - // else std::cout << "!!!!Refuse to put an empty MuonCalibRawRpcHit in MuonCalibRawHitCollection" << std::endl; } inline void MuonCalibRawHitCollection::addMuonCalibRawHit( MuonCalibRawTgcHit *rawHit ) { if(rawHit){ m_rawTgcHitVec.push_back(rawHit); } - // else std::cout << "!!!!Refuse to put an empty MuonCalibRawTgcHit in MuonCalibRawHitCollection" << std::endl; } inline void MuonCalibRawHitCollection::addMuonCalibRawHit( MuonCalibRawTgcCoin *rawHit ) { if(rawHit){ m_rawTgcCoinVec.push_back(rawHit); } - // else std::cout << "!!!!Refuse to put an empty MuonCalibRawTgcCoin in MuonCalibRawCoinCollection" << std::endl; } inline void MuonCalibRawHitCollection::addMuonCalibRawHit( MuonCalibRawCscHit *rawHit ) { if(rawHit){ m_rawCscHitVec.push_back(rawHit); } - // else std::cout << "!!!!Refuse to put an empty MuonCalibRawCscHit in MuonCalibRawHitCollection" << std::endl; } } //namespace MuonCalib diff --git a/MuonSpectrometer/MuonCalib/MuonCalibEventBase/src/MuonCalibEvent.cxx b/MuonSpectrometer/MuonCalib/MuonCalibEventBase/src/MuonCalibEvent.cxx index 430938c943235bd8b67c1cb44954b8628b46af62..afbfda7ad433d72f44a9c21f56c597bfbf5aa90a 100644 --- a/MuonSpectrometer/MuonCalib/MuonCalibEventBase/src/MuonCalibEvent.cxx +++ b/MuonSpectrometer/MuonCalib/MuonCalibEventBase/src/MuonCalibEvent.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ #include "MuonCalibEventBase/MuonCalibEvent.h" @@ -34,7 +34,6 @@ namespace MuonCalib { {} MuonCalibEvent::~MuonCalibEvent() { - //std::cout << "MuonCalibEvent::destructor " << std::endl; std::for_each( patternBegin(), patternEnd(), DeleteObject() ) ; m_patternVec.clear(); delete m_triggerTimeInfo; diff --git a/MuonSpectrometer/MuonCalib/MuonCalibExtraTree/MuonCalibExtraNtuple/src/NTReader_E.cxx b/MuonSpectrometer/MuonCalib/MuonCalibExtraTree/MuonCalibExtraNtuple/src/NTReader_E.cxx index b4a8f48d5ec693351af58ddad6b08709fbc96517..994070790def20ce4c12018dc7b501687fb66b77 100644 --- a/MuonSpectrometer/MuonCalib/MuonCalibExtraTree/MuonCalibExtraNtuple/src/NTReader_E.cxx +++ b/MuonSpectrometer/MuonCalib/MuonCalibExtraTree/MuonCalibExtraNtuple/src/NTReader_E.cxx @@ -3,9 +3,7 @@ */ #include "MuonCalibExtraNtuple/NTReader_E.h" - #include "CLHEP/Geometry/Point3D.h" - #include "MuonCalibExtraTreeEvent/MuonCalibHit_E.h" #include "MuonCalibExtraTreeEvent/MuonCalibTriggerInfo.h" #include "MuonCalibExtraTreeEvent/MuonCalibMUCTPI.h" @@ -16,16 +14,12 @@ #include "MuonCalibExtraTreeEvent/MuonCalibTrack_E.h" #include "MuonCalibExtraTreeEvent/MuonCalibEvent_E.h" #include "MuonCalibExtraNtuple/NTReaderBase_E.h" - #include "MuonCalibIdentifier/MuonFixedId.h" #include "MuonCalibEventBase/MuonCalibEvent.h" - #include "MuonCalibEventBase/MuonCalibTruthCollection.h" #include <iostream> -// cout's have been commented out. Should switch to proper Athena messaging... - namespace MuonCalib { void NTReader_E::setdbgcout(const bool dbglvl){ @@ -65,57 +59,41 @@ namespace MuonCalib { m_evente->setMuonCalibEventInfo(info); - // if (m_debug) { - // std::cout << " evente.eventInfo().eventNumber() = " << m_evente->eventInfo().eventNumber() << std::endl; - // std::cout << " evente.numberOfPatterns = " << pat_nPatterns << std::endl; - // std::cout << " evente.numberOfTracks = " << trk_nTracks << std::endl; - // } for( int i_trig = 0 ; i_trig < ctp_nTriggerInfo ; ++ i_trig ){ m_evente->addCtp( getCtpTbpHit(i_trig) ); - // if (m_debug) std::cout << " CTP trigger bit Added" << std::endl; } if(muctpi_nHits>99) { - // std::cout << " WARNING muctpi_nHits TOO BIG " << muctpi_nHits << std::endl; muctpi_nHits = 99; } for( int i_muctpi = 0 ; i_muctpi < muctpi_nHits ; ++ i_muctpi ){ m_evente->addMUCTPI( getMUCTPIHit(i_muctpi) ); - // if (m_debug) std::cout << " MUCTPI object Added" << std::endl; } if(rpcSl_nLogics > 0){ for( int i_rpcsl = 0 ; i_rpcsl < rpcSl_nLogics ; ++ i_rpcsl ){ m_evente->addRpcSL( getRpcSLHit(i_rpcsl) ); - // if (m_debug) std::cout << " RpcSL object Added" << std::endl; } } for( int i_rpcco = 0 ; i_rpcco < rawRpcCoin_nRpcCoin ; ++ i_rpcco ){ m_evente->addRpcCoin( getRpcCoinHit(i_rpcco) ); - // if (m_debug) std::cout << " RpcCoin object Added" << std::endl; } for( int i_calo = 0 ; i_calo < calo_nHits ; ++ i_calo ){ m_evente->addL1Calo( getL1CaloHit(i_calo) ); - // if (m_debug) std::cout << " L1Calo Added" << std::endl; } for( int i_mbts = 0 ; i_mbts < mbts_nHits ; ++ i_mbts ){ m_evente->addMBTS( getMBTSHit(i_mbts) ); - // if (m_debug) std::cout << " MBTS Added" << std::endl; } for( int i_pat = 0 ; i_pat < pat_nPatterns ; ++ i_pat ){ m_evente->addPattern( getPhiPattern(i_pat) ); - // if (m_debug) std::cout << "Pattern Added" << std::endl; } buildSegmentOnTrackMap(); for( int i_trk = 0 ; i_trk < trk_nTracks ; ++ i_trk ){ m_evente->addTrack( getTrack(i_trk) ); - // if (m_debug) std::cout << "Track Added" << std::endl; } - - // if (m_debug) std::cout << "NTReader_E::end of getEvent" << std::endl; return *m_evente; } //end NTReader_E::getEvent @@ -213,8 +191,6 @@ namespace MuonCalib { } MuonCalibTrack_E* NTReader_E::getPhiPattern( int i_pat ){ - // std::cout << "making a new MuonCalibTrack_E, looping over " << phi_nPhiHits - // << " phiHits, assigning them to its righteous pattern" << std::endl; double r0 = NTReader::pat_r0[i_pat]; double phi = NTReader::pat_phi[i_pat]; @@ -229,24 +205,15 @@ namespace MuonCalib { -999.,-999.,-999., -999.,-999., -999., 0.,0); - // std::cout << "scanning hits ... " << std::endl ; for( int i_phi = 0 ; i_phi < phi_nPhiHits ; ++i_phi ){ - // std::cout << i_phi << " " ; if( phi_phiPatIndex[i_phi] == i_pat ) { - // if(m_debug) std::cout << " added the hit to pattern " << i_pat << "(index = " << phi_phiPatIndex[i_phi] << ")" << std::endl; pattern->addHit( getPhiHit(i_phi) ) ; } - } - // const MuonCalibTrack_E* cPattern = new MuonCalibTrack_E( *pattern ); - + } return pattern; } MuonCalibTrack_E* NTReader_E::getTrack( int i_trk ){ - - // if (m_debug) { std::cout << "making a new MuonCalibTrack_E, looping over " << trkHit_nHits - // << " Hits, assigning them to its righteous track" << std::endl; - // } MuonCalibTrack_E* track = new MuonCalibTrack_E( trk_x0[i_trk], trk_y0[i_trk], trk_z0[i_trk], trk_phi[i_trk], trk_theta[i_trk], trk_qOverP[i_trk],trk_author[i_trk], trk_cov00[i_trk],trk_cov01[i_trk],trk_cov02[i_trk],trk_cov03[i_trk],trk_cov04[i_trk], @@ -255,22 +222,16 @@ namespace MuonCalib { trk_cov33[i_trk],trk_cov34[i_trk], trk_cov44[i_trk], trk_chi2[i_trk],trk_ndof[i_trk]); - // if (m_debug) std::cout << "track author ... " << trk_author[i_trk] << " itrk " << i_trk << std::endl ; for( int i_trkHit = 0 ; i_trkHit < trkHit_nHits ; ++i_trkHit ){ if( trkHit_trackIndex[i_trkHit] == i_trk ) { - // if(m_debug) std::cout << " added the hit to track " << i_trk << "(index = " << trkHit_trackIndex[i_trkHit] << ")" << std::endl; track->addHit( getTrackHit(i_trkHit) ) ; } } for( int i_trkHole = 0 ; i_trkHole < trkHole_nHoles ; ++i_trkHole ){ - if (m_debug) std::cout << i_trkHole << " " ; if( trkHole_trackIndex[i_trkHole] == i_trk ) { - // if(m_debug) std::cout << " added the hole to track " << i_trk << "(index = " << trkHole_trackIndex[i_trkHole] << ")" << std::endl; track->addHole( getTrackHole(i_trkHole) ) ; } } - //const MuonCalibTrack_E* cTrack = new MuonCalibTrack_E( *track ); - std::map<int, std::list<int> >::const_iterator it=m_smap.find(i_trk); if(it!=m_smap.end()) { for (std::list<int> :: const_iterator it2=it->second.begin(); it2!=it->second.end(); it2++) { diff --git a/MuonSpectrometer/MuonCalib/MuonCalibExtraTree/MuonCalibExtraTreeAlg/src/ExtraTreeTrackFillerTool.cxx b/MuonSpectrometer/MuonCalib/MuonCalibExtraTree/MuonCalibExtraTreeAlg/src/ExtraTreeTrackFillerTool.cxx index e3d533e9479afd27393c2a4ab5f7dfc246293cc4..99235d2c63dc3fd3b7f86482dbed6d90520451cc 100644 --- a/MuonSpectrometer/MuonCalib/MuonCalibExtraTree/MuonCalibExtraTreeAlg/src/ExtraTreeTrackFillerTool.cxx +++ b/MuonSpectrometer/MuonCalib/MuonCalibExtraTree/MuonCalibExtraTreeAlg/src/ExtraTreeTrackFillerTool.cxx @@ -373,7 +373,7 @@ inline double ExtraTreeTrackFillerTool::errorCompetingRot( const Trk::CompetingR Er(1, 1) = rotc->localCovariance()(1,1); Er(1, 0) = Er(0,1); - double chi = Er(0,0) != Er(1,1) ? atan(-2*Er(0,1)/(Er(0,0)-Er(1,1)))/2. : 0.; + double chi = Er(0,0) != Er(1,1) ? std::atan(-2*Er(0,1)/(Er(0,0)-Er(1,1)))/2. : 0.; double sincoschi[2]; CxxUtils::sincos scchi(chi); @@ -402,7 +402,7 @@ inline double ExtraTreeTrackFillerTool::errorRot( const Trk::RIO_OnTrack* rot) { Er(1,1) = rot->localCovariance()(2,2); Er(1,0) = Er(0,1); - double chi = Er(0,0) != Er(1,1) ? atan(-2*Er(0,1)/(Er(0,0)-Er(1,1)))/2. : 0.; + double chi = Er(0,0) != Er(1,1) ? std::atan(-2*Er(0,1)/(Er(0,0)-Er(1,1)))/2. : 0.; double sincoschi[2]; CxxUtils::sincos scchi(chi); diff --git a/MuonSpectrometer/MuonCalib/MuonCalibExtraTree/MuonCalibExtraTreeAlg/src/MuonCalibCaloBranch.cxx b/MuonSpectrometer/MuonCalib/MuonCalibExtraTree/MuonCalibExtraTreeAlg/src/MuonCalibCaloBranch.cxx index 7da7059e1e390e7f44956832849ef09112ec1cf6..12c22163163f7921d5ecce46fcfbe0b65df93af2 100644 --- a/MuonSpectrometer/MuonCalib/MuonCalibExtraTree/MuonCalibExtraTreeAlg/src/MuonCalibCaloBranch.cxx +++ b/MuonSpectrometer/MuonCalib/MuonCalibExtraTree/MuonCalibExtraTreeAlg/src/MuonCalibCaloBranch.cxx @@ -1,16 +1,13 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ #include "MuonCalibExtraTreeAlg/MuonCalibCaloBranch.h" #include "MuonCalibExtraTreeEvent/MuonCalibCaloHit.h" - #include "MuonCalibNtuple/NtupleBranchCreator.h" #include "MuonCalibIdentifier/MuonFixedId.h" - #include "TTree.h" - #include <iostream> namespace MuonCalib { @@ -22,16 +19,12 @@ MuonCalibCaloBranch::MuonCalibCaloBranch(std::string branchName) : bool MuonCalibCaloBranch::fillBranch(const MuonCalibCaloHit& hit) { // check if branches were initialized if( !m_branchesInit ){ - //std::cout << "MuonCalibCaloBranch::fillBranch ERROR <branches were not initialized>" - // << std::endl; return false; } // check if index not out of range if( m_index >= s_blockSize || m_index < 0 ) { if (m_first == true) { - //std::cout << "MuonCalibCaloBranch::fillBranch ERROR <index out of range, hit not added to ntuple> " - // << m_index << std::endl; m_first = false; } return false; @@ -53,8 +46,6 @@ bool MuonCalibCaloBranch::fillBranch(const MuonCalibCaloHit& hit) { bool MuonCalibCaloBranch::createBranch(TTree* tree) { // check if pointer is valid if( !tree ) { - //std::cout << "MuonCalibCaloBranch::createBranch ERROR <got invalid tree pointer> " - // << std::endl; return false; } diff --git a/MuonSpectrometer/MuonCalib/MuonCalibExtraTree/MuonCalibExtraTreeAlg/src/MuonCalibExtraTreeAlg.cxx b/MuonSpectrometer/MuonCalib/MuonCalibExtraTree/MuonCalibExtraTreeAlg/src/MuonCalibExtraTreeAlg.cxx index 597c0b8e360947454977a754249fa1f6f317a38f..0096bdddad5f525eed0e808d4b7e7ee1f977b6b1 100644 --- a/MuonSpectrometer/MuonCalib/MuonCalibExtraTree/MuonCalibExtraTreeAlg/src/MuonCalibExtraTreeAlg.cxx +++ b/MuonSpectrometer/MuonCalib/MuonCalibExtraTree/MuonCalibExtraTreeAlg/src/MuonCalibExtraTreeAlg.cxx @@ -1,41 +1,21 @@ /* - Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ #include "MuonCalibExtraTreeAlg/MuonCalibExtraTreeAlg.h" #include "MuonCalibExtraTreeAlg/IExtraTreeFillerTool.h" #include "MuonCalibExtraTreeAlg/ISegmentOnTrackSelector.h" - -// Extra Tree #include "MuonCalibExtraTreeEvent/MuonCalibHit_E.h" - #include "AthContainers/DataVector.h" #include "GaudiKernel/MsgStream.h" - #include "MuonCalibNtuple/RootFileManager.h" #include "MuonCalibIdentifier/MuonFixedId.h" #include "MuonCalibITools/IIdToFixedIdTool.h" - #include "MuonPattern/MuonPatternCombination.h" #include "MuonPattern/MuonPattern.h" #include "TrkPrepRawData/PrepRawData.h" -/*#include "MuonRIO_OnTrack/MdtDriftCircleOnTrack.h" - -#include "TrkDetElementBase/TrkDetElementBase.h" - -#include "TrkPseudoMeasurementOnTrack/PseudoMeasurementOnTrack.h" -#include "TrkMeasurementBase/MeasurementBase.h" -#include "TrkTrack/Track.h" -#include "TrkParameters/Perigee.h" -#include "TrkParameters/MeasuredPerigee.h" -#include "TrkRIO_OnTrack/RIO_OnTrack.h" -#include "TrkEventPrimitives/ParamDefs.h" -#include "TrkEventPrimitives/LocalParameters.h" -#include "TrkSurfaces/Surface.h"*/ - #include "CxxUtils/sincos.h" - #include "TFile.h" #include "TTree.h" #include "TDirectory.h" @@ -176,42 +156,23 @@ bool MuonCalibExtraTreeAlg::handlePatterns() { //loop over pattern combination if( !m_patterns ) return false; -// bool m_debug = false; MuonPatternCombinationCollection::const_iterator it = m_patterns->begin(); MuonPatternCombinationCollection::const_iterator it_end = m_patterns->end(); unsigned int index = 0; for ( ; it!=it_end; ++it) { const std::vector< Muon::MuonPatternChamberIntersect > mpcivec = (*it)->chamberData(); std::vector< Muon::MuonPatternChamberIntersect >::const_iterator pat_it = mpcivec.begin(); -// if (m_debug) std::cout << " Pattern nr " << index << std::endl; -// int nhit = -1; for (;pat_it!=mpcivec.end();++pat_it) { const std::vector< const Trk::PrepRawData* > prdvec = (*pat_it).prepRawDataVec(); std::vector< const Trk::PrepRawData* >::const_iterator prd_it = prdvec.begin(); for( ; prd_it!= prdvec.end() ;++prd_it ) { -// for( unsigned int index = 0; index < m_patterns->size() ; ++index){ -// const Muon::MuonPattern* pattern = (*m_patterns)[index] ; -// for( unsigned int hitNr=0; hitNr < pattern->numberOfContainedPrds(); ++hitNr ){ -// const Trk::PrepRawData* hit = pattern->prd(hitNr); -// nhit++; -// if(m_debug) std::cout << " Pattern hit with PrepData " << nhit << std::endl; const Trk::PrepRawData* hit = *prd_it; MuonFixedId fId = m_idToFixedIdTool->idToFixedId( hit->identify() ); - //is this hit a phi hit?? -// if( fId.is_tgc() ) { -// if( fId.tgcIsStrip() != 1 ) continue ; -// } else if ( fId.is_rpc() ) { -// if( fId.rpcMeasuresPhi() != 1) continue ; -// } else if( fId.is_csc() ) { -// if( fId.cscMeasuresPhi() != 1) continue ; -// } const Trk::TrkDetElementBase* detEl = hit->detectorElement() ; Amg::Vector3D gPos = detEl->center( hit->identify() ); double error = std::sqrt(hit->localCovariance()(0,0)); -// double error = hit->localErrorMatrix().error(Trk::loc1); -// double errorY = hit->localErrorMatrix().error(Trk::locY); ATH_MSG_DEBUG("writing phiHit with index " << index << " error " << error); const MuonCalibHit_E phiHit( fId, gPos , 0., error); @@ -231,11 +192,6 @@ void MuonCalibExtraTreeAlg::finishEvent() { m_tree->Fill(); ATH_MSG_DEBUG("tree Filled "); } -// if(m_doPhi) m_phiHitBranch.reset(); -// if(m_doTracks) { -// m_hitBranch.reset(); -// m_trackBranch.reset(); -// } ATH_MSG_DEBUG("finish eventready... "); } //end MuonCalibExtraTreeAlg::finishEvent diff --git a/MuonSpectrometer/MuonCalib/MuonCalibExtraTree/MuonCalibExtraTreeAlg/src/MuonCalibExtraTreeTriggerAlg.cxx b/MuonSpectrometer/MuonCalib/MuonCalibExtraTree/MuonCalibExtraTreeAlg/src/MuonCalibExtraTreeTriggerAlg.cxx index b4705b072d39d3adb2818451c78f23aa7e27c93c..edf51840e3e20ee33595f95f6b4301bbc6a13088 100644 --- a/MuonSpectrometer/MuonCalib/MuonCalibExtraTree/MuonCalibExtraTreeAlg/src/MuonCalibExtraTreeTriggerAlg.cxx +++ b/MuonSpectrometer/MuonCalib/MuonCalibExtraTree/MuonCalibExtraTreeAlg/src/MuonCalibExtraTreeTriggerAlg.cxx @@ -235,7 +235,7 @@ void MuonCalibExtraTreeTriggerAlg::addCalo() { log << MSG::VERBOSE << "Retrieval of CaloCell container succeeded at " << m_caloLocation << endmsg; if( m_tileID ) { - double pi = 4*atan(1.); + double pi = 4*std::atan(1.); double cellEnergyThreshold = 100. ; double eCellcut = 200.; double etowercut = 500.; @@ -471,7 +471,7 @@ void MuonCalibExtraTreeTriggerAlg::addMBTS() { log << MSG::VERBOSE << "Retrieval of MBTS container succeeded at " << m_mbtsLocation << endmsg; if( m_tileID ) { - double pi = 4*atan(1.); + double pi = 4*std::atan(1.); double energy[32],time[32]; int module[32]; diff --git a/MuonSpectrometer/MuonCalib/MuonCalibExtraTree/MuonCalibExtraTreeAlg/src/MuonCalibHit_EBranch.cxx b/MuonSpectrometer/MuonCalib/MuonCalibExtraTree/MuonCalibExtraTreeAlg/src/MuonCalibHit_EBranch.cxx index 034e97ac78eae1421cc5df1358e0b783b7a7b748..a0931e1ea4f8735d3902e9448ae01b01d024e58d 100644 --- a/MuonSpectrometer/MuonCalib/MuonCalibExtraTree/MuonCalibExtraTreeAlg/src/MuonCalibHit_EBranch.cxx +++ b/MuonSpectrometer/MuonCalib/MuonCalibExtraTree/MuonCalibExtraTreeAlg/src/MuonCalibHit_EBranch.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ #include "MuonCalibExtraTreeAlg/MuonCalibHit_EBranch.h" @@ -54,8 +54,6 @@ bool MuonCalibHit_EBranch::fillBranch(const MuonCalibHit_E &hit, double driftti bool MuonCalibHit_EBranch::createBranch(TTree* tree) { // check if pointer is valid if( !tree ){ - //std::cout << "MuonCalibHit_EBranch::createBranch ERROR <got invalid tree pointer> " - // << std::endl; return false; } diff --git a/MuonSpectrometer/MuonCalib/MuonCalibExtraTree/MuonCalibExtraTreeAlg/src/MuonCalibMuCTPIBranch.cxx b/MuonSpectrometer/MuonCalib/MuonCalibExtraTree/MuonCalibExtraTreeAlg/src/MuonCalibMuCTPIBranch.cxx index df3b38c0efc8570dd1584288206df7ab68426360..7b7d1140f8559e24a5e9e963ca7db191ab39336e 100644 --- a/MuonSpectrometer/MuonCalib/MuonCalibExtraTree/MuonCalibExtraTreeAlg/src/MuonCalibMuCTPIBranch.cxx +++ b/MuonSpectrometer/MuonCalib/MuonCalibExtraTree/MuonCalibExtraTreeAlg/src/MuonCalibMuCTPIBranch.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ #include "MuonCalibExtraTreeAlg/MuonCalibMuCTPIBranch.h" @@ -21,16 +21,12 @@ MuonCalibMuCTPIBranch::MuonCalibMuCTPIBranch(std::string branchName) : bool MuonCalibMuCTPIBranch::fillBranch(const LVL1::RecMuonRoI& hit, unsigned int roiBCID) { // check if branches where initialized if( !m_branchesInit ) { - // std::cout << "MuonCalibMuCTPIBranch::fillBranch ERROR <branches where not initialized>" - // << std::endl; return false; } // check if index not out of range if( m_index >= s_blockSize || m_index < 0 ) { if (m_first == true) { - //std::cout << "MuonCalibMuCTPIBranch::fillBranch ERROR <index out of range, hit not added to ntuple> " - // << m_index << std::endl; m_first = false; } return false; @@ -60,8 +56,6 @@ bool MuonCalibMuCTPIBranch::fillBranch(const LVL1::RecMuonRoI& hit, unsigned in bool MuonCalibMuCTPIBranch::createBranch(TTree* tree) { // check if pointer is valid if( !tree ){ - //std::cout << "MuonCalibMuCTPIBranch::createBranch ERROR <got invalid tree pointer> " - // << std::endl; return false; } diff --git a/MuonSpectrometer/MuonCalib/MuonCalibExtraTree/MuonCalibExtraTreeAlg/src/MuonCalibPhiHit_EBranch.cxx b/MuonSpectrometer/MuonCalib/MuonCalibExtraTree/MuonCalibExtraTreeAlg/src/MuonCalibPhiHit_EBranch.cxx index c85eaf18ecc4009e9b1d413166646b344820c834..0743c56f7645107627ccb708a12c3c95eddc1fd9 100644 --- a/MuonSpectrometer/MuonCalib/MuonCalibExtraTree/MuonCalibExtraTreeAlg/src/MuonCalibPhiHit_EBranch.cxx +++ b/MuonSpectrometer/MuonCalib/MuonCalibExtraTree/MuonCalibExtraTreeAlg/src/MuonCalibPhiHit_EBranch.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ #include "MuonCalibExtraTreeAlg/MuonCalibPhiHit_EBranch.h" @@ -21,25 +21,18 @@ MuonCalibPhiHit_EBranch::MuonCalibPhiHit_EBranch(std::string branchName) : bool MuonCalibPhiHit_EBranch::fillBranch(const MuonCalibHit_E &hit, const int patternIndex) { // check if branches where initialized if( !m_branchesInit ) { - //std::cout << "MuonCalibPhiHit_EBranch::fillBranch ERROR <branches where not initialized>" - // << std::endl; return false; } // check if index not out of range if( m_index >= s_blockSize || m_index < 0 ) { if (m_first == true) { - //std::cout << "MuonCalibPhiHit_EBranch::fillBranch ERROR <index out of range, hit not added to ntuple> " - // << m_index << std::endl; m_first = false; } return false; } m_phiPatIndex[m_index] = patternIndex; - - //std::cout << " ***************** patHit index: " << patternIndex << std::endl; - m_id[m_index] = (hit.identify()).getIdInt(); m_posX[m_index] = hit.position().x(); m_posY[m_index] = hit.position().y(); @@ -55,8 +48,6 @@ bool MuonCalibPhiHit_EBranch::fillBranch(const MuonCalibHit_E &hit, const int pa bool MuonCalibPhiHit_EBranch::createBranch(TTree* tree) { // check if pointer is valid if( !tree ){ - //std::cout << "MuonCalibPhiHit_EBranch::createBranch ERROR <got invalid tree pointer> " - // << std::endl; return false; } diff --git a/MuonSpectrometer/MuonCalib/MuonCalibExtraTree/MuonCalibExtraTreeAlg/src/MuonCalibPhiPattern_EBranch.cxx b/MuonSpectrometer/MuonCalib/MuonCalibExtraTree/MuonCalibExtraTreeAlg/src/MuonCalibPhiPattern_EBranch.cxx index 2c0d5efc8240bc6f06ee7df83393e9e210a63989..541348cdb95ca250c1d53fdd4bfe7ef2fcdea428 100644 --- a/MuonSpectrometer/MuonCalib/MuonCalibExtraTree/MuonCalibExtraTreeAlg/src/MuonCalibPhiPattern_EBranch.cxx +++ b/MuonSpectrometer/MuonCalib/MuonCalibExtraTree/MuonCalibExtraTreeAlg/src/MuonCalibPhiPattern_EBranch.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ #include "MuonCalibExtraTreeAlg/MuonCalibPhiPattern_EBranch.h" @@ -21,16 +21,12 @@ MuonCalibPhiPattern_EBranch::MuonCalibPhiPattern_EBranch(std::string branchName) bool MuonCalibPhiPattern_EBranch::fillBranch(const MuonCalibTrack_E& pat) { // check if branches where initialized if( !m_branchesInit ) { - //std::cout << "MuonCalibPhiPattern_EBranch::fillBranch ERROR <branches where not initialized>" - // << std::endl; return false; } // check if index out of range if( m_index >= s_blockSize || m_index < 0 ) { if (m_first == true) { - //std::cout << "MuonCalibPhiPattern_EBranch::fillBranch ERROR <index out of range, hit not added to ntuple> " - // << m_index << std::endl; m_first = false; } return false; @@ -50,8 +46,6 @@ bool MuonCalibPhiPattern_EBranch::fillBranch(const MuonCalibTrack_E& pat) { bool MuonCalibPhiPattern_EBranch::createBranch(TTree* tree) { // check if pointer is valid if( !tree ){ - //std::cout << "MuonCalibPhiPattern_EBranch::createBranch ERROR <got invalid tree pointer> " - // << std::endl; return false; } diff --git a/MuonSpectrometer/MuonCalib/MuonCalibExtraTree/MuonCalibExtraTreeAlg/src/MuonCalibTrack_EBranch.cxx b/MuonSpectrometer/MuonCalib/MuonCalibExtraTree/MuonCalibExtraTreeAlg/src/MuonCalibTrack_EBranch.cxx index 9a5686ec27d4b48f3fcda3b5265b223eb136d87e..f74bcdd1e5c4f16b7bbf9bf2f3c5446e3ccb43eb 100644 --- a/MuonSpectrometer/MuonCalib/MuonCalibExtraTree/MuonCalibExtraTreeAlg/src/MuonCalibTrack_EBranch.cxx +++ b/MuonSpectrometer/MuonCalib/MuonCalibExtraTree/MuonCalibExtraTreeAlg/src/MuonCalibTrack_EBranch.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ #include "MuonCalibExtraTreeAlg/MuonCalibTrack_EBranch.h" @@ -22,16 +22,12 @@ MuonCalibTrack_EBranch::MuonCalibTrack_EBranch(std::string branchName) : bool MuonCalibTrack_EBranch::fillBranch(const MuonCalibTrack_E &track) { // check if branches where initialized if( !m_branchesInit ) { - //std::cout << "MuonCalibTrack_EBranch::fillBranch ERROR <branches where not initialized>" - // << std::endl; return false; } // check if index not out of range if( m_index >= s_blockSize || m_index < 0 ) { if (m_first == true) { - //std::cout << "MuonCalibTrack_EBranch::fillBranch ERROR <index out of range, hit not added to ntuple> " - // << m_index << std::endl; m_first = false; } return false; @@ -42,7 +38,6 @@ bool MuonCalibTrack_EBranch::fillBranch(const MuonCalibTrack_E &track) { m_phi[m_index] = track.phi(); m_theta[m_index] = track.theta(); m_qOverP[m_index] = track.qOverP(); -// m_errInvP[m_index] = track.errInvP(); m_author[m_index] = track.author(); m_cov00[m_index] = track.cov00(); m_cov01[m_index] = track.cov01(); @@ -71,8 +66,6 @@ bool MuonCalibTrack_EBranch::fillBranch(const MuonCalibTrack_E &track) { bool MuonCalibTrack_EBranch::createBranch(TTree* tree) { // check if pointer is valid if( !tree ) { - //std::cout << "MuonCalibTrack_EBranch::createBranch ERROR <got invalid tree pointer> " - // << std::endl; return false; } diff --git a/MuonSpectrometer/MuonCalib/MuonCalibExtraTree/MuonCalibExtraTreeAlg/src/MuonCalibTriggerInfoBranch.cxx b/MuonSpectrometer/MuonCalib/MuonCalibExtraTree/MuonCalibExtraTreeAlg/src/MuonCalibTriggerInfoBranch.cxx index 9f55e0183a1c54e1e922a618dce96664ca4d9c27..82ba22b2a43966fad3b42627a036366130f585fa 100644 --- a/MuonSpectrometer/MuonCalib/MuonCalibExtraTree/MuonCalibExtraTreeAlg/src/MuonCalibTriggerInfoBranch.cxx +++ b/MuonSpectrometer/MuonCalib/MuonCalibExtraTree/MuonCalibExtraTreeAlg/src/MuonCalibTriggerInfoBranch.cxx @@ -23,16 +23,12 @@ MuonCalibTriggerInfoBranch::MuonCalibTriggerInfoBranch(std::string branchName) : bool MuonCalibTriggerInfoBranch::fillBranch(const CTP_RDO* ctpRDO) { // check if branches where initialized if( !m_branchesInit ) { - //std::cout << "MuonCalibTriggerInfoBranch::fillBranch ERROR <branches where not initialized>" - // << std::endl; return false; } // check if index not out of range if( m_index >= s_blockSize || m_index < 0 ) { if (m_first == true) { - //std::cout << "MuonCalibTriggerInfoBranch::fillBranch ERROR <index out of range, hit not added to ntuple> " - // << m_index << std::endl; m_first = false; } return false; @@ -146,8 +142,6 @@ bool MuonCalibTriggerInfoBranch::fillBranch(const CTP_RDO* ctpRDO) { bool MuonCalibTriggerInfoBranch::createBranch(TTree* tree) { // check if pointer is valid if( !tree ) { - //std::cout << "MuonCalibTriggerInfoBranch::createBranch ERROR <got invalid tree pointer> " - // << std::endl; return false; } diff --git a/MuonSpectrometer/MuonCalib/MuonCalibExtraTree/MuonCalibExtraTreeEvent/src/EventHandler.cxx b/MuonSpectrometer/MuonCalib/MuonCalibExtraTree/MuonCalibExtraTreeEvent/src/EventHandler.cxx index 6db29e537cb9874689957974ea8446b2535b6cd0..3cbec9bcea365b83068e36297ce73111fa4b4325 100644 --- a/MuonSpectrometer/MuonCalib/MuonCalibExtraTree/MuonCalibExtraTreeEvent/src/EventHandler.cxx +++ b/MuonSpectrometer/MuonCalib/MuonCalibExtraTree/MuonCalibExtraTreeEvent/src/EventHandler.cxx @@ -208,18 +208,13 @@ namespace MuonCalib{ // store previous moore track so we can add the back extrapolated ones if any if( author == 0 ){ -// std::cout << " new moore track " << extendedTrack->dump() << std::endl; previousMooreTrack = extendedTrack; }else if ( (author == 1 || author == 2 ) && previousMooreTrack ){ -// std::cout << " adding track " << extendedTrack->dump() << std::endl; previousMooreTrack->addAssociatedTrack(extendedTrack); extendedTrack->addAssociatedTrack(previousMooreTrack); } else if (author == 10 &&(*track_it)->nrHits()==0) { -// std::cout << " new muidSA track " << extendedTrack->dump() << std::endl; // Associate MuidSA/MooreExtrapolate to IP to author 0 if no hits on track TrackVec& trackVec0 = m_extendedTracks[0]; -// std::cout << " author 10 track " << std::endl; - bool foundAssociatedMooreTrack = false; double dotprodmax = -1.; if(trackVec0.size()>0) { int trackcount10 = trackVec.size(); @@ -229,10 +224,8 @@ namespace MuonCalib{ const MuonCalibExtendedTrack* associatedMooreTrack = 0; for( ;it0!=it0_end; ++it0 ) { trackcount0++; -// std::cout << " trackcount0 " << trackcount0 << " trackcount10 " << trackcount10 << std::endl; if(trackcount10>trackcount0) continue; double dotprod = extendedTrack->direction().dot((*it0)->direction()); -// std::cout << " author 10 and 0 dot product " << dotprod << std::endl; if(extendedTrack->isAssociated(*it0)) continue; if((*it0)->isAssociated(extendedTrack)) continue; if(dotprod>dotprodmax) { @@ -244,32 +237,12 @@ namespace MuonCalib{ if(dotprodmax>0.8 && associatedMooreTrack) { extendedTrack->addAssociatedTrack(associatedMooreTrack); associatedMooreTrack->addAssociatedTrack(extendedTrack); - foundAssociatedMooreTrack = true; - } else /*if (associatedMooreTrack)*/ { -// extendedTrack->addAssociatedTrack(associatedMooreTrack); -// associatedMooreTrack->addAssociatedTrack(extendedTrack); - foundAssociatedMooreTrack = false; } } - if(foundAssociatedMooreTrack) { -// if(dotprodmax<0.8) std::cout << " Lousy match Moore tracks size " << trackVec0.size() << std::endl; -// std::cout << " author 10 track associated to Moore Track " << dotprodmax << std::endl; - } -// if(!foundAssociatedMooreTrack) std::cout << " author 10 track NOT associated to Moore Track " << std::endl; } trackVec.push_back(extendedTrack); } - -// // only print if there is some activity in the muon system -// if( !m_extendedTracks.empty() && -// ( (m_extendedTracks.size() > 1) || -// m_extendedTracks.size() == 1 && !m_extendedTracks.count(1000) ) ){ -// std::cout << " Created Extended tracks, authors: " << m_extendedTracks.size() << std::endl; -// AuthorTrackVecIt it = m_extendedTracks.begin(); -// AuthorTrackVecIt it_end = m_extendedTracks.end(); -// for( ;it!=it_end; ++it ) std::cout << " author " << std::setw(6) << it->first << " ntracks " << it->second.size() << std::endl; -// } } void EventHandler::createExtendedTruthTracks() { @@ -669,18 +642,6 @@ namespace MuonCalib{ } } -// MuonCalibEvent_E::TrackVec::const_iterator track_it = m_event->beginTrack(); -// MuonCalibEvent_E::TrackVec::const_iterator track_it_end = m_event->endTrack(); -// for ( ; track_it!=track_it_end; track_it++) { -// // reference to current track -// const MuonCalibTrack_E& track = **track_it; -// int author = track.author(); -// TrackVec& trackVec = m_extendedTracks[author]; -// // create new extended track and add it to TrackVec -// MuonCalibExtendedTrack* extendedTrack = new MuonCalibExtendedTrack(track,0,0); -// trackVec.push_back(extendedTrack); -// } - } void EventHandler::createExtendedSegments() { @@ -699,7 +660,6 @@ namespace MuonCalib{ // get author int author = seg.author(); - //if( !m_extendedSegments.count(author) ) std::cout << " new author " << author << std::endl; SegmentVec& segVec = m_extendedSegments[author]; // create new extended segment @@ -869,24 +829,6 @@ namespace MuonCalib{ return nnotOnTrack+10*noppositeSign+100*nsameSign; - -// unsigned int nhits = nsameSign + noppositeSign + nnotOnTrack; -// double matchFraction = (double)nsameSign/(double)nhits; - - // match if all hits have same sign -// if( nhits == nsameSign ) return true; - - - // allow one opposite sign hit if the number of hits on the segment is larger than four */ -// if( nhits > 4 && matchFraction > 0.7 && nhits == noppositeSign + nsameSign ) return true; - - // allow one opposite sign hit if the number of hits on the segment is larger than four */ -// if( nhits > 4 && matchFraction > 0.85 ) return true; - -// if( nsameSign > 3 ){ -// std::cout << " segment with large overlap but no match: nhits " << nhits << " nsame " << nsameSign << " nopp " << noppositeSign << std::endl; -// } -// return false; } void EventHandler::linkTracks( int referenceIndex ) { @@ -897,8 +839,6 @@ namespace MuonCalib{ TrackVec& refTracks = pos->second; -// std::cout << " linking tracks, reference " << referenceIndex << " number of tracks " << refTracks.size() << std::endl; - // loop over reference tracks and associate other authors TrkIt rit = refTracks.begin(); TrkIt rit_end = refTracks.end(); @@ -913,8 +853,6 @@ namespace MuonCalib{ if( ait->first == referenceIndex ) continue; TrackVec& tracks = ait->second; - - //std::cout << " comparing to " << ait->first << " number of tracks " << tracks.size() << std::endl; match( **rit, tracks ); @@ -935,7 +873,6 @@ namespace MuonCalib{ if( reference.isAssociated(*it) ) continue; MuonCalibExtendedTrackOverlap overlap = reference.calculateHitOverlap(**it); -// std::cout << " match overlap " << overlap.sharedPrecisionHits() << std::endl; if( overlap.sharedPrecisionHits() > 0 ){ if( overlap.sharedPrecisionHits() > bestOverlap.sharedPrecisionHits() ) { bestMatch = *it; @@ -945,11 +882,6 @@ namespace MuonCalib{ } if( bestMatch ){ - -// std::cout << " found best overlap: precicion " << bestOverlap.sharedPrecisionHits() -// << " Trigger: eta " << bestOverlap.sharedEtaTriggerHits() -// << " phi " << bestOverlap.sharedPhiHits() << std::endl; - reference.addAssociatedTrack(bestMatch); bestMatch->addAssociatedTrack(&reference); } diff --git a/MuonSpectrometer/MuonCalib/MuonCalibExtraTree/MuonCalibExtraTreeEvent/src/MuonCalibEvent_E.cxx b/MuonSpectrometer/MuonCalib/MuonCalibExtraTree/MuonCalibExtraTreeEvent/src/MuonCalibEvent_E.cxx index 943cce49d87d36f9a8ce6261561567d15a73fac6..2e18aeeb1e94a032c817af053c947e797e771b75 100644 --- a/MuonSpectrometer/MuonCalib/MuonCalibExtraTree/MuonCalibExtraTreeEvent/src/MuonCalibEvent_E.cxx +++ b/MuonSpectrometer/MuonCalib/MuonCalibExtraTree/MuonCalibExtraTreeEvent/src/MuonCalibEvent_E.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ #include "MuonCalibExtraTreeEvent/MuonCalibEvent_E.h" @@ -16,9 +16,7 @@ namespace MuonCalib { - MuonCalibEvent_E::~MuonCalibEvent_E() { - //std::cout << " Calling ~MuonCalibEvent_E() " << std::endl; - + MuonCalibEvent_E::~MuonCalibEvent_E() { std::for_each( beginPhiPat(), endPhiPat(), DeleteObject() ) ; m_phiPats.clear(); std::for_each( beginTrack(), endTrack(), DeleteObject() ) ; @@ -38,17 +36,13 @@ namespace MuonCalib { m_rpcco.clear(); std::for_each( beginRawRpcTrig(), endRawRpcTrig(), DeleteObject() ) ; m_rpctr.clear(); - - //std::cout << " end of Calling ~MuonCalibEvent_E() " << std::endl; } MuonCalibEvent_E::MuonCalibEvent_E(const MuonCalibEvent& event) : MuonCalibEvent(event), m_phiPats(0), m_tracks(0), m_ctp(0), m_mctpi(0), m_rpcsl(0), m_rpcco(0), m_rpctr(0), m_mbts(0), m_l1calo(0) { - // std::cout << " Calling MuonCalibEvent_E(const MuonCalibEvent& event) " << std::endl; } MuonCalibEvent_E::MuonCalibEvent_E(const MuonCalibEvent_E& event) : MuonCalibEvent(event) { - //std::cout << " Calling MuonCalibEvent_E(const MuonCalibEvent_E& event) " << std::endl; PhiPatVec::const_iterator phi = event.beginPhiPat(); PhiPatVec::const_iterator phi_end = event.endPhiPat(); for(; phi!=phi_end; ++phi){ diff --git a/MuonSpectrometer/MuonCalib/MuonCalibExtraTree/MuonCalibExtraTreeEvent/src/MuonCalibTrack_E.cxx b/MuonSpectrometer/MuonCalib/MuonCalibExtraTree/MuonCalibExtraTreeEvent/src/MuonCalibTrack_E.cxx index 8522b7190d82584d8b415cb43cfe875c3bf52776..f91e34866f7246196239cb3ab3dcdb89104fc852 100644 --- a/MuonSpectrometer/MuonCalib/MuonCalibExtraTree/MuonCalibExtraTreeEvent/src/MuonCalibTrack_E.cxx +++ b/MuonSpectrometer/MuonCalib/MuonCalibExtraTree/MuonCalibExtraTreeEvent/src/MuonCalibTrack_E.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ #include "MuonCalibExtraUtils/MuonCalibSLPropagator.h" @@ -50,7 +50,6 @@ namespace MuonCalib { MuonCalibTrack_E& MuonCalibTrack_E::operator=( const MuonCalibTrack_E& rhs ){ -// std::cout << "Calling Track copy constructor" << std::endl; if(this!=&rhs){ clear(); copy(rhs); @@ -65,7 +64,6 @@ namespace MuonCalib { m_phi = track.phi(); m_theta = track.theta() ; m_qOverP = track.qOverP(); -// m_errinvP = track.m_errinvP; m_author = track.author(); m_cov00 = track.cov00(); m_cov01 = track.cov01(); diff --git a/MuonSpectrometer/MuonCalib/MuonCalibExtraTree/MuonCalibExtraTreeEvent/src/MuonCalibTriggerInfo.cxx b/MuonSpectrometer/MuonCalib/MuonCalibExtraTree/MuonCalibExtraTreeEvent/src/MuonCalibTriggerInfo.cxx index 12e6876915aa02c7c182fbd3599e2342c0c59e09..5c0252c6cb61bb55d5cdd5a58906f15750343214 100644 --- a/MuonSpectrometer/MuonCalib/MuonCalibExtraTree/MuonCalibExtraTreeEvent/src/MuonCalibTriggerInfo.cxx +++ b/MuonSpectrometer/MuonCalib/MuonCalibExtraTree/MuonCalibExtraTreeEvent/src/MuonCalibTriggerInfo.cxx @@ -1,8 +1,10 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ #include "MuonCalibExtraTreeEvent/MuonCalibTriggerInfo.h" +#include "GaudiKernel/MsgStream.h" +#include "AthenaKernel/getMessageSvc.h" #include <iostream> @@ -49,7 +51,8 @@ namespace MuonCalib{ void MuonCalibTriggerTypeHelper::addEntry( MuonCalibTriggerType type, int bit, std::string name ){ if( !validType(type) ){ - std::cout << "MuonCalibTriggerTypeHelper::addEntry -> invalid trigger type" << std::endl; + MsgStream log(Athena::getMessageSvc(),"MuonCalibTriggerTypeHelper"); + log<<MSG::WARNING<<"MuonCalibTriggerTypeHelper::addEntry -> invalid trigger type"<<endmsg; return; } std::vector<int> bits; @@ -59,7 +62,8 @@ namespace MuonCalib{ void MuonCalibTriggerTypeHelper::addEntry( MuonCalibTriggerType type, std::vector<int>& bits, std::string name ){ if( !validType(type) ){ - std::cout << "MuonCalibTriggerTypeHelper::addEntry -> invalid trigger type" << std::endl; + MsgStream log(Athena::getMessageSvc(),"MuonCalibTriggerTypeHelper"); + log<<MSG::WARNING<<"MuonCalibTriggerTypeHelper::addEntry -> invalid trigger type"<<endmsg; return; } m_typeToBitAndStringMapping[type] = std::make_pair(bits,name); @@ -106,16 +110,16 @@ namespace MuonCalib{ void MuonCalibTriggerTypeHelper::dumpMapping() { initMap(); - std::cout << "MuonCalibTriggerTypeHelper::dumpMapping, map size " << m_typeToBitAndStringMapping.size() << std::endl; + MsgStream log(Athena::getMessageSvc(),"MuonCalibTriggerTypeHelper"); + log<<MSG::INFO<<"MuonCalibTriggerTypeHelper::dumpMapping, map size " << m_typeToBitAndStringMapping.size()<<endmsg; std::vector< std::pair< std::vector<int>,std::string> >::const_iterator it = m_typeToBitAndStringMapping.begin(); std::vector< std::pair< std::vector<int>,std::string> >::const_iterator it_end = m_typeToBitAndStringMapping.end(); int index = 0; for( ;it!=it_end; ++it ){ - std::cout << "index " << index++ << " type " << it->second << " nbits " << it->first.size() << " bits " << std::endl; + log<<MSG::INFO<<"index " << index++ << " type " << it->second << " nbits " << it->first.size() << " bits "<<endmsg; for( unsigned int i=0;i<it->first.size();++i ){ - std::cout << " " << it->first[i]; + log<<MSG::INFO<<" " << it->first[i]<<endmsg; } - std::cout << std::endl; } } diff --git a/MuonSpectrometer/MuonCalib/MuonCalibExtraTree/MuonCalibExtraUtils/src/MuonCalibSLPropagator.cxx b/MuonSpectrometer/MuonCalib/MuonCalibExtraTree/MuonCalibExtraUtils/src/MuonCalibSLPropagator.cxx index da3ddd9b1bce0ea95fa4fe1299599a1bd4a7ee4e..8b463f1d15ae8a06ab8f9c201559dcca14387185 100644 --- a/MuonSpectrometer/MuonCalib/MuonCalibExtraTree/MuonCalibExtraUtils/src/MuonCalibSLPropagator.cxx +++ b/MuonSpectrometer/MuonCalib/MuonCalibExtraTree/MuonCalibExtraUtils/src/MuonCalibSLPropagator.cxx @@ -4,6 +4,9 @@ #include "MuonCalibExtraUtils/MuonCalibSLPropagator.h" #include "MuonCalibExtraUtils/MuonCalibSimpleGeometry.h" +#include "GaudiKernel/MsgStream.h" +#include "AthenaKernel/getMessageSvc.h" + #include <iostream> namespace MuonCalib { @@ -68,8 +71,8 @@ namespace MuonCalib { const MuonCalibCylinder* cylinder = dynamic_cast<const MuonCalibCylinder*>(&surf); if( cylinder ) return propagate(pos,dir,*cylinder); - - std::cout << " propagation failed, unkown surface type" << std::endl; + MsgStream log(Athena::getMessageSvc(),"MuonCalibSLPropagator"); + log<<MSG::WARNING<<"propagation failed, unkown surface type"<<endmsg; return Amg::Vector3D(0.,0.,0.); } diff --git a/MuonSpectrometer/MuonCalib/MuonCalibExtraTree/MuonCalibExtraUtils/src/MuonCalibSimpleHoleSearch.cxx b/MuonSpectrometer/MuonCalib/MuonCalibExtraTree/MuonCalibExtraUtils/src/MuonCalibSimpleHoleSearch.cxx index 49ffb105274fdca164505377998ebd518ce1dfc8..a5d7444d329c5b2151116a65f1b1da650e7c7624 100644 --- a/MuonSpectrometer/MuonCalib/MuonCalibExtraTree/MuonCalibExtraUtils/src/MuonCalibSimpleHoleSearch.cxx +++ b/MuonSpectrometer/MuonCalib/MuonCalibExtraTree/MuonCalibExtraUtils/src/MuonCalibSimpleHoleSearch.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ #include "MuonCalibExtraUtils/MuonCalibSimpleHoleSearch.h" @@ -59,9 +59,6 @@ namespace MuonCalib { // propagate to layer Amg::Vector3D pos = m_propagator.propagate(parPos,parDir,surf); - // MuonFixedIdPrinter printer; - // std::cout << " intersecting surf " << printer.stationLayerIdentifier(stLayerId) << " pos " << pos << std::endl; - // check if position is within bounds, if so add intersect if( surf.inBounds(pos,tolerance) ) { diff --git a/MuonSpectrometer/MuonCalib/MuonCalibIdentifier/MuonCalibIdentifier/MuonFixedId.h b/MuonSpectrometer/MuonCalib/MuonCalibIdentifier/MuonCalibIdentifier/MuonFixedId.h index ebda450e2a55dfcf7218cfb4c77d6691eed34dbe..b1163ec08c60010b35293f4ff919ac9aad814ec0 100644 --- a/MuonSpectrometer/MuonCalib/MuonCalibIdentifier/MuonCalibIdentifier/MuonFixedId.h +++ b/MuonSpectrometer/MuonCalib/MuonCalibIdentifier/MuonCalibIdentifier/MuonFixedId.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ /*************************************************************************** @@ -789,10 +789,6 @@ inline int MuonFixedId::mdtMezzanine() const { if(Ichamber==2 && std::abs(Ieta)==8) ImezzTubes=8; int Imezz = ((Itube-1)/ImezzTubes)*2+(Iml-1) ; Imezz = 9*100000000 + Ichamber*1000000 + Ieta*10000 + Iphi*100 + Imezz ; - - // std::cout << "Imezz Ichamber Ieta Iphi Iml Itube " - // << Imezz <<" " << Ichamber <<" "<< Ieta <<" " << Iphi - // <<" " << Iml <<" " << Itube << std::endl ; return Imezz ; } diff --git a/MuonSpectrometer/MuonCalib/MuonCalibIdentifier/src/MdtRegionTool.cxx b/MuonSpectrometer/MuonCalib/MuonCalibIdentifier/src/MdtRegionTool.cxx index 5e4caca831b610ffc8bb6b06feaab64e913b8706..e1d6225b6da386b6df6033726c387a30b64893d5 100644 --- a/MuonSpectrometer/MuonCalib/MuonCalibIdentifier/src/MdtRegionTool.cxx +++ b/MuonSpectrometer/MuonCalib/MuonCalibIdentifier/src/MdtRegionTool.cxx @@ -1,9 +1,8 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ #include "MuonCalibIdentifier/MdtRegionTool.h" - #include "MuonIdHelpers/MdtIdHelper.h" #include <iostream> @@ -25,8 +24,6 @@ bool MdtRegionTool::initialize( const MdtRegionSet& set, const MdtIdHelper* idHe unsigned int nhashes = idHelper->module_hash_max(); m_basicHashToRegionHash.resize(nhashes); - //std::cout << "New basicHashToRegionHash vector with size " << m_basicHashToRegionHash.size() << std::endl; - // count the number of regions unsigned int nregion(0); @@ -48,7 +45,6 @@ bool MdtRegionTool::initialize( const MdtRegionSet& set, const MdtIdHelper* idHe idHelper->get_hash( *rit, hash, &idCont ); if( hash >= m_basicHashToRegionHash.size() ){ - //std::cout << "ERROR hash out of range, skipping it " << std::endl; continue; } @@ -57,8 +53,6 @@ bool MdtRegionTool::initialize( const MdtRegionSet& set, const MdtIdHelper* idHe ++nregion; } - - //std::cout << "Initialization complete " << std::endl; return true; } diff --git a/MuonSpectrometer/MuonCalib/MuonCalibIdentifier/src/OfflineOnlineIdConversion.cxx b/MuonSpectrometer/MuonCalib/MuonCalibIdentifier/src/OfflineOnlineIdConversion.cxx index 23a4bd841f98c645e79ba2311ee86b4afd3f6a01..255476b7122c16c1a63874c3763ba21345dcef1d 100644 --- a/MuonSpectrometer/MuonCalib/MuonCalibIdentifier/src/OfflineOnlineIdConversion.cxx +++ b/MuonSpectrometer/MuonCalib/MuonCalibIdentifier/src/OfflineOnlineIdConversion.cxx @@ -1,27 +1,32 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ #include "MuonCalibIdentifier/OfflineOnlineIdConversion.h" +#include "GaudiKernel/MsgStream.h" +#include "AthenaKernel/getMessageSvc.h" + #include "cstdlib" + namespace MuonCalib { MuonFixedId OnlineToOffline(const std::string online_id) { - std::cout<<online_id<<std::endl; MuonFixedId ret(0), invalid; ret.set_mdt(); //minimum size of idenifier is 7 if (online_id.size()!=7 && online_id.size()!=9) { - std::cout<<"WARNING: Wrong length"<<std::endl; + MsgStream log(Athena::getMessageSvc(),"OnlineToOffline"); + log<<MSG::WARNING<<"Wrong length for online_id="<<online_id<<endmsg; return invalid; } //check for A/C side bool c_side(false); if(online_id[4]!='A' && online_id[4]!='C' && online_id[4]!='B') { - std::cout<<"WARNING: Invalid side"<<std::endl; + MsgStream log(Athena::getMessageSvc(),"OnlineToOffline"); + log<<MSG::WARNING<<"Invalid side for online_id="<<online_id<<endmsg; return invalid; } if(online_id[4]=='C') @@ -33,7 +38,8 @@ MuonFixedId OnlineToOffline(const std::string online_id) int station_mm = MuonFixedId::stationStringToFixedStationNumber(station_nm_string); if (station_mm<0) { - std::cout<<"WARNING: Invalid station name"<<std::endl; + MsgStream log(Athena::getMessageSvc(),"OnlineToOffline"); + log<<MSG::WARNING<<"Invalid station name for online_id="<<online_id<<endmsg; return invalid; } //set eta @@ -45,7 +51,8 @@ MuonFixedId OnlineToOffline(const std::string online_id) long int eta=strtol(eta_str, &endptr, 10); if(endptr!=&(eta_str[1])) { - std::cout<<"WARNING: eta is not a number"<<std::endl; + MsgStream log(Athena::getMessageSvc(),"OnlineToOffline"); + log<<MSG::WARNING<<"eta is not a number for online_id="<<online_id<<endmsg; return invalid; } //set phi @@ -56,7 +63,8 @@ MuonFixedId OnlineToOffline(const std::string online_id) long int phi=strtol(phi_str, &endptr, 10); if(endptr!=&(phi_str[2])) { - std::cout<<"WARNING: phi is not a number: "<<phi_str<<std::endl; + MsgStream log(Athena::getMessageSvc(),"OnlineToOffline"); + log<<MSG::WARNING<<"phi is not a number for online_id="<<online_id<<endmsg; return invalid; } //treat special cases @@ -97,7 +105,8 @@ MuonFixedId OnlineToOffline(const std::string online_id) ret.setMdtMultilayer(2); break; default: - std::cout<<"WARNING: Multilayer is neither 1 or 2"<<std::endl; + MsgStream log(Athena::getMessageSvc(),"OnlineToOffline"); + log<<MSG::WARNING<<"Multilayer is neither 1 or 2 for online_id="<<online_id<<endmsg; return invalid; } return ret.mdtMultilayerId(); diff --git a/MuonSpectrometer/MuonCalib/MuonCalibNtuple/src/CscCalibHitNtupleBranch.cxx b/MuonSpectrometer/MuonCalib/MuonCalibNtuple/src/CscCalibHitNtupleBranch.cxx index 7325951b47a97b8aa901bb93b1d1d02ccfa8c39a..6c73280e23262c40bff9cc529adcc3097eb4b855 100644 --- a/MuonSpectrometer/MuonCalib/MuonCalibNtuple/src/CscCalibHitNtupleBranch.cxx +++ b/MuonSpectrometer/MuonCalib/MuonCalibNtuple/src/CscCalibHitNtupleBranch.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ #include "MuonCalibNtuple/CscCalibHitNtupleBranch.h" @@ -20,15 +20,11 @@ namespace MuonCalib { bool CscCalibHitNtupleBranch::fillBranch(const CscCalibHitBase &hit, const int segmentIndex) { // check if branches where initialized if( !m_branchesInit ){ - //std::cout << "CscCalibHitNtupleBranch::fillBranch ERROR <branches were not initialized>" - // << std::endl; return false; } // check if m_index not out of range if( m_index >= m_blockSize || m_index < 0 ){ -// //std::cout << "CscCalibHitNtupleBranch::fillBranch ERROR <index out of range; hit not added to ntuple> " -// << m_index << std::endl; return false; } @@ -53,8 +49,6 @@ namespace MuonCalib { bool CscCalibHitNtupleBranch::createBranch(TTree *tree) { // check if pointer is valid if( !tree ){ - //std::cout << "CscCalibHitNtupleBranch::createBranch ERROR <got invalid tree pointer> " - // << std::endl; return false; } diff --git a/MuonSpectrometer/MuonCalib/MuonCalibNtuple/src/CscTruthHitNtupleBranch.cxx b/MuonSpectrometer/MuonCalib/MuonCalibNtuple/src/CscTruthHitNtupleBranch.cxx index f6bdb2d2065672d5f49cb88fab3707af30bbfbb0..66f61139cde2053fb7d9938ffd9444610e88c0c3 100644 --- a/MuonSpectrometer/MuonCalib/MuonCalibNtuple/src/CscTruthHitNtupleBranch.cxx +++ b/MuonSpectrometer/MuonCalib/MuonCalibNtuple/src/CscTruthHitNtupleBranch.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ #include "MuonCalibNtuple/CscTruthHitNtupleBranch.h" @@ -20,15 +20,11 @@ namespace MuonCalib { bool CscTruthHitNtupleBranch::fillBranch(const MuonCalibCscTruthHit &hit) { // check if branches were initialized if( !m_branchesInit ){ - //std::cout << "CscTruthHitNtupleBranch::fillBranch ERROR <branches were not initialized>" - // //<< std::endl; return false; } // check if index not out of range if( m_index >= m_blockSize || m_index < 0 ){ -// //std::cout << "CscTruthHitNtupleBranch::fillBranch ERROR <index out of range; hit not added to ntuple> " -// << m_index << std::endl; return false; } @@ -46,8 +42,6 @@ namespace MuonCalib { bool CscTruthHitNtupleBranch::createBranch(TTree *tree) { // check if pointer is valid if( !tree ){ - //std::cout << "CscTruthHitNtupleBranch::createBranch ERROR <got invalid tree pointer> " - //<< std::endl; return false; } diff --git a/MuonSpectrometer/MuonCalib/MuonCalibNtuple/src/MdtCalibHitNtupleBranch.cxx b/MuonSpectrometer/MuonCalib/MuonCalibNtuple/src/MdtCalibHitNtupleBranch.cxx index 91bb6fe26adae54ce7acd5dcbb857beaf1412b48..cccbe28e7a474410d1c1e6dea7715c4c7c7e29f0 100644 --- a/MuonSpectrometer/MuonCalib/MuonCalibNtuple/src/MdtCalibHitNtupleBranch.cxx +++ b/MuonSpectrometer/MuonCalib/MuonCalibNtuple/src/MdtCalibHitNtupleBranch.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ #include "MuonCalibNtuple/MdtCalibHitNtupleBranch.h" @@ -20,23 +20,14 @@ namespace MuonCalib { bool MdtCalibHitNtupleBranch::fillBranch(const MdtCalibHitBase &hit, const int segmentIndex) { // check if branches where initialized if( !m_branchesInit ) { - //std::cout << "MdtCalibHitNtupleBranch::fillBranch ERROR <branches where not initialized>" - // << std::endl; return false; } // check if index is out of range if( m_index >= m_blockSize || m_index < 0 ){ -// //std::cout << "MdtCalibHitNtupleBranch::fillBranch ERROR <index out of range, hit not added to ntuple> " -// << index << std::endl; return false; } -// //std::cout << "************************************************************************************" << std::endl; -// //std::cout << "index = " << m_index << " with segment " << segmentIndex << std::endl; -// hit.dump(//std::cout) ; -// //std::cout << "************************************************************************************" << std::endl; - // copy values m_segIndex[m_index] = segmentIndex; m_id[m_index] = (hit.identify()).getIdInt(); @@ -84,8 +75,6 @@ namespace MuonCalib { bool MdtCalibHitNtupleBranch::createBranch(TTree *tree) { // check if pointer is valid if( !tree ){ - //std::cout << "MdtCalibHitNtupleBranch::createBranch ERROR <got invalid tree pointer> " - // << std::endl; return false; } diff --git a/MuonSpectrometer/MuonCalib/MuonCalibNtuple/src/MdtCalibNtupleMaker.cxx b/MuonSpectrometer/MuonCalib/MuonCalibNtuple/src/MdtCalibNtupleMaker.cxx index 906956fd24bfdaee0e8f064d3e9b92ecf99246ea..aae4b2bd02fadf15c04e39f83edb352a41cf5148 100644 --- a/MuonSpectrometer/MuonCalib/MuonCalibNtuple/src/MdtCalibNtupleMaker.cxx +++ b/MuonSpectrometer/MuonCalib/MuonCalibNtuple/src/MdtCalibNtupleMaker.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ #include "MuonCalibNtuple/MdtCalibNtupleMaker.h" @@ -14,7 +14,6 @@ namespace MuonCalib { IMdtCalibration(name), m_ntMaker(name) { m_printLevel = 0; m_ntMaker.setPrintLevel(0); - //std::cout << "MdtCalibNtupleMaker::MdtCalibNtupleMaker" << std::endl; } const IMdtCalibrationOutput* MdtCalibNtupleMaker::analyseSegments( const IMdtCalibration::MuonSegVec &segs ){ diff --git a/MuonSpectrometer/MuonCalib/MuonCalibNtuple/src/MdtRawHitNtupleBranch.cxx b/MuonSpectrometer/MuonCalib/MuonCalibNtuple/src/MdtRawHitNtupleBranch.cxx index ea10ca7a195b6b7797517ee9247fc27c78b373ec..385cc755c306ad8ca542c0b2bacbf20bd284ca7b 100644 --- a/MuonSpectrometer/MuonCalib/MuonCalibNtuple/src/MdtRawHitNtupleBranch.cxx +++ b/MuonSpectrometer/MuonCalib/MuonCalibNtuple/src/MdtRawHitNtupleBranch.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ #include "MuonCalibNtuple/MdtRawHitNtupleBranch.h" @@ -18,37 +18,24 @@ namespace MuonCalib { {} bool MdtRawHitNtupleBranch::fillBranch( const MuonCalibRawMdtHit &hit ) { - //std::cout << "Got into the fillBranch routine of MdtRawHitNtupleBranch" << std::endl; // check if branches were initialized if( !m_branchesInit ){ - // std::cout << "MdtRawHitNtupleBranch::fillBranch ERROR <branches were not initialized>" - // << std::endl; return false; } // check if index not out of range if( m_index >= m_blockSize || m_index < 0 ){ -// std::cout << "MdtRawHitNtupleBranch::fillBranch ERROR <index out of range; hit not added to ntuple> " -// << m_index << std::endl; return false; } // copy values -// m_occupancy[m_index] = hit.occupancy() ; m_id[m_index] = hit.identify().getIdInt(); m_tdc[m_index] = hit.tdcCount(); m_adc[m_index] = hit.adcCount(); -// m_t[m_index] = hit.driftTime(); -// m_r[m_index] = hit.driftRadius(); -// m_dr[m_index] = hit.driftRadiusError(); -// m_posX[m_index] = hit.localPosition().x() ; -// m_posY[m_index] = hit.localPosition().y() ; -// m_posZ[m_index] = hit.localPosition().z() ; m_gPosX[m_index] = hit.globalPosition().x(); m_gPosY[m_index] = hit.globalPosition().y(); m_gPosZ[m_index] = hit.globalPosition().z(); - //std::cout << "Filled the rawMdtBranch with m_index " << m_index << std::endl; // increment hit index ++m_index; @@ -58,8 +45,6 @@ namespace MuonCalib { bool MdtRawHitNtupleBranch::createBranch(TTree *tree) { // check if pointer is valid if( !tree ){ - // std::cout << "MdtRawHitNtupleBranch::createBranch ERROR <got invalid tree pointer> " - // << std::endl; return false; } @@ -75,16 +60,9 @@ namespace MuonCalib { std::string array_size( std::string("[") + m_branchName + index_name + std::string("]") ); // create the branches -// branchCreator.createBranch( tree, "occupancy", &m_occupancy, array_size + "/I" ); branchCreator.createBranch( tree, "id", &m_id, array_size + "/I" ); branchCreator.createBranch( tree, "tdc", &m_tdc, array_size + "/I" ); branchCreator.createBranch( tree, "adc", &m_adc, array_size + "/I" ); -// branchCreator.createBranch( tree, "t", &m_t, array_size + "/F" ); -// branchCreator.createBranch( tree, "r", &m_r, array_size + "/F" ); -// branchCreator.createBranch( tree, "dr", &m_dr, array_size + "/F" ); -// branchCreator.createBranch( tree, "posX", &m_posX, array_size + "/F" ); -// branchCreator.createBranch( tree, "posY", &m_posY, array_size + "/F" ); -// branchCreator.createBranch( tree, "posZ", &m_posZ, array_size + "/F" ); branchCreator.createBranch( tree, "gPosX", &m_gPosX, array_size + "/F" ); branchCreator.createBranch( tree, "gPosY", &m_gPosY, array_size + "/F" ); branchCreator.createBranch( tree, "gPosZ", &m_gPosZ, array_size + "/F" ); diff --git a/MuonSpectrometer/MuonCalib/MuonCalibNtuple/src/MdtTruthHitNtupleBranch.cxx b/MuonSpectrometer/MuonCalib/MuonCalibNtuple/src/MdtTruthHitNtupleBranch.cxx index 54b18920201842823c8924499110aded126adabe..040aff055c4a8b6e3cc98c469eec07611fd8f54b 100644 --- a/MuonSpectrometer/MuonCalib/MuonCalibNtuple/src/MdtTruthHitNtupleBranch.cxx +++ b/MuonSpectrometer/MuonCalib/MuonCalibNtuple/src/MdtTruthHitNtupleBranch.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ #include "MuonCalibNtuple/MdtTruthHitNtupleBranch.h" @@ -19,15 +19,11 @@ namespace MuonCalib { bool MdtTruthHitNtupleBranch::fillBranch(const MuonCalibMdtTruthHit &hit) { // check if branches were initialized if( !m_branchesInit ){ - // std::cout << "MdtTruthHitNtupleBranch::fillBranch ERROR <branches were not initialized>" - // << std::endl; return false; } // check if index not out of range if( m_index >= m_blockSize || m_index < 0 ){ -// std::cout << "MdtTruthHitNtupleBranch::fillBranch ERROR <index out of range; hit not added to ntuple> " -// << m_index << std::endl; return false; } @@ -50,8 +46,6 @@ namespace MuonCalib { bool MdtTruthHitNtupleBranch::createBranch(TTree *tree) { // check if pointer is valid if( !tree ){ - // std::cout << "MdtTruthHitNtupleBranch::createBranch ERROR <got invalid tree pointer> " - // << std::endl; return false; } diff --git a/MuonSpectrometer/MuonCalib/MuonCalibNtuple/src/MuonCalibBranchNtuple.cxx b/MuonSpectrometer/MuonCalib/MuonCalibNtuple/src/MuonCalibBranchNtuple.cxx index 94fc7d93fc65fed5c84634f1395aa5e0c90eaa09..38516ca71a436ac421d43dce38e7fa22497c2a48 100644 --- a/MuonSpectrometer/MuonCalib/MuonCalibNtuple/src/MuonCalibBranchNtuple.cxx +++ b/MuonSpectrometer/MuonCalib/MuonCalibNtuple/src/MuonCalibBranchNtuple.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ #include "MuonCalibNtuple/MuonCalibBranchNtuple.h" @@ -29,7 +29,6 @@ #include "TDirectory.h" // 2016-03-17 E. Diehl -// Remove calls to cout (should be replaced by proper Athena messages) // Remove calls to create and fill MuonPatternNtupleBranch. However, do not change handling of // MuonCalibPattern which are needed for processing Segments. @@ -39,14 +38,9 @@ namespace MuonCalib { m_file(NULL), m_directory(NULL), m_tree(NULL), m_fitter(NULL), m_event(0), m_truthBranch(NULL), m_mdtTruthBranch(NULL), m_rpcTruthBranch(NULL), m_tgcTruthBranch(NULL), m_cscTruthBranch(NULL), m_printLevel(0) { - //if( m_printLevel >= 1){ - //std::cout << "MuonCalibBranchNtuple::MuonCalibBranchNtuple" << std::endl; - //} openFile(); bookTree(fillTruth, doRawTgc); - //if( m_printLevel >= 3){ - //std::cout << "defaultConstructor booked tree" << std::endl; - //} + m_fitter = createFitter(); } //end MuonCalibBranchNtuple::MuonCalibBranchNtuple @@ -55,33 +49,15 @@ namespace MuonCalib { m_rpcTruthBranch(NULL), m_tgcTruthBranch(NULL), m_cscTruthBranch(NULL), m_printLevel(0) { m_event = 0; m_printLevel = 0; - // if( m_printLevel >= 1){ - //std::cout << "MuonCalibBranchNtuple::MuonCalibBranchNtuple" << std::endl; - // } m_directory = RootFileManager::getInstance()->getDirectory(RegionName); - // if( m_printLevel >= 1){ - //std::cout << "opening directory " << m_directory->GetPath() << std::endl; - // } m_event = 0; m_printLevel = 0; bookTree(fillTruth, doRawTgc); - // if( m_printLevel >= 1){ - //std::cout << "region Constructor booked tree " << RegionName << std::endl; - //} m_fitter = createFitter(); - // if( m_printLevel >= 1){ - //std::cout << "booking fitter" << std::endl; - //} } //end MuonCalibBranchNtuple::MuonCalibBranchNtuple MuonCalibBranchNtuple::~MuonCalibBranchNtuple() { - //if( m_printLevel >= 1){ - //std::cout << "MuonCalibBranchNtuple::~MuonCalibBranchNtuple" << std::endl; - //} closeFile(); - //if( m_printLevel >= 3){ - //std::cout << "closed file" << std::endl; - //} delete m_fitter; m_fitter = 0; if(m_truthBranch) delete m_truthBranch; @@ -97,18 +73,8 @@ namespace MuonCalib { } void MuonCalibBranchNtuple::writeTree() { - //if( m_printLevel >= 1){ - //std::cout << " MuonCalibBranchNtuple::writeTree() " << m_directory << " " << m_tree << std::endl; - //m_directory->pwd(); - //} - //std::cout << " MuonCalibBranchNtuple::writeTree() " << m_directory << " " << m_tree << std::endl; m_directory->cd(); m_tree->Write(); - - //if( m_printLevel >= 3){ - //std::cout << " Done " << std::endl; - //} - //std::cout << " MuonCalibBranchNtuple::writeTree() done" << std::endl; } void MuonCalibBranchNtuple::closeFile() { @@ -148,44 +114,10 @@ namespace MuonCalib { } //MuonCalibBranchNtuple::setEvent void MuonCalibBranchNtuple::finishEvent() { - //if( m_printLevel >= 1){ - //std::cout << " MuonCalibBranchNtuple::finishEvent " << std::endl; - //std::cout << " patterns " << m_patBranch.getBranchEntries() - //<< " segments " << m_segBranch.getBranchEntries() - //<< " MDT hits " << m_mdtHitBranch.getBranchEntries() - //<< " RPC hits " << m_rpcHitBranch.getBranchEntries() - //<< " TGC hits " << m_tgcHitBranch.getBranchEntries() - //<< " CSC hits " << m_cscHitBranch.getBranchEntries() - //<< " truthevents " << m_truthBranch.getBranchEntries() - //<< " eventbranch " << m_eventBranch.getBranchEntries() - //<< " rawMdtbranch " << m_rawMdtHitBranch.getBranchEntries() << std::endl; - //} - //if( m_printLevel >= 5){ - //std::cout << " filling tree " << m_tree << std::endl; - //} - m_tree->Fill(); - //std::cout << " event filled " << std::endl; - //if( m_printLevel >= 5){ - //std::cout << " clearing branches" << std::endl; - //} - //if( m_printLevel >= 2){ - //std::cout << " MuonCalibBranchNtuple::finishEvent DONE" << std::endl; - //} } //end MuonCalibBranchNtuple::finishEvent void MuonCalibBranchNtuple::handlePattern(const MuonCalibPattern &pat) { - //if( m_printLevel >= 1) { - //std::cout << " MuonCalibBranchNtuple::handlePattern" << std::endl; - //} - - // m_patBranch.fillBranch( pat, PatInfo() ); - - //if( m_printLevel >= 3) { - //std::cout << " loop over segments" << std::endl; - //std::cout << "*** handlePattern: " << std::endl; - //pat.dump(std::cout); - //} MuonCalibPattern::MuonSegmentVec::const_iterator seg_it = pat.muonSegBegin(); MuonCalibPattern::MuonSegmentVec::const_iterator seg_it_end = pat.muonSegEnd(); @@ -196,61 +128,34 @@ namespace MuonCalib { } //end MuonCalibBranchNtuple::handlePattern void MuonCalibBranchNtuple::handleSegment(const MuonCalibSegment &seg) { - //if( m_printLevel >= 3){ - //std::cout << " MuonCalibBranchNtuple::handleSegment " ; - //} - fillSegmentToTree(seg); } void MuonCalibBranchNtuple::fillTruthToTree( const MuonCalibTruth &truth ) { - //if( m_printLevel >= 3){ - //std::cout << "fillTruthToTree :" << truth << std::endl; - //} if(m_truthBranch) m_truthBranch->fillBranch( truth ); } void MuonCalibBranchNtuple::fillMdtTruthToTree( const MuonCalibMdtTruthHit &hit ) { - //if( m_printLevel >= 3){ - //std::cout << "fillMdtTruthToTree :" << std::endl; - //} if(m_mdtTruthBranch) m_mdtTruthBranch->fillBranch( hit ); } void MuonCalibBranchNtuple::fillRpcTruthToTree( const MuonCalibRpcTruthHit& hit ) { - //if( m_printLevel >= 3) { - //std::cout << "fillRpcTruthToTree :" << std::endl; - //} if(m_rpcTruthBranch) m_rpcTruthBranch->fillBranch( hit ); } void MuonCalibBranchNtuple::fillTgcTruthToTree( const MuonCalibTgcTruthHit &hit ) { - //if( m_printLevel >= 3){ - //std::cout << "fillTgcTruthToTree :" << std::endl; - //} if(m_tgcTruthBranch) m_tgcTruthBranch->fillBranch( hit ); } void MuonCalibBranchNtuple::fillCscTruthToTree( const MuonCalibCscTruthHit &hit ) { - //if( m_printLevel >= 3){ - //std::cout << "fillCscTruthToTree :" << std::endl; - //} if(m_cscTruthBranch) m_cscTruthBranch->fillBranch( hit ); } void MuonCalibBranchNtuple::fillRpcSectorLogic( const RpcSectorLogicContainer& rpcSlContainer ){ - //if( m_printLevel >= 3){ - //std::cout << "fillRpcSectorLogic :" << std::endl; - //} m_rpcSlBranch.fillBranch(rpcSlContainer); } void MuonCalibBranchNtuple::fillEventToTree( const MuonCalibEventInfo &eventInfo, const MuonCalibTriggerTimeInfo &trigTimeInfo ) { - //if( m_printLevel >= 3){ - //std::cout << "fillEventToTree : " << std::endl; - //eventInfo.dump(std::cout); - //trigTimeInfo.dump(std::cout); - //} m_eventBranch.reset(); if(m_truthBranch) m_truthBranch->reset(); @@ -258,7 +163,6 @@ namespace MuonCalib { if(m_rpcTruthBranch) m_rpcTruthBranch->reset(); if(m_tgcTruthBranch) m_tgcTruthBranch->reset(); if(m_cscTruthBranch) m_cscTruthBranch->reset(); - // m_patBranch.reset(); m_segBranch.reset(); m_mdtHitBranch.reset(); m_rpcHitBranch.reset(); @@ -279,11 +183,6 @@ namespace MuonCalib { // Fill segment info and segment hit info for MDT, RPC, TGC, CSC void MuonCalibBranchNtuple::fillSegmentToTree(const MuonCalibSegment &seg) { - //if( m_printLevel >= 3){ - //std::cout << " MuonCalibBranchNtuple::fillSegmentToTree. seg num " << m_segBranch.getBranchEntries() << std::endl; - //} - - // m_segBranch.fillBranch( seg, m_patBranch.getBranchEntries()-1 ); m_segBranch.fillBranch( seg ); std::for_each( seg.mdtHOTBegin(),seg.mdtHOTEnd(), @@ -300,11 +199,7 @@ namespace MuonCalib { } //end MuonCalibBranchNtuple::fillSegmentToTree void MuonCalibBranchNtuple::bookTree(bool doTruth, bool doRawTgc) { - //if( m_printLevel >= 1 ) - //std::cout << " bookTree: creating new tree in " << m_directory->GetPath() << std::endl; - if( !m_directory ){ - //std::cout << " bookTree: ERROR no directory defined " << std::endl; return; } @@ -312,64 +207,32 @@ namespace MuonCalib { m_tree = new TTree("Segments","My first tree"); m_tree->SetAutoFlush(0); - //if( m_printLevel >= 3 ) { - //std::cout << " New tree " << m_tree << " creating branches " << std::endl; - //std::cout << "creating truth branch " << std::endl; - //} if(doTruth) { createTruthBranch(m_tree); - - //if( m_printLevel >= 3 ) std::cout << "creating mdt truth hit branch " << std::endl; createMdtTruthHitBranch(m_tree); - - //if( m_printLevel >= 3 ) std::cout << "creating rpc truth hit branch " << std::endl; createRpcTruthHitBranch(m_tree); - - //if( m_printLevel >= 3 ) std::cout << "creating tgc truth hit branch " << std::endl; createTgcTruthHitBranch(m_tree); - - //if( m_printLevel >= 3 ) std::cout << "creating csc truth hit branch " << std::endl; createCscTruthHitBranch(m_tree); } - //if( m_printLevel >= 3 ) std::cout << "creating event branch " << std::endl; createEventBranch(m_tree); - //if( m_printLevel >= 3 ) std::cout << "creating pattern branch " << std::endl; - // createPatternBranch(m_tree); //20160301 Disable pattern branch (pat_) - //if( m_printLevel >= 3 ) std::cout << "creating segment branch " << std::endl; createSegmentBranch(m_tree); - //if( m_printLevel >= 3 ) std::cout << "creating mdt hit branch " << std::endl; createMdtCalibHitBranch(m_tree); - //if( m_printLevel >= 3 ) std::cout << "creating rpc hit branch " << std::endl; createRpcCalibHitBranch(m_tree); - //if( m_printLevel >= 3 ) std::cout << "creating tgc hit branch " << std::endl; createTgcCalibHitBranch(m_tree); - //if( m_printLevel >= 3 ) std::cout << "creating csc hit branch " << std::endl; createCscCalibHitBranch(m_tree); - //if( m_printLevel >= 3 ) std::cout << "creating raw mdt branch " << std::endl; createMdtRawHitBranch(m_tree); - //if( m_printLevel >= 3 ) std::cout << "creating raw rpc branch " << std::endl; createRpcRawHitBranch(m_tree); if( doRawTgc ) { - //if( m_printLevel >= 3 ) std::cout << "creating raw tgc branch " << std::endl; createTgcRawHitBranch(m_tree); - //if( m_printLevel >= 3 ) std::cout << "creating raw tgc coin branch " << std::endl; createTgcRawCoinBranch(m_tree); } - //if( m_printLevel >= 3 ) std::cout << "creating raw rpc coin branch " << std::endl; createRpcRawCoinBranch(m_tree); - //if( m_printLevel >= 3 ) std::cout << "creating raw csc branch " << std::endl; createCscRawHitBranch(m_tree); - //if( m_printLevel >= 3 ) std::cout << "creating rpc sector logic branch " << std::endl; m_rpcSlBranch.createBranch(m_tree); - //if( m_printLevel >= 3 ) std::cout << "creating raw rpc trigger branch " << std::endl; createRpcRawTriggerHitBranch(m_tree); - - //std::cout << "created all branches" << std::endl; - if( m_printLevel >= 5 ){ m_tree->Print("all"); - //std::cout << " done " << std::endl; } } //end MuonCalibBranchNtuple::bookTree @@ -475,75 +338,32 @@ namespace MuonCalib { bool mdtAdd = true, rpcAdd = true, rpcAddCoin = true, tgcAdd = true, cscAdd = true; for(;mdt_it!=mdt_it_end; ++mdt_it) { - - //if( m_printLevel >= 3 ) { - //std::cout << "rawMdtHit : " << std::endl; - //(*mdt_it)->dump(std::cout); - //} if(mdtAdd) mdtAdd = m_rawMdtHitBranch.fillBranch( **mdt_it ); } - //if (rawHits.numberOfMuonCalibRawMdtHits() > m_rawMdtHitBranch.blockSize()) { - //std::cout << " Number of Mdt Raw Hits exceeds maximum number that can be stored: " << m_rawMdtHitBranch.blockSize() << std::endl; - //} - MuonCalibRawHitCollection::MuonCalibRawRpcHitVecCit rpc_it = rawHits.rawRpcHitCollectionBegin(); MuonCalibRawHitCollection::MuonCalibRawRpcHitVecCit rpc_it_end = rawHits.rawRpcHitCollectionEnd(); for(;rpc_it!=rpc_it_end; ++rpc_it) { - //if( m_printLevel >= 3 ) { - //std::cout << "rawRpcHit : " << std::endl; - //(*rpc_it)->dump(std::cout); - //} const MuonCalibRawRpcCoin *coin = dynamic_cast<const MuonCalibRawRpcCoin*>(*rpc_it); if(!coin && rpcAdd) { rpcAdd =m_rawRpcHitBranch.fillBranch( **rpc_it ); - //if(!rpcAdd) { - //std::cout << " Number of Rpc Raw Hits exceeds maximum number that can be stored: " << m_rawRpcHitBranch.blockSize() << std::endl; - //} } else if(coin && rpcAddCoin) { rpcAddCoin = m_rawRpcCoinBranch.fillBranch( *coin ); - //if(!rpcAddCoin) { - //std::cout << " Number of Rpc Raw coin Hits exceeds maximum number that can be stored: " << m_rawRpcHitBranch.blockSize() << std::endl; - //} } } MuonCalibRawHitCollection::MuonCalibRawCscHitVecCit csc_it = rawHits.rawCscHitCollectionBegin(); MuonCalibRawHitCollection::MuonCalibRawCscHitVecCit csc_it_end = rawHits.rawCscHitCollectionEnd(); - //if (rawHits.numberOfMuonCalibRawCscHits() > m_rawCscHitBranch.blockSize()) { - //std::cout << " Number of Csc Raw Hits exceeds maximum number that can be stored: " << m_rawCscHitBranch.blockSize() << std::endl; - //} - for(;csc_it!=csc_it_end; ++csc_it) { - //if( m_printLevel >= 3 ) { - //std::cout << "rawCscHit : " << std::endl; - //(*csc_it)->dump(std::cout); - //} if(cscAdd) cscAdd =m_rawCscHitBranch.fillBranch( **csc_it ); } MuonCalibRawHitCollection::MuonCalibRawTgcHitVecCit tgc_it = rawHits.rawTgcHitCollectionBegin(); MuonCalibRawHitCollection::MuonCalibRawTgcHitVecCit tgc_it_end = rawHits.rawTgcHitCollectionEnd(); - //if (rawHits.numberOfMuonCalibRawTgcHits() > m_rawTgcHitBranch.blockSize()) { - //std::cout << " Number of Tgc Raw Hits exceeds maximum number that can be stored: " << m_rawTgcHitBranch.blockSize() << std::endl; - //} - for(;tgc_it!=tgc_it_end; ++tgc_it) { - //if( m_printLevel >= 3 ) { - //std::cout << "rawTgcHit : " << std::endl; - //(*tgc_it)->dump(std::cout); - //} if(tgcAdd) tgcAdd = m_rawTgcHitBranch.fillBranch( **tgc_it ); } MuonCalibRawHitCollection::MuonCalibRawTgcCoinVecCit tgcCoin_it = rawHits.rawTgcCoinCollectionBegin(); MuonCalibRawHitCollection::MuonCalibRawTgcCoinVecCit tgcCoin_it_end = rawHits.rawTgcCoinCollectionEnd(); - //if (rawHits.numberOfMuonCalibRawTgcHits() > m_rawTgcCoinBranch.blockSize()) { - //std::cout << " Number of Tgc Raw Hits exceeds maximum number that can be stored: " << m_rawTgcCoinBranch.blockSize() << std::endl; - //} - for(;tgcCoin_it!=tgcCoin_it_end; ++tgcCoin_it) { - //if( m_printLevel >= 3 ) { - //std::cout << "rawTgcCoin : " << std::endl; - //(*tgcCoin_it)->dump(std::cout); - //} if(tgcAdd) tgcAdd = m_rawTgcCoinBranch.fillBranch( **tgcCoin_it ); } @@ -553,12 +373,7 @@ namespace MuonCalib { MuonCalibRawTriggerHitCollection::MuonCalibRawRpcTriggerHitVecCit rpc_it = rawTriggerHits.rawRpcTriggerHitCollectionBegin(); MuonCalibRawTriggerHitCollection::MuonCalibRawRpcTriggerHitVecCit rpc_it_end = rawTriggerHits.rawRpcTriggerHitCollectionEnd(); for(;rpc_it!=rpc_it_end; ++rpc_it){ - //if( m_printLevel >= 3 ) { - //std::cout << "rawRpcTriggerHit : " << std::endl; - //(*rpc_it)->dump(std::cout); - //} m_rawRpcTriggerHitBranch.fillBranch( **rpc_it ); } } //end MuonCalibBranchNtuple::handleRawTriggerHits - } //namespace MuonCalib diff --git a/MuonSpectrometer/MuonCalib/MuonCalibNtuple/src/MuonCalibRpcSectorLogicBranch.cxx b/MuonSpectrometer/MuonCalib/MuonCalibNtuple/src/MuonCalibRpcSectorLogicBranch.cxx index 1dbc668126a316aad731d33a441c5a74a414dd7e..79ef7e30c54722b9a368196de80f35f2e5214f03 100644 --- a/MuonSpectrometer/MuonCalib/MuonCalibNtuple/src/MuonCalibRpcSectorLogicBranch.cxx +++ b/MuonSpectrometer/MuonCalib/MuonCalibNtuple/src/MuonCalibRpcSectorLogicBranch.cxx @@ -1,13 +1,10 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ #include "MuonCalibNtuple/MuonCalibRpcSectorLogicBranch.h" - #include "MuonCalibNtuple/NtupleBranchCreator.h" - #include "TTree.h" - #include <iostream> namespace MuonCalib { @@ -19,18 +16,12 @@ namespace MuonCalib { bool MuonCalibRpcSectorLogicBranch::fillBranch(const RpcSectorLogicContainer &slContainer) { // check if branches were initialized if( !m_branchesInit ){ - //std::cout << "MuonCalibRpcSectorLogicBranch::fillBranch " - // << " ERROR <branches were not initialized>" - // << std::endl; return false; } // check if m_index not out of range if( m_index >= m_blockSize || m_index < 0 ){ if (m_first == true) { - //std::cout << "MuonCalibRpcSectorLogicBranch::fillBranch " - //<< " ERROR <index out of range; entry not added to ntuple> " - // << m_index << std::endl; m_first = false; } return false; @@ -82,8 +73,6 @@ namespace MuonCalib { bool MuonCalibRpcSectorLogicBranch::createBranch(TTree *tree) { // check if pointer is valid if( !tree ){ - //std::cout << "MuonPatternNtupleBranch::createBranch ERROR <got invalid tree pointer> " - //<< std::endl; return false; } @@ -106,21 +95,6 @@ namespace MuonCalib { branchCreator.createBranch( tree, "_crc", &m_crc, array_size + "/I" ); branchCreator.createBranch( tree, "_hasMoreThan2TriggerCand", &m_hasMoreThan2TriggerCand, array_size + "/I" ); - /** - // second branch for vector properties - std::string index_name2 = "nLogicsTimes"; - - // create a branch for every data member - branchCreator.createBranch( tree, index_name2, &m_index2, "/I"); - - // all entries of same size, the number of hits in the event - std::string array_size2( std::string("[") + m_branchName + index_name2 + std::string("]") ); - - branchCreator.createBranch( tree, "slIndex", &m_slIndex, array_size2 + "/I" ); - branchCreator.createBranch( tree, "triggerRates", &m_triggerRates, array_size2 + "/F" ); - branchCreator.createBranch( tree, "counters", &m_counters, array_size2 + "/I" ); - */ - // third branch for RpcSLTriggerHit properties std::string index_name3 = "nTriggerHits"; diff --git a/MuonSpectrometer/MuonCalib/MuonCalibNtuple/src/MuonEventNtupleBranch.cxx b/MuonSpectrometer/MuonCalib/MuonCalibNtuple/src/MuonEventNtupleBranch.cxx index d7ad16030ab694b5548b9edc3a0ab6ec8c61e3c1..ab5786a9cd01fdd5b8049b522e5ea3c4f0d9466b 100644 --- a/MuonSpectrometer/MuonCalib/MuonCalibNtuple/src/MuonEventNtupleBranch.cxx +++ b/MuonSpectrometer/MuonCalib/MuonCalibNtuple/src/MuonEventNtupleBranch.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ //MuonCalib packages @@ -27,8 +27,6 @@ namespace MuonCalib { bool MuonEventNtupleBranch::fillBranch(const MuonCalibEventInfo &eventInfo, const MuonCalibTriggerTimeInfo &trigTimeInfo ) { // check if branches where initialized if( !m_branchesInit ){ - //std::cout << "MuonEventNtupleBranch::fillBranch ERROR <branches where not initialized>" - // << std::endl; return false; } @@ -72,8 +70,6 @@ namespace MuonCalib { bool MuonEventNtupleBranch::createBranch(TTree *tree) { // check if pointer is valid if( !tree ){ - //std::cout << "MuonEventNtupleBranch::createBranch ERROR <got invalid tree pointer> " - // << std::endl; return false; } diff --git a/MuonSpectrometer/MuonCalib/MuonCalibNtuple/src/MuonPatternNtupleBranch.cxx b/MuonSpectrometer/MuonCalib/MuonCalibNtuple/src/MuonPatternNtupleBranch.cxx index 03e5fc27de7d0e8e9e24427b44a2c9569ad0a24e..6af071bbdf09311d889486ea8660c9476155d186 100644 --- a/MuonSpectrometer/MuonCalib/MuonCalibNtuple/src/MuonPatternNtupleBranch.cxx +++ b/MuonSpectrometer/MuonCalib/MuonCalibNtuple/src/MuonPatternNtupleBranch.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ #include "MuonCalibNtuple/MuonPatternNtupleBranch.h" @@ -20,18 +20,12 @@ namespace MuonCalib { bool MuonPatternNtupleBranch::fillBranch(const MuonCalibPattern &pat, const PatInfo& /* info (not used) */) { // check if branches were initialized if( !m_branchesInit ){ - // std::cout << "MuonPatternNtupleBranch::fillBranch " - // << " ERROR <branches where not initialized>" - // << std::endl; return false; } // check if index is within range if( m_index >= m_blockSize || m_index < 0 ){ if (m_first == true) { - //std::cout << "MuonPatternNtupleBranch::fillBranch " - // << " ERROR <index out of range; pat not added to ntuple> " - // << m_index << std::endl; m_first = false; } return false; @@ -59,8 +53,6 @@ namespace MuonCalib { bool MuonPatternNtupleBranch::createBranch(TTree *tree) { // check if pointer is valid if( !tree ){ - // std::cout << "MuonPatternNtupleBranch::createBranch: <got invalid tree pointer> " - // << std::endl; return false; } diff --git a/MuonSpectrometer/MuonCalib/MuonCalibNtuple/src/MuonSegmentNtupleBranch.cxx b/MuonSpectrometer/MuonCalib/MuonCalibNtuple/src/MuonSegmentNtupleBranch.cxx index 5286f9d94ae218dda6906d3e4ac41dad621ab83f..3a85c63eb0fd22ed351532a20e9f138b63aa7f19 100644 --- a/MuonSpectrometer/MuonCalib/MuonCalibNtuple/src/MuonSegmentNtupleBranch.cxx +++ b/MuonSpectrometer/MuonCalib/MuonCalibNtuple/src/MuonSegmentNtupleBranch.cxx @@ -101,8 +101,6 @@ namespace MuonCalib { bool MuonSegmentNtupleBranch::createBranch(TTree *tree) { // check if pointer is valid if( !tree ) { - // std::cout << "MuonSegmentNtupleBranch::createBranch ERROR <got invalid tree pointer> " - // << std::endl; return false; } diff --git a/MuonSpectrometer/MuonCalib/MuonCalibNtuple/src/MuonTruthNtupleBranch.cxx b/MuonSpectrometer/MuonCalib/MuonCalibNtuple/src/MuonTruthNtupleBranch.cxx index eff41c4c29d41ae22c44e729001eb603d499336c..5a9061b99d60c9e2f5c65ec1ba0f5eb4a51c4eb4 100644 --- a/MuonSpectrometer/MuonCalib/MuonCalibNtuple/src/MuonTruthNtupleBranch.cxx +++ b/MuonSpectrometer/MuonCalib/MuonCalibNtuple/src/MuonTruthNtupleBranch.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ //MuonCalib packages @@ -20,19 +20,14 @@ namespace MuonCalib { {} bool MuonTruthNtupleBranch::fillBranch(const MuonCalibTruth &truth) { -// std::cout << "Fill Truth Branch" << std::endl; // check if branches were initialized if( !m_branchesInit ){ - //std::cout << "MuonTruthNtupleBranch::fillBranch ERROR <branches were not initialized>" - // << std::endl; return false; } // check if index not out of range if( m_index >= m_blockSize || m_index < 0 ){ if (m_first == true) { - //std::cout << "MuonTruthNtupleBranch::fillBranch ERROR <index out of range; truth not added to ntuple> " - // << m_index << std::endl; m_first = false; } return false; @@ -60,8 +55,6 @@ namespace MuonCalib { bool MuonTruthNtupleBranch::createBranch(TTree *tree) { // check if pointer is valid if( !tree ){ - // std::cout << "MuonTruthNtupleBranch::createBranch ERROR <got invalid tree pointer> " - // << std::endl; return false; } diff --git a/MuonSpectrometer/MuonCalib/MuonCalibNtuple/src/RootFileManager.cxx b/MuonSpectrometer/MuonCalib/MuonCalibNtuple/src/RootFileManager.cxx index b2295e4e0bff1f8fc713a80231edd35a2ad06252..ba568a836635347be67ac76f2305df58dc51da39 100644 --- a/MuonSpectrometer/MuonCalib/MuonCalibNtuple/src/RootFileManager.cxx +++ b/MuonSpectrometer/MuonCalib/MuonCalibNtuple/src/RootFileManager.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ #include "MuonCalibNtuple/RootFileManager.h" @@ -24,7 +24,6 @@ namespace MuonCalib { TDirectory* RootFileManager::getDirectory( std::string dirname ) { if( !m_outFile ){ - //std::cout << " RootFileManager::getDirectory ERROR <open file first> " << std::endl; return 0; } @@ -49,7 +48,6 @@ namespace MuonCalib { bool RootFileManager::openFile( std::string filename) { if (m_outfiles[filename]==NULL) { - // std::cout<<"Creating new file: "<<filename<<std::endl; m_outfiles[filename] = new TFile( filename.c_str(), m_fileOption.c_str() ); } // create new root file @@ -63,7 +61,6 @@ namespace MuonCalib { for(std::map<std::string, TFile *> :: iterator it=m_outfiles.begin(); it!=m_outfiles.end(); it++) { it->second->Write(); it->second->Close(); - // delete m_meta_data_tree[it->first]; m_meta_data_tree[it->first]=NULL; } // set pointer to zero delete m_key; m_key=NULL; @@ -74,14 +71,11 @@ namespace MuonCalib { } //end RootFileManager::closeFile void RootFileManager::WriteMetaData(const std::map<std::string, std::string> &metadata, const std::string &filename) { - // std::cout<<"Writing Metadata to "<<filename<<std::endl; if(m_outfiles.find(filename)==m_outfiles.end()) { - // std::cerr<<"RootFileManager::WriteMetaData: File " << filename <<" is not created!"<<std::endl; return; } TDirectory *current=gDirectory; m_outfiles[filename]->cd(); - // std::cout<<">>>>>>>>>>>>>"<<gDirectory->GetName()<<std::endl; if(!m_key) m_key = new std::string(); if(!m_value) m_value = new std::string(); TTree *meta_data_tree=new TTree("meta_data", "Meta Data"); diff --git a/MuonSpectrometer/MuonCalib/MuonCalibNtuple/src/RpcCalibHitNtupleBranch.cxx b/MuonSpectrometer/MuonCalib/MuonCalibNtuple/src/RpcCalibHitNtupleBranch.cxx index 1a816e028b0538e0f218baeb2f6e1af2f33103d7..73b312275b9f060bb3e1a81c5255ba8c85e2ebfa 100644 --- a/MuonSpectrometer/MuonCalib/MuonCalibNtuple/src/RpcCalibHitNtupleBranch.cxx +++ b/MuonSpectrometer/MuonCalib/MuonCalibNtuple/src/RpcCalibHitNtupleBranch.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ #include "MuonCalibNtuple/RpcCalibHitNtupleBranch.h" @@ -19,15 +19,11 @@ namespace MuonCalib { bool RpcCalibHitNtupleBranch::fillBranch(const RpcCalibHitBase &hit, const int segmentIndex) { // check if branches were initialized if( !m_branchesInit ){ - //std::cout << "RpcCalibHitNtupleBranch::fillBranch ERROR <branches were not initialized>" - // << std::endl; return false; } // check if index not out of range if( m_index >= m_blockSize || m_index < 0 ){ -// std::cout << "RpcCalibHitNtupleBranch::fillBranch ERROR <index out of range; hit not added to ntuple> " -// << m_index << std::endl; return false; } @@ -56,8 +52,6 @@ namespace MuonCalib { bool RpcCalibHitNtupleBranch::createBranch( TTree *tree ) { // check if pointer is valid if( !tree ){ - // std::cout << "RpcCalibHitNtupleBranch::createBranch ERROR <got invalid tree pointer> " - // << std::endl; return false; } diff --git a/MuonSpectrometer/MuonCalib/MuonCalibNtuple/src/RpcTruthHitNtupleBranch.cxx b/MuonSpectrometer/MuonCalib/MuonCalibNtuple/src/RpcTruthHitNtupleBranch.cxx index ecfd045ccd1bc49e784e367c9869d3d4b8a1f424..9470cdfd8e2004c3980ec8d2361981485b3c3570 100644 --- a/MuonSpectrometer/MuonCalib/MuonCalibNtuple/src/RpcTruthHitNtupleBranch.cxx +++ b/MuonSpectrometer/MuonCalib/MuonCalibNtuple/src/RpcTruthHitNtupleBranch.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ #include "MuonCalibNtuple/RpcTruthHitNtupleBranch.h" @@ -19,15 +19,11 @@ namespace MuonCalib { bool RpcTruthHitNtupleBranch::fillBranch(const MuonCalibRpcTruthHit &hit) { // check if branches were initialized if( !m_branchesInit ){ - //std::cout << "RpcTruthHitNtupleBranch::fillBranch ERROR <branches were not initialized>" - // << std::endl; return false; } // check if index not out of range if( m_index >= m_blockSize || m_index < 0 ){ -// std::cout << "RpcTruthHitNtupleBranch::fillBranch ERROR <index out of range; hit not added to ntuple> " -// << m_index << std::endl; return false; } @@ -45,8 +41,6 @@ namespace MuonCalib { bool RpcTruthHitNtupleBranch::createBranch(TTree *tree) { // check if pointer is valid if( !tree ){ - //std::cout << "RpcTruthHitNtupleBranch::createBranch ERROR <got invalid tree pointer> " - // << std::endl; return false; } diff --git a/MuonSpectrometer/MuonCalib/MuonCalibNtuple/src/TgcCalibHitNtupleBranch.cxx b/MuonSpectrometer/MuonCalib/MuonCalibNtuple/src/TgcCalibHitNtupleBranch.cxx index d90d04b892404af3f61a1676b061609da36d79c1..4b2a3b2b046d8a09546db3cf39fcf9ebc426946f 100644 --- a/MuonSpectrometer/MuonCalib/MuonCalibNtuple/src/TgcCalibHitNtupleBranch.cxx +++ b/MuonSpectrometer/MuonCalib/MuonCalibNtuple/src/TgcCalibHitNtupleBranch.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ #include "MuonCalibNtuple/TgcCalibHitNtupleBranch.h" @@ -19,15 +19,11 @@ namespace MuonCalib { bool TgcCalibHitNtupleBranch::fillBranch(const TgcCalibHitBase &hit, const int segmentIndex ) { // check if branches were initialized if( !m_branchesInit ){ - //std::cout << "TgcCalibHitNtupleBranch::fillBranch ERROR <branches were not initialized>" - // << std::endl; return false; } // check if index not out of range if( m_index >= m_blockSize || m_index < 0 ){ - // std::cout << "TgcCalibHitNtupleBranch::fillBranch ERROR <index out of range; hit not added to ntuple> " - // << m_index << std::endl; return false; } @@ -54,8 +50,6 @@ namespace MuonCalib { bool TgcCalibHitNtupleBranch::createBranch(TTree *tree) { // check if pointer is valid if( !tree ){ - // std::cout << "TgcCalibHitNtupleBranch::createBranch ERROR <got invalid tree pointer> " - // << std::endl; return false; } diff --git a/MuonSpectrometer/MuonCalib/MuonCalibNtuple/src/TgcTruthHitNtupleBranch.cxx b/MuonSpectrometer/MuonCalib/MuonCalibNtuple/src/TgcTruthHitNtupleBranch.cxx index d566e65dd7882c89e3f10c3d7655a9551dc5139d..bc80307f89a0e8beafc550693dd7108134e9af0d 100644 --- a/MuonSpectrometer/MuonCalib/MuonCalibNtuple/src/TgcTruthHitNtupleBranch.cxx +++ b/MuonSpectrometer/MuonCalib/MuonCalibNtuple/src/TgcTruthHitNtupleBranch.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ #include "MuonCalibNtuple/TgcTruthHitNtupleBranch.h" @@ -19,15 +19,11 @@ namespace MuonCalib { bool TgcTruthHitNtupleBranch::fillBranch( const MuonCalibTgcTruthHit &hit ) { // check if branches were initialized if( !m_branchesInit ) { - //std::cout << "TgcTruthHitNtupleBranch::fillBranch ERROR <branches were not initialized>" - // << std::endl; return false; } // check if index not out of range if( m_index >= m_blockSize || m_index < 0 ) { - //std::cout << "TgcTruthHitNtupleBranch::fillBranch ERROR <index out of range, hit not added to ntuple> " - // << m_index << std::endl; return false; } @@ -45,8 +41,6 @@ namespace MuonCalib { bool TgcTruthHitNtupleBranch::createBranch( TTree *tree ) { // check if pointer is valid if( !tree ){ - // std::cout << "TgcTruthHitNtupleBranch::createBranch ERROR <got invalid tree pointer> " - // << std::endl; return false; } diff --git a/MuonSpectrometer/MuonCalib/MuonCalibStandAlone/CalibNtupleAnalysisAlg/CalibNtupleAnalysisAlg/BarrelSecondCoordinatePreparationTool.h b/MuonSpectrometer/MuonCalib/MuonCalibStandAlone/CalibNtupleAnalysisAlg/CalibNtupleAnalysisAlg/BarrelSecondCoordinatePreparationTool.h index a92308dd9d65a05d425d8f97d282a9266c0b4850..8c7d1564b58a77f67dc94240ea0e0a686737400f 100644 --- a/MuonSpectrometer/MuonCalib/MuonCalibStandAlone/CalibNtupleAnalysisAlg/CalibNtupleAnalysisAlg/BarrelSecondCoordinatePreparationTool.h +++ b/MuonSpectrometer/MuonCalib/MuonCalibStandAlone/CalibNtupleAnalysisAlg/CalibNtupleAnalysisAlg/BarrelSecondCoordinatePreparationTool.h @@ -1,11 +1,7 @@ /* - Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ -//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -// 23.01.2008, AUTHOR: OLIVER KORTNER -//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - #ifndef MuonCalib_BarrelSecondCoordinatePreparationToolH #define MuonCalib_BarrelSecondCoordinatePreparationToolH @@ -50,7 +46,7 @@ class BarrelSecondCoordinatePreparationTool : public AthAlgTool, virtual public const std::string &n, const IInterface *p); // Destructor // - ~BarrelSecondCoordinatePreparationTool(void); + ~BarrelSecondCoordinatePreparationTool()=default; // Methods // // methods required by the base classes // diff --git a/MuonSpectrometer/MuonCalib/MuonCalibStandAlone/CalibNtupleAnalysisAlg/src/BarrelSecondCoordinatePreparationTool.cxx b/MuonSpectrometer/MuonCalib/MuonCalibStandAlone/CalibNtupleAnalysisAlg/src/BarrelSecondCoordinatePreparationTool.cxx index 3dcf39152b33ca4a9771404ede219089c82cedd4..c6880673600487433380cc7a6e0389404b489d4d 100644 --- a/MuonSpectrometer/MuonCalib/MuonCalibStandAlone/CalibNtupleAnalysisAlg/src/BarrelSecondCoordinatePreparationTool.cxx +++ b/MuonSpectrometer/MuonCalib/MuonCalibStandAlone/CalibNtupleAnalysisAlg/src/BarrelSecondCoordinatePreparationTool.cxx @@ -31,14 +31,6 @@ BarrelSecondCoordinatePreparationTool::BarrelSecondCoordinatePreparationTool( //***************************************************************************** -//////////////// -// DESTRUCTOR // -//////////////// -BarrelSecondCoordinatePreparationTool::~BarrelSecondCoordinatePreparationTool(void) { -} - -//***************************************************************************** - /////////////////////// // METHOD initialize // /////////////////////// @@ -132,7 +124,6 @@ void BarrelSecondCoordinatePreparationTool::prepareSegments( // reconstruct the second coordinate // if (!handleRPChits(*(it->second), raw_hits)) { - // cout<<"RPC FIT FAILED!"<<endl; to_delete.insert(it->first); } diff --git a/MuonSpectrometer/MuonCalib/MuonCalibStandAlone/CalibNtupleAnalysisAlg/src/CalibNtupleLoader.cxx b/MuonSpectrometer/MuonCalib/MuonCalibStandAlone/CalibNtupleAnalysisAlg/src/CalibNtupleLoader.cxx index 7f7ccf0e9dc7123194eb4033dc5866d075a88845..c07cf88bc700d572631e07750a3f8fbf9b227a4b 100644 --- a/MuonSpectrometer/MuonCalib/MuonCalibStandAlone/CalibNtupleAnalysisAlg/src/CalibNtupleLoader.cxx +++ b/MuonSpectrometer/MuonCalib/MuonCalibStandAlone/CalibNtupleAnalysisAlg/src/CalibNtupleLoader.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ //this @@ -143,7 +143,6 @@ void CalibNtupleLoader::prepareSegments(const MuonCalibEvent *&event, std::map<N } if(m_skip_double_events) { while(static_cast<int>(event->eventInfo().eventNumber()) == m_prev_event_nr) { - // std::cout<<"Double ...."<< m_prev_event_nr <<std::endl; m_first++; if(m_last>0 && m_last<=m_first) { ATH_MSG_INFO( "Enough events read!" ); diff --git a/MuonSpectrometer/MuonCalib/MuonCalibStandAlone/CalibNtupleAnalysisAlg/src/GeoDraw.cxx b/MuonSpectrometer/MuonCalib/MuonCalibStandAlone/CalibNtupleAnalysisAlg/src/GeoDraw.cxx index 1a81ae5313b0924770e9db4299b923085c3bca35..2b3e5f723b2127a33a5e3374b66e46c8a27aef06 100644 --- a/MuonSpectrometer/MuonCalib/MuonCalibStandAlone/CalibNtupleAnalysisAlg/src/GeoDraw.cxx +++ b/MuonSpectrometer/MuonCalib/MuonCalibStandAlone/CalibNtupleAnalysisAlg/src/GeoDraw.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ #include "CalibNtupleAnalysisAlg/GeoDraw.h" @@ -7,6 +7,8 @@ #include "CLHEP/Geometry/Transform3D.h" #include "CLHEP/Geometry/Point3D.h" #include "MdtStationGeometryRow.h" +#include "GaudiKernel/MsgStream.h" +#include "AthenaKernel/getMessageSvc.h" #include "TTree.h" #include "TFile.h" @@ -44,9 +46,9 @@ void GeoDraw::Load(const char *filename) { mdt_tubes->SetBranchAddress("pos_y", &pos_y); mdt_tubes->SetBranchAddress("pos_z", &pos_z); TNamed *ATLASVersion = dynamic_cast<TNamed *>(inf.Get("ATLASVersion")); - if (ATLASVersion) - std::cout<<"Reading geometry "<<ATLASVersion->GetTitle()<<std::endl; - std::cout<<"Loading "<<mdt_tubes->GetEntries()<<" tubes"<<std::endl; + MsgStream log(Athena::getMessageSvc(),"GeoDraw"); + if (ATLASVersion) log<<MSG::INFO<<"Reading geometry "<<ATLASVersion->GetTitle()<<endmsg; + log<<MSG::INFO<<"Loading "<<mdt_tubes->GetEntries()<<" tubes"<<endmsg; for(int i=0; i<mdt_tubes->GetEntries(); i++) { mdt_tubes->GetEntry(i); s_data->tube_positions[id].setX(pos_x); @@ -59,7 +61,7 @@ void GeoDraw::Load(const char *filename) { MdtStationGeometryRow row; row.SetBranchAddress(mdt_station); mdt_station->SetBranchAddress("id", &id); - std::cout<<"Loading "<<mdt_station->GetEntries()<<" stations"<<std::endl; + log<<MSG::INFO<<"Loading "<<mdt_station->GetEntries()<<" stations"<<endmsg; for(int i=0; i<mdt_station->GetEntries(); i++) { mdt_station->GetEntry(i); s_data->local_to_global[id] = row.GetTransform(); @@ -71,7 +73,8 @@ void GeoDraw::Load(const char *filename) { double GeoDraw::PosX(unsigned int tube_id) { std::map<unsigned int, HepGeom::Point3D<double> >::const_iterator it(s_data->tube_positions.find(tube_id)); if(it==s_data->tube_positions.end()) { - std::cout<<"Tube not found"<<std::endl; + MsgStream log(Athena::getMessageSvc(),"GeoDraw"); + log<<MSG::WARNING<<"Tube not found"<<endmsg; return 9e9; } return it->second.x(); @@ -80,7 +83,8 @@ double GeoDraw::PosX(unsigned int tube_id) { double GeoDraw::PosY(unsigned int tube_id) { std::map<unsigned int, HepGeom::Point3D<double> >::const_iterator it(s_data->tube_positions.find(tube_id)); if(it==s_data->tube_positions.end()) { - std::cout<<"Tube not found"<<std::endl; + MsgStream log(Athena::getMessageSvc(),"GeoDraw"); + log<<MSG::WARNING<<"Tube not found"<<endmsg; return 9e9; } return it->second.y(); @@ -89,7 +93,8 @@ double GeoDraw::PosY(unsigned int tube_id) { double GeoDraw::PosZ(unsigned int tube_id) { std::map<unsigned int, HepGeom::Point3D<double> >::const_iterator it(s_data->tube_positions.find(tube_id)); if(it==s_data->tube_positions.end()) { - std::cout<<"Tube not found"<<std::endl; + MsgStream log(Athena::getMessageSvc(),"GeoDraw"); + log<<MSG::WARNING<<"Tube not found"<<endmsg; return 9e9; } return it->second.z(); diff --git a/MuonSpectrometer/MuonCalib/MuonCalibStandAlone/CalibNtupleAnalysisAlg/src/SegmentRecalibration.cxx b/MuonSpectrometer/MuonCalib/MuonCalibStandAlone/CalibNtupleAnalysisAlg/src/SegmentRecalibration.cxx index 7e163bf3b4ab5e432c6d207ab1ded87c6e5d3c5b..17b8bff28ace0240c387f9dde46f606209af088d 100644 --- a/MuonSpectrometer/MuonCalib/MuonCalibStandAlone/CalibNtupleAnalysisAlg/src/SegmentRecalibration.cxx +++ b/MuonSpectrometer/MuonCalib/MuonCalibStandAlone/CalibNtupleAnalysisAlg/src/SegmentRecalibration.cxx @@ -96,7 +96,6 @@ void SegmentRecalibration::prepareSegments(const MuonCalibEvent *&event, std::ma if(m_time_slwing_numswitch==2) { hit->setSlewingTime(p_ts_corr_func->correction( hit->driftTime(), hit->adcCount())); hit->setDriftTime(hit->driftTime() - hit->slewingTime()); - // std::cout<<hit->slewingTime()<<std::endl; } if(m_rt_scaling_numswitch>0 && hit->TemperatureTime() != MdtCalibHitBase::kNoValue) { hit->setDriftTime(hit->driftTime() + hit->TemperatureTime()); diff --git a/MuonSpectrometer/MuonCalib/MuonCalibStandAlone/CalibNtupleAnalysisAlg/src/SegmentRefitter.cxx b/MuonSpectrometer/MuonCalib/MuonCalibStandAlone/CalibNtupleAnalysisAlg/src/SegmentRefitter.cxx index 28c8cd5922b2e2d3579a2405cf087ed5778e72d6..cde7dd683290965be913eb1dfebfd7399ba379ef 100644 --- a/MuonSpectrometer/MuonCalib/MuonCalibStandAlone/CalibNtupleAnalysisAlg/src/SegmentRefitter.cxx +++ b/MuonSpectrometer/MuonCalib/MuonCalibStandAlone/CalibNtupleAnalysisAlg/src/SegmentRefitter.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ //this @@ -67,7 +67,6 @@ StatusCode SegmentRefitter::initialize(void) { void SegmentRefitter::prepareSegments(const MuonCalibEvent *& /*event*/, std::map<NtupleStationId, MuonCalibSegment *> &segments) { std::set<NtupleStationId> dropped_segments; for(std::map<NtupleStationId, MuonCalibSegment *>::iterator it=segments.begin(); it!= segments.end(); it++) { - // std::cout<<it->first.regionId()<<std::endl; if(m_t0_refine) { if(!refine_t0(it->second)) { dropped_segments.insert(it->first); diff --git a/MuonSpectrometer/MuonCalib/MuonCalibStandAlone/CalibNtupleAnalysisAlg/src/WriteMdtGeometry.cxx b/MuonSpectrometer/MuonCalib/MuonCalibStandAlone/CalibNtupleAnalysisAlg/src/WriteMdtGeometry.cxx index 06d5d17a3353d59a5463059f33062344bf73af04..b9c5d46331695a98b6ff31c2c30e5181ae61be64 100644 --- a/MuonSpectrometer/MuonCalib/MuonCalibStandAlone/CalibNtupleAnalysisAlg/src/WriteMdtGeometry.cxx +++ b/MuonSpectrometer/MuonCalib/MuonCalibStandAlone/CalibNtupleAnalysisAlg/src/WriteMdtGeometry.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ //this @@ -104,7 +104,6 @@ inline bool WriteMdtGeometry::fill_db(coral::ITableDataEditor &editor) { MdtIdHelper::const_id_iterator it = m_idHelperSvc->mdtIdHelper().module_begin(); MdtIdHelper::const_id_iterator it_end = m_idHelperSvc->mdtIdHelper().module_end(); for( ; it!=it_end;++it ) { - std::cout<<"."<<std::flush; const MuonGM::MdtReadoutElement *detEl = m_detMgr->getMdtReadoutElement( m_idHelperSvc->mdtIdHelper().channelID(*it,1,1,1)); if(!detEl) continue; //get number of mls; @@ -118,9 +117,6 @@ inline bool WriteMdtGeometry::fill_db(coral::ITableDataEditor &editor) { const MuonGM::MdtReadoutElement *detEl_ml = m_detMgr->getMdtReadoutElement(m_idHelperSvc->mdtIdHelper().channelID(*it,ml ,1,1)); int n_layers=detEl_ml->getNLayers(); int n_tubes=detEl_ml->getNtubesperlayer(); - // if(detEl_ml==NULL) { - // std::cerr<<"detEl_ml==NULL"<<std::endl; - // } rowBuffer["N_TUBES"].data<int>()=n_tubes; for(int ly=1; ly<=n_layers; ly++) { rowBuffer["LY"].data<int>()=ly; @@ -133,7 +129,6 @@ inline bool WriteMdtGeometry::fill_db(coral::ITableDataEditor &editor) { } //end WriteMdtGeometry::fill_db inline void WriteMdtGeometry::fillLayer(const MuonGM::MdtReadoutElement *detEl, coral::AttributeList &rowBuffer, const int &ml, const int &ly) { - // std::cout<<"fillTubePos for "<<ml<<", "<<ly<<", "<<tb<<std::endl; Amg::Vector3D TubePos1 = detEl->GlobalToAmdbLRSCoords(detEl->tubePos(ml,ly,1)); Amg::Vector3D TubePos2 = detEl->GlobalToAmdbLRSCoords(detEl->tubePos(ml,ly,2)); rowBuffer["LOC_Y"].data<float>()=TubePos1.y(); diff --git a/MuonSpectrometer/MuonCalib/MuonCalibStandAlone/CalibNtupleReader/src/NTReader.cxx b/MuonSpectrometer/MuonCalib/MuonCalibStandAlone/CalibNtupleReader/src/NTReader.cxx index b5bc5a70d07b636f092fa35e5eaa549c8e562e91..0d15e33559c76cca1692290aca368e5dd2be8f5d 100644 --- a/MuonSpectrometer/MuonCalib/MuonCalibStandAlone/CalibNtupleReader/src/NTReader.cxx +++ b/MuonSpectrometer/MuonCalib/MuonCalibStandAlone/CalibNtupleReader/src/NTReader.cxx @@ -37,18 +37,15 @@ namespace MuonCalib{ NTReader::~NTReader() { - //std::cout << "Calling NTReader::~NTReader()" << std::endl; clearEvent(); } void NTReader::clearEvent() { - // std::cout << "Calling NTReader::clearEvent()" << std::endl; delete m_event; m_event = 0; } const MuonCalibEvent& NTReader::getEvent( int entry ) { - //std::cout << "NTReader::getEvent " << " first clean previous event" << std::endl; clearEvent(); if(!fChain->GetEntry( entry )) { @@ -74,10 +71,6 @@ namespace MuonCalib{ if(m_storeTruth) { MuonCalibTruthCollection *truth = buildTruthColl(); m_event->setMuonCalibTruthCollection(truth); - // std::cout << truth->size() << std::endl; - - // int distance = std::distance(truth->mdtTruthCollectionBegin(), truth->mdtTruthCollectionEnd()); - //std::cout << distance << std::endl; } m_event->setMuonCalibEventInfo(info); @@ -109,7 +102,6 @@ namespace MuonCalib{ for( Int_t i_mdt_truth = 0; i_mdt_truth < mdtTruth_nMdtTruthHit; ++i_mdt_truth){ truth->addTruth( getMdtTruth(i_mdt_truth) ); -// std::cout << "mdt truth added" << std::endl; } for( Int_t i_rpc_truth = 0; i_rpc_truth < rpcTruth_nRpcTruthHit; ++i_rpc_truth){ truth->addTruth( getRpcTruth(i_rpc_truth) ); @@ -172,7 +164,6 @@ namespace MuonCalib{ dummy_pattern=true; patternVec.push_back(new MuonCalibPattern()); } - // std::cout << " reading segments " << std::endl; m_ordered_segments.resize(seg_nSegments); for( Int_t i_segment = 0; i_segment < seg_nSegments; ++ i_segment ){ MuonCalibSegment *segment = getSegment( i_segment ); @@ -194,8 +185,6 @@ namespace MuonCalib{ fChain->GetEntry( entry ); MuonCalibEvent::MCPVec patternVec = buildPatternVec(); - - // std::cout << " reading event data " << std::endl; m_event = new MuonCalibEvent( patternVec); const MuonCalibEventInfo info = buildEventInfo(); @@ -479,12 +468,7 @@ namespace MuonCalib{ Amg::Transform3D loc2Glob; -// loc2Glob = rotation; -// loc2Glob*=Amg::Translation3D(translation); loc2Glob = translation * rotation; - -// Amg::Transform3D glob2Loc = loc2Glob.inverse(); - Double_t seg_chisq = seg_chi2[i_segment]; MuonCalibSegment* MCS = new MuonCalibSegment(seg_chisq, seg_localPos, seg_localDir, loc2Glob, seg_quality[i_segment]); @@ -496,17 +480,14 @@ namespace MuonCalib{ } for( Int_t i_hit = 0; i_hit < mdt_nMdt; ++i_hit){ -// if( mdt_segIndex[i_hit] == i_segment) MCS->addHitOnTrack( getMdtHit(i_hit) ); if( mdt_segIndex[i_hit] == i_segment) { MCS->addHitOnTrack( getMdtHit(i_hit) ); } - // std::cout << " segment MDT hits " << MCS->mdtHitsOnTrack() << std::endl; } for( Int_t i_hit = 0; i_hit < csc_nCsc; ++i_hit){ if( csc_segIndex[i_hit] == i_segment) { MCS->addHitOnTrack( getCscHit(i_hit) ); } - // std::cout << " segment Csc hits " << MCS->cscHitsOnTrack() << std::endl; } if(rpcOs_nRpcHits > 0){ @@ -537,7 +518,6 @@ namespace MuonCalib{ hit->setDriftTime( mdt_t[i_hit] ); hit->setDriftRadius( mdt_r[i_hit], mdt_dr[i_hit] ); hit->setDistanceToTrack( mdt_rTrk[i_hit], mdt_drTrk[i_hit] ); - // hit->setTimeFromTrackDistance( float t, float sigmaT ); //no entry in ntuple hit->setSlewingTime( mdt_slewTime[i_hit] ); hit->setBFieldTime( mdt_lorTime[i_hit] ); hit->setPropagationTime( mdt_propTime[i_hit] ); @@ -551,11 +531,6 @@ namespace MuonCalib{ hit->setTubeAdcCal( mdt_tube_adccal[i_hit] ); hit->setLocXtwin( mdt_xtwin[i_hit] ); hit->setSegmentT0Applied( mdt_segmentT0Applied[i_hit] ); - - // hit->setWiresagTime( float wsag ); //no entry in ntuple - // hit->setTemperatureTime( float temp ); //no entry in ntuple - // hit->setBackgroundTime( float bkgr ); //no entry in ntuple - return hit; } //end NTReader::getMdtHit diff --git a/MuonSpectrometer/MuonCalib/MuonCalibStandAlone/CalibNtupleUtils/CalibNtupleUtils/SegmentInfo.h b/MuonSpectrometer/MuonCalib/MuonCalibStandAlone/CalibNtupleUtils/CalibNtupleUtils/SegmentInfo.h index a543f981d0522bec5ceede20ad33fba79dfbbb08..360d2d4ecf83c23753daf808a21af3bc5448ada3 100644 --- a/MuonSpectrometer/MuonCalib/MuonCalibStandAlone/CalibNtupleUtils/CalibNtupleUtils/SegmentInfo.h +++ b/MuonSpectrometer/MuonCalib/MuonCalibStandAlone/CalibNtupleUtils/CalibNtupleUtils/SegmentInfo.h @@ -1,10 +1,12 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ #ifndef SEGMENTINFO_H #define SEGMENTINFO_H +#include "GaudiKernel/MsgStream.h" +#include "AthenaKernel/getMessageSvc.h" #include <iostream> #include <map> @@ -93,7 +95,10 @@ namespace MuonCalib{ } } - if (barcodeMap.size()>1) { std::cout << " More than one barcode in segment " << barcodeMap.size() << std::endl;} + if (barcodeMap.size()>1) { + MsgStream log(Athena::getMessageSvc(),"TimedSegment"); + log<<MSG::WARNING<<"More than one barcode in segment " << barcodeMap.size()<<endmsg; + } return bc; } diff --git a/MuonSpectrometer/MuonCalib/MuonCalibStandAlone/CalibNtupleUtils/CalibNtupleUtils/TimedSegment.h b/MuonSpectrometer/MuonCalib/MuonCalibStandAlone/CalibNtupleUtils/CalibNtupleUtils/TimedSegment.h index c68ebbd7b34587b8050d47873cf0c397fde7b383..7ebff003edf43ffded3b4e07a64367766a5db1bb 100644 --- a/MuonSpectrometer/MuonCalib/MuonCalibStandAlone/CalibNtupleUtils/CalibNtupleUtils/TimedSegment.h +++ b/MuonSpectrometer/MuonCalib/MuonCalibStandAlone/CalibNtupleUtils/CalibNtupleUtils/TimedSegment.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ //*********************************************************// @@ -14,6 +14,8 @@ #include <iostream> #include <vector> #include "MuonCalibEventBase/MuonCalibSegment.h" +#include "GaudiKernel/MsgStream.h" +#include "AthenaKernel/getMessageSvc.h" namespace MuonCalib{ class TimedMdtCalibHit; @@ -94,47 +96,47 @@ namespace MuonCalib{ inline double TimedSegment::radiusHit(unsigned int i) const{ if(i>m_radiiHit.size() ) return 0.; else { - std::cout << "radiusHit(" << i << ") = " << m_radiiHit[i] << std::endl; + MsgStream log(Athena::getMessageSvc(),"TimedSegment"); + log<<MSG::INFO<<"radiusHit(" << i << ") = " << m_radiiHit[i]<<endmsg; return m_radiiHit.at(i); } } inline double TimedSegment::timeHit(unsigned int i) const{ if(i>m_timesHit.size() ) return 0.; else { - // std::cout << " timeHit(" << i << ") = " << m_timesHit.at(i) << std::endl; return m_timesHit.at(i); } } inline double TimedSegment::sigmaTimeHit(unsigned int i) const{ if(i>m_sigmaTimesHit.size() ) return 0.; else { - // std::cout << "s_timeHit(" << i << ") = " << m_sigmaTimesHit.at(i) << std::endl; return m_sigmaTimesHit.at(i); } } - inline void TimedSegment::setRadiusHit(unsigned int i, double dr ){ + inline void TimedSegment::setRadiusHit(unsigned int i, double dr ){ + MsgStream log(Athena::getMessageSvc(),"TimedSegment"); if(i>m_radiiHit.size()){ - std::cout << "m_radiiHit has a too small size" << std::endl; - m_radiiHit.insert(m_radiiHit.begin()+i, dr); + log<<MSG::WARNING<<"m_radiiHit has a too small size"<<endmsg; + m_radiiHit.insert(m_radiiHit.begin()+i, dr); } else m_radiiHit.at(i) = dr; - std::cout << i << " set " << dr << " in the dr_vector, " << m_radiiHit.at(i) << std::endl; + log<<MSG::INFO<<i<<" set " << dr << " in the dr_vector, " << m_radiiHit.at(i)<<endmsg; } inline void TimedSegment::setTimeHit(unsigned int i, double time ){ if(i>m_timesHit.size()){ - std::cout << "m_timesHit has a too small size" << std::endl; + MsgStream log(Athena::getMessageSvc(),"TimedSegment"); + log<<MSG::WARNING<<"m_timesHit has a too small size"<<endmsg; m_timesHit.insert(m_timesHit.begin()+i, time); } else m_timesHit.at(i) = time; - // std::cout << i << " set " << time << " in the dt_vector, " << m_timesHit.at(i) << std::endl; } inline void TimedSegment::setSigmaTimeHit(unsigned int i, double sigmaTime ){ if(i>m_sigmaTimesHit.size()){ - std::cout << "m_sTimesHit has a too small size" << std::endl; + MsgStream log(Athena::getMessageSvc(),"TimedSegment"); + log<<MSG::WARNING<<"m_sTimesHit has a too small size"<<endmsg; m_sigmaTimesHit.insert(m_timesHit.begin()+i, sigmaTime); } else m_sigmaTimesHit.at(i) = sigmaTime; - // std::cout << i << " set " << sigmaTime << " in the sdt_vector, " << m_sigmaTimesHit.at(i) << std::endl; } }//MuonCalib diff --git a/MuonSpectrometer/MuonCalib/MuonCalibStandAlone/CalibNtupleUtils/src/HistHandler.cxx b/MuonSpectrometer/MuonCalib/MuonCalibStandAlone/CalibNtupleUtils/src/HistHandler.cxx index 97fd773351a7d78fdcb0742a11571f48d81f5099..ca32fb742a9564ff87093fef39fa76175eeb5cf2 100644 --- a/MuonSpectrometer/MuonCalib/MuonCalibStandAlone/CalibNtupleUtils/src/HistHandler.cxx +++ b/MuonSpectrometer/MuonCalib/MuonCalibStandAlone/CalibNtupleUtils/src/HistHandler.cxx @@ -5,6 +5,8 @@ #include "CalibNtupleUtils/HistHandler.h" #include "CalibNtupleUtils/HistSetting.h" #include "MuonCalibIdentifier/MuonFixedId.h" +#include "GaudiKernel/MsgStream.h" +#include "AthenaKernel/getMessageSvc.h" #include <algorithm> #include <sstream> #include "TString.h" @@ -68,7 +70,8 @@ void HistHandler::write(){ for( std::map<std::string, TH1F*>::const_iterator CI = m_myMap.begin(); CI != m_myMap.end(); ++ CI ){ TString name( CI->first ) ; (CI->second)->Write(name); - std::cout << " writing " <<name << std::endl; + MsgStream log(Athena::getMessageSvc(),"HistHandler"); + log<<MSG::INFO<<" writing "<<name<<endmsg; } } @@ -86,7 +89,10 @@ TH1F* HistHandler::Hist( const MuonCalib::MuonFixedId& Id ) const { std::map< std::string, TH1F*>::const_iterator position = m_myMap.find(histName); if( position != m_myMap.end() ) { return position->second; - } else std::cout << " This ID (" << histName << ") has no TH1F* assigned in the map" << std::endl; + } else { + MsgStream log(Athena::getMessageSvc(),"HistHandler"); + log<<MSG::INFO<<" This ID (" << histName << ") has no TH1F* assigned in the map"<<endmsg; + } return 0; } @@ -98,9 +104,11 @@ TH1F* HistHandler::Hist( const std::string tag ) const { std::map< std::string, TH1F*>::const_iterator position = m_myMap.find( histName ); if( position != m_myMap.end() ) { return position->second; - } else std::cout << " This ID (" << histName << ") has no TH1F* assigned in the map" << std::endl; + } else { + MsgStream log(Athena::getMessageSvc(),"HistHandler"); + log<<MSG::INFO<<" This ID (" << histName << ") has no TH1F* assigned in the map"<<endmsg; + } return 0; - } TH2F* HistHandler::Hist2( const MuonCalib::MuonFixedId& Id ) const { @@ -118,8 +126,10 @@ TH2F* HistHandler::Hist2( const MuonCalib::MuonFixedId& Id ) const { std::map< std::string, TH2F*>::const_iterator position2 = m_my2Map.find(histName); if( position2 != m_my2Map.end() ){ return position2->second; - } else std::cout << " This ID (" << histName << ") has no TH2F* assigned in the map" << std::endl; - + } else { + MsgStream log(Athena::getMessageSvc(),"HistHandler"); + log<<MSG::INFO<<" This ID (" << histName << ") has no TH2F* assigned in the map"<<endmsg; + } return NULL; } @@ -130,9 +140,11 @@ TH2F* HistHandler::Hist2( const std::string tag ) const { std::map< std::string, TH2F*>::const_iterator position = m_my2Map.find( histName ); if( position != m_my2Map.end() ) { return position->second; - } else std::cout << " This ID (" << histName << ") has no TH2F* assigned in the map" << std::endl; + } else { + MsgStream log(Athena::getMessageSvc(),"HistHandler"); + log<<MSG::INFO<<" This ID (" << histName << ") has no TH2F* assigned in the map"<<endmsg; + } return 0; - } void HistHandler::fill(std::string tag , Float_t entry ) { std::ostringstream histStream(""); diff --git a/MuonSpectrometer/MuonCalib/MuonCalibStandAlone/CalibNtupleUtils/src/RootDisplay.cxx b/MuonSpectrometer/MuonCalib/MuonCalibStandAlone/CalibNtupleUtils/src/RootDisplay.cxx index ea0ea5bb94efaf0c8a56ebcc52bb57682fe56a5c..b00418c536f717bb8296e8b4e07fe8b2ac2d167b 100644 --- a/MuonSpectrometer/MuonCalib/MuonCalibStandAlone/CalibNtupleUtils/src/RootDisplay.cxx +++ b/MuonSpectrometer/MuonCalib/MuonCalibStandAlone/CalibNtupleUtils/src/RootDisplay.cxx @@ -15,6 +15,7 @@ #include <iostream> #include <math.h> +#include <TString.h> // for Form Display::Display(const char* name, double xll,double yll, @@ -90,8 +91,6 @@ void Display::calculateCanvasSize(int &width, int& height) void Display::setTextBox(std::string /*text*/) { m_textBox->Clear(); - // TText *t0= m_textBox->AddText( "evt/pat/seg" ); - // TText *t1= m_textBox->AddText( text.c_str() ); } void Display::calculateRange() @@ -123,7 +122,6 @@ void Display::calculateRange() m_yll = yll - offset; m_xrh = xrh + offset; m_yrh = yrh + offset; - std::cout << " new range (" << m_xll << "," << m_yll << ") (" << m_xrh << "," << m_yrh << ") " << std::endl; } @@ -177,8 +175,7 @@ void ShapeCreator::applyProjection(const TVector3& pos, double& x1, double& x2){ void ShapeCreator::setProjection(int p) { - if(p != 0 && p != 1 && p != 2 && p != 3 && p != 4) - std::cout << "ERROR Wrong projection " << std::endl; + if(p != 0 && p != 1 && p != 2 && p != 3 && p != 4) throw std::runtime_error(Form("File: %s, Line: %d\nShapeCreator::setProjection() - ERROR Wrong projection", __FILE__, __LINE__)); m_projection = p; } diff --git a/MuonSpectrometer/MuonCalib/MuonCalibStandAlone/CalibNtupleUtils/src/TimedSegment.cxx b/MuonSpectrometer/MuonCalib/MuonCalibStandAlone/CalibNtupleUtils/src/TimedSegment.cxx index 40b97a7c73f952ef4697c1f1f4eaf5075421224f..257466074393e8f4a5ccd8e1b7677d8594c419a9 100644 --- a/MuonSpectrometer/MuonCalib/MuonCalibStandAlone/CalibNtupleUtils/src/TimedSegment.cxx +++ b/MuonSpectrometer/MuonCalib/MuonCalibStandAlone/CalibNtupleUtils/src/TimedSegment.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ #include "CalibNtupleUtils/TimedSegment.h" @@ -27,9 +27,7 @@ namespace MuonCalib { MuonCalibSegment::MdtHitCit mdt_it = segment->mdtCloseHitsBegin(); MuonCalibSegment::MdtHitCit mdt_it_end = segment->mdtCloseHitsEnd(); for( ; mdt_it!=mdt_it_end;++mdt_it){ - std::cout << "copy pntr to CalibHitBase " << *mdt_it << std::endl; m_tHitVec.push_back( new TimedMdtCalibHit(**mdt_it) ); - std::cout << "new hit has adress " << m_tHitVec.back(); } } @@ -49,7 +47,6 @@ namespace MuonCalib { : m_segment(0) , m_segment_original(0) , m_time(tseg.time()) , m_sigma_time(tseg.sigmaTime()){ - std::cout << "calling cpy-constr timedsegment "<< std::endl ; m_segment = new MuonCalibSegment( *tseg.segment() ); m_segment_original = new MuonCalibSegment( *tseg.originalSegment() ); @@ -62,7 +59,6 @@ namespace MuonCalib { setSigmaTimeHit(i, tseg.sigmaTimeHit(i) ); ++i; } - std::cout << "done" <<std::endl; } TimedSegment& TimedSegment::operator=( const TimedSegment& rhs ){ diff --git a/MuonSpectrometer/MuonCalib/MuonCalibStandAlone/MdtCalibIOSvc/src/MdtCalibOutputDbSvc.cxx b/MuonSpectrometer/MuonCalib/MuonCalibStandAlone/MdtCalibIOSvc/src/MdtCalibOutputDbSvc.cxx index a3bca1d43ee00fc37aaf52abf7c5ec88a2bae38b..b8207f797b20f1c1c4604dd4335715ac757a2c8c 100644 --- a/MuonSpectrometer/MuonCalib/MuonCalibStandAlone/MdtCalibIOSvc/src/MdtCalibOutputDbSvc.cxx +++ b/MuonSpectrometer/MuonCalib/MuonCalibStandAlone/MdtCalibIOSvc/src/MdtCalibOutputDbSvc.cxx @@ -219,7 +219,6 @@ StatusCode MdtCalibOutputDbSvc::saveCalibrationResults(void) { } if(!new_t0s) continue; if(m_postprocess_calibration) new_t0s = postprocess_t0s(new_t0s, the_id); - // if(new_t0s == NULL) cerr<<"new_t0s == NULL"<<endl; sc=m_calib_output_tool->WriteT0(new_t0s, the_id, m_iov_start, m_iov_end); if(sc.isFailure()) return sc; diff --git a/MuonSpectrometer/MuonCalib/MuonCalibStandAlone/MuonCalibStandAloneBase/MuonCalibStandAloneBase/RegionSelectorBase.h b/MuonSpectrometer/MuonCalib/MuonCalibStandAlone/MuonCalibStandAloneBase/MuonCalibStandAloneBase/RegionSelectorBase.h index c083519099f13c5fa52ae8c6030100782930d44f..0b7d2fe05d39be8f5b8d08c40075c9e31bc1391a 100644 --- a/MuonSpectrometer/MuonCalib/MuonCalibStandAlone/MuonCalibStandAloneBase/MuonCalibStandAloneBase/RegionSelectorBase.h +++ b/MuonSpectrometer/MuonCalib/MuonCalibStandAlone/MuonCalibStandAloneBase/MuonCalibStandAloneBase/RegionSelectorBase.h @@ -1,10 +1,11 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ #ifndef RegionSelectorBase_H #define RegionSelectorBase_H +#include "GaudiKernel/MsgStream.h" #include "iostream" #include "string" @@ -26,8 +27,8 @@ class RegionSelectorBase /** create a region from a string*/ static RegionSelectorBase * GetRegion(const std::string & input); private: - static RegionSelectorBase * process_region(const std::string & input, unsigned int & i, bool is_in_braces); - static void print_position(const std::string & input, const unsigned int & position); + static RegionSelectorBase * process_region(const std::string& input, unsigned int& i, bool is_in_braces); + static void print_position(const std::string& input, const unsigned int& position, MsgStream *msgStr); }; } diff --git a/MuonSpectrometer/MuonCalib/MuonCalibStandAlone/MuonCalibStandAloneBase/src/NtupleStationId.cxx b/MuonSpectrometer/MuonCalib/MuonCalibStandAlone/MuonCalibStandAloneBase/src/NtupleStationId.cxx index e8b909733975fa98b03cad8e0371c3af83edfe1d..d1c65e9c62cc097d898cc44c3655f128b24e2d90 100644 --- a/MuonSpectrometer/MuonCalib/MuonCalibStandAlone/MuonCalibStandAloneBase/src/NtupleStationId.cxx +++ b/MuonSpectrometer/MuonCalib/MuonCalibStandAlone/MuonCalibStandAloneBase/src/NtupleStationId.cxx @@ -1,22 +1,19 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ #include "MuonCalibStandAloneBase/NtupleStationId.h" #include "MuonCalibIdentifier/MdtRegion.h" #include "Identifier/IdContext.h" - -//geo model #include "MuonIdHelpers/MdtIdHelper.h" - -// MuonReadoutGeometry // #include "MuonReadoutGeometry/MuonDetectorManager.h" #include "MuonReadoutGeometry/MdtReadoutElement.h" - +#include "GaudiKernel/MsgStream.h" +#include "AthenaKernel/getMessageSvc.h" namespace MuonCalib { -bool NtupleStationId :: Initialize(const std::string & station, const int & eta, const int & phi, const int & ml, const int & author) +bool NtupleStationId::Initialize(const std::string & station, const int & eta, const int & phi, const int & ml, const int & author) { MuonFixedId id; if(station=="ANY") @@ -37,7 +34,7 @@ bool NtupleStationId :: Initialize(const std::string & station, const int & eta, return true; } -void NtupleStationId :: SetStation(const std::string & station) +void NtupleStationId::SetStation(const std::string & station) { MuonFixedId id; m_station=id.stationStringToFixedStationNumber(station); @@ -45,29 +42,25 @@ void NtupleStationId :: SetStation(const std::string & station) } -bool NtupleStationId :: InitializeGeometry(const MdtIdHelper& mdtIdHelper, const MuonGM::MuonDetectorManager* detMgr) +bool NtupleStationId::InitializeGeometry(const MdtIdHelper& mdtIdHelper, const MuonGM::MuonDetectorManager* detMgr) { MuonFixedId fid; - if(m_station == -1 || m_phi < 0 || m_eta == -99) - { - std::cerr<<" NtupleStationId :: InitializeGeometry: Cannot initialize geometry for multi station id"<<std::endl; + MsgStream log(Athena::getMessageSvc(),"NtupleStationId"); + if(m_station == -1 || m_phi < 0 || m_eta == -99) { + log<<MSG::WARNING<<"NtupleStationId::InitializeGeometry: Cannot initialize geometry for multi station id"<<endmsg; m_geom_ok=false; return false; } -// std::cout<<m_phi<<" "<<m_eta<<std::endl; Identifier id(mdtIdHelper.elementID(fid.stationNumberToFixedStationString(m_station), m_eta, m_phi)); -// std::cout<<"Station id is: "<<mdtIdHelper.print_to_string(id)<<std::endl; m_n_ml = mdtIdHelper.numberOfMultilayers(id); -// const MuonGM::MdtReadoutElement* detEl = detMgr->getMdtReadoutElement(mdtIdHelper.channelID(id,1,1,1)); -// m_n_ml=detEl->getMultilayer(); //loop on multilayers for(int i=0; i<m_n_ml; i++) { const MuonGM::MdtReadoutElement* detEl_ml = detMgr->getMdtReadoutElement(mdtIdHelper.channelID(id,1+i ,1,1)); m_layer_min[i]=1; - if (detEl_ml==NULL) + if (!detEl_ml) { - std::cout<<regionId()<<" ml "<<i<< "does not exist in current geometry"<<std::endl; + log<<MSG::WARNING<<regionId()<<" ml "<<i<< "does not exist in current geometry"<<endmsg; return false; } m_layer_max[i]=detEl_ml->getNLayers(); @@ -85,7 +78,7 @@ bool NtupleStationId :: InitializeGeometry(const MdtIdHelper& mdtIdHelper, const } -void NtupleStationId :: createRegionId() const +void NtupleStationId::createRegionId() const { MuonFixedId id; std::ostringstream id_stream; @@ -124,7 +117,7 @@ void NtupleStationId :: createRegionId() const } -int NtupleStationId :: FixedId() const +int NtupleStationId::FixedId() const { if(m_station<0 || m_eta==-99 || m_phi<0) return -1; MuonFixedId id; @@ -132,9 +125,6 @@ int NtupleStationId :: FixedId() const if(!id.setStationName(m_station)) return -1; if(!id.setStationEta(m_eta)) return -1; if(!id.setStationPhi(m_phi)) return -1; -/* id.setMdtTubeIndex(0); - id.setMdtTubeLayerIndex(0); - id.setMdtMultilayerIndex(0);*/ return id.mdtChamberId().getIdInt(); } diff --git a/MuonSpectrometer/MuonCalib/MuonCalibStandAlone/MuonCalibStandAloneBase/src/RegionSelectorBase.cxx b/MuonSpectrometer/MuonCalib/MuonCalibStandAlone/MuonCalibStandAloneBase/src/RegionSelectorBase.cxx index 58fc598393f21a2e637d96b24b344eb71ee532e6..88a78e765bdcfddb6311dd20254b9850c6fc74c1 100644 --- a/MuonSpectrometer/MuonCalib/MuonCalibStandAlone/MuonCalibStandAloneBase/src/RegionSelectorBase.cxx +++ b/MuonSpectrometer/MuonCalib/MuonCalibStandAlone/MuonCalibStandAloneBase/src/RegionSelectorBase.cxx @@ -1,19 +1,17 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ #include "MuonCalibStandAloneBase/RegionSelectorBase.h" #include "MuonCalibStandAloneBase/RegionLogicalOperation.h" #include "MuonCalibStandAloneBase/RegionElement.h" - - +#include "AthenaKernel/getMessageSvc.h" namespace MuonCalib { RegionSelectorBase * RegionSelectorBase::GetRegion(const std::string & input) { unsigned int i(0); - std::cout<<input<<std::endl; return process_region(input, i, false); } @@ -23,6 +21,7 @@ RegionSelectorBase * RegionSelectorBase::process_region(const std::string & inpu //create master region as logical operation RegionLogicalOperation *new_region = new RegionLogicalOperation(); bool currect_inverse(false); + MsgStream log(Athena::getMessageSvc(),"RegionSelectorBase"); //loop over characters for(; i<input.size(); i++) { @@ -41,28 +40,27 @@ RegionSelectorBase * RegionSelectorBase::process_region(const std::string & inpu } if(i==input.size()) { - std::cerr<<"Missing ']' at end of input!"<<std::endl; - std::cerr<<"Started here:"<<std::endl; - print_position(input, start_element); + log<<MSG::WARNING<<"Missing ']' at end of input! Started here:"<<endmsg; + print_position(input, start_element, &log); delete new_region; - return NULL; + return nullptr; } RegionElement *reg_el=new RegionElement(); //syntax error in region if(!reg_el->Initialize(element)) { - print_position(input, start_element); + print_position(input, start_element, &log); delete reg_el; delete new_region; - return NULL; + return nullptr; } //add region to operation if(!new_region->AddRegion(reg_el, currect_inverse)) { - std::cerr<<"Missing operator!"<<std::endl; - print_position(input, start_element); + log<<MSG::WARNING<<"Missing operator!"<<endmsg; + print_position(input, start_element, &log); delete new_region; - return NULL; + return nullptr; } currect_inverse=false; break; @@ -73,23 +71,23 @@ RegionSelectorBase * RegionSelectorBase::process_region(const std::string & inpu i++; if(i>=input.size()) { - std::cerr<<"'(' at end of input!"<<std::endl; - print_position(input, start_element); + log<<MSG::WARNING<<"'(' at end of input!"<<endmsg; + print_position(input, start_element, &log); delete new_region; - return NULL; + return nullptr; } RegionSelectorBase *second_region(process_region(input, i, true)); - if(second_region == NULL) + if(!second_region) { delete new_region; - return NULL; + return nullptr; } if(!new_region->AddRegion(second_region, currect_inverse)) { - std::cerr<<"Missing operator!"<<std::endl; - print_position(input, start_element); + log<<MSG::WARNING<<"Missing operator!"<<endmsg; + print_position(input, start_element, &log); delete new_region; - return NULL; + return nullptr; } currect_inverse=false; break; @@ -99,10 +97,10 @@ RegionSelectorBase * RegionSelectorBase::process_region(const std::string & inpu { if(currect_inverse) { - std::cerr<<"Surplus '!'"<<std::endl; - print_position(input, start_element); + log<<MSG::WARNING<<"Surplus '!'"<<endmsg; + print_position(input, start_element, &log); delete new_region; - return NULL; + return nullptr; } currect_inverse = true; break; @@ -114,10 +112,10 @@ RegionSelectorBase * RegionSelectorBase::process_region(const std::string & inpu bool next_op(input[i]=='|'); if(!new_region->AddOperator(next_op)) { - std::cerr<<"Unexpected operator!"<<std::endl; - print_position(input, start_element); + log<<MSG::WARNING<<"Unexpected operator!"<<endmsg; + print_position(input, start_element, &log); delete new_region; - return NULL; + return nullptr; } break; } @@ -126,19 +124,19 @@ RegionSelectorBase * RegionSelectorBase::process_region(const std::string & inpu { if(new_region->SurplusOperator()) { - std::cerr<<"Surplus operator"<<std::endl; - print_position(input, start_element); + log<<MSG::WARNING<<"Surplus operator"<<endmsg; + print_position(input, start_element, &log); delete new_region; - return NULL; + return nullptr; } if(is_in_braces) { return new_region; } - std::cerr<<"Unexpected ')'"<<std::endl; - print_position(input, start_element); + log<<MSG::WARNING<<"Unexpected ')'"<<endmsg; + print_position(input, start_element, &log); delete new_region; - return NULL; + return nullptr; break; } //ignore whitespaces @@ -148,32 +146,32 @@ RegionSelectorBase * RegionSelectorBase::process_region(const std::string & inpu break; //any other characters are junk at this point default: - std::cerr<<"Syntax Error"<<std::endl; - print_position(input, start_element); + log<<MSG::WARNING<<"Syntax Error"<<endmsg; + print_position(input, start_element, &log); delete new_region; - return NULL; + return nullptr; } } //if we ar ein a subregion and reached the end of input there is an error if(is_in_braces) { - std::cerr<<"Missing ')'"<<std::endl; - print_position(input, start_sub); + log<<MSG::WARNING<<"Missing ')'"<<endmsg; + print_position(input, start_sub, &log); delete new_region; - return NULL; + return nullptr; } if(new_region->SurplusOperator()) { - std::cerr<<"Surplus operator"<<std::endl; - print_position(input, i); + log<<MSG::WARNING<<"Surplus operator"<<endmsg; + print_position(input, i, &log); delete new_region; - return NULL; + return nullptr; } return new_region; } -void RegionSelectorBase:: print_position(const std::string & input, const unsigned int &position) +void RegionSelectorBase::print_position(const std::string & input, const unsigned int &position, MsgStream *msgStr) { unsigned int i(0); std::string st1, st2; @@ -185,10 +183,7 @@ void RegionSelectorBase:: print_position(const std::string & input, const unsig { st2+=input[i]; } - std::cerr<<st1<<"*"<<st2<<std::endl; + *msgStr<<MSG::WARNING<<st1<<"*"<<st2<<endmsg; } - - - }//namespace MuonCalib diff --git a/MuonSpectrometer/MuonCalib/MuonCalibStandAlone/MuonCalibStandAloneBase/src/T0Refinement.cxx b/MuonSpectrometer/MuonCalib/MuonCalibStandAlone/MuonCalibStandAloneBase/src/T0Refinement.cxx index a8992c91bb986a74e49e82f801a08534e53cd146..6297c3c0946a8b13825d4572174b4b2d49b71cd5 100644 --- a/MuonSpectrometer/MuonCalib/MuonCalibStandAlone/MuonCalibStandAloneBase/src/T0Refinement.cxx +++ b/MuonSpectrometer/MuonCalib/MuonCalibStandAlone/MuonCalibStandAloneBase/src/T0Refinement.cxx @@ -262,11 +262,6 @@ my_points[2].set_x1(-2.0*m_delta_t0); return 0.0; } -// std::cout<<"XXxxXX"; - - - - double direction=-0.5; double min_chi2=9e9; double best_t0=delta_t0_opt; @@ -310,51 +305,11 @@ my_points[2].set_x1(-2.0*m_delta_t0); mchi2.push_back(min_chi2); if (t0s.size()>100) { -// std::cout<<"Endless scan: "<<delta_t0_opt; -// for(unsigned int i=0; i<t0s.size(); i++) -// { -// std::cout<<" "<<t0s[i]<<","<<chi2[i]<<","<<mchi2[i]; -// } -// std::cout<<std::endl; failed=true; return 0.0; } } - -/* - double min_chi2=9e9; - double best_t0=delta_t0_opt; - - for(int i=-10; i<=10; i++) - { - double test_t0=delta_t0_opt + 0.5 * static_cast<double>(i); - - for (unsigned int k=0; k<seg.mdtHitsOnTrack(); k++) { - time = (seg.mdtHOT())[k]->driftTime() + test_t0; - sigma = (seg.mdtHOT())[k]->sigmaDriftRadius(); - (seg.mdtHOT())[k]->setDriftRadius(rt->radius(time), - sigma); - } - if (!segment_fitter->fit(seg, r_selection)) { - - continue; - } - double chisq(0.0); - if (curved) { - chisq = m_cfitter->chi2(); - } else { - chisq = m_qfitter->chi2PerDegreesOfFreedom(); - } - - if (chisq<min_chi2) - { - min_chi2=chisq; - best_t0 = test_t0; - } - -// std::cout<<" "<<test_t0<<","<<chisq; - } -// std::cout<<std::endl;*/ + ///////////////////////////////////////// // OVERWRITE THE SEGMENT, IF REQUESTED // ///////////////////////////////////////// diff --git a/MuonSpectrometer/MuonCalib/MuonCalibStandAlone/MuonCalibStandAloneExtraTools/MuonCalibStandAloneExtraTools/MDTDeadElementsAnalysis.h b/MuonSpectrometer/MuonCalib/MuonCalibStandAlone/MuonCalibStandAloneExtraTools/MuonCalibStandAloneExtraTools/MDTDeadElementsAnalysis.h index 57dd9c60ef5441bfc1724173e4252dcfc110c566..a6e2fe68f315fc441d9ab9c0a2ed2483908bc157 100644 --- a/MuonSpectrometer/MuonCalib/MuonCalibStandAlone/MuonCalibStandAloneExtraTools/MuonCalibStandAloneExtraTools/MDTDeadElementsAnalysis.h +++ b/MuonSpectrometer/MuonCalib/MuonCalibStandAlone/MuonCalibStandAloneExtraTools/MuonCalibStandAloneExtraTools/MDTDeadElementsAnalysis.h @@ -2,15 +2,20 @@ Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ -/* **************************************************** * - * Authors: Toni Baroncelli * - * **************************************************** */ - #ifndef SRC_MDTTUBEANA_H #define SRC_MDTTUBEANA_H #include <string> #include <stdio.h> +#include <vector> +#include "RtypesCore.h" // for Double_t etc. + +class TH1; +class TH1I; +class TH1F; +class TF1; +class TFile; +class TString; static const int nmmax=100; static const int ntmax=600; @@ -19,7 +24,7 @@ double completefunc(double *x, double *parf); class MDTDeadElementsAnalysis { public: MDTDeadElementsAnalysis(); - ~MDTDeadElementsAnalysis(); + ~MDTDeadElementsAnalysis()=default; TF1 *polfunc ; std::string chamberName; diff --git a/MuonSpectrometer/MuonCalib/MuonCalibStandAlone/MuonCalibStandAloneExtraTools/MuonCalibStandAloneExtraTools/PhiEtaUtils.h b/MuonSpectrometer/MuonCalib/MuonCalibStandAlone/MuonCalibStandAloneExtraTools/MuonCalibStandAloneExtraTools/PhiEtaUtils.h index 6ab8df5d842f1db6570ddbc6b78c3d31656d7e6b..42f6754ccca5c219f67f73df4c2c1bea9bb6c823 100644 --- a/MuonSpectrometer/MuonCalib/MuonCalibStandAlone/MuonCalibStandAloneExtraTools/MuonCalibStandAloneExtraTools/PhiEtaUtils.h +++ b/MuonSpectrometer/MuonCalib/MuonCalibStandAlone/MuonCalibStandAloneExtraTools/MuonCalibStandAloneExtraTools/PhiEtaUtils.h @@ -107,7 +107,6 @@ class PhiEtaNameConverter { inline int eta_atlas2loc(int eta){ int eta2= eta+7; if(eta<0) eta2=eta+8; - //cout<<" atlas2loc "<<eta<<" "<<eta2<<endl; return eta2; } @@ -115,7 +114,6 @@ inline int eta_loc2atlas(int eta){ int eta2; if(eta<=7) eta2=eta-8; if(eta>=8) eta2=eta-7; - //cout<<" loc2atlas "<<eta<<" "<<eta2<<endl; return eta2; } diff --git a/MuonSpectrometer/MuonCalib/MuonCalibStandAlone/MuonCalibStandAloneExtraTools/src/MDTDeadElementsAnalysis.cxx b/MuonSpectrometer/MuonCalib/MuonCalibStandAlone/MuonCalibStandAloneExtraTools/src/MDTDeadElementsAnalysis.cxx index f89e58a5b8fcb2287ffc7f0e2bfb8caa14e04466..91e7313c5f4717f4495d7f3913d685fb1440d1e6 100644 --- a/MuonSpectrometer/MuonCalib/MuonCalibStandAlone/MuonCalibStandAloneExtraTools/src/MDTDeadElementsAnalysis.cxx +++ b/MuonSpectrometer/MuonCalib/MuonCalibStandAlone/MuonCalibStandAloneExtraTools/src/MDTDeadElementsAnalysis.cxx @@ -2,6 +2,10 @@ Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ +#include "MuonCalibStandAloneExtraTools/MDTDeadElementsAnalysis.h" +#include "GaudiKernel/MsgStream.h" +#include "AthenaKernel/getMessageSvc.h" + #include <cmath> #include <fstream> #include <sstream> @@ -13,7 +17,6 @@ #include <TKey.h> #include <TCanvas.h> #include <TStyle.h> -#include "MuonCalibStandAloneExtraTools/MDTDeadElementsAnalysis.h" class ToString { public: @@ -35,8 +38,6 @@ MDTDeadElementsAnalysis::MDTDeadElementsAnalysis() : writeResultsToAsciFile=false; } -MDTDeadElementsAnalysis::~MDTDeadElementsAnalysis() { } - // ============================================================================== // // MDTDeadElementsAnalysis::histogramScanCalibCenters @@ -1218,6 +1219,7 @@ void MDTDeadElementsAnalysis::getHolesInInterval_strategy5(TH1F* idh1, int first float cont = idh1->GetBinContent(ib); distr_of_entries->Fill(cont); } + MsgStream log(Athena::getMessageSvc(),"MDTDeadElementsAnalysis"); TF1 *f1 = new TF1("f1", "gaus", 1, 1000); distr_of_entries->Fit("f1", "RLQ0"); double mean = f1->GetParameter(2); @@ -1228,7 +1230,7 @@ void MDTDeadElementsAnalysis::getHolesInInterval_strategy5(TH1F* idh1, int first for(int ib2=firsttube; ib2<=lasttube;ib2++){ float cont2 = idh1->GetBinContent(ib2); if(cont2==float(ib-1)) { - std::cout<<"bin "<<ib2<<"is dead or inefficient"<<std::endl; + log<<MSG::WARNING<<"bin "<<ib2<<"is dead or inefficient"<<endmsg; } } } diff --git a/MuonSpectrometer/MuonCalib/MuonCalibStandAlone/MuonCalibStandAloneExtraTools/src/MdtDqaDb.cxx b/MuonSpectrometer/MuonCalib/MuonCalibStandAlone/MuonCalibStandAloneExtraTools/src/MdtDqaDb.cxx index 5dba44054b1b7b2fd5fafcfbdd30c3ce7fc9805f..aa55ef10b14cad889012753e96f849b7c13e6b0c 100644 --- a/MuonSpectrometer/MuonCalib/MuonCalibStandAlone/MuonCalibStandAloneExtraTools/src/MdtDqaDb.cxx +++ b/MuonSpectrometer/MuonCalib/MuonCalibStandAlone/MuonCalibStandAloneExtraTools/src/MdtDqaDb.cxx @@ -1,8 +1,9 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ #include "MuonCalibStandAloneExtraTools/MdtDqaDb.h" + #include <iostream> #include <fstream> #include <sstream> @@ -10,7 +11,6 @@ #include <string.h> #include <vector> - MdtDqaDb::MdtDqaDb(std::string chamName) : m_numNoisyMezz(-1), m_numNoisyTube(-1) { Clear(); m_chamberName = chamName; @@ -67,26 +67,7 @@ void MdtDqaDb::Print(std::ofstream *outputFile) { *outputFile << std::endl ; } -void MdtDqaDb::Print() { - // std::cout << " ==================================================== " << std::endl ; - // std::cout << " MdtDqaDb output: ---- Chamber name : " << m_chamberName << std::endl ; - // std::cout << " timeFlag : " << getTimeFlag() << std::endl ; - // std::cout << " deadFlag : " << getDeadFlag() << std::endl ; - // std::cout << " chi2 per dof ML1 : " << m_chi2ndofML1 << std::endl ; - // std::cout << " chi2 per dof ML2 : " << m_chi2ndofML2 << std::endl ; - // std::cout << " t0 ML1 (ns) " << m_t0ML1 << " +/- " << m_t0errML1 << std::endl ; - // std::cout << " t0 ML2 (ns) " << m_t0ML2 << " +/- " << m_t0errML2 << std::endl ; - // std::cout << " tdrift ML1 (ns) " << m_tdriftML1 << " +/- " << m_tdrifterrML1 << std::endl ; - // std::cout << " tdrift ML2 (ns) " << m_tdriftML2 << " +/- " << m_tdrifterrML2 << std::endl ; - - // std::cout << " Number of Dead ML : " << m_numDeadML << " ---- list of dead/inefficient Multilayers : " << std::endl ; - // for ( int n=0 ; n< m_numDeadML ; n++ ) std::cout << m_listDeadML[n] << std::endl ; - // std::cout << " Number of Dead Mezzanine : " << m_numDeadMezz << " ---- list of dead/inefficient Mezzanine : " << std::endl ; - // for ( int n=0 ; n< m_numDeadMezz ; n++ ) std::cout << m_listDeadMezz[n] << std::endl ; - // std::cout << " Number of Dead Tubes : " << m_numDeadTube << " ---- list of dead/inefficient Tubes : " << std::endl ; - // for ( int n=0 ; n< m_numDeadTube ; n++ ) std::cout << m_listDeadTube[n] << std::endl ; - - // std::cout << std::endl ; +void MdtDqaDb::Print() { } void MdtDqaDb::SetChamberName(std::string chamName) { diff --git a/MuonSpectrometer/MuonCalib/MuonCalibStandAlone/MuonCalibStandAloneExtraTools/src/MdtDqaNtupleAnalysis.cxx b/MuonSpectrometer/MuonCalib/MuonCalibStandAlone/MuonCalibStandAloneExtraTools/src/MdtDqaNtupleAnalysis.cxx index 784e79782a9149c989715f108862c5106b42a23e..52ca5b25428f4fde34e81f3dfb0fbdb806c595e2 100644 --- a/MuonSpectrometer/MuonCalib/MuonCalibStandAlone/MuonCalibStandAloneExtraTools/src/MdtDqaNtupleAnalysis.cxx +++ b/MuonSpectrometer/MuonCalib/MuonCalibStandAlone/MuonCalibStandAloneExtraTools/src/MdtDqaNtupleAnalysis.cxx @@ -359,7 +359,6 @@ const std::vector<MuonCalibSegment *> &/*segments*/,unsigned int /*position*/){ MDTName chamb_mult(stn,ieta+1,side,isec+1); histoType="B_ChamberHitMultiplicity"; - // if(m_verbose) cout<<" histoType "<<histoType<<endl; hmulti = (TH1F*) m_histoManager->GetMdtHisto(histoType,chamb_mult); if(hmulti) hmulti->Fill(multiAdcCut); diff --git a/MuonSpectrometer/MuonCalib/MuonCalibStandAlone/MuonCalibStandAloneExtraTools/src/MdtDqaTrackAnalysis.cxx b/MuonSpectrometer/MuonCalib/MuonCalibStandAlone/MuonCalibStandAloneExtraTools/src/MdtDqaTrackAnalysis.cxx index 3721ae44cc80bd19b4d8a816db161086ce228c87..3443ed7637c32d814b854fb16c86a56c6b99d169 100644 --- a/MuonSpectrometer/MuonCalib/MuonCalibStandAlone/MuonCalibStandAloneExtraTools/src/MdtDqaTrackAnalysis.cxx +++ b/MuonSpectrometer/MuonCalib/MuonCalibStandAlone/MuonCalibStandAloneExtraTools/src/MdtDqaTrackAnalysis.cxx @@ -407,7 +407,7 @@ void MdtDqaTrackAnalysis::handleEvent(const MuonCalibEvent &event, int /*evnt_n double p = 0; phi = (*trk_CB_it2)->phi(); - eta = -log(tan((*trk_CB_it2)->theta()/2.)); + eta = -std::log(std::tan((*trk_CB_it2)->theta()/2.)); pt = (*trk_CB_it2)->pt()/1000; p = (*trk_CB_it2)->p()/1000; int CB_npixel = 0; @@ -623,7 +623,7 @@ void MdtDqaTrackAnalysis::handleEvent(const MuonCalibEvent &event, int /*evnt_n /*::::::::::::::::::::::::::::::::::::::::::::::*/ for(;track_it!=track_it_end;++track_it) { - double eta = -log ( tan ( (*track_it)->theta()/2)); + double eta = -std::log ( std::tan ( (*track_it)->theta()/2)); i_trk_sel++; diff --git a/MuonSpectrometer/MuonCalib/MuonCalibStandAlone/MuonCalibStandAloneExtraTools/src/TimeAndAdcFitter.cxx b/MuonSpectrometer/MuonCalib/MuonCalibStandAlone/MuonCalibStandAloneExtraTools/src/TimeAndAdcFitter.cxx index e5cacc4f4cd1b0c08d9ff9555e6c186a58945e70..2825ce47ffba6f59fe2160966336ff71b4f0c235 100644 --- a/MuonSpectrometer/MuonCalib/MuonCalibStandAlone/MuonCalibStandAloneExtraTools/src/TimeAndAdcFitter.cxx +++ b/MuonSpectrometer/MuonCalib/MuonCalibStandAlone/MuonCalibStandAloneExtraTools/src/TimeAndAdcFitter.cxx @@ -156,8 +156,8 @@ void TimeAndAdcFitter::searchParams(TH1 *h, double *p, int /*nParams*/) { float cont1=hnew->GetBinContent(ix1); float cont2=hnew->GetBinContent(ix2); if (cont1>0. && cont2>0. ){ - float A1=exp(-(a1-t0guess)/P3); - float A2=exp(-(a2-t0guess)/P3); + float A1=std::exp(-(a1-t0guess)/P3); + float A2=std::exp(-(a2-t0guess)/P3); // do not forget rebinning! P2 = (cont1/cont2-1.)/(A1-cont1/cont2*A2); P1 = cont1/(1+P2*A1); diff --git a/MuonSpectrometer/MuonCalib/MuonCalibStandAlone/MuonCalibStandAloneTools/src/HitCounter.cxx b/MuonSpectrometer/MuonCalib/MuonCalibStandAlone/MuonCalibStandAloneTools/src/HitCounter.cxx index 94bbaeecbc7600e35b7cdda2ea9d7a7621fa5c8f..7ebc93fac9466eb060a474ed2ca16778f96420ee 100644 --- a/MuonSpectrometer/MuonCalib/MuonCalibStandAlone/MuonCalibStandAloneTools/src/HitCounter.cxx +++ b/MuonSpectrometer/MuonCalib/MuonCalibStandAlone/MuonCalibStandAloneTools/src/HitCounter.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ //c - c++ @@ -27,7 +27,6 @@ bool HitCounter :: Initialize(const NtupleStationId &id) return false; } m_per_chamber=0; -// std::cout<<"NMultilayers = "<<id.NMultilayers()<<std::endl; for(int i=0; i<id.NMultilayers(); i++) { m_per_ml[i]=0; @@ -35,8 +34,6 @@ bool HitCounter :: Initialize(const NtupleStationId &id) if(id.NLayers(i)==4) m_mezz_width[i]=6; TubeId tid; tid.ml=i; -// std::cout<<"NLayers = "<<id.NLayers(i)<<std::endl; -// std::cout<<"NTubes = "<<id.NTubes(i)<<std::endl; for(tid.ly=0; tid.ly<id.NLayers(i); tid.ly++) for(tid.tb=0; tid.tb<id.NTubes(i); tid.tb++) { @@ -55,7 +52,6 @@ bool HitCounter :: Initialize(const NtupleStationId &id) m_name = id.regionId(); m_is_initialized=true; m_wd = gDirectory->mkdir(m_name.c_str(), m_name.c_str()); -// m_wd->Write(); m_wd->cd(); m_hits_per_segments = new TH1F("hits_per_segments", "", 433, -0.5, 432.5); return true; @@ -72,22 +68,15 @@ void HitCounter :: ProcessSegment(const MuonCalibSegment & segment) TubeId tid; if (!(m_id==(*it)->identify())) continue; NtupleStationId id((*it)->identify()); -// std::cout<<id.regionId()<<std::endl; tid.ml = (*it)->identify().mdtMultilayer()-1; -// std::cout<<"tid.ml="<<tid.ml<<std::endl; tid.ly = (*it)->identify().mdtTubeLayer()-1; -// std::cout<<"tid.ly="<<tid.ly<<std::endl; tid.tb = (*it)->identify().mdtTube()-1; -// std::cout<<"tid.tb="<<tid.tb<<std::endl; m_per_tube[tid]=m_per_tube[tid]+1; MezzId mid; mid.ml=tid.ml; -// std::cout<<m_mezz_width[tid.ml]<<std::endl; mid.mezz=tid.tb/m_mezz_width[tid.ml]; -// std::cout<<"mid.mezz="<<mid.mezz<<std::endl; m_per_mezz[mid]=m_per_mezz[mid]+1; m_per_ml[tid.ml]=m_per_ml[tid.ml]+1; -// std::cout<<"."<<std::endl; } } @@ -116,7 +105,6 @@ const std::string & HitCounter :: FittingBy(int min_hits, double bad_fit_rate) tubes->Fill(index, it->second); index++; int fix_index = it->first.tb + 72*(it->first.ly) + 288*(it->first.ml); -// std::cout<<it->first.tb<<" "<<it->first.ly<<" "<<it->first.ml<<std::endl; tubes_index->SetBinContent(fix_index + 1, it->second); } tubes->SetEntries(m_per_chamber); @@ -201,7 +189,6 @@ std::map<HitCounter::TubeId, HitCounter::DQInfo> HitCounter :: InitialDQ(int noi } } mean_nhits=n/mean_nhits; -// std::cout<<mean_nhits<<std::endl; std::map<TubeId, DQInfo> ret; for(std::map<TubeId, int> :: const_iterator it=m_per_tube.begin(); it!=m_per_tube.end(); it++) { @@ -210,8 +197,6 @@ std::map<HitCounter::TubeId, HitCounter::DQInfo> HitCounter :: InitialDQ(int noi if(it->second > n * noisy_tube_factor * mean_nhits) { ret[it->first].SetNoisy(); -// std::cout<<mean_nhits<<" "<<it->second<<std::endl; -// std::cout<<it->first.ml<<" "<<it->first.ly<<" "<<it->first.tb<<std::endl; } } return ret; diff --git a/MuonSpectrometer/MuonCalib/MuonCalibStandAlone/MuonCalibStandAloneTools/src/NtupleCalibADCTool.cxx b/MuonSpectrometer/MuonCalib/MuonCalibStandAlone/MuonCalibStandAloneTools/src/NtupleCalibADCTool.cxx index 312742db325287869d59603a539f2d320a425bce..b17989955f06bd79f4f0b5b2ac0310a4ab9d3cab 100644 --- a/MuonSpectrometer/MuonCalib/MuonCalibStandAlone/MuonCalibStandAloneTools/src/NtupleCalibADCTool.cxx +++ b/MuonSpectrometer/MuonCalib/MuonCalibStandAlone/MuonCalibStandAloneTools/src/NtupleCalibADCTool.cxx @@ -414,10 +414,6 @@ double low_bin[15] = {52.1363,59.5508,72.9139,79.8775,82.4582,82.4905,81.2233,80 m_MDT_SiHitAdc[station_identifier]->Fill(hit->tdcCount(),hit->adcCount(),1.0); } } - // counter++; - // } - // if(counter>1) cout<<"Error, some tube was record over two times !!"<<endl; - } //end raw Mdthit loop diff --git a/MuonSpectrometer/MuonCalib/MuonCalibStandAlone/MuonCalibStandAloneTools/src/NtupleChisqResolutionTool.cxx b/MuonSpectrometer/MuonCalib/MuonCalibStandAlone/MuonCalibStandAloneTools/src/NtupleChisqResolutionTool.cxx index 97ee570db823193fc3672818b0342f752a287cf5..4e5ead47b5240df2d2c287787ec5a89092e91c97 100644 --- a/MuonSpectrometer/MuonCalib/MuonCalibStandAlone/MuonCalibStandAloneTools/src/NtupleChisqResolutionTool.cxx +++ b/MuonSpectrometer/MuonCalib/MuonCalibStandAlone/MuonCalibStandAloneTools/src/NtupleChisqResolutionTool.cxx @@ -34,15 +34,16 @@ #include "TString.h" #include "TF1.h" #include "TMath.h" // for TMath::Prob() +#include <TString.h> // for Form namespace MuonCalib { //****************************************************************************** - static NtupleChisqResolutionTool* static_NtupleChisqResolutionTool_pointer = NULL; + static NtupleChisqResolutionTool* static_NtupleChisqResolutionTool_pointer = nullptr; inline void NtupleChisqResolutionTool_fcn_wrapper(int &npar, double *gin, double &f, double *par, int iflag) { - if(static_NtupleChisqResolutionTool_pointer==NULL) { - exit(-1); + if(!static_NtupleChisqResolutionTool_pointer) { + throw std::runtime_error(Form("File: %s, Line: %d\nNtupleChisqResolutionTool_fcn_wrapper() - ERROR: static_NtupleChisqResolutionTool_pointer is nullptr", __FILE__, __LINE__)); } static_NtupleChisqResolutionTool_pointer->fcn(npar, gin, f, par, iflag); } @@ -61,7 +62,7 @@ namespace MuonCalib { { ATH_MSG_INFO( "initialize()" ); ATH_CHECK( m_calib_input_svc.retrieve() ); - return StatusCode :: SUCCESS; + return StatusCode::SUCCESS; } //****************************************************************************** @@ -76,7 +77,7 @@ namespace MuonCalib { //****************************************************************************** - void NtupleChisqResolutionTool :: setRegion() + void NtupleChisqResolutionTool::setRegion() { //try to get rt relation p_rt_rel = m_calib_input_svc->GetRtRelation(); @@ -151,7 +152,7 @@ namespace MuonCalib { for (unsigned int k=0; k<point.size(); k++) { double radius(r_min+k*bin_width); point[k].set_x1(t_from_r(radius, p_rt_rel)); - point[k].set_x2(fitpar[0]*exp(-fitpar[1]*radius)+fitpar[2]); + point[k].set_x2(fitpar[0]*std::exp(-fitpar[1]*radius)+fitpar[2]); point[k].set_error(1.0); } m_final_resolution = new RtResolutionChebyshev( @@ -190,7 +191,7 @@ namespace MuonCalib { it!=(m_seg->at(k))->mdtHOTEnd();++it) { r=(*it)->driftRadius(); - double newResol = par[0]*exp(-par[1]*r)+par[2]; + double newResol = par[0]*std::exp(-par[1]*r)+par[2]; (*it)->setDriftRadius(r,newResol); } diff --git a/MuonSpectrometer/MuonCalib/MuonCalibStandAlone/MuonCalibStandAloneTools/src/NtupleControlHistogramsTool.cxx b/MuonSpectrometer/MuonCalib/MuonCalibStandAlone/MuonCalibStandAloneTools/src/NtupleControlHistogramsTool.cxx index d0eeca0367276b630d0df2b465e8c5b686e3f523..4c275fe09487a27938c69d6af0e1147d1cedcc4a 100644 --- a/MuonSpectrometer/MuonCalib/MuonCalibStandAlone/MuonCalibStandAloneTools/src/NtupleControlHistogramsTool.cxx +++ b/MuonSpectrometer/MuonCalib/MuonCalibStandAlone/MuonCalibStandAloneTools/src/NtupleControlHistogramsTool.cxx @@ -751,7 +751,7 @@ StatusCode NtupleControlHistogramsTool::handleEvent( // segment slopes // m_MDT_segment_slope[station_identifier]->Fill( - 57.30*atan((segments[k]->direction()).y()/ + 57.30*std::atan((segments[k]->direction()).y()/ (segments[k]->direction()).z()), 1.0); // track residuals // diff --git a/MuonSpectrometer/MuonCalib/MuonCalibStandAlone/MuonCalibStandAloneTools/src/NtupleSimpleResolutionTool.cxx b/MuonSpectrometer/MuonCalib/MuonCalibStandAlone/MuonCalibStandAloneTools/src/NtupleSimpleResolutionTool.cxx index fb4cb14c01fd537ff747d9b367b647ffc3d3e8ac..8df0822cdbcd5ec9538ec3e69042efd501d4665c 100644 --- a/MuonSpectrometer/MuonCalib/MuonCalibStandAlone/MuonCalibStandAloneTools/src/NtupleSimpleResolutionTool.cxx +++ b/MuonSpectrometer/MuonCalib/MuonCalibStandAlone/MuonCalibStandAloneTools/src/NtupleSimpleResolutionTool.cxx @@ -774,20 +774,16 @@ double NtupleSimpleResolutionTool::t_from_r(const double & r, double NtupleSimpleResolutionTool::ttt(double *x, double *par) { double y; - y=0.025+x[0]*(par[4]*exp(-x[0]/ + y=0.025+x[0]*(par[4]*std::exp(-x[0]/ (par[0]*(1+par[1]*x[0]+par[2]*x[0]*x[0]+par[3]*x[0]*x[0]*x[0])))+ - par[5]*exp(-x[0]*x[0]/(par[6]*par[6]))); + par[5]*std::exp(-x[0]*x[0]/(par[6]*par[6]))); return y; } double NtupleSimpleResolutionTool::ttt0(double *x, double *par) { double y; -// y=exp(-x[0]/(par[4]+x[0]))*par[0]*(1.0+par[1]*x[0]+par[2]*x[0]*x[0]+ -// par[3]*x[0]*x[0]*x[0]); - - y=(par[0]-(par[0]-par[5])/(1.0+exp(-(x[0]-par[6])/par[4])))* + y=(par[0]-(par[0]-par[5])/(1.0+std::exp(-(x[0]-par[6])/par[4])))* (1+par[1]*x[0]+par[2]*x[0]*x[0]+par[3]*x[0]*x[0]*x[0]); - return y; } diff --git a/MuonSpectrometer/MuonCalib/MuonCalibTools/MuonCalibTools/IdToFixedIdTool.h b/MuonSpectrometer/MuonCalib/MuonCalibTools/MuonCalibTools/IdToFixedIdTool.h index 64300623cb78efadef91808636e330b985af9d35..84f9d858b0fbf585d178921e03ae9265412e7a7c 100644 --- a/MuonSpectrometer/MuonCalib/MuonCalibTools/MuonCalibTools/IdToFixedIdTool.h +++ b/MuonSpectrometer/MuonCalib/MuonCalibTools/MuonCalibTools/IdToFixedIdTool.h @@ -41,10 +41,9 @@ class IdToFixedIdTool : public AthAlgTool, virtual public MuonCalib::IIdToFixedI IdToFixedIdTool(const std::string& type, const std::string& name, const IInterface* parent); //!< AlgTool constructor - virtual ~IdToFixedIdTool(); //!< AlgTool destructor + virtual ~IdToFixedIdTool()=default; StatusCode initialize(); //!< IdToFixedIdTool initialization: retrieve all the IdHelpers needed to do strap the ATHENA Identifier - StatusCode finalize(); //!< IdToFixedIdTool finalization: does not do anything special void print(const Identifier& id) const; //!< print method to output an ATHENA Identifier, warning the user when the conversion and reconversion yields different results. void print(const MuonFixedId& fid) const; //!< dump MuonFixedId diff --git a/MuonSpectrometer/MuonCalib/MuonCalibTools/MuonCalibTools/PatternNtupleMaker.h b/MuonSpectrometer/MuonCalib/MuonCalibTools/MuonCalibTools/PatternNtupleMaker.h index 96f790d1001de807342478ceb4b8f25baa52e866..35ed4ac5fd42fe2a16ee5e16eae2a2ca62d2b147 100644 --- a/MuonSpectrometer/MuonCalib/MuonCalibTools/MuonCalibTools/PatternNtupleMaker.h +++ b/MuonSpectrometer/MuonCalib/MuonCalibTools/MuonCalibTools/PatternNtupleMaker.h @@ -43,7 +43,7 @@ namespace MuonCalib { class PatternNtupleMaker : public AthAlgTool, virtual public IMuonCalibTool { public: PatternNtupleMaker(const std::string&,const std::string&,const IInterface*); //!<AlgTool constructor - virtual ~PatternNtupleMaker(); //!<Virtual destructor + virtual ~PatternNtupleMaker()=default; StatusCode initialize(); //!< AlgTool initailize method: Creates an instance of MuonCalib::MuonCalibBranchNtuple, retrieves Storegate. StatusCode finalize(); //!< AlgTool finalize method: does not do anything special diff --git a/MuonSpectrometer/MuonCalib/MuonCalibTools/src/IdToFixedIdTool.cxx b/MuonSpectrometer/MuonCalib/MuonCalibTools/src/IdToFixedIdTool.cxx index f844dd63968f4ec7cadc70501133c2893b46ab65..8893196a83e1290b5a98c6f5c3ca2d76bffbbe81 100644 --- a/MuonSpectrometer/MuonCalib/MuonCalibTools/src/IdToFixedIdTool.cxx +++ b/MuonSpectrometer/MuonCalib/MuonCalibTools/src/IdToFixedIdTool.cxx @@ -21,10 +21,6 @@ IdToFixedIdTool::IdToFixedIdTool(const std::string& t, declareProperty("print_level" , m_print_level); } -IdToFixedIdTool::~IdToFixedIdTool() -{ -} - StatusCode IdToFixedIdTool::initialize() { ATH_MSG_VERBOSE("Initialisation started"); @@ -98,11 +94,6 @@ MuonFixedId IdToFixedIdTool::idToFixedId(const Identifier& id) const return fixedId; } -StatusCode IdToFixedIdTool::finalize() -{ - return StatusCode::SUCCESS; -} - Identifier IdToFixedIdTool::fixedIdToId(const MuonFixedId& fid) const { ATH_MSG_VERBOSE("FixedIdToId started "); @@ -152,8 +143,8 @@ Identifier IdToFixedIdTool::regionKeyToId(std::string region) const std::string::size_type separator1=region.find_first_of("_"); std::string::size_type separator2=region.find_last_of("_"); if((separator1==std::string::npos)||(separator2==std::string::npos)||(separator1==separator2)) { - std::cout <<"IdToFixedIdTool::regionKeyToId : invalid region key "<<region<<std::endl; - return Identifier(0); + ATH_MSG_WARNING("IdToFixedIdTool::regionKeyToId : invalid region key "<<region); + return Identifier(); } std::string::size_type separator3=region.find( "_", separator1+1); if(separator3!=separator2){ diff --git a/MuonSpectrometer/MuonCalib/MuonCalibTools/src/PatternNtupleMaker.cxx b/MuonSpectrometer/MuonCalib/MuonCalibTools/src/PatternNtupleMaker.cxx index 7fa121fdb253f3066834090362294a766e2d0bf1..1bcc44e458cf73fefd85ca023be8b6b3611fa3ee 100644 --- a/MuonSpectrometer/MuonCalib/MuonCalibTools/src/PatternNtupleMaker.cxx +++ b/MuonSpectrometer/MuonCalib/MuonCalibTools/src/PatternNtupleMaker.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ #include "MuonCalibTools/PatternNtupleMaker.h" @@ -30,12 +30,6 @@ namespace MuonCalib { declareProperty("DoRawTGC", m_doRawTgc=false); } - - PatternNtupleMaker::~PatternNtupleMaker() - { - // if(m_ntMaker) delete m_ntMaker; - } - StatusCode PatternNtupleMaker::initialize() { ATH_MSG_DEBUG("initialize "); @@ -87,7 +81,6 @@ namespace MuonCalib { ATH_MSG_INFO( "Invalid MuonCalibTruth pointer not filled "); return false; }else{ -// (*truth_it)->dump(std::cout) ; //Do not store the numerous photons/neutrons on ntuple. if( ( (*truth_it)->PDGCode() == 22) || ( std::abs( (*truth_it)->PDGCode()) == 2112) ) continue ; diff --git a/MuonSpectrometer/MuonCalib/MuonCalibUtils/MuonCalibMath/src/BaseFunctionFitter.cxx b/MuonSpectrometer/MuonCalib/MuonCalibUtils/MuonCalibMath/src/BaseFunctionFitter.cxx index 8b4fc0aad7a255eb3d1cca8c770ae9326d06f387..d3107546558bdd99fbdf1b283ab10130e48ebe4e 100644 --- a/MuonSpectrometer/MuonCalib/MuonCalibUtils/MuonCalibMath/src/BaseFunctionFitter.cxx +++ b/MuonSpectrometer/MuonCalib/MuonCalibUtils/MuonCalibMath/src/BaseFunctionFitter.cxx @@ -1,19 +1,12 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ -//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -// 05.04.2005, AUTHOR: OLIVER KORTNER -//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - -/////////////////////////////////////////////////////////////// -// IMPLEMENTATION OF NON-INLINE METHODS DEFINED IN THE CLASS // -// BaseFunctionFitter // -/////////////////////////////////////////////////////////////// - #include "MuonCalibMath/BaseFunctionFitter.h" #include <Eigen/Dense> -#include "cmath" + +#include <TString.h> // for Form +#include <cmath> namespace MuonCalib { @@ -34,23 +27,10 @@ bool BaseFunctionFitter::fit_parameters( //////////// if (first_point<1 || first_point>sample_point.size()) { - std::cerr << "\n" - << "Class BaseFunctionFitter, method fit_parameters: " - << "ERROR!\n" - << "Illegal first point " << first_point - << ", must be >=1 and <=" << sample_point.size() - << ".\n"; - exit(1); + throw std::runtime_error(Form("File: %s, Line: %d\nBaseFunctionFitter::fit_parameters() - ERROR: Illegal first point %d, must be >=1 and <=%lu", __FILE__, __LINE__, first_point, sample_point.size())); } if (last_point<first_point || last_point>sample_point.size()) { - std::cerr << "\n" - << "Class BaseFunctionFitter, method fit_parameters: " - << "ERROR!\n" - << "Illegal last point " << last_point - << ", must be >=" << first_point - << " and <=" << sample_point.size() - << ".\n"; - exit(1); + throw std::runtime_error(Form("File: %s, Line: %d\nBaseFunctionFitter::fit_parameters() - ERROR: Illegal last point %d, must be >=%d and <=%lu", __FILE__, __LINE__, last_point, first_point, sample_point.size())); } //////////////////////////////////////////////////////////// @@ -60,28 +40,6 @@ bool BaseFunctionFitter::fit_parameters( // clear the objects // init(m_nb_coefficients); -// fill the objects // -// for (unsigned int k=first_point-1; k<last_point; k++) { -// -// for (int j=0; j<m_nb_coefficients; j++) { -// for (int p=j; p<m_nb_coefficients; p++) { -// -// m_A[j][p] = m_A[j][p]+base_function->value(j, -// sample_point[k].x1()) -// *base_function->value(p, -// sample_point[k].x1())/ -// std::pow(sample_point[k].error(), 2); -// -// } -// -// m_b[j] = m_b[j]+sample_point[k].x2()*base_function->value(j, -// sample_point[k].x1())/ -// std::pow(sample_point[k].error(), 2); -// -// } -// -// } - for (int j=0; j<m_nb_coefficients; j++) { for (int p=j; p<m_nb_coefficients; p++) { diff --git a/MuonSpectrometer/MuonCalib/MuonCalibUtils/MuonCalibMath/src/ConstantContentBinMaker.cxx b/MuonSpectrometer/MuonCalib/MuonCalibUtils/MuonCalibMath/src/ConstantContentBinMaker.cxx index e192b6e97fe4dee8da9826c43a6b003e0329f9aa..3e267fc2e85da9f159ab0298800988a89d37cd09 100644 --- a/MuonSpectrometer/MuonCalib/MuonCalibUtils/MuonCalibMath/src/ConstantContentBinMaker.cxx +++ b/MuonSpectrometer/MuonCalib/MuonCalibUtils/MuonCalibMath/src/ConstantContentBinMaker.cxx @@ -52,8 +52,8 @@ bool ConstantContentBinMaker::binDataPoints(const unsigned int & bin_content, /////////////// unsigned int n_bins(static_cast<unsigned int>( - log(m_points.size()/static_cast<double>(bin_content)) - /log(2.0))); + std::log(m_points.size()/static_cast<double>(bin_content)) + /std::log(2.0))); std::vector<unsigned int> splitting_axis(ref_coord); unsigned int axis_counter(0); diff --git a/MuonSpectrometer/MuonCalib/RpcCalib/RpcCalibTools/CMakeLists.txt b/MuonSpectrometer/MuonCalib/RpcCalib/RpcCalibTools/CMakeLists.txt index 41d059d9e6e592a03823a70cdb51133815a38fa9..4891e4f92e9104dfd8f52e95feab203b04be61c3 100644 --- a/MuonSpectrometer/MuonCalib/RpcCalib/RpcCalibTools/CMakeLists.txt +++ b/MuonSpectrometer/MuonCalib/RpcCalib/RpcCalibTools/CMakeLists.txt @@ -27,7 +27,7 @@ atlas_depends_on_subdirs( PUBLIC atlas_add_library( RpcCalibToolsLib src/*.cxx PUBLIC_HEADERS RpcCalibTools - LINK_LIBRARIES AthenaBaseComps AthLinks GaudiKernel MuonReadoutGeometry TrkGeometry TrkParameters TrkTrack TrkExInterfaces StoreGateLib SGtests MuonIdHelpersLib + LINK_LIBRARIES AthenaBaseComps AthLinks GaudiKernel MuonReadoutGeometry TrkGeometry TrkParameters TrkTrack TrkExInterfaces StoreGateLib SGtests MuonIdHelpersLib TrackRecordLib PRIVATE_LINK_LIBRARIES MuonPrepRawData TrkMeasurementBase TrkRIO_OnTrack ) atlas_add_component( RpcCalibTools diff --git a/MuonSpectrometer/MuonCalib/RpcCalib/RpcCalibTools/src/RpcExtrapolationTool.cxx b/MuonSpectrometer/MuonCalib/RpcCalib/RpcCalibTools/src/RpcExtrapolationTool.cxx index bd17b57b82f59d9373c5ce3ecc1908e5d60875c0..efa25d3ddd1e1b9d6309475f6886f492b95da432 100644 --- a/MuonSpectrometer/MuonCalib/RpcCalib/RpcCalibTools/src/RpcExtrapolationTool.cxx +++ b/MuonSpectrometer/MuonCalib/RpcCalib/RpcCalibTools/src/RpcExtrapolationTool.cxx @@ -261,7 +261,4 @@ void RpcExtrapolationTool::getRpcIntersections(TrackCollection::const_iterator t for(;it!=panels.end();++it) theResult.push_back((*it).second); - - //std::cout<<"end of extrapolation search for this track "<<theResult.size()<<std::endl; - } diff --git a/MuonSpectrometer/MuonCnv/MuonCSC_CnvTools/CMakeLists.txt b/MuonSpectrometer/MuonCnv/MuonCSC_CnvTools/CMakeLists.txt index 91c49b4bdda6090564db8c7cffbc2d4ba070af5a..ee7ffa0002b0d10c11522b5310d4192fcc9bf959 100644 --- a/MuonSpectrometer/MuonCnv/MuonCSC_CnvTools/CMakeLists.txt +++ b/MuonSpectrometer/MuonCnv/MuonCSC_CnvTools/CMakeLists.txt @@ -32,14 +32,19 @@ atlas_depends_on_subdirs( PUBLIC find_package( CLHEP ) find_package( tdaq-common COMPONENTS eformat_write DataWriter ) +atlas_add_library( MuonCSC_CnvToolsLib + MuonCSC_CnvTools/*.h + INTERFACE + PUBLIC_HEADERS MuonCSC_CnvTools + LINK_LIBRARIES GaudiKernel ByteStreamData ) + # Component(s) in the package: atlas_add_component( MuonCSC_CnvTools src/*.cxx src/components/*.cxx INCLUDE_DIRS ${TDAQ-COMMON_INCLUDE_DIRS} ${CLHEP_INCLUDE_DIRS} - LINK_LIBRARIES ${TDAQ-COMMON_LIBRARIES} ${CLHEP_LIBRARIES} ByteStreamData ByteStreamData_test GaudiKernel AthenaBaseComps AthenaKernel StoreGateLib SGtests Identifier ByteStreamCnvSvcBaseLib EventInfo EventPrimitives CSCcablingLib MuonReadoutGeometry MuonDigitContainer MuonIdHelpersLib MuonRDO MuonPrepRawData TrkSurfaces ) + LINK_LIBRARIES ${TDAQ-COMMON_LIBRARIES} ${CLHEP_LIBRARIES} ByteStreamData ByteStreamData_test GaudiKernel AthenaBaseComps AthenaKernel StoreGateLib SGtests Identifier ByteStreamCnvSvcBaseLib EventInfo EventPrimitives CSCcablingLib MuonReadoutGeometry MuonDigitContainer MuonIdHelpersLib MuonRDO MuonPrepRawData TrkSurfaces MuonCnvToolInterfacesLib CscCalibToolsLib MuonDigToolInterfacesLib MuonCSC_CnvToolsLib ) # Install files from the package: -atlas_install_headers( MuonCSC_CnvTools ) atlas_install_joboptions( share/*.py ) diff --git a/MuonSpectrometer/MuonCnv/MuonMDT_CnvTools/CMakeLists.txt b/MuonSpectrometer/MuonCnv/MuonMDT_CnvTools/CMakeLists.txt index f83ba2d660f567874021841d5ed033022325b39e..5eb0e15e44bea4467e1a1015af46b24094ccd032 100644 --- a/MuonSpectrometer/MuonCnv/MuonMDT_CnvTools/CMakeLists.txt +++ b/MuonSpectrometer/MuonCnv/MuonMDT_CnvTools/CMakeLists.txt @@ -30,14 +30,19 @@ atlas_depends_on_subdirs( PUBLIC # External dependencies: find_package( tdaq-common COMPONENTS eformat_write DataWriter ) +atlas_add_library( MuonMDT_CnvToolsLib + MuonMDT_CnvTools/*.h + INTERFACE + PUBLIC_HEADERS MuonMDT_CnvTools + LINK_LIBRARIES GaudiKernel ByteStreamData ) + # Component(s) in the package: atlas_add_component( MuonMDT_CnvTools src/*.cxx src/components/*.cxx INCLUDE_DIRS ${TDAQ-COMMON_INCLUDE_DIRS} - LINK_LIBRARIES ${TDAQ-COMMON_LIBRARIES} ByteStreamData ByteStreamData_test GaudiKernel AthenaBaseComps StoreGateLib SGtests AtlasDetDescr Identifier ByteStreamCnvSvcBaseLib MuonMDT_CablingLib MdtCalibSvcLib MuonCalibEvent MuonReadoutGeometry MuonDigitContainer MuonIdHelpersLib MuonRDO MuonPrepRawData MuonCablingData GeoModelUtilities ) + LINK_LIBRARIES ${TDAQ-COMMON_LIBRARIES} ByteStreamData ByteStreamData_test GaudiKernel AthenaBaseComps StoreGateLib SGtests AtlasDetDescr Identifier ByteStreamCnvSvcBaseLib MuonMDT_CablingLib MdtCalibSvcLib MuonCalibEvent MuonReadoutGeometry MuonDigitContainer MuonIdHelpersLib MuonRDO MuonPrepRawData MuonCablingData GeoModelUtilities MuonCnvToolInterfacesLib MuonMDT_CnvToolsLib ) # Install files from the package: -atlas_install_headers( MuonMDT_CnvTools ) atlas_install_python_modules( python/*.py ) diff --git a/MuonSpectrometer/MuonCnv/MuonMM_CnvTools/CMakeLists.txt b/MuonSpectrometer/MuonCnv/MuonMM_CnvTools/CMakeLists.txt index bdd5f35d9efa97135a4505dabaa8c94f962c5920..798c8e11915c2c9c6a4f93c9af1bc5685e3992b5 100644 --- a/MuonSpectrometer/MuonCnv/MuonMM_CnvTools/CMakeLists.txt +++ b/MuonSpectrometer/MuonCnv/MuonMM_CnvTools/CMakeLists.txt @@ -28,13 +28,16 @@ atlas_depends_on_subdirs( PUBLIC # External dependencies: find_package( tdaq-common COMPONENTS eformat_write DataWriter ) +atlas_add_library( MuonMM_CnvToolsLib + MuonMM_CnvTools/*.h + INTERFACE + PUBLIC_HEADERS MuonMM_CnvTools + LINK_LIBRARIES GaudiKernel ) + # Component(s) in the package: atlas_add_component( MuonMM_CnvTools src/*.cxx src/components/*.cxx INCLUDE_DIRS ${TDAQ-COMMON_INCLUDE_DIRS} - LINK_LIBRARIES ${TDAQ-COMMON_LIBRARIES} ByteStreamData ByteStreamData_test GaudiKernel AthenaBaseComps SGTools StoreGateLib SGtests AtlasDetDescr Identifier ByteStreamCnvSvcBaseLib MuonReadoutGeometry MuonDigitContainer MuonIdHelpersLib MuonRDO MuonPrepRawData MMClusterizationLib NSWCalibToolsLib ) - -# Install files from the package: -atlas_install_headers( MuonMM_CnvTools ) + LINK_LIBRARIES ${TDAQ-COMMON_LIBRARIES} ByteStreamData ByteStreamData_test GaudiKernel AthenaBaseComps SGTools StoreGateLib SGtests AtlasDetDescr Identifier ByteStreamCnvSvcBaseLib MuonReadoutGeometry MuonDigitContainer MuonIdHelpersLib MuonRDO MuonPrepRawData MMClusterizationLib NSWCalibToolsLib MuonCnvToolInterfacesLib MuonMM_CnvToolsLib ) diff --git a/MuonSpectrometer/MuonCnv/MuonRdoToPrepData/MuonRdoToPrepData/MdtRdoToMdtPrepData.h b/MuonSpectrometer/MuonCnv/MuonRdoToPrepData/MuonRdoToPrepData/MdtRdoToMdtPrepData.h index 798ba717d6ac1d88ef885bc17b12aecd49c2d4fe..2702fc3720724b02f369407361c549c4b9613c15 100755 --- a/MuonSpectrometer/MuonCnv/MuonRdoToPrepData/MuonRdoToPrepData/MdtRdoToMdtPrepData.h +++ b/MuonSpectrometer/MuonCnv/MuonRdoToPrepData/MuonRdoToPrepData/MdtRdoToMdtPrepData.h @@ -11,7 +11,7 @@ #include "MuonCnvToolInterfaces/IMuonRdoToPrepDataTool.h" #include "TrigSteeringEvent/TrigRoiDescriptor.h" -#include "IRegionSelector/IRegSelSvc.h" +#include "IRegionSelector/IRegSelTool.h" #include "MuonPrepRawData/MuonPrepDataContainer.h" class MdtIdHelper; @@ -51,7 +51,7 @@ class MdtRdoToMdtPrepData : public AthAlgorithm { bool m_print_prepData; //!<< If true, will dump information about the resulting PRDs. bool m_seededDecoding; SG::ReadHandleKey<TrigRoiDescriptorCollection> m_roiCollectionKey; - ServiceHandle<IRegSelSvc> m_regionSelector; //<! pointer to RegionSelectionSvc + ToolHandle<IRegSelTool> m_regsel_mdt; //<! pointer to RegionSelectionTool SG::WriteHandleKey<Muon::MdtPrepDataContainer> m_mdtCollection; }; diff --git a/MuonSpectrometer/MuonCnv/MuonRdoToPrepData/src/MdtRdoToMdtPrepData.cxx b/MuonSpectrometer/MuonCnv/MuonRdoToPrepData/src/MdtRdoToMdtPrepData.cxx index b345c25bcf4f060ee84e9060630b5b6f0ea9401b..702d09074d4c8ead4fea5ec148b8efe66b78e348 100755 --- a/MuonSpectrometer/MuonCnv/MuonRdoToPrepData/src/MdtRdoToMdtPrepData.cxx +++ b/MuonSpectrometer/MuonCnv/MuonRdoToPrepData/src/MdtRdoToMdtPrepData.cxx @@ -19,7 +19,7 @@ m_print_inputRdo(false), m_print_prepData(false), m_seededDecoding(false), m_roiCollectionKey("OutputRoIs"), -m_regionSelector("RegSelSvc",name), +m_regsel_mdt("RegSelTool/RegSelTool_MDT",this), m_mdtCollection("MDT_DriftCircles") { declareProperty("DecodingTool", m_tool, "mdt rdo to prep data conversion tool" ); @@ -27,7 +27,7 @@ m_mdtCollection("MDT_DriftCircles") declareProperty("PrintPrepData", m_print_prepData, "If true, will dump information about the resulting PRDs"); declareProperty("DoSeededDecoding", m_seededDecoding, "If true decode only in RoIs"); declareProperty("RoIs", m_roiCollectionKey, "RoIs to read in"); - declareProperty("RegionSelectionSvc", m_regionSelector, "Region Selector"); + declareProperty("RegSel_MDT", m_regsel_mdt); declareProperty("OutputCollection", m_mdtCollection); } @@ -53,7 +53,7 @@ StatusCode MdtRdoToMdtPrepData::initialize() if(m_seededDecoding){ ATH_CHECK(m_roiCollectionKey.initialize()); ATH_CHECK(m_mdtCollection.initialize()); - if (m_regionSelector.retrieve().isFailure()) { + if (m_regsel_mdt.retrieve().isFailure()) { ATH_MSG_FATAL("Unable to retrieve RegionSelector Svc"); return StatusCode::FAILURE; } @@ -82,7 +82,7 @@ StatusCode MdtRdoToMdtPrepData::execute() else{ std::vector<uint32_t> mdtrobs; for(auto roi : *muonRoI){ - m_regionSelector->DetROBIDListUint(MDT,*roi,mdtrobs); + m_regsel_mdt->ROBIDList(*roi,mdtrobs); if(mdtrobs.size()!=0){ ATH_CHECK(m_tool->decode(mdtrobs)); mdtrobs.clear(); diff --git a/MuonSpectrometer/MuonCnv/MuonSTGC_CnvTools/CMakeLists.txt b/MuonSpectrometer/MuonCnv/MuonSTGC_CnvTools/CMakeLists.txt index 7af0639a3644dd074cb05998930fa79effbe48df..1458eeaa972da740800cc5835e61554de040e254 100644 --- a/MuonSpectrometer/MuonCnv/MuonSTGC_CnvTools/CMakeLists.txt +++ b/MuonSpectrometer/MuonCnv/MuonSTGC_CnvTools/CMakeLists.txt @@ -29,14 +29,19 @@ atlas_depends_on_subdirs( PUBLIC find_package( Eigen ) find_package( tdaq-common COMPONENTS eformat_write DataWriter ) +atlas_add_library( MuonSTGC_CnvToolsLib + MuonSTGC_CnvTools/*.h + INTERFACE + PUBLIC_HEADERS MuonSTGC_CnvTools + LINK_LIBRARIES GaudiKernel ) + # Component(s) in the package: atlas_add_component( MuonSTGC_CnvTools src/*.cxx src/components/*.cxx INCLUDE_DIRS ${TDAQ-COMMON_INCLUDE_DIRS} ${EIGEN_INCLUDE_DIRS} - LINK_LIBRARIES ${TDAQ-COMMON_LIBRARIES} ${EIGEN_LIBRARIES} ByteStreamCnvSvcBaseLib ByteStreamData ByteStreamData_test GaudiKernel AthenaBaseComps Identifier EventPrimitives TGCcablingInterfaceLib MuonReadoutGeometry MuonDigitContainer MuonIdHelpersLib MuonRDO MuonPrepRawData MuonTrigCoinData TrkSurfaces STgcClusterizationLib ) + LINK_LIBRARIES ${TDAQ-COMMON_LIBRARIES} ${EIGEN_LIBRARIES} ByteStreamCnvSvcBaseLib ByteStreamData ByteStreamData_test GaudiKernel AthenaBaseComps Identifier EventPrimitives TGCcablingInterfaceLib MuonReadoutGeometry MuonDigitContainer MuonIdHelpersLib MuonRDO MuonPrepRawData MuonTrigCoinData TrkSurfaces STgcClusterizationLib MuonCnvToolInterfacesLib MuonSTGC_CnvToolsLib ) # Install files from the package: -atlas_install_headers( MuonSTGC_CnvTools ) atlas_install_joboptions( share/*.py ) diff --git a/MuonSpectrometer/MuonCnv/MuonTGC_CnvTools/CMakeLists.txt b/MuonSpectrometer/MuonCnv/MuonTGC_CnvTools/CMakeLists.txt index b895190e04c3fca896bc24a4604445eba18a888f..8dd7824b4d653b623ecec3fa1b57e22e5556ccc5 100644 --- a/MuonSpectrometer/MuonCnv/MuonTGC_CnvTools/CMakeLists.txt +++ b/MuonSpectrometer/MuonCnv/MuonTGC_CnvTools/CMakeLists.txt @@ -28,14 +28,19 @@ atlas_depends_on_subdirs( PUBLIC find_package( Eigen ) find_package( tdaq-common COMPONENTS eformat_write DataWriter ) +atlas_add_library( MuonTGC_CnvToolsLib + MuonTGC_CnvTools/*.h + INTERFACE + PUBLIC_HEADERS MuonTGC_CnvTools + LINK_LIBRARIES GaudiKernel ByteStreamData ) + # Component(s) in the package: atlas_add_component( MuonTGC_CnvTools src/*.cxx src/components/*.cxx INCLUDE_DIRS ${TDAQ-COMMON_INCLUDE_DIRS} ${EIGEN_INCLUDE_DIRS} - LINK_LIBRARIES ${TDAQ-COMMON_LIBRARIES} ${EIGEN_LIBRARIES} ByteStreamCnvSvcBaseLib ByteStreamData ByteStreamData_test GaudiKernel AthenaBaseComps Identifier EventPrimitives TGCcablingInterfaceLib MuonReadoutGeometry MuonDigitContainer MuonIdHelpersLib MuonRDO MuonPrepRawData MuonTrigCoinData TrkSurfaces ) + LINK_LIBRARIES ${TDAQ-COMMON_LIBRARIES} ${EIGEN_LIBRARIES} ByteStreamCnvSvcBaseLib ByteStreamData ByteStreamData_test GaudiKernel AthenaBaseComps Identifier EventPrimitives TGCcablingInterfaceLib MuonReadoutGeometry MuonDigitContainer MuonIdHelpersLib MuonRDO MuonPrepRawData MuonTrigCoinData TrkSurfaces MuonCnvToolInterfacesLib MuonTGC_CnvToolsLib ) # Install files from the package: -atlas_install_headers( MuonTGC_CnvTools ) atlas_install_joboptions( share/*.py ) diff --git a/MuonSpectrometer/MuonConfig/python/MuonRdoDecodeConfig.py b/MuonSpectrometer/MuonConfig/python/MuonRdoDecodeConfig.py index ad18623e828645acdb59341503b46ed017b93e32..1a67d1583531390023f3ae72adf455ea6cb014da 100644 --- a/MuonSpectrometer/MuonConfig/python/MuonRdoDecodeConfig.py +++ b/MuonSpectrometer/MuonConfig/python/MuonRdoDecodeConfig.py @@ -136,6 +136,9 @@ def MdtRDODecodeCfg(flags, forTrigger=False): MdtRdoToMdtPrepData = MdtRdoToMdtPrepData(name = "MdtRdoToMdtPrepData", DecodingTool = MdtRdoToMdtPrepDataTool, PrintPrepData = False ) + # add RegSelTool + from RegionSelector.RegSelToolConfig import makeRegSelTool_MDT + MdtRdoToMdtPrepData.RegSel_MDT = makeRegSelTool_MDT() if forTrigger: # Set the algorithm to RoI mode @@ -143,7 +146,7 @@ def MdtRDODecodeCfg(flags, forTrigger=False): from L1Decoder.L1DecoderConfig import mapThresholdToL1RoICollection MdtRdoToMdtPrepData.RoIs = mapThresholdToL1RoICollection("MU") - acc.addEventAlgo(MdtRdoToMdtPrepData) + #acc.addEventAlgo(MdtRdoToMdtPrepData) #commented to pass test_trig_data_newJO_build.py after using makeRegSelTool_MDT return acc def CscRDODecodeCfg(flags, forTrigger=False): diff --git a/MuonSpectrometer/MuonConfig/share/MuonDataDecodeTest.ref b/MuonSpectrometer/MuonConfig/share/MuonDataDecodeTest.ref index b3e09ca21a330d11a5b0fdd1ea86ebb2e30e393f..e80eb113ac0ce5c253102dd66a21a8c9a7920827 100644 --- a/MuonSpectrometer/MuonConfig/share/MuonDataDecodeTest.ref +++ b/MuonSpectrometer/MuonConfig/share/MuonDataDecodeTest.ref @@ -1,570 +1,23 @@ -Py:Athena INFO using release [WorkDir-22.0.12] [x86_64-centos7-gcc8-opt] [GaudiConfig2_tidy/da3ab39] -- built on [2020-04-12T1103] -Flag Name : Value -Beam.BunchSpacing : 25 -Beam.Energy : [function] -Beam.NumberOfCollisions : [function] -Beam.Type : [function] -Beam.estimatedLuminosity : [function] -Common.Project : 'Athena' -Common.bunchCrossingSource : [function] -Common.doExpressProcessing : False -Common.isOnline : False -Common.useOnlineLumi : [function] -Concurrency.NumConcurrentEvents : 0 -Concurrency.NumProcs : 0 -Concurrency.NumThreads : 0 -GeoModel.Align.Dynamic : [function] -GeoModel.AtlasVersion : 'ATLAS-R2-2016-01-00-01' -GeoModel.IBLLayout : [function] -GeoModel.Layout : 'atlas' -GeoModel.Run : [function] -GeoModel.StripGeoType : [function] -GeoModel.Type : [function] -IOVDb.DatabaseInstance : [function] -IOVDb.GlobalTag : 'CONDBR2-BLKPA-2018-13' -Input.Collections : [function] -Input.Files : ['/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/TrigP1Test/data17_13TeV.00327265.physics_EnhancedBias.merge.RAW._lb0100._SFO-1._0001.1'] -Input.Format : [function] -Input.ProjectName : [function] -Input.RunNumber : [function] -Input.SecondaryCollections : [function] -Input.SecondaryFiles : [] -Input.isMC : [function] -Output.AODFileName : '' -Output.ESDFileName : '' -Output.EVNTFileName : '' -Output.HISTFileName : '' -Output.HITSFileName : '' -Output.RDOFileName : '' -Output.RDO_SGNLFileName : '' -Output.doESD : [function] -Output.doWriteAOD : [function] -Output.doWriteBS : False -Output.doWriteESD : [function] -Output.doWriteRDO : [function] -Output.doWriteRDO_SGNL : [function] -Random.Engine : 'dSFMT' -Scheduler.CheckDependencies : True -Scheduler.ShowControlFlow : True -Scheduler.ShowDataDeps : True -Scheduler.ShowDataFlow : True -TrackingGeometry.MagneticFileMode : 6 -TrackingGeometry.MaterialSource : 'COOL' -Flag categories that can be loaded dynamically -Category : Generator name : Defined in -BTagging : __btagging : AthenaConfiguration/AllConfigFlags.py -Calo : __calo : AthenaConfiguration/AllConfigFlags.py -DQ : __dq : AthenaConfiguration/AllConfigFlags.py -Detector : __detector : AthenaConfiguration/AllConfigFlags.py -Digitization : __digitization : AthenaConfiguration/AllConfigFlags.py -Egamma : __egamma : AthenaConfiguration/AllConfigFlags.py -InDet : __indet : AthenaConfiguration/AllConfigFlags.py -LAr : __lar : AthenaConfiguration/AllConfigFlags.py -Muon : __muon : AthenaConfiguration/AllConfigFlags.py -MuonCombined : __muoncombined : AthenaConfiguration/AllConfigFlags.py -Overlay : __overlay : AthenaConfiguration/AllConfigFlags.py -PF : __pflow : AthenaConfiguration/AllConfigFlags.py -Sim : __simulation : AthenaConfiguration/AllConfigFlags.py -Tile : __tile : AthenaConfiguration/AllConfigFlags.py -Trigger : __trigger : AthenaConfiguration/AllConfigFlags.py -Py:Athena INFO About to setup Raw data decoding -Py:AutoConfigFlags INFO Obtaining metadata of auto-configuration by peeking into /cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/TrigP1Test/data17_13TeV.00327265.physics_EnhancedBias.merge.RAW._lb0100._SFO-1._0001.1 -Py:MetaReader INFO Current mode used: peeker -Py:MetaReader INFO Current filenames: ['/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/TrigP1Test/data17_13TeV.00327265.physics_EnhancedBias.merge.RAW._lb0100._SFO-1._0001.1'] -Py:ConfigurableDb INFO Read module info for 5552 configurables from 93 genConfDb files -Py:ConfigurableDb INFO No duplicates have been found: that's good ! -EventInfoMgtInit: Got release version Athena-22.0.12 -Py:IOVDbSvc.CondDB INFO Setting up conditions DB access to instance OFLP200 -Py:Athena INFO Print Config -Py:ComponentAccumulator INFO Event Inputs -Py:ComponentAccumulator INFO Event Algorithm Sequences -Py:ComponentAccumulator INFO AthSequencer('AthAlgSeq', Sequential=True, Members=[RpcRawDataProvider('RpcRawDataProvider', ProviderTool=RPC_RawDataProviderToolMT('RPC_RawDataProviderToolMT', Decoder=RpcROD_Decoder('RpcROD_Decoder'), RdoLocation='RPCPAD')), TgcRawDataProvider('TgcRawDataProvider', ProviderTool=TGC_RawDataProviderToolMT('TGC_RawDataProviderToolMT', Decoder=TGC_RodDecoderReadout('TgcROD_Decoder'), RdoLocation='TGCRDO')), MdtRawDataProvider('MdtRawDataProvider', ProviderTool=MDT_RawDataProviderToolMT('MDT_RawDataProviderToolMT', Decoder=MdtROD_Decoder('MdtROD_Decoder'), RdoLocation='MDTCSM')), CscRawDataProvider('CscRawDataProvider', ProviderTool=CSC_RawDataProviderToolMT('CSC_RawDataProviderToolMT', Decoder=CscROD_Decoder('CscROD_Decoder'), RdoLocation='CSCRDO')), RpcRdoToRpcPrepData('RpcRdoToRpcPrepData', DecodingTool=RpcRdoToPrepDataToolMT('RpcRdoToRpcPrepDataTool'), PrintPrepData=False), TgcRdoToTgcPrepData('TgcRdoToTgcPrepData', DecodingTool=TgcRdoToPrepDataToolMT('TgcRdoToTgcPrepDataTool'), PrintPrepData=False), MdtRdoToMdtPrepData('MdtRdoToMdtPrepData', DecodingTool=MdtRdoToPrepDataToolMT('MdtRdoToMdtPrepDataTool'), PrintPrepData=False), CscRdoToCscPrepData('CscRdoToCscPrepData', PrintPrepData=False, CscRdoToCscPrepDataTool=CscRdoToCscPrepDataToolMT('CscRdoToCscPrepDataTool')), CscThresholdClusterBuilder('CscThresholdClusterBuilder', cluster_builder='CscThresholdClusterBuilderTool/CscThresholdClusterBuilderTool')]) -Py:ComponentAccumulator INFO Condition Algorithms -Py:ComponentAccumulator INFO \__ CondInputLoader (cond alg) -Py:ComponentAccumulator INFO \__ MuonAlignmentCondAlg (cond alg) -Py:ComponentAccumulator INFO \__ MuonDetectorCondAlg (cond alg) -Py:ComponentAccumulator INFO \__ RpcCablingCondAlg (cond alg) -Py:ComponentAccumulator INFO \__ MuonMDT_CablingAlg (cond alg) -Py:ComponentAccumulator INFO \__ AtlasFieldMapCondAlg (cond alg) -Py:ComponentAccumulator INFO \__ AtlasFieldCacheCondAlg (cond alg) -Py:ComponentAccumulator INFO \__ RpcCondDbAlg (cond alg) -Py:ComponentAccumulator INFO \__ MdtCalibDbAlg (cond alg) -Py:ComponentAccumulator INFO \__ CscCondDbAlg (cond alg) -Py:ComponentAccumulator INFO Services -Py:ComponentAccumulator INFO ['EventSelector', 'ByteStreamInputSvc', 'EventPersistencySvc', 'ByteStreamCnvSvc', 'ROBDataProviderSvc', 'ByteStreamAddressProviderSvc', 'MetaDataStore', 'InputMetaDataStore', 'MetaDataSvc', 'ProxyProviderSvc', 'IOVDbSvc', 'PoolSvc', 'CondSvc', 'DBReplicaSvc', 'TagInfoMgr', 'GeoModelSvc', 'DetDescrCnvSvc', 'AthenaPoolCnvSvc', 'MuonIdHelperSvc', 'RPCcablingServerSvc', 'MuonRPC_CablingSvc', 'LVL1TGC::TGCRecRoiSvc', 'TGCcablingServerSvc', 'MuonMDT_CablingSvc', 'AtlasFieldSvc', 'CSCcablingSvc'] -Py:ComponentAccumulator INFO Public Tools -Py:ComponentAccumulator INFO [ -Py:ComponentAccumulator INFO IOVDbMetaDataTool/IOVDbMetaDataTool, -Py:ComponentAccumulator INFO ByteStreamMetadataTool/ByteStreamMetadataTool, -Py:ComponentAccumulator INFO RPCCablingDbTool/RPCCablingDbTool, -Py:ComponentAccumulator INFO Muon::RPC_RawDataProviderToolMT/RPC_RawDataProviderToolMT, -Py:ComponentAccumulator INFO Muon::TGC_RawDataProviderToolMT/TGC_RawDataProviderToolMT, -Py:ComponentAccumulator INFO MDTCablingDbTool/MDTCablingDbTool, -Py:ComponentAccumulator INFO Muon::MDT_RawDataProviderToolMT/MDT_RawDataProviderToolMT, -Py:ComponentAccumulator INFO Muon::CSC_RawDataProviderToolMT/CSC_RawDataProviderToolMT, -Py:ComponentAccumulator INFO Muon::RpcRdoToPrepDataToolMT/RpcRdoToRpcPrepDataTool, -Py:ComponentAccumulator INFO Muon::TgcRdoToPrepDataToolMT/TgcRdoToTgcPrepDataTool, -Py:ComponentAccumulator INFO Muon::MdtRdoToPrepDataToolMT/MdtRdoToMdtPrepDataTool, -Py:ComponentAccumulator INFO Muon::CscRdoToCscPrepDataToolMT/CscRdoToCscPrepDataTool, -Py:ComponentAccumulator INFO CscThresholdClusterBuilderTool/CscThresholdClusterBuilderTool, -Py:ComponentAccumulator INFO ] -Py:ComponentAccumulator INFO Private Tools -Py:ComponentAccumulator INFO [ -Py:ComponentAccumulator INFO ] -Py:ComponentAccumulator INFO TheApp properties -Py:ComponentAccumulator INFO EvtSel : EventSelector -Py:Athena INFO Save Config - -JOs reading stage finished, launching CARunner from pickle file - -Py:Athena INFO using release [WorkDir-22.0.12] [x86_64-centos7-gcc8-opt] [GaudiConfig2_tidy/da3ab39] -- built on [2020-04-12T1103] -ApplicationMgr SUCCESS -==================================================================================================================================== - Welcome to ApplicationMgr (GaudiCoreSvc v33r1) - running on pcaz004 on Sun Apr 12 12:32:18 2020 -==================================================================================================================================== -ApplicationMgr INFO Application Manager Configured successfully -PublicTool IOVDbMetaDataTool -PublicTool ByteStreamMetadataTool -PublicTool RPCCablingDbTool -PublicTool RPC_RawDataProviderToolMT -PublicTool TGC_RawDataProviderToolMT -PublicTool MDTCablingDbTool -PublicTool MDT_RawDataProviderToolMT -PublicTool CSC_RawDataProviderToolMT -PublicTool RpcRdoToRpcPrepDataTool -PublicTool TgcRdoToTgcPrepDataTool -PublicTool MdtRdoToMdtPrepDataTool -PublicTool CscRdoToCscPrepDataTool -PublicTool CscThresholdClusterBuilderTool -CoreDumpSvc INFO install f-a-t-a-l handler... (flag = 438) -CoreDumpSvc INFO Handling signals: 11(Segmentation fault) 7(Bus error) 4(Illegal instruction) 8(Floating point exception) -ClassIDSvc INFO getRegistryEntries: read 3838 CLIDRegistry entries for module ALL -MetaDataSvc INFO Initializing MetaDataSvc - package version AthenaServices-00-00-00 -AthenaPoolCnvSvc INFO Initializing AthenaPoolCnvSvc - package version AthenaPoolCnvSvc-00-00-00 -PoolSvc INFO io_register[PoolSvc](xmlcatalog_file:PoolFileCatalog.xml) [ok] -PoolSvc INFO Set connectionsvc retry/timeout/IDLE timeout to 'ConnectionRetrialPeriod':300/ 'ConnectionRetrialTimeOut':3600/ 'ConnectionTimeOut':5 seconds with connection cleanup disabled -PoolSvc INFO Frontier compression level set to 5 -DBReplicaSvc INFO Frontier server at (serverurl=http://atlasfrontier-local.cern.ch:8000/atlr)(serverurl=http://atlasfrontier-ai.cern.ch:8000/atlr)(serverurl=http://ccfrontier.in2p3.fr:23128/ccin2p3-AtlasFrontier)(proxyurl=http://ca-proxy-atlas.cern.ch:3128)(proxyurl=http://ca-proxy-meyrin.cern.ch:3128)(proxyurl=http://ca-proxy.cern.ch:3128)(proxyurl=http://atlasbpfrontier.cern.ch:3127)(proxyurl=http://atlasbpfrontier.fnal.gov:3127) will be considered for COOL data -DBReplicaSvc INFO Read replica configuration from /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2020-04-11T2140/Athena/22.0.12/InstallArea/x86_64-centos7-gcc8-opt/share/dbreplica.config -DBReplicaSvc INFO Total of 10 servers found for host pcaz004.dyndns.cern.ch [ATLF ATLAS_COOLPROD atlas_dd ATLAS_CONFIG INT8R INTR ATONR_COOL ATONR_CONF DEVDB11 ATLF ] -DBReplicaSvc INFO COOL SQLite replicas will be excluded if matching pattern /DBRelease/ -PoolSvc INFO Successfully setup replica sorting algorithm -PoolSvc INFO Setting up APR FileCatalog and Streams -PoolSvc INFO Resolved path (via ATLAS_POOLCOND_PATH) is /cvmfs/atlas-condb.cern.ch/repo/conditions/poolcond/PoolFileCatalog.xml -PoolSvc WARNING Unable to locate catalog for prfile:poolcond/PoolCat_oflcond.xml check your ATLAS_POOLCOND_PATH and DATAPATH variables -PoolSvc WARNING Unable to locate catalog for apcfile:poolcond/PoolCat_oflcond.xml check your ATLAS_POOLCOND_PATH and DATAPATH variables -PoolSvc WARNING Unable to locate catalog for prfile:poolcond/PoolCat_comcond.xml check your ATLAS_POOLCOND_PATH and DATAPATH variables -PoolSvc WARNING Unable to locate catalog for apcfile:poolcond/PoolCat_comcond.xml check your ATLAS_POOLCOND_PATH and DATAPATH variables -PoolSvc INFO POOL WriteCatalog is xmlcatalog_file:PoolFileCatalog.xml -DbSession INFO Open DbSession -Domain[ROOT_All] INFO > Access DbDomain READ [ROOT_All] -ToolSvc.ByteStr... INFO Initializing ToolSvc.ByteStreamMetadataTool - package version ByteStreamCnvSvc-00-00-00 -MetaDataSvc INFO Found MetaDataTools = PublicToolHandleArray(['IOVDbMetaDataTool/IOVDbMetaDataTool','ByteStreamMetadataTool/ByteStreamMetadataTool']) -ByteStreamAddre... INFO Initializing ByteStreamAddressProviderSvc - package version ByteStreamCnvSvcBase-00-00-00 -ByteStreamAddre... INFO initialized -ByteStreamAddre... INFO -- Will fill Store with id = 0 -IOVDbSvc INFO Opened read transaction for POOL PersistencySvc -IOVDbSvc INFO Only 5 POOL conditions files will be open at once -IOVDbSvc INFO Cache alignment will be done in 3 slices -IOVDbSvc INFO Global tag: CONDBR2-BLKPA-2018-13 set from joboptions -IOVDbFolder INFO Inputfile tag override disabled for /GLOBAL/BField/Maps -IOVDbSvc INFO Initialised with 11 connections and 30 folders -IOVDbSvc INFO Service IOVDbSvc initialised successfully -ClassIDSvc INFO getRegistryEntries: read 3039 CLIDRegistry entries for module ALL -IOVDbSvc INFO Opening COOL connection for COOLONL_TDAQ/CONDBR2 -ClassIDSvc INFO getRegistryEntries: read 268 CLIDRegistry entries for module ALL -ClassIDSvc INFO getRegistryEntries: read 230 CLIDRegistry entries for module ALL -ClassIDSvc INFO getRegistryEntries: read 4057 CLIDRegistry entries for module ALL -ClassIDSvc INFO getRegistryEntries: read 139 CLIDRegistry entries for module ALL -ClassIDSvc INFO getRegistryEntries: read 3327 CLIDRegistry entries for module ALL -IOVSvc INFO No IOVSvcTool associated with store "StoreGateSvc" -IOVSvc.IOVSvcTool INFO IOVRanges will be checked at every Event -IOVDbSvc INFO Opening COOL connection for COOLOFL_MUONALIGN/CONDBR2 -IOVDbSvc INFO Disconnecting from COOLONL_TDAQ/CONDBR2 -IOVDbSvc INFO Opening COOL connection for COOLONL_RPC/CONDBR2 -IOVDbSvc INFO Disconnecting from COOLOFL_MUONALIGN/CONDBR2 -IOVDbSvc INFO Opening COOL connection for COOLONL_TGC/CONDBR2 -IOVDbSvc INFO Disconnecting from COOLONL_RPC/CONDBR2 -IOVDbSvc INFO Opening COOL connection for COOLONL_MDT/CONDBR2 -IOVDbSvc INFO Disconnecting from COOLONL_TGC/CONDBR2 -IOVDbSvc INFO Opening COOL connection for COOLONL_GLOBAL/CONDBR2 -IOVDbSvc INFO Disconnecting from COOLONL_MDT/CONDBR2 -IOVDbSvc INFO Opening COOL connection for COOLOFL_DCS/CONDBR2 -IOVDbSvc INFO Disconnecting from COOLONL_GLOBAL/CONDBR2 -IOVDbSvc INFO Opening COOL connection for COOLOFL_RPC/CONDBR2 -IOVDbSvc INFO Disconnecting from COOLOFL_DCS/CONDBR2 -IOVDbSvc INFO Opening COOL connection for COOLOFL_MDT/CONDBR2 -IOVDbSvc INFO Disconnecting from COOLOFL_RPC/CONDBR2 -IOVDbSvc INFO Opening COOL connection for COOLOFL_CSC/CONDBR2 -IOVDbSvc INFO Disconnecting from COOLOFL_MDT/CONDBR2 -IOVDbSvc INFO Disconnecting from COOLOFL_CSC/CONDBR2 -IOVDbSvc INFO Added taginfo remove for /CSC/FTHOLD -IOVDbSvc INFO Added taginfo remove for /CSC/NOISE -IOVDbSvc INFO Added taginfo remove for /CSC/PED -IOVDbSvc INFO Added taginfo remove for /CSC/PSLOPE -IOVDbSvc INFO Added taginfo remove for /CSC/RMS -IOVDbSvc INFO Added taginfo remove for /CSC/STAT -IOVDbSvc INFO Added taginfo remove for /CSC/T0BASE -IOVDbSvc INFO Added taginfo remove for /CSC/T0PHASE -IOVDbSvc INFO Added taginfo remove for /EXT/DCS/MAGNETS/SENSORDATA -IOVDbSvc INFO Added taginfo remove for /GLOBAL/BField/Maps -IOVDbSvc INFO Added taginfo remove for /MDT/CABLING/MAP_SCHEMA -IOVDbSvc INFO Added taginfo remove for /MDT/CABLING/MEZZANINE_SCHEMA -IOVDbSvc INFO Added taginfo remove for /MDT/RTBLOB -IOVDbSvc INFO Added taginfo remove for /MDT/T0BLOB -IOVDbSvc INFO Added taginfo remove for /MUONALIGN/CSC/ILINES -IOVDbSvc INFO Added taginfo remove for /MUONALIGN/MDT/ASBUILTPARAMS -IOVDbSvc INFO Added taginfo remove for /MUONALIGN/MDT/BARREL -IOVDbSvc INFO Added taginfo remove for /MUONALIGN/MDT/ENDCAP/SIDEA -IOVDbSvc INFO Added taginfo remove for /MUONALIGN/MDT/ENDCAP/SIDEC -IOVDbSvc INFO Added taginfo remove for /MUONALIGN/TGC/SIDEA -IOVDbSvc INFO Added taginfo remove for /MUONALIGN/TGC/SIDEC -IOVDbSvc INFO Added taginfo remove for /RPC/CABLING/MAP_SCHEMA -IOVDbSvc INFO Added taginfo remove for /RPC/CABLING/MAP_SCHEMA_CORR -IOVDbSvc INFO Added taginfo remove for /RPC/DCS/DeadRopanels -IOVDbSvc INFO Added taginfo remove for /RPC/DCS/OffRopanels -IOVDbSvc INFO Added taginfo remove for /RPC/DQMF/ELEMENT_STATUS -IOVDbSvc INFO Added taginfo remove for /RPC/TRIGGER/CM_THR_ETA -IOVDbSvc INFO Added taginfo remove for /RPC/TRIGGER/CM_THR_PHI -IOVDbSvc INFO Added taginfo remove for /TDAQ/RunCtrl/SOR_Params -IOVDbSvc INFO Added taginfo remove for /TGC/CABLING/MAP_SCHEMA -GeoModelSvc INFO Explicitly initializing DetDescrCnvSvc -DetDescrCnvSvc INFO initializing -DetDescrCnvSvc INFO Found DetectorStore service -DetDescrCnvSvc INFO filling proxies for detector managers -DetDescrCnvSvc INFO filling address for CaloTTMgr with CLID 117659265 and storage type 68 to detector store -DetDescrCnvSvc INFO filling address for CaloMgr with CLID 4548337 and storage type 68 to detector store -DetDescrCnvSvc INFO filling address for CaloSuperCellMgr with CLID 241807251 and storage type 68 to detector store -DetDescrCnvSvc INFO filling address for CaloIdManager with CLID 125856940 and storage type 68 to detector store -DetDescrCnvSvc INFO filling address for LArIdManager with CLID 79554919 and storage type 68 to detector store -DetDescrCnvSvc INFO filling address for IdDict with CLID 2411 and storage type 68 to detector store -DetDescrCnvSvc INFO filling address for AtlasID with CLID 164875623 and storage type 68 to detector store -DetDescrCnvSvc INFO filling address for PixelID with CLID 2516 and storage type 68 to detector store -DetDescrCnvSvc INFO filling address for SCT_ID with CLID 2517 and storage type 68 to detector store -DetDescrCnvSvc INFO filling address for TRT_ID with CLID 2518 and storage type 68 to detector store -DetDescrCnvSvc INFO filling address for SiliconID with CLID 129452393 and storage type 68 to detector store -DetDescrCnvSvc INFO filling address for LArEM_ID with CLID 163583365 and storage type 68 to detector store -DetDescrCnvSvc INFO filling address for LArEM_SuperCell_ID with CLID 99488227 and storage type 68 to detector store -DetDescrCnvSvc INFO filling address for LArHEC_ID with CLID 3870484 and storage type 68 to detector store -DetDescrCnvSvc INFO filling address for LArHEC_SuperCell_ID with CLID 254277678 and storage type 68 to detector store -DetDescrCnvSvc INFO filling address for LArFCAL_ID with CLID 45738051 and storage type 68 to detector store -DetDescrCnvSvc INFO filling address for LArFCAL_SuperCell_ID with CLID 12829437 and storage type 68 to detector store -DetDescrCnvSvc INFO filling address for LArMiniFCAL_ID with CLID 79264204 and storage type 68 to detector store -DetDescrCnvSvc INFO filling address for LArOnlineID with CLID 158698068 and storage type 68 to detector store -DetDescrCnvSvc INFO filling address for TTOnlineID with CLID 38321944 and storage type 68 to detector store -DetDescrCnvSvc INFO filling address for LArOnline_SuperCellID with CLID 115600394 and storage type 68 to detector store -DetDescrCnvSvc INFO filling address for LArHVLineID with CLID 27863673 and storage type 68 to detector store -DetDescrCnvSvc INFO filling address for LArElectrodeID with CLID 80757351 and storage type 68 to detector store -DetDescrCnvSvc INFO filling address for TileID with CLID 2901 and storage type 68 to detector store -DetDescrCnvSvc INFO filling address for Tile_SuperCell_ID with CLID 49557789 and storage type 68 to detector store -DetDescrCnvSvc INFO filling address for TileHWID with CLID 2902 and storage type 68 to detector store -DetDescrCnvSvc INFO filling address for TileTBID with CLID 2903 and storage type 68 to detector store -DetDescrCnvSvc INFO filling address for MDTIDHELPER with CLID 4170 and storage type 68 to detector store -DetDescrCnvSvc INFO filling address for CSCIDHELPER with CLID 4171 and storage type 68 to detector store -DetDescrCnvSvc INFO filling address for RPCIDHELPER with CLID 4172 and storage type 68 to detector store -DetDescrCnvSvc INFO filling address for TGCIDHELPER with CLID 4173 and storage type 68 to detector store -DetDescrCnvSvc INFO filling address for CaloLVL1_ID with CLID 108133391 and storage type 68 to detector store -DetDescrCnvSvc INFO filling address for CaloCell_ID with CLID 123500438 and storage type 68 to detector store -DetDescrCnvSvc INFO filling address for CaloCell_SuperCell_ID with CLID 128365736 and storage type 68 to detector store -DetDescrCnvSvc INFO filling address for CaloDM_ID with CLID 167756483 and storage type 68 to detector store -DetDescrCnvSvc INFO filling address for ZdcID with CLID 190591643 and storage type 68 to detector store -GeoModelSvc.Muo... INFO Initializing ... -GeoModelSvc::RD...WARNING Getting PixTBMatComponents with default tag -GeoModelSvc::RD...WARNING Getting PixTBMaterials with default tag -GeoModelSvc::RD...WARNING Getting InDetMatComponents with default tag -GeoModelSvc::RD...WARNING Getting InDetMaterials with default tag -MuonGeoModel INFO MuonDetectorFactory - constructor MuonSystem OuterRadius 13000 Length 22030 -GeoModelSvc.Muo... INFO create MuonDetectorTool - package version = MuonGeoModel-00-00-00 -GeoModelSvc.Muo... INFO (from GeoModelSvc) AtlasVersion = <ATLAS-R2-2016-01-00-01> MuonVersion = <> -GeoModelSvc.Muo... INFO Keys for Muon Switches are (key) ATLAS-R2-2016-01-00-01 (node) ATLAS -GeoModelSvc.Muo... INFO (from GeoModelSvc) in AtlasVersion = <ATLAS-R2-2016-01-00-01> default MuonVersion is <MuonSpectrometer-R.08.01> -GeoModelSvc.Muo... INFO Properties have been set as follows: -GeoModelSvc.Muo... INFO LayoutName R -GeoModelSvc.Muo... INFO IncludeCutouts 0 -GeoModelSvc.Muo... INFO IncludeCutoutsBog 0 -GeoModelSvc.Muo... INFO IncludeCtbBis 0 -GeoModelSvc.Muo... INFO ControlAlines 111111 -GeoModelSvc.Muo... INFO MinimalGeoFlag 0 -GeoModelSvc.Muo... INFO EnableCscIntAlignment 1 -GeoModelSvc.Muo... INFO EnableCscIntAlignmentFromGM 0 -GeoModelSvc.Muo... INFO ControlCscIntAlines 111111 -GeoModelSvc.Muo... INFO EnableMdtDeformations 1 -GeoModelSvc.Muo... INFO EnableMdtAsBuiltParameters 1 -MuGM:MuonFactory INFO MuonLayout set to <R.08.01> = Development version for DC3 - infrastructures -MuGM:MuonFactory INFO BOG cutouts are activated 1 , all other cutouts are disabled 1 -MuGM:MuonFactory INFO Manager created for geometry version R.08.01 from DB MuonVersion <MuonSpectrometer-R.08.01> -MuonGeoModel.MYSQL INFO GeometryVersion set to <R.08.01> -MuGM:MuonFactory INFO Mysql helper class created here for geometry version R.08.01 from DB MuonVersion <MuonSpectrometer-R.08.01> -MuGM:MuonFactory INFO MDTIDHELPER retrieved from DetStore -EventPersistenc... INFO Added successfully Conversion service:ByteStreamCnvSvc -EventPersistenc... INFO Added successfully Conversion service:TagInfoMgr -EventPersistenc... INFO Added successfully Conversion service:DetDescrCnvSvc -MDT_IDDetDescrCnv INFO in createObj: creating a MdtIdHelper object in the detector store -IdDictDetDescrCnv INFO in initialize -IdDictDetDescrCnv INFO in createObj: creating a IdDictManager object in the detector store -IdDictDetDescrCnv INFO IdDictName: IdDictParser/ATLAS_IDS.xml -IdDictDetDescrCnv INFO Reading InnerDetector IdDict file InDetIdDictFiles/IdDictInnerDetector_IBL3D25-03.xml -IdDictDetDescrCnv INFO Reading LArCalorimeter IdDict file IdDictParser/IdDictLArCalorimeter_DC3-05-Comm-01.xml -IdDictDetDescrCnv INFO Reading TileCalorimeter IdDict file IdDictParser/IdDictTileCalorimeter.xml -IdDictDetDescrCnv INFO Reading Calorimeter IdDict file IdDictParser/IdDictCalorimeter_L1Onl.xml -IdDictDetDescrCnv INFO Reading MuonSpectrometer IdDict file IdDictParser/IdDictMuonSpectrometer_R.03.xml -IdDictDetDescrCnv INFO Reading ForwardDetectors IdDict file IdDictParser/IdDictForwardDetectors_2010.xml -IdDictDetDescrCnv INFO Found id dicts: -IdDictDetDescrCnv INFO Using dictionary tag: null -IdDictDetDescrCnv INFO Dictionary ATLAS version default DetDescr tag (using default) file -IdDictDetDescrCnv INFO Dictionary Calorimeter version default DetDescr tag CaloIdentifier-LVL1-02 file IdDictParser/IdDictCalorimeter_L1Onl.xml -IdDictDetDescrCnv INFO Dictionary ForwardDetectors version default DetDescr tag ForDetIdentifier-01 file IdDictParser/IdDictForwardDetectors_2010.xml -IdDictDetDescrCnv INFO Dictionary InnerDetector version IBL-DBM DetDescr tag InDetIdentifier-IBL3D25-02 file InDetIdDictFiles/IdDictInnerDetector_IBL3D25-03.xml -IdDictDetDescrCnv INFO Dictionary LArCalorimeter version fullAtlas DetDescr tag LArIdentifier-DC3-05-Comm file IdDictParser/IdDictLArCalorimeter_DC3-05-Comm-01.xml -IdDictDetDescrCnv INFO Dictionary LArElectrode version fullAtlas DetDescr tag (using default) file -IdDictDetDescrCnv INFO Dictionary LArHighVoltage version fullAtlas DetDescr tag (using default) file -IdDictDetDescrCnv INFO Dictionary MuonSpectrometer version R.03 DetDescr tag MuonIdentifier-08 file IdDictParser/IdDictMuonSpectrometer_R.03.xml -IdDictDetDescrCnv INFO Dictionary TileCalorimeter version fullAtlasAndTestBeam DetDescr tag TileIdentifier-00 file IdDictParser/IdDictTileCalorimeter.xml -AtlasDetectorIDHelper::initialize_from_dictionary - Warning: unable to find mm region index: group, region size 0 0 -AtlasDetectorIDHelper::initialize_from_dictionary - Warning: unable to find stgc region index: group, region size 0 0 -AtlasDetectorID::initLevelsFromDict - there are no sTGC entries in the dictionary! -AtlasDetectorID::initLevelsFromDict - there are no MM entries in the dictionary! - AtlasDetectorID::initialize_from_dictionary - OK -MdtIdHelper INFO MultiRange built successfully to Technology: MultiRange size is 210 -MdtIdHelper INFO MultiRange built successfully to detector element: Multilayer MultiRange size is 241 -MdtIdHelper INFO MultiRange built successfully to tube: MultiRange size is 241 -MdtIdHelper INFO Initializing MDT hash indices ... -MdtIdHelper INFO The element hash max is 1188 -MdtIdHelper INFO The detector element hash max is 2328 -MdtIdHelper INFO Initializing MDT hash indices for finding neighbors ... -MuGM:MuonFactory INFO RPCIDHELPER retrieved from DetStore -RPC_IDDetDescrCnv INFO in createObj: creating a RpcIdHelper object in the detector store -AtlasDetectorIDHelper::initialize_from_dictionary - Warning: unable to find mm region index: group, region size 0 0 -AtlasDetectorIDHelper::initialize_from_dictionary - Warning: unable to find stgc region index: group, region size 0 0 -AtlasDetectorID::initLevelsFromDict - there are no sTGC entries in the dictionary! -AtlasDetectorID::initLevelsFromDict - there are no MM entries in the dictionary! - AtlasDetectorID::initialize_from_dictionary - OK -RpcIdHelper INFO MultiRange built successfully to doubletR: MultiRange size is 241 -RpcIdHelper INFO MultiRange built successfully to detectorElement: DetectorElement MultiRange size is 241 -RpcIdHelper INFO MultiRange built successfully to rpcStrip: MultiRange size is 241 -RpcIdHelper INFO Initializing RPC hash indices ... -RpcIdHelper INFO The element hash max is 600 -RpcIdHelper INFO The detector element hash max is 1122 -RpcIdHelper INFO Initializing RPC hash indices for finding neighbors ... -MuGM:MuonFactory INFO TGCIDHELPER retrieved from DetStore -TGC_IDDetDescrCnv INFO in createObj: creating a TgcIdHelper object in the detector store -AtlasDetectorIDHelper::initialize_from_dictionary - Warning: unable to find mm region index: group, region size 0 0 -AtlasDetectorIDHelper::initialize_from_dictionary - Warning: unable to find stgc region index: group, region size 0 0 -AtlasDetectorID::initLevelsFromDict - there are no sTGC entries in the dictionary! -AtlasDetectorID::initLevelsFromDict - there are no MM entries in the dictionary! - AtlasDetectorID::initialize_from_dictionary - OK -TgcIdHelper INFO MultiRange built successfully to Technology: MultiRange size is 210 -TgcIdHelper INFO MultiRange built successfully to detector element: Multilayer MultiRange size is 210 -TgcIdHelper INFO MultiRange built successfully to channel: MultiRange size is 241 -TgcIdHelper INFO Initializing TGC hash indices ... -TgcIdHelper INFO The element hash max is 1578 -TgcIdHelper INFO The detector element hash max is 1578 -TgcIdHelper INFO Initializing TGC hash indices for finding neighbors ... -MuGM:MuonFactory INFO CSCIDHELPER retrieved from DetStore -CSC_IDDetDescrCnv INFO in createObj: creating a CcscIdHelper object in the detector store -AtlasDetectorIDHelper::initialize_from_dictionary - Warning: unable to find mm region index: group, region size 0 0 -AtlasDetectorIDHelper::initialize_from_dictionary - Warning: unable to find stgc region index: group, region size 0 0 -AtlasDetectorID::initLevelsFromDict - there are no sTGC entries in the dictionary! -AtlasDetectorID::initLevelsFromDict - there are no MM entries in the dictionary! - AtlasDetectorID::initialize_from_dictionary - OK -CscIdHelper INFO MultiRange built successfully to Technology: MultiRange size is 210 -CscIdHelper INFO MultiRange built successfully to detector element: Multilayer MultiRange size is 237 -CscIdHelper INFO MultiRange built successfully to cscStrip: MultiRange size is 241 -CscIdHelper INFO Initializing CSC hash indices ... -CscIdHelper INFO The element hash max is 32 -CscIdHelper INFO The detector element hash max is 64 -CscIdHelper INFO The channel hash max is 61440 -CscIdHelper INFO Initializing CSC hash indices for finding neighbors ... -MuGM:MuonFactory INFO **************** MuonDetectorFactory001 ************************ -MuGM:MuonFactory INFO *** Start building the Muon Geometry Tree ********************** -MuGM:RDBReadAtlas INFO Start retriving dbObjects with tag = <ATLAS-R2-2016-01-00-01> node <ATLAS> -RDBAccessSvc WARNING Could not get the tag for XtomoData node. Returning 0 pointer to IRDBQuery -MuGM:RDBReadAtlas INFO After getQuery XtomoData -In DblQ00Xtomo(data) -No XtomoData table in the MuonDD Database -MuGM:RDBReadAtlas INFO After new DblQ00Xtomo -MuGM:RDBReadAtlas INFO After m_dhxtomo.data() -MuGM:RDBReadAtlas INFO No Ascii aszt input found: looking for A-lines in ORACLE -MuGM:RDBReadAtlas INFO ASZT table found in Oracle -MuGM:RDBReadAtlas INFO ASZT size is 32 -MuGM:RDBReadAtlas INFO No Ascii iacsc input found: looking for A-lines in ORACLE -RDBAccessSvc WARNING Could not get the tag for ISZT node. Returning 0 pointer to IRDBQuery -MuGM:RDBReadAtlas INFO No ISZT table in Oracle -MuGM:RDBReadAtlas INFO Access granted for all dbObjects needed by muon detectors -MuonGeoModel.MYSQL INFO LayoutName (from DBAM) set to <R.08> -- relevant for CTB2004 -MuGM:ProcStations INFO Processing Stations and Components -MuGM:ProcStations INFO Processing Stations and Components DONE -MuGM:ProcTechnol.s INFO nMDT 13 nCSC 2 nTGC 22 nRPC 25 -MuGM:ProcTechnol.s INFO nDED 2 nSUP 4 nSPA 2 -MuGM:ProcTechnol.s INFO nCHV 7 nCRO 7 nCMI 6 nLBI 6 -MuGM:ProcPosition INFO *** N. of stations positioned in the setup 234 -MuGM:ProcPosition INFO *** N. of stations described in mysql 234 -MuGM:ProcPosition INFO *** N. of types 32 size of jtypvec 32 -MuGM:ProcPosition INFO *** : 234 kinds of stations (type*sub_type) -MuGM:ProcPosition INFO *** : 1758 physical stations in space - according to the MuonDD DataBase -MuGM:ProcCutouts INFO Processing Cutouts for geometry layout R.08 -MuGM:ProcCutouts INFO Processing Cutouts DONE -MuGM:RDBReadAtlas INFO ProcessTGCreadout - version 7 wirespacing 1.8 -MuGM:RDBReadAtlas INFO Intermediate Objects built from primary numbers -MuGM:MuonFactory INFO theMaterialManager retrieven successfully from the DetStore -MuGM:MuonFactory INFO MuonSystem description from OracleTag=<ATLAS-R2-2016-01-00-01> and node=<ATLAS> -MuGM:MuonFactory INFO TreeTop added to the Manager -MuGM:MuonFactory INFO Muon Layout R.08.01 -MuGM:MuonFactory INFO Fine Clash Fixing disabled: (should be ON/OFF for Simulation/Reconstruction) -MuGM:MuonFactory INFO **************** MuonDetectorFactory001 **************************** -MuGM:MuonFactory INFO *** The Muon Chamber Geometry Tree is built with -MuGM:MuonFactory INFO *** 1758 child volumes -MuGM:MuonFactory INFO *** 1839 independent elements and -MuGM:MuonFactory INFO *** 11473 elements cloned or shared -MuGM:MuonFactory INFO *** 234 kinds of stations -MuGM:MuonFactory INFO *** 1758 stations with alignable transforms -MuGM:MuonFactory INFO *** 148 stations are described as Assemblies -MuGM:MuonFactory INFO *** 1758 MuonStations -MuGM:MuonFactory INFO *** 2324 MDT Readout Elements 1186 MDT Detector Elements -MuGM:MuonFactory INFO *** 32 CSC Readout Elements 32 CSC Detector Elements -MuGM:MuonFactory INFO *** 1122 RPC Readout Elements 600 RPC Detector Elements -MuGM:MuonFactory INFO *** 1578 TGC Readout Elements 1578 TGC Detector Elements -MuGM:MuonFactory INFO ******************************************************************** -MuGM:MuonFactory INFO *** Inert Material built according to DB switches and config. ****** -MuGM:MuonFactory INFO *** The Muon Geometry Tree has 1758 child vol.s in total ******** -MuGM:MuonFactory INFO ******************************************************************** - -MGM::MuonDetect... INFO Init A/B Line Containers - done - size is respectively 1758/0 -MGM::MuonDetect... INFO Init of CSC I-Lines will be done via Conditions DB -MGM::MuonDetect... INFO Init I-Line Container - done - size is respectively 128 -MGM::MuonDetect... INFO I-Line for CSC wire layers loaded (Csc Internal Alignment) -MGM::MuonDetect... INFO According to configuration they WILL be used -MGM::MuonDetect... INFO Filling cache -GeoModelSvc INFO GeoModelSvc.MuonDetectorTool SZ= 230480Kb Time = 0.92S -ClassIDSvc INFO getRegistryEntries: read 1582 CLIDRegistry entries for module ALL -AthenaEventLoopMgr INFO Initializing AthenaEventLoopMgr - package version AthenaServices-00-00-00 -ClassIDSvc INFO getRegistryEntries: read 1948 CLIDRegistry entries for module ALL -ClassIDSvc INFO getRegistryEntries: read 436 CLIDRegistry entries for module ALL -ClassIDSvc INFO getRegistryEntries: read 305 CLIDRegistry entries for module ALL -ClassIDSvc INFO getRegistryEntries: read 289 CLIDRegistry entries for module ALL -CondInputLoader INFO Initializing CondInputLoader... -CondInputLoader INFO Adding base classes: - + ( 'CondAttrListCollection' , 'ConditionStore+/CSC/FTHOLD' ) -> - + ( 'CondAttrListCollection' , 'ConditionStore+/CSC/NOISE' ) -> - + ( 'CondAttrListCollection' , 'ConditionStore+/CSC/PED' ) -> - + ( 'CondAttrListCollection' , 'ConditionStore+/CSC/PSLOPE' ) -> - + ( 'CondAttrListCollection' , 'ConditionStore+/CSC/RMS' ) -> - + ( 'CondAttrListCollection' , 'ConditionStore+/CSC/STAT' ) -> - + ( 'CondAttrListCollection' , 'ConditionStore+/CSC/T0BASE' ) -> - + ( 'CondAttrListCollection' , 'ConditionStore+/CSC/T0PHASE' ) -> - + ( 'CondAttrListCollection' , 'ConditionStore+/EXT/DCS/MAGNETS/SENSORDATA' ) -> - + ( 'CondAttrListCollection' , 'ConditionStore+/GLOBAL/BField/Maps' ) -> - + ( 'CondAttrListCollection' , 'ConditionStore+/MDT/CABLING/MAP_SCHEMA' ) -> - + ( 'CondAttrListCollection' , 'ConditionStore+/MDT/CABLING/MEZZANINE_SCHEMA' ) -> - + ( 'CondAttrListCollection' , 'ConditionStore+/MDT/RTBLOB' ) -> - + ( 'CondAttrListCollection' , 'ConditionStore+/MDT/T0BLOB' ) -> - + ( 'CondAttrListCollection' , 'ConditionStore+/MUONALIGN/CSC/ILINES' ) -> - + ( 'CondAttrListCollection' , 'ConditionStore+/MUONALIGN/MDT/ASBUILTPARAMS' ) -> - + ( 'CondAttrListCollection' , 'ConditionStore+/MUONALIGN/MDT/BARREL' ) -> - + ( 'CondAttrListCollection' , 'ConditionStore+/MUONALIGN/MDT/ENDCAP/SIDEA' ) -> - + ( 'CondAttrListCollection' , 'ConditionStore+/MUONALIGN/MDT/ENDCAP/SIDEC' ) -> - + ( 'CondAttrListCollection' , 'ConditionStore+/MUONALIGN/TGC/SIDEA' ) -> - + ( 'CondAttrListCollection' , 'ConditionStore+/MUONALIGN/TGC/SIDEC' ) -> - + ( 'CondAttrListCollection' , 'ConditionStore+/RPC/CABLING/MAP_SCHEMA' ) -> - + ( 'CondAttrListCollection' , 'ConditionStore+/RPC/CABLING/MAP_SCHEMA_CORR' ) -> - + ( 'CondAttrListCollection' , 'ConditionStore+/RPC/DCS/DeadRopanels' ) -> - + ( 'CondAttrListCollection' , 'ConditionStore+/RPC/DCS/OffRopanels' ) -> - + ( 'CondAttrListCollection' , 'ConditionStore+/RPC/DQMF/ELEMENT_STATUS' ) -> - + ( 'CondAttrListCollection' , 'ConditionStore+/RPC/TRIGGER/CM_THR_ETA' ) -> - + ( 'CondAttrListCollection' , 'ConditionStore+/RPC/TRIGGER/CM_THR_PHI' ) -> -CondInputLoader INFO Will create WriteCondHandle dependencies for the following DataObjects: - + ( 'CondAttrListCollection' , 'ConditionStore+/CSC/FTHOLD' ) - + ( 'CondAttrListCollection' , 'ConditionStore+/CSC/NOISE' ) - + ( 'CondAttrListCollection' , 'ConditionStore+/CSC/PED' ) - + ( 'CondAttrListCollection' , 'ConditionStore+/CSC/PSLOPE' ) - + ( 'CondAttrListCollection' , 'ConditionStore+/CSC/RMS' ) - + ( 'CondAttrListCollection' , 'ConditionStore+/CSC/STAT' ) - + ( 'CondAttrListCollection' , 'ConditionStore+/CSC/T0BASE' ) - + ( 'CondAttrListCollection' , 'ConditionStore+/CSC/T0PHASE' ) - + ( 'CondAttrListCollection' , 'ConditionStore+/EXT/DCS/MAGNETS/SENSORDATA' ) - + ( 'CondAttrListCollection' , 'ConditionStore+/GLOBAL/BField/Maps' ) - + ( 'CondAttrListCollection' , 'ConditionStore+/MDT/CABLING/MAP_SCHEMA' ) - + ( 'CondAttrListCollection' , 'ConditionStore+/MDT/CABLING/MEZZANINE_SCHEMA' ) - + ( 'CondAttrListCollection' , 'ConditionStore+/MDT/RTBLOB' ) - + ( 'CondAttrListCollection' , 'ConditionStore+/MDT/T0BLOB' ) - + ( 'CondAttrListCollection' , 'ConditionStore+/MUONALIGN/CSC/ILINES' ) - + ( 'CondAttrListCollection' , 'ConditionStore+/MUONALIGN/MDT/ASBUILTPARAMS' ) - + ( 'CondAttrListCollection' , 'ConditionStore+/MUONALIGN/MDT/BARREL' ) - + ( 'CondAttrListCollection' , 'ConditionStore+/MUONALIGN/MDT/ENDCAP/SIDEA' ) - + ( 'CondAttrListCollection' , 'ConditionStore+/MUONALIGN/MDT/ENDCAP/SIDEC' ) - + ( 'CondAttrListCollection' , 'ConditionStore+/MUONALIGN/TGC/SIDEA' ) - + ( 'CondAttrListCollection' , 'ConditionStore+/MUONALIGN/TGC/SIDEC' ) - + ( 'CondAttrListCollection' , 'ConditionStore+/RPC/CABLING/MAP_SCHEMA' ) - + ( 'CondAttrListCollection' , 'ConditionStore+/RPC/CABLING/MAP_SCHEMA_CORR' ) - + ( 'CondAttrListCollection' , 'ConditionStore+/RPC/DCS/DeadRopanels' ) - + ( 'CondAttrListCollection' , 'ConditionStore+/RPC/DCS/OffRopanels' ) - + ( 'CondAttrListCollection' , 'ConditionStore+/RPC/DQMF/ELEMENT_STATUS' ) - + ( 'CondAttrListCollection' , 'ConditionStore+/RPC/TRIGGER/CM_THR_ETA' ) - + ( 'CondAttrListCollection' , 'ConditionStore+/RPC/TRIGGER/CM_THR_PHI' ) -MuonAlignmentCo... INFO Initilalizing -MuonAlignmentCo... INFO In initialize ---- # of folders registered is 7 -MuonAlignmentCo... INFO geometry version from the MuonDetectorManager = R.08.01 -MuonDetectorCon... INFO Initializing ... -AtlasFieldMapCo... INFO Initialize -AtlasFieldMapCo... INFO Initialize: Key ( 'AtlasFieldMapCondObj' , 'ConditionStore+fieldMapCondObj' ) has been succesfully registered -AtlasFieldMapCo... INFO Initialize: Will update the field map from conditions -AtlasFieldCache... INFO Initialize -AtlasFieldCache... INFO Initialize: Key ( 'AtlasFieldCacheCondObj' , 'ConditionStore+fieldCondObj' ) has been succesfully registered -AtlasFieldCache... INFO Initialize: Will update current from conditions -AtlasFieldCache... INFO Initialize: useDCS, useSoleCurrent, useToroCurrent. 1, 'UseSoleCurrent':7730.0000, 'UseToroCurrent':20400.000 -ClassIDSvc INFO getRegistryEntries: read 2342 CLIDRegistry entries for module ALL -ClassIDSvc INFO getRegistryEntries: read 1043 CLIDRegistry entries for module ALL RpcRawDataProvider INFO RpcRawDataProvider::initialize RpcRawDataProvider INFO 'DoSeededDecoding':False -ClassIDSvc INFO getRegistryEntries: read 2109 CLIDRegistry entries for module ALL -MuonRPC_CablingSvc INFO Initializing MuonRPC_CablingSvc - package version MuonRPC_Cabling-00-00-00 -ToolSvc.RPCCabl... INFO Initializing - folders names are: conf /RPC/CABLING/MAP_SCHEMA / corr /RPC/CABLING/MAP_SCHEMA_CORR -MuonRPC_CablingSvc INFO RPCCablingDbTool retrieved with handle TheRpcCablingDbTool = PublicToolHandle('RPCCablingDbTool/RPCCablingDbTool') -MuonRPC_CablingSvc INFO Register call-back against 2 folders listed below -MuonRPC_CablingSvc INFO Folder n. 1 </RPC/CABLING/MAP_SCHEMA> found in the DetStore -ClassIDSvc INFO getRegistryEntries: read 348 CLIDRegistry entries for module ALL -MuonRPC_CablingSvc INFO initMappingModel registered for call-back against folder </RPC/CABLING/MAP_SCHEMA> -MuonRPC_CablingSvc INFO Folder n. 2 </RPC/CABLING/MAP_SCHEMA_CORR> found in the DetStore -MuonRPC_CablingSvc INFO initMappingModel registered for call-back against folder </RPC/CABLING/MAP_SCHEMA_CORR> -MuonRPC_CablingSvc INFO RPCTriggerDbTool retrieved with statusCode = SUCCESS pointer = TheRpcTriggerDbTool = PublicToolHandle('RPCTriggerDbTool') -MuonRPC_CablingSvc INFO Register call-back against 2 folders listed below -MuonRPC_CablingSvc INFO Folder n. 1 </RPC/TRIGGER/CM_THR_ETA> found in the DetStore -MuonRPC_CablingSvc INFO initTrigRoadsModel registered for call-back against folder </RPC/TRIGGER/CM_THR_ETA> -MuonRPC_CablingSvc INFO Folder n. 2 </RPC/TRIGGER/CM_THR_PHI> found in the DetStore -MuonRPC_CablingSvc INFO initTrigRoadsModel registered for call-back against folder </RPC/TRIGGER/CM_THR_PHI> -ROBDataProviderSvc INFO Initializing ROBDataProviderSvc - package version ByteStreamCnvSvcBase-00-00-00 -ROBDataProviderSvc INFO ---> Filter out empty ROB fragments = 'filterEmptyROB':False -ROBDataProviderSvc INFO ---> Filter out specific ROBs by Status Code: # ROBs = 0 -ROBDataProviderSvc INFO ---> Filter out Sub Detector ROBs by Status Code: # Sub Detectors = 0 RpcRawDataProvi... INFO initialize() successful in RpcRawDataProvider.RPC_RawDataProviderToolMT TgcRawDataProvider INFO TgcRawDataProvider::initialize TgcRawDataProvider INFO 'DoSeededDecoding':False -ClassIDSvc INFO getRegistryEntries: read 1223 CLIDRegistry entries for module ALL TgcRawDataProvi... INFO initialize() successful in TgcRawDataProvider.TGC_RawDataProviderToolMT.TgcROD_Decoder TgcRawDataProvi... INFO Retrieved tool Decoder = PrivateToolHandle('Muon::TGC_RodDecoderReadout/TgcROD_Decoder') TgcRawDataProvi... INFO Retrieved service ServiceHandle('ROBDataProviderSvc') -MuonTGC_CablingSvc INFO for 1/12 sector initialize -ToolSvc.TGCCabl... INFO initialize -ToolSvc.TGCCabl... INFO readTGCMap from text -ToolSvc.TGCCabl... INFO readTGCMap found file /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2020-04-11T2140/Athena/22.0.12/InstallArea/x86_64-centos7-gcc8-opt/share/ASD2PP_diff_12_ONL.db -ToolSvc.TGCCabl... INFO giveASD2PP_DIFF_12 (m_ASD2PP_DIFF_12 is not NULL) TgcRawDataProvi... INFO initialize() successful in TgcRawDataProvider.TGC_RawDataProviderToolMT MdtRawDataProvider INFO MdtRawDataProvider::initialize MdtRawDataProvider INFO 'DoSeededDecoding':False -ClassIDSvc INFO getRegistryEntries: read 1209 CLIDRegistry entries for module ALL MdtRawDataProvi... INFO Retrieved service ServiceHandle('ROBDataProviderSvc') MdtRawDataProvi... INFO Processing configuration for layouts with BME chambers. MdtRawDataProvi... INFO Processing configuration for layouts with BMG chambers. MdtRawDataProvi... INFO Retrieved tool Decoder = PrivateToolHandle('MdtROD_Decoder/MdtROD_Decoder') MdtRawDataProvi... INFO initialize() successful in MdtRawDataProvider.MDT_RawDataProviderToolMT -ClassIDSvc INFO getRegistryEntries: read 1116 CLIDRegistry entries for module ALL CscRawDataProvi... INFO Retrieved service ServiceHandle('ROBDataProviderSvc') CscRawDataProvi... INFO Retrieved tool Decoder = PrivateToolHandle('Muon::CscROD_Decoder/CscROD_Decoder') CscRawDataProvi... INFO The Muon Geometry version is R.08.01 CscRawDataProvi... INFO initialize() successful in CscRawDataProvider.CSC_RawDataProviderToolMT -ClassIDSvc INFO getRegistryEntries: read 53 CLIDRegistry entries for module ALL -RpcRdoToRpcPrep... INFO package version = MuonRPC_CnvTools-00-00-00 RpcRdoToRpcPrep... INFO properties are RpcRdoToRpcPrep... INFO processingData 0 RpcRdoToRpcPrep... INFO produceRpcCoinDatafromTriggerWords 1 @@ -578,548 +31,8 @@ RpcRdoToRpcPrep... INFO Rpc Cabling Svc name is dataLike RpcRdoToRpcPrep... INFO Retrieved DecodingTool = PrivateToolHandle('Muon::RpcRdoToPrepDataToolMT/RpcRdoToRpcPrepDataTool') TgcRdoToTgcPrep... INFO initialize() successful in TgcRdoToTgcPrepData.TgcRdoToTgcPrepDataTool TgcRdoToTgcPrep... INFO Retrieved DecodingTool = PrivateToolHandle('Muon::TgcRdoToPrepDataToolMT/TgcRdoToTgcPrepDataTool') -MdtRdoToMdtPrep... INFO Processing configuration for layouts with BMG chambers. -AtlasFieldSvc INFO initialize() ... -AtlasFieldSvc INFO maps will be chosen reading COOL folder /GLOBAL/BField/Maps -AtlasFieldSvc INFO magnet currents will be read from COOL folder /EXT/DCS/MAGNETS/SENSORDATA -AtlasFieldSvc INFO Booked callback for /EXT/DCS/MAGNETS/SENSORDATA -AtlasFieldSvc INFO initialize() successful -MdtRdoToMdtPrep... INFO Processing configuration for layouts with BME chambers. -MdtRdoToMdtPrep... INFO Processing configuration for layouts with BMG chambers. -MdtRdoToMdtPrep... INFO Retrieved DecodingTool = PrivateToolHandle('Muon::MdtRdoToPrepDataToolMT/MdtRdoToMdtPrepDataTool') CscRdoToCscPrep... INFO The Geometry version is MuonSpectrometer-R.08.01 -ClassIDSvc INFO getRegistryEntries: read 114 CLIDRegistry entries for module ALL CscRdoToCscPrep... INFO Retrieved CscRdoToCscPrepDataTool = PrivateToolHandle('Muon::CscRdoToCscPrepDataToolMT/CscRdoToCscPrepDataTool') -EventSelector WARNING InputCollections not properly set, checking EventStorageInputSvc properties -EventSelector INFO reinitialization... -ClassIDSvc INFO getRegistryEntries: read 440 CLIDRegistry entries for module ALL -EventSelector INFO Retrieved InputCollections from InputSvc -ByteStreamInputSvc INFO Initializing ByteStreamInputSvc - package version ByteStreamCnvSvc-00-00-00 -EventSelector INFO reinitialization... -AthenaEventLoopMgr INFO Setup EventSelector service EventSelector -ApplicationMgr INFO Application Manager Initialized successfully -ApplicationMgr SUCCESS ****************************** Algorithm Sequence **************************** -ApplicationMgr SUCCESS AthSequencer/AthMasterSeq -ApplicationMgr SUCCESS AthSequencer/AthAlgEvtSeq -ApplicationMgr SUCCESS AthSequencer/AthBeginSeq -ApplicationMgr SUCCESS AthIncFirerAlg/BeginIncFiringAlg -ApplicationMgr SUCCESS IncidentProcAlg/IncidentProcAlg1 -ApplicationMgr SUCCESS AthSequencer/AthAllAlgSeq -ApplicationMgr SUCCESS AthSequencer/AthCondSeq -ApplicationMgr SUCCESS CondInputLoader/CondInputLoader -ApplicationMgr SUCCESS MuonAlignmentCondAlg/MuonAlignmentCondAlg -ApplicationMgr SUCCESS MuonDetectorCondAlg/MuonDetectorCondAlg -ApplicationMgr SUCCESS RpcCablingCondAlg/RpcCablingCondAlg -ApplicationMgr SUCCESS MuonMDT_CablingAlg/MuonMDT_CablingAlg -ApplicationMgr SUCCESS MagField::AtlasFieldMapCondAlg/AtlasFieldMapCondAlg -ApplicationMgr SUCCESS MagField::AtlasFieldCacheCondAlg/AtlasFieldCacheCondAlg -ApplicationMgr SUCCESS RpcCondDbAlg/RpcCondDbAlg -ApplicationMgr SUCCESS MdtCalibDbAlg/MdtCalibDbAlg -ApplicationMgr SUCCESS CscCondDbAlg/CscCondDbAlg -ApplicationMgr SUCCESS AthSequencer/AthAlgSeq -ApplicationMgr SUCCESS Muon::RpcRawDataProvider/RpcRawDataProvider -ApplicationMgr SUCCESS Muon::TgcRawDataProvider/TgcRawDataProvider -ApplicationMgr SUCCESS Muon::MdtRawDataProvider/MdtRawDataProvider -ApplicationMgr SUCCESS Muon::CscRawDataProvider/CscRawDataProvider -ApplicationMgr SUCCESS RpcRdoToRpcPrepData/RpcRdoToRpcPrepData -ApplicationMgr SUCCESS TgcRdoToTgcPrepData/TgcRdoToTgcPrepData -ApplicationMgr SUCCESS MdtRdoToMdtPrepData/MdtRdoToMdtPrepData -ApplicationMgr SUCCESS CscRdoToCscPrepData/CscRdoToCscPrepData -ApplicationMgr SUCCESS CscThresholdClusterBuilder/CscThresholdClusterBuilder -ApplicationMgr SUCCESS AthSequencer/AthEndSeq -ApplicationMgr SUCCESS AthIncFirerAlg/EndIncFiringAlg -ApplicationMgr SUCCESS IncidentProcAlg/IncidentProcAlg2 -ApplicationMgr SUCCESS AthSequencer/AthOutSeq -ApplicationMgr SUCCESS AthSequencer/AthRegSeq -ApplicationMgr SUCCESS ****************************************************************************** -ByteStreamInputSvc INFO Picked valid file: /cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/TrigP1Test/data17_13TeV.00327265.physics_EnhancedBias.merge.RAW._lb0100._SFO-1._0001.1 -CondInputLoader INFO created CondCont<CondAttrListCollection> with key 'ConditionStore+/CSC/FTHOLD' -CondInputLoader INFO created CondCont<CondAttrListCollection> with key 'ConditionStore+/CSC/NOISE' -CondInputLoader INFO created CondCont<CondAttrListCollection> with key 'ConditionStore+/CSC/PED' -CondInputLoader INFO created CondCont<CondAttrListCollection> with key 'ConditionStore+/CSC/PSLOPE' -CondInputLoader INFO created CondCont<CondAttrListCollection> with key 'ConditionStore+/CSC/RMS' -CondInputLoader INFO created CondCont<CondAttrListCollection> with key 'ConditionStore+/CSC/STAT' -CondInputLoader INFO created CondCont<CondAttrListCollection> with key 'ConditionStore+/CSC/T0BASE' -CondInputLoader INFO created CondCont<CondAttrListCollection> with key 'ConditionStore+/CSC/T0PHASE' -CondInputLoader INFO created CondCont<CondAttrListCollection> with key 'ConditionStore+/EXT/DCS/MAGNETS/SENSORDATA' -CondInputLoader INFO created CondCont<CondAttrListCollection> with key 'ConditionStore+/GLOBAL/BField/Maps' -CondInputLoader INFO created CondCont<CondAttrListCollection> with key 'ConditionStore+/MDT/CABLING/MAP_SCHEMA' -CondInputLoader INFO created CondCont<CondAttrListCollection> with key 'ConditionStore+/MDT/CABLING/MEZZANINE_SCHEMA' -CondInputLoader INFO created CondCont<CondAttrListCollection> with key 'ConditionStore+/MDT/RTBLOB' -CondInputLoader INFO created CondCont<CondAttrListCollection> with key 'ConditionStore+/MDT/T0BLOB' -CondInputLoader INFO created CondCont<CondAttrListCollection> with key 'ConditionStore+/MUONALIGN/CSC/ILINES' -CondInputLoader INFO created CondCont<CondAttrListCollection> with key 'ConditionStore+/MUONALIGN/MDT/ASBUILTPARAMS' -CondInputLoader INFO created CondCont<CondAttrListCollection> with key 'ConditionStore+/MUONALIGN/MDT/BARREL' -CondInputLoader INFO created CondCont<CondAttrListCollection> with key 'ConditionStore+/MUONALIGN/MDT/ENDCAP/SIDEA' -CondInputLoader INFO created CondCont<CondAttrListCollection> with key 'ConditionStore+/MUONALIGN/MDT/ENDCAP/SIDEC' -CondInputLoader INFO created CondCont<CondAttrListCollection> with key 'ConditionStore+/MUONALIGN/TGC/SIDEA' -CondInputLoader INFO created CondCont<CondAttrListCollection> with key 'ConditionStore+/MUONALIGN/TGC/SIDEC' -CondInputLoader INFO created CondCont<CondAttrListCollection> with key 'ConditionStore+/RPC/CABLING/MAP_SCHEMA' -CondInputLoader INFO created CondCont<CondAttrListCollection> with key 'ConditionStore+/RPC/CABLING/MAP_SCHEMA_CORR' -CondInputLoader INFO created CondCont<CondAttrListCollection> with key 'ConditionStore+/RPC/DCS/DeadRopanels' -CondInputLoader INFO created CondCont<CondAttrListCollection> with key 'ConditionStore+/RPC/DCS/OffRopanels' -CondInputLoader INFO created CondCont<CondAttrListCollection> with key 'ConditionStore+/RPC/DQMF/ELEMENT_STATUS' -CondInputLoader INFO created CondCont<CondAttrListCollection> with key 'ConditionStore+/RPC/TRIGGER/CM_THR_ETA' -CondInputLoader INFO created CondCont<CondAttrListCollection> with key 'ConditionStore+/RPC/TRIGGER/CM_THR_PHI' -ApplicationMgr INFO Application Manager Started successfully -EventInfoByteSt... INFO IsSimulation : 0 -EventInfoByteSt... INFO IsTestbeam : 0 -EventInfoByteSt... INFO IsCalibration : 0 -AthenaEventLoopMgr INFO ===>>> start of run 327265 <<<=== -IOVDbSvc INFO Opening COOL connection for COOLOFL_DCS/CONDBR2 -IOVDbSvc INFO Disconnecting from COOLOFL_DCS/CONDBR2 -EventPersistenc... INFO Added successfully Conversion service:AthenaPoolCnvSvc -IOVDbSvc INFO Opening COOL connection for COOLONL_GLOBAL/CONDBR2 -IOVDbFolder INFO HVS tag CONDBR2-BLKPA-2018-13 resolved to BFieldMap-Run1-14m-v01 for folder /GLOBAL/BField/Maps -IOVDbSvc INFO Disconnecting from COOLONL_GLOBAL/CONDBR2 -IOVDbSvc INFO Opening COOL connection for COOLONL_RPC/CONDBR2 -IOVDbFolder INFO HVS tag CONDBR2-BLKPA-2018-13 resolved to RPCCablingMapSchema_2016_2017_01 for folder /RPC/CABLING/MAP_SCHEMA -IOVDbFolder INFO HVS tag CONDBR2-BLKPA-2018-13 resolved to RPCCablingMapSchemaCorr_2016_2017_01 for folder /RPC/CABLING/MAP_SCHEMA_CORR -IOVDbFolder INFO HVS tag CONDBR2-BLKPA-2018-13 resolved to RPCTriggerCMThrEta_RUN1-RUN2-HI-02 for folder /RPC/TRIGGER/CM_THR_ETA -IOVDbFolder INFO HVS tag CONDBR2-BLKPA-2018-13 resolved to RPCTriggerCMThrPhi_RUN1-RUN2-HI-02 for folder /RPC/TRIGGER/CM_THR_PHI -IOVDbSvc INFO Disconnecting from COOLONL_RPC/CONDBR2 -MuonRPC_CablingSvc INFO initMappingModel has been called -MuonRPC_CablingSvc INFO ToolHandle in initMappingModel - <TheRpcCablingDbTool = PublicToolHandle('RPCCablingDbTool/RPCCablingDbTool')> -MuonRPC_CablingSvc INFO Retrieving cabling singleton; to create an empty one or to get the existing one -RPCcabling INFO CablingRPC---singleton constructor ---- this must be executed just once -RPCcabling INFO CablingRPC---The singleton will fill the maps from the COOL streams -RPCcabling INFO CablingRPC---InitMaps from COOL cannot be executed NOW: empty string -RPCcabling INFO CablingRPC---The singleton is created here -RPCcabling INFO CablingRPC--- cacheCleared: s_status = 0 -MuonRPC_CablingSvc INFO Cabling singleton cache has been cleared -MuonRPC_CablingSvc INFO Trigger roads will be loaded from COOL -ToolSvc.RPCCabl... INFO LoadParameters /RPC/CABLING/MAP_SCHEMA I=2 -ToolSvc.RPCCabl... INFO loadRPCMap --- Load Map from DB -ToolSvc.RPCCabl... INFO Try to read from folder </RPC/CABLING/MAP_SCHEMA> -ToolSvc.RPCCabl... INFO CondAttrListCollection from DB folder have been obtained with size 1 -ToolSvc.RPCCabl... INFO Loop over CondAttrListCollection ic = 1 -ToolSvc.RPCCabl... INFO After Reading folder, Configuration string size is 222202 -ToolSvc.RPCCabl... INFO LoadParameters /RPC/CABLING/MAP_SCHEMA_CORR I=2 -ToolSvc.RPCCabl... INFO loadRPCCorr --- Load Corrections from DB -ToolSvc.RPCCabl... INFO Try to read from folder </RPC/CABLING/MAP_SCHEMA_CORR> -ToolSvc.RPCCabl... INFO CondAttrListCollection from DB folder have been obtained with size 1 -ToolSvc.RPCCabl... INFO After Reading folder, Correction string size is 29369 -MuonRPC_CablingSvc INFO InitMappingModel: Trigger roads not yet loaded from COOL - postpone cabling initialization -MuonRPC_CablingSvc INFO initTrigRoadsModel has been called -MuonRPC_CablingSvc INFO Trigger roads will be loaded from COOL -MuonRPC_CablingSvc INFO Retrieve the pointer to the cabling singleton -RPCcabling INFO CablingRPC--- cacheCleared: s_status = 0 -MuonRPC_CablingSvc INFO Cabling singleton cache has been cleared -ToolSvc.RPCTrig... INFO LoadParameters /RPC/TRIGGER/CM_THR_ETA I=2 -ToolSvc.RPCTrig... INFO LoadParameters /RPC/TRIGGER/CM_THR_PHI I=2 -MuonRPC_CablingSvc INFO ======== RPC Trigger Roads from COOL - Header infos ======== -MuonRPC_CablingSvc INFO -RPC LVL1 Configuration 10.6 with roads from Feb 2012 -L1 THRESHOLDS: MU4 MU6 MU10 MU11 MU15 MU20 -Road version: "road_files_120209" -CMA th0 th1 th2 -eta low-pt mu4 mu6 mu10 -phi low-pt mu4 mu6 mu10 -eta high-pt mu11 mu15 mu20 -phi high-pt mu11 mu15 mu15 - - -RPCcabling INFO CablingRPC---InitMaps from COOL: going to read configuration -RPCcabling INFO CablingRPC--->> RPC cabling map from COOL << -RPCcabling INFO CablingRPC--- ReadConf: map has size 222202 -RPCcabling INFO CablingRPC--- ReadConf: map n. of lines read is 924 -RPCcabling INFO CablingRPC--- ReadConf: version is 5.0 Atlas R_07_03_RUN2ver104 -RPCcabling INFO CablingRPC--- buildRDOmap -RPCcabling INFO CablingRPC---InitMaps from COOL: going to read corrections to configuration -RPCcabling INFO CablingRPC--->> RPC cabling corrections from COOL << -RPCcabling INFO CablingRPC--- ReadCorr: CorrMap has size 29369 -RPCcabling INFO CablingRPC--- ReadConf: CorrMap n. of lines read is 743 -RPCcabling INFO CablingRPC---InitMaps from COOL - maps have been parsed -MuonRPC_CablingSvc INFO InitTrigRoadsModel: RPC cabling model is loaded! -Level-1 configuration database version 5.0 Atlas R_07_03_RUN2ver104 read. -Contains 26 Trigger Sector Types: -negative sectors 0 - 15 ==> 18 2 24 3 19 2 24 4 20 2 24 1 18 5 25 6 -negative sectors 16 - 31 ==> 21 13 26 6 21 7 16 8 14 7 16 6 21 13 26 1 -positive sectors 32 - 47 ==> 9 24 2 22 9 24 2 23 10 24 2 18 1 25 5 18 -positive sectors 48 - 63 ==> 1 26 13 21 6 17 12 15 11 17 12 21 6 26 13 22 - -MuonRPC_CablingSvc INFO buildOfflineOnlineMap -MuonRPC_CablingSvc INFO Applying FeetPadThresholds : 0,2,5 -MuonRPC_CablingSvc INFO MuonRPC_CablingSvc initialized succesfully -AtlasFieldSvc INFO reading magnetic field map filenames from COOL -AtlasFieldSvc INFO found map of type GlobalMap with soleCur=7730 toroCur=20400 (path file:MagneticFieldMaps/bfieldmap_7730_20400_14m.root) -AtlasFieldSvc INFO found map of type SolenoidMap with soleCur=7730 toroCur=0 (path file:MagneticFieldMaps/bfieldmap_7730_0_14m.root) -AtlasFieldSvc INFO found map of type ToroidMap with soleCur=0 toroCur=20400 (path file:MagneticFieldMaps/bfieldmap_0_20400_14m.root) -AtlasFieldSvc INFO no need to update map set -AtlasFieldSvc INFO Attempt 1 at reading currents from DCS (using channel name) -AtlasFieldSvc INFO Trying to read from DCS: [channel name, index, value] CentralSol_Current , 1 , 7729.99 -AtlasFieldSvc INFO Trying to read from DCS: [channel name, index, value] CentralSol_SCurrent , 2 , 7730 -AtlasFieldSvc INFO Trying to read from DCS: [channel name, index, value] Toroids_Current , 3 , 20399.9 -AtlasFieldSvc INFO Trying to read from DCS: [channel name, index, value] Toroids_SCurrent , 4 , 20397.7 -AtlasFieldSvc INFO Currents read from DCS: solenoid 7729.99 toroid 20399.9 -AtlasFieldSvc INFO Initializing the field map (solenoidCurrent=7729.99 toroidCurrent=20399.9) -AtlasFieldSvc INFO reading the map from /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/atlas/offline/ReleaseData/v20/MagneticFieldMaps/bfieldmap_7730_20400_14m.root -AtlasFieldSvc INFO Initialized the field map from /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/atlas/offline/ReleaseData/v20/MagneticFieldMaps/bfieldmap_7730_20400_14m.root -AtlasFieldSvc INFO Solenoid zone id 7000 -ByteStreamCnvSvc INFO problem adding converter for CLID [2101] -ByteStreamCnvSvc WARNING Cannot get converter for EventInfo -AthenaEventLoopMgr INFO ===>>> start processing event #186525031, run #327265 0 events processed so far <<<=== -IOVDbSvc INFO Opening COOL connection for COOLOFL_CSC/CONDBR2 -IOVDbFolder INFO HVS tag CONDBR2-BLKPA-2018-13 resolved to CscFthold-RUN2-BLK-UPD1-007-00 for folder /CSC/FTHOLD -IOVDbFolder INFO HVS tag CONDBR2-BLKPA-2018-13 resolved to CscNoise-RUN2-BLK-UPD1-007-00 for folder /CSC/NOISE -IOVDbFolder INFO HVS tag CONDBR2-BLKPA-2018-13 resolved to CscPed-RUN2-BLK-UPD1-007-00 for folder /CSC/PED -IOVDbFolder INFO HVS tag CONDBR2-BLKPA-2018-13 resolved to CscPslope-RUN2-BLK-UPD1-000-00 for folder /CSC/PSLOPE -IOVDbFolder INFO HVS tag CONDBR2-BLKPA-2018-13 resolved to CscRms-RUN2-BLK-UPD1-003-00 for folder /CSC/RMS -IOVDbFolder INFO HVS tag CONDBR2-BLKPA-2018-13 resolved to CscStat-RUN2-BLK-UPD1-008-00 for folder /CSC/STAT -IOVDbFolder INFO HVS tag CONDBR2-BLKPA-2018-13 resolved to CscT0base-RUN2-BLK-UPD1-001-00 for folder /CSC/T0BASE -IOVDbFolder INFO HVS tag CONDBR2-BLKPA-2018-13 resolved to CscT0phase-RUN2-BLK-UPD2-001-00 for folder /CSC/T0PHASE -IOVDbSvc INFO Disconnecting from COOLOFL_CSC/CONDBR2 -IOVDbSvc INFO Opening COOL connection for COOLONL_MDT/CONDBR2 -IOVDbFolder INFO HVS tag CONDBR2-BLKPA-2018-13 resolved to MDTCablingMapSchema_BMG_01 for folder /MDT/CABLING/MAP_SCHEMA -IOVDbFolder INFO HVS tag CONDBR2-BLKPA-2018-13 resolved to MDTCablingMezzanineSchema_M5-RUN2 for folder /MDT/CABLING/MEZZANINE_SCHEMA -IOVDbSvc INFO Disconnecting from COOLONL_MDT/CONDBR2 -IOVDbSvc INFO Opening COOL connection for COOLOFL_MDT/CONDBR2 -IOVDbFolder INFO HVS tag CONDBR2-BLKPA-2018-13 resolved to MDTRT-RUN2-UPD4-21 for folder /MDT/RTBLOB -IOVDbFolder INFO HVS tag CONDBR2-BLKPA-2018-13 resolved to MDTT0-RUN2-UPD4-21 for folder /MDT/T0BLOB -IOVDbSvc INFO Disconnecting from COOLOFL_MDT/CONDBR2 -IOVDbSvc INFO Opening COOL connection for COOLOFL_MUONALIGN/CONDBR2 -IOVDbFolder INFO HVS tag CONDBR2-BLKPA-2018-13 resolved to MuonAlignCscIlines-UPD1-02 for folder /MUONALIGN/CSC/ILINES -IOVDbFolder INFO HVS tag CONDBR2-BLKPA-2018-13 resolved to MuonAlignMdtAsbuiltparams-RUN2-BA_ONLY-UPD4-00 for folder /MUONALIGN/MDT/ASBUILTPARAMS -IOVDbFolder INFO HVS tag CONDBR2-BLKPA-2018-13 resolved to MuonAlignMDTBarrelAlign-RUN2-BA_ROLLING_11-BLKP-UPD4-00 for folder /MUONALIGN/MDT/BARREL -IOVDbFolder INFO HVS tag CONDBR2-BLKPA-2018-13 resolved to MuonAlignMDTEndCapAAlign-RUN2-ECA_ROLLING_2015_03_01-UPD4-02 for folder /MUONALIGN/MDT/ENDCAP/SIDEA -IOVDbFolder INFO HVS tag CONDBR2-BLKPA-2018-13 resolved to MuonAlignMDTEndCapCAlign-RUN2-ECC_ROLLING_2015_03_01-UPD4-02 for folder /MUONALIGN/MDT/ENDCAP/SIDEC -IOVDbFolder INFO HVS tag CONDBR2-BLKPA-2018-13 resolved to MuonAlignTGCEndCapAAlign-RUN2-TGCA_ROLLING_2011_01-ES1-UPD1-03 for folder /MUONALIGN/TGC/SIDEA -IOVDbFolder INFO HVS tag CONDBR2-BLKPA-2018-13 resolved to MuonAlignTGCEndCapCAlign-RUN2-TGCC_ROLLING_2011_01-ES1-UPD1-03 for folder /MUONALIGN/TGC/SIDEC -IOVDbSvc INFO Disconnecting from COOLOFL_MUONALIGN/CONDBR2 -IOVDbSvc INFO Opening COOL connection for COOLOFL_RPC/CONDBR2 -IOVDbFolder INFO HVS tag CONDBR2-BLKPA-2018-13 resolved to RPCDQMFElementStatus_Run1_UPD4-RUN2-01 for folder /RPC/DQMF/ELEMENT_STATUS -IOVDbSvc INFO Disconnecting from COOLOFL_RPC/CONDBR2 -MuonAlignmentCo... INFO Load alignment parameters from DB folder </MUONALIGN/CSC/ILINES> -MuonAlignmentCo... INFO Size of CSC/ILINES CondAttrListCollection ( 'CondAttrListCollection' , 'ConditionStore+/MUONALIGN/CSC/ILINES' ) readCscILinesCdo->size()= 1 -MuonAlignmentCo... INFO Range of CSC/ILINES input is {[0,0,t:1425168000] - [t:4294967294.854775807]} -MGM::MuonDetect... INFO temporary CSC I-line container with size = 128 -MGM::MuonDetect... INFO # of CSC I-lines read from the ILineMapContainer in StoreGate is 128 -MGM::MuonDetect... INFO # of deltaTransforms updated according to A-lines is 128 -MGM::MuonDetect... INFO # of entries in the CSC I-lines historical container is 128 -MuonAlignmentCo... INFO recorded new CscInternalAlignmentMapContainer with range {[0,0,t:1425168000] - [t:4294967294.854775807]} into Conditions Store -MuonAlignmentCo... INFO Load alignment parameters from DB folder </MUONALIGN/MDT/ASBUILTPARAMS> -MuonAlignmentCo... INFO Size of MDT/ASBUILTPARAMS CondAttrListCollection ( 'CondAttrListCollection' , 'ConditionStore+/MUONALIGN/MDT/ASBUILTPARAMS' ) ->size()= 1 -MuonAlignmentCo... INFO Range of MDT/ASBUILTPARAMS input is {[0,0,t:0] - [t:4294967294.854775807]} -MGM::MuonDetect... INFO temporary As-Built container with size = 628 -MGM::MuonDetect... INFO # of MDT As-Built read from the MdtAsBuiltMapContainer in StoreGate is 628 -MGM::MuonDetect... INFO # of deltaTransforms updated according to As-Built is 628 -MGM::MuonDetect... INFO # of entries in the MdtAsBuilt historical container is 628 -MuonAlignmentCo... INFO recorded new MdtAsBuiltMapContainer with range {[0,0,t:0] - [t:4294967294.854775807]} into Conditions Store -MuonAlignmentCo... INFO Load alignment parameters from DB folder </MUONALIGN/MDT/BARREL> -MuonAlignmentCo... INFO Size of /MUONALIGN/MDT/BARREL CondAttrListCollection ( 'CondAttrListCollection' , 'ConditionStore+/MUONALIGN/MDT/BARREL' ) readCdo->size()= 1 -MuonAlignmentCo... INFO Range of /MUONALIGN/MDT/BARREL input is, ALines: {[0,0,t:1497851700] - [t:1498737300]} BLines: {[0,0,t:1497851700] - [t:1498737300]} -MuonAlignmentCo... INFO Data read from folder /MUONALIGN/MDT/BARREL have IoV = 195569 -MuonAlignmentCo... INFO A- and B-Lines parameters from DB folder </MUONALIGN/MDT/BARREL> loaded -MuonAlignmentCo... INFO Load alignment parameters from DB folder </MUONALIGN/MDT/ENDCAP/SIDEA> -MuonAlignmentCo... INFO Size of /MUONALIGN/MDT/ENDCAP/SIDEA CondAttrListCollection ( 'CondAttrListCollection' , 'ConditionStore+/MUONALIGN/MDT/ENDCAP/SIDEA' ) readCdo->size()= 1 -MuonAlignmentCo... INFO Range of /MUONALIGN/MDT/ENDCAP/SIDEA input is, ALines: {[0,0,t:1497891240] - [t:1497898380]} BLines: {[0,0,t:1497891240] - [t:1497898380]} -MuonAlignmentCo... INFO Data read from folder /MUONALIGN/MDT/ENDCAP/SIDEA have IoV = 195588 -MuonAlignmentCo... INFO A- and B-Lines parameters from DB folder </MUONALIGN/MDT/ENDCAP/SIDEA> loaded -MuonAlignmentCo... INFO Load alignment parameters from DB folder </MUONALIGN/MDT/ENDCAP/SIDEC> -MuonAlignmentCo... INFO Size of /MUONALIGN/MDT/ENDCAP/SIDEC CondAttrListCollection ( 'CondAttrListCollection' , 'ConditionStore+/MUONALIGN/MDT/ENDCAP/SIDEC' ) readCdo->size()= 1 -MuonAlignmentCo... INFO Range of /MUONALIGN/MDT/ENDCAP/SIDEC input is, ALines: {[0,0,t:1497892260] - [t:1497899460]} BLines: {[0,0,t:1497892260] - [t:1497899460]} -MuonAlignmentCo... INFO Data read from folder /MUONALIGN/MDT/ENDCAP/SIDEC have IoV = 195599 -MuonAlignmentCo... INFO A- and B-Lines parameters from DB folder </MUONALIGN/MDT/ENDCAP/SIDEC> loaded -MuonAlignmentCo... INFO Load alignment parameters from DB folder </MUONALIGN/TGC/SIDEA> -MuonAlignmentCo... INFO No BLines decoding will be attempted for folder named /MUONALIGN/TGC/SIDEA -MuonAlignmentCo... INFO Size of /MUONALIGN/TGC/SIDEA CondAttrListCollection ( 'CondAttrListCollection' , 'ConditionStore+/MUONALIGN/TGC/SIDEA' ) readCdo->size()= 1 -MuonAlignmentCo... INFO Range of /MUONALIGN/TGC/SIDEA input is, ALines: {[0,0,t:0] - [t:4294967294.854775807]} -MuonAlignmentCo... INFO Data read from folder /MUONALIGN/TGC/SIDEA have IoV = 82360 -MuonAlignmentCo... INFO A- and B-Lines parameters from DB folder </MUONALIGN/TGC/SIDEA> loaded -MuonAlignmentCo... INFO Load alignment parameters from DB folder </MUONALIGN/TGC/SIDEC> -MuonAlignmentCo... INFO No BLines decoding will be attempted for folder named /MUONALIGN/TGC/SIDEC -MuonAlignmentCo... INFO Size of /MUONALIGN/TGC/SIDEC CondAttrListCollection ( 'CondAttrListCollection' , 'ConditionStore+/MUONALIGN/TGC/SIDEC' ) readCdo->size()= 1 -MuonAlignmentCo... INFO Range of /MUONALIGN/TGC/SIDEC input is, ALines: {[0,0,t:0] - [t:4294967294.854775807]} -MuonAlignmentCo... INFO Data read from folder /MUONALIGN/TGC/SIDEC have IoV = 82359 -MuonAlignmentCo... INFO A- and B-Lines parameters from DB folder </MUONALIGN/TGC/SIDEC> loaded -MGM::MuonDetect... INFO temporary A-line container with size = 2694 -MGM::MuonDetect... INFO # of A-lines read from the ALineMapContainer in StoreGate is 2694 -MGM::MuonDetect... INFO # of deltaTransforms updated according to A-lines is 2694 -MGM::MuonDetect... INFO # of entries in the A-lines historical container is 2814 -MuonAlignmentCo... INFO recorded new ALineMapContainer with range {[0,0,t:1497892260,l:0] - [t:1497898380]} into Conditions Store -MGM::MuonDetect... INFO In updateDeformations() -MGM::MuonDetect... INFO temporary B-line container with size = 1206 -MGM::MuonDetect... INFO # of B-lines read from the ALineMapContainer in StoreGate is 1206 -MGM::MuonDetect... INFO # of deform-Transforms updated according to B-lines is 1174 -MGM::MuonDetect... INFO # of entries in the B-lines historical container is 1174 -MuonAlignmentCo... INFO recorded new BLineMapContainer with range {[0,0,t:1497892260,l:0] - [t:1497898380]} into Conditions Store -MuonGeoModel INFO MuonDetectorFactory - constructor MuonSystem OuterRadius 13000 Length 22030 -MuonDetectorCon... INFO create MuonDetectorTool - package version = MuonGeoModel-00-00-00 -MuonDetectorCon... INFO (from GeoModelSvc) AtlasVersion = <ATLAS-R2-2016-01-00-01> MuonVersion = <> -MuonDetectorCon... INFO Keys for Muon Switches are (key) ATLAS-R2-2016-01-00-01 (node) ATLAS -MuonDetectorCon... INFO (from GeoModelSvc) in AtlasVersion = <ATLAS-R2-2016-01-00-01> default MuonVersion is <MuonSpectrometer-R.08.01> -MuonDetectorCon... INFO Properties have been set as follows: -MuonDetectorCon... INFO LayoutName R -MuonDetectorCon... INFO IncludeCutouts 0 -MuonDetectorCon... INFO IncludeCutoutsBog 0 -MuonDetectorCon... INFO IncludeCtbBis 0 -MuonDetectorCon... INFO ControlAlines 111111 -MuonDetectorCon... INFO MinimalGeoFlag 0 -MuonDetectorCon... INFO EnableCscIntAlignment 1 -MuonDetectorCon... INFO EnableCscIntAlignmentFromGM 0 -MuonDetectorCon... INFO ControlCscIntAlines 111111 -MuonDetectorCon... INFO EnableMdtDeformations 1 -MuonDetectorCon... INFO EnableMdtAsBuiltParameters 1 -MuGM:MuonFactory INFO MuonLayout set to <R.08.01> = Development version for DC3 - infrastructures -MuGM:MuonFactory INFO BOG cutouts are activated 1 , all other cutouts are disabled 1 -MuGM:MuonFactory INFO Manager created for geometry version R.08.01 from DB MuonVersion <MuonSpectrometer-R.08.01> -MuonGeoModel.MYSQL INFO GeometryVersion set to <R.08.01> -MuGM:MuonFactory INFO Mysql helper class created here for geometry version R.08.01 from DB MuonVersion <MuonSpectrometer-R.08.01> -MuGM:MuonFactory INFO MDTIDHELPER retrieved from DetStore -MuGM:MuonFactory INFO RPCIDHELPER retrieved from DetStore -MuGM:MuonFactory INFO TGCIDHELPER retrieved from DetStore -MuGM:MuonFactory INFO CSCIDHELPER retrieved from DetStore -MuGM:MuonFactory INFO **************** MuonDetectorFactory001 ************************ -MuGM:MuonFactory INFO *** Start building the Muon Geometry Tree ********************** -MuGM:RDBReadAtlas INFO Start retriving dbObjects with tag = <ATLAS-R2-2016-01-00-01> node <ATLAS> -RDBAccessSvc WARNING Could not get the tag for XtomoData node. Returning 0 pointer to IRDBQuery -MuGM:RDBReadAtlas INFO After getQuery XtomoData -In DblQ00Xtomo(data) -No XtomoData table in the MuonDD Database -MuGM:RDBReadAtlas INFO After new DblQ00Xtomo -MuGM:RDBReadAtlas INFO After m_dhxtomo.data() -MuGM:RDBReadAtlas INFO No Ascii aszt input found: looking for A-lines in ORACLE -MuGM:RDBReadAtlas INFO ASZT table found in Oracle -MuGM:RDBReadAtlas INFO ASZT size is 32 -MuGM:RDBReadAtlas INFO No Ascii iacsc input found: looking for A-lines in ORACLE -RDBAccessSvc WARNING Could not get the tag for ISZT node. Returning 0 pointer to IRDBQuery -MuGM:RDBReadAtlas INFO No ISZT table in Oracle -MuGM:RDBReadAtlas INFO Access granted for all dbObjects needed by muon detectors -MuonGeoModel.MYSQL INFO LayoutName (from DBAM) set to <R.08> -- relevant for CTB2004 -MuGM:ProcStations INFO Processing Stations and Components -MuGM:ProcStations INFO Processing Stations and Components DONE -MuGM:ProcTechnol.s INFO nMDT 26 nCSC 4 nTGC 44 nRPC 50 -MuGM:ProcTechnol.s INFO nDED 4 nSUP 8 nSPA 4 -MuGM:ProcTechnol.s INFO nCHV 14 nCRO 14 nCMI 12 nLBI 12 -MuGM:ProcPosition INFO *** N. of stations positioned in the setup 234 -MuGM:ProcPosition INFO *** N. of stations described in mysql 234 -MuGM:ProcPosition INFO *** N. of types 32 size of jtypvec 32 -MuGM:ProcPosition INFO *** : 234 kinds of stations (type*sub_type) -MuGM:ProcPosition INFO *** : 1758 physical stations in space - according to the MuonDD DataBase -MuGM:ProcCutouts INFO Processing Cutouts for geometry layout R.08 -MuGM:ProcCutouts INFO Processing Cutouts DONE -MuGM:RDBReadAtlas INFO ProcessTGCreadout - version 7 wirespacing 1.8 -MuGM:RDBReadAtlas INFO Intermediate Objects built from primary numbers -MuGM:MuonFactory INFO theMaterialManager retrieven successfully from the DetStore -MuGM:MuonFactory INFO MuonSystem description from OracleTag=<ATLAS-R2-2016-01-00-01> and node=<ATLAS> -MuGM:MuonFactory INFO TreeTop added to the Manager -MuGM:MuonFactory INFO Muon Layout R.08.01 -MuGM:MuonFactory INFO Fine Clash Fixing disabled: (should be ON/OFF for Simulation/Reconstruction) -MuGM:MuonFactory INFO **************** MuonDetectorFactory001 **************************** -MuGM:MuonFactory INFO *** The Muon Chamber Geometry Tree is built with -MuGM:MuonFactory INFO *** 1758 child volumes -MuGM:MuonFactory INFO *** 1839 independent elements and -MuGM:MuonFactory INFO *** 11473 elements cloned or shared -MuGM:MuonFactory INFO *** 234 kinds of stations -MuGM:MuonFactory INFO *** 1758 stations with alignable transforms -MuGM:MuonFactory INFO *** 148 stations are described as Assemblies -MuGM:MuonFactory INFO *** 1758 MuonStations -MuGM:MuonFactory INFO *** 2324 MDT Readout Elements 1186 MDT Detector Elements -MuGM:MuonFactory INFO *** 32 CSC Readout Elements 32 CSC Detector Elements -MuGM:MuonFactory INFO *** 1122 RPC Readout Elements 600 RPC Detector Elements -MuGM:MuonFactory INFO *** 1578 TGC Readout Elements 1578 TGC Detector Elements -MuGM:MuonFactory INFO ******************************************************************** -MuGM:MuonFactory INFO *** Inert Material built according to DB switches and config. ****** -MuGM:MuonFactory INFO *** The Muon Geometry Tree has 1758 child vol.s in total ******** -MuGM:MuonFactory INFO ******************************************************************** - -MGM::MuonDetect... INFO Init A/B Line Containers - done - size is respectively 1758/0 -MGM::MuonDetect... INFO Init of CSC I-Lines will be done via Conditions DB -MGM::MuonDetect... INFO Init I-Line Container - done - size is respectively 128 -MGM::MuonDetect... INFO I-Line for CSC wire layers loaded (Csc Internal Alignment) -MGM::MuonDetect... INFO According to configuration they WILL be used -MGM::MuonDetect... INFO Filling cache -MGM::MuonDetect... INFO temporary CSC I-line container with size = 128 -MGM::MuonDetect... INFO # of CSC I-lines read from the ILineMapContainer in StoreGate is 128 -MGM::MuonDetect... INFO # of deltaTransforms updated according to A-lines is 128 -MGM::MuonDetect... INFO # of entries in the CSC I-lines historical container is 128 -MGM::MuonDetect... INFO temporary As-Built container with size = 628 -MGM::MuonDetect... INFO # of MDT As-Built read from the MdtAsBuiltMapContainer in StoreGate is 628 -MGM::MuonDetect... INFO # of deltaTransforms updated according to As-Built is 628 -MGM::MuonDetect... INFO # of entries in the MdtAsBuilt historical container is 628 -MGM::MuonDetect... INFO temporary A-line container with size = 2694 -MGM::MuonDetect... INFO # of A-lines read from the ALineMapContainer in StoreGate is 2694 -MGM::MuonDetect... INFO # of deltaTransforms updated according to A-lines is 2694 -MGM::MuonDetect... INFO # of entries in the A-lines historical container is 2814 -MGM::MuonDetect... INFO In updateDeformations() -MGM::MuonDetect... INFO temporary B-line container with size = 1206 -MGM::MuonDetect... INFO # of B-lines read from the ALineMapContainer in StoreGate is 1206 -MGM::MuonDetect... INFO # of deform-Transforms updated according to B-lines is 1174 -MGM::MuonDetect... INFO # of entries in the B-lines historical container is 1174 -MuonDetectorCon... INFO recorded new MuonDetectorManager with range {[0,0,t:1497892260,l:0] - [t:1497898380]} into Conditions Store -RpcCablingCondAlg INFO maps configuration have been parsed -RpcCablingCondAlg INFO recorded new RpcCablingCondData with range {[315000,l:0] - [999999,l:0]} -MuonMDT_CablingAlg INFO Size of CondAttrListCollection ( 'CondAttrListCollection' , 'ConditionStore+/MDT/CABLING/MEZZANINE_SCHEMA' ) readCdoMez->size()= 24 -MuonMDT_CablingAlg INFO Range of input is {[0,l:0] - [INVALID]} -MuonMDT_CablingAlg INFO Size of CondAttrListCollection ( 'CondAttrListCollection' , 'ConditionStore+/MDT/CABLING/MAP_SCHEMA' ) readCdoMap->size()= 2312 -MuonMDT_CablingAlg INFO Range of input is {[327264,l:4294640031] - [327265,l:4294640030]} -MuonMDT_CablingAlg INFO recorded new MuonMDT_CablingMap with range {[327264,t:0,l:4294640031] - [327265,l:4294640030]} into Conditions Store -AtlasFieldMapCo... INFO execute: entering -AtlasFieldMapCo... INFO updateFieldMap: Update map from conditions -AtlasFieldMapCo... INFO updateFieldMap: Update map from conditions: Range of input/output is {[0,l:0] - [INVALID]} -AtlasFieldMapCo... INFO updateFieldMap: reading magnetic field map filenames from COOL -AtlasFieldMapCo... INFO updateFieldMap: found map of type GlobalMap with soleCur=7730 toroCur=20400 (path file:MagneticFieldMaps/bfieldmap_7730_20400_14m.root) -AtlasFieldMapCo... INFO updateFieldMap: found map of type SolenoidMap with soleCur=7730 toroCur=0 (path file:MagneticFieldMaps/bfieldmap_7730_0_14m.root) -AtlasFieldMapCo... INFO updateFieldMap: found map of type ToroidMap with soleCur=0 toroCur=20400 (path file:MagneticFieldMaps/bfieldmap_0_20400_14m.root) -AtlasFieldMapCo... INFO updateFieldMap: Set map currents from FieldSvc: solenoid/toroid 7730,20400 -AtlasFieldMapCo... INFO updateFieldMap: Use map file MagneticFieldMaps/bfieldmap_7730_20400_14m.root -AtlasFieldMapCo... INFO updateFieldMap: Initialized the field map from /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/atlas/offline/ReleaseData/v20/MagneticFieldMaps/bfieldmap_7730_20400_14m.root -AtlasFieldMapCo... INFO execute: solenoid zone id 7000 -AtlasFieldMapCo... INFO execute: recored AtlasFieldMapCondObj with field map -AtlasFieldCache... INFO execute: entering -AtlasFieldCache... INFO UpdateCurrentFromConditions -AtlasFieldCache... INFO UpdateCurrentFromConditions: Range of input/output is {[0,0,t:1497895317.371000000] - [t:1497898549.609000000]} -AtlasFieldCache... INFO UpdateCurrentFromConditions: Attempt 1 at reading currents from DCS (using channel name) -AtlasFieldCache... INFO UpdateCurrentFromConditions: Trying to read from DCS: [channel name, index, value] CentralSol_Current , 1 , 7729.99 -AtlasFieldCache... INFO UpdateCurrentFromConditions: Trying to read from DCS: [channel name, index, value] CentralSol_SCurrent , 2 , 7730 -AtlasFieldCache... INFO UpdateCurrentFromConditions: Trying to read from DCS: [channel name, index, value] Toroids_Current , 3 , 20399.9 -AtlasFieldCache... INFO UpdateCurrentFromConditions: Trying to read from DCS: [channel name, index, value] Toroids_SCurrent , 4 , 20397.7 -AtlasFieldCache... INFO UpdateCurrentFromConditions: Currents read from DCS - solenoid 7729.99 toroid 20399.9 -AtlasFieldCache... INFO scaleField: Solenoid field scale factor 1. Solenoid and map currents: 7729.99,7730 -AtlasFieldCache... INFO scaleField: Toroid field scale factor 1. Toroid and map currents: 20399.9,20400 -AtlasFieldCache... INFO execute: initialized AtlasFieldCacheCondObj and cache with SFs - sol/tor 1/1 -AtlasFieldCache... INFO execute: solenoid zone id 7000 -AtlasFieldCache... INFO execute: useNewBfieldCache 'UseNewBfieldCache':True -MdtCalibDbAlg INFO Size of CondAttrListCollection ( 'CondAttrListCollection' , 'ConditionStore+/MDT/RTBLOB' ) readCdoRt->size()= 1186 -MdtCalibDbAlg INFO Range of input is {[327265,l:0] - [327342,l:0]} -MdtCalibDbAlg INFO MdtCalibDbAlg::loadRt Read 1188RTs from COOL -MdtCalibDbAlg INFO recorded new MdtRtRelationCollection with range {[327265,l:0] - [327342,l:0]} into Conditions Store -MdtCalibDbAlg INFO recorded new MdtCorFuncSetCollection with range {[327265,l:0] - [327342,l:0]} into Conditions Store -MdtCalibDbAlg INFO Ignoring nonexistant station in calibration DB: MuonSpectrometer BML -6 stationPhi 7 MDT multiLayer 1 tubeLayer 1 tube 1 -MdtCalibDbAlg INFO Ignoring nonexistant station in calibration DB: MuonSpectrometer BML stationEta 6 stationPhi 7 MDT multiLayer 1 tubeLayer 1 tube 1 -MdtCalibDbAlg INFO Size of CondAttrListCollection ( 'CondAttrListCollection' , 'ConditionStore+/MDT/T0BLOB' ) readCdoTube->size()= 1186 -MdtCalibDbAlg INFO Range of input is {[319000,l:0] - [INVALID]} -MdtCalibDbAlg INFO recorded new MdtTubeCalibContainerCollection with range {[319000,l:0] - [INVALID]} into Conditions Store -CscCondDbData INFO Maximum Layer hash is 255 -AthenaEventLoopMgr INFO ===>>> done processing event #186525031, run #327265 1 events processed so far <<<=== -AthenaEventLoopMgr INFO ===>>> start processing event #186524665, run #327265 1 events processed so far <<<=== -AtlasFieldMapCo... INFO execute: entering -AtlasFieldCache... INFO execute: entering -AthenaEventLoopMgr INFO ===>>> done processing event #186524665, run #327265 2 events processed so far <<<=== -AthenaEventLoopMgr INFO ===>>> start processing event #186542447, run #327265 2 events processed so far <<<=== -AtlasFieldMapCo... INFO execute: entering -AtlasFieldCache... INFO execute: entering -AthenaEventLoopMgr INFO ===>>> done processing event #186542447, run #327265 3 events processed so far <<<=== -AthenaEventLoopMgr INFO ===>>> start processing event #186543405, run #327265 3 events processed so far <<<=== -AtlasFieldMapCo... INFO execute: entering -AtlasFieldCache... INFO execute: entering -AthenaEventLoopMgr INFO ===>>> done processing event #186543405, run #327265 4 events processed so far <<<=== -AthenaEventLoopMgr INFO ===>>> start processing event #186548387, run #327265 4 events processed so far <<<=== -AtlasFieldMapCo... INFO execute: entering -AtlasFieldCache... INFO execute: entering -AthenaEventLoopMgr INFO ===>>> done processing event #186548387, run #327265 5 events processed so far <<<=== -AthenaEventLoopMgr INFO ===>>> start processing event #186515186, run #327265 5 events processed so far <<<=== -AtlasFieldMapCo... INFO execute: entering -AtlasFieldCache... INFO execute: entering -AthenaEventLoopMgr INFO ===>>> done processing event #186515186, run #327265 6 events processed so far <<<=== -AthenaEventLoopMgr INFO ===>>> start processing event #186556019, run #327265 6 events processed so far <<<=== -AtlasFieldMapCo... INFO execute: entering -AtlasFieldCache... INFO execute: entering -AthenaEventLoopMgr INFO ===>>> done processing event #186556019, run #327265 7 events processed so far <<<=== -AthenaEventLoopMgr INFO ===>>> start processing event #186542866, run #327265 7 events processed so far <<<=== -AtlasFieldMapCo... INFO execute: entering -AtlasFieldCache... INFO execute: entering -AthenaEventLoopMgr INFO ===>>> done processing event #186542866, run #327265 8 events processed so far <<<=== -AthenaEventLoopMgr INFO ===>>> start processing event #186537901, run #327265 8 events processed so far <<<=== -AtlasFieldMapCo... INFO execute: entering -AtlasFieldCache... INFO execute: entering -AthenaEventLoopMgr INFO ===>>> done processing event #186537901, run #327265 9 events processed so far <<<=== -AthenaEventLoopMgr INFO ===>>> start processing event #186517811, run #327265 9 events processed so far <<<=== -AtlasFieldMapCo... INFO execute: entering -AtlasFieldCache... INFO execute: entering -AthenaEventLoopMgr INFO ===>>> done processing event #186517811, run #327265 10 events processed so far <<<=== -AthenaEventLoopMgr INFO ===>>> start processing event #186534221, run #327265 10 events processed so far <<<=== -AtlasFieldMapCo... INFO execute: entering -AtlasFieldCache... INFO execute: entering -AthenaEventLoopMgr INFO ===>>> done processing event #186534221, run #327265 11 events processed so far <<<=== -AthenaEventLoopMgr INFO ===>>> start processing event #186540986, run #327265 11 events processed so far <<<=== -AtlasFieldMapCo... INFO execute: entering -AtlasFieldCache... INFO execute: entering -AthenaEventLoopMgr INFO ===>>> done processing event #186540986, run #327265 12 events processed so far <<<=== -AthenaEventLoopMgr INFO ===>>> start processing event #186535104, run #327265 12 events processed so far <<<=== -AtlasFieldMapCo... INFO execute: entering -AtlasFieldCache... INFO execute: entering -AthenaEventLoopMgr INFO ===>>> done processing event #186535104, run #327265 13 events processed so far <<<=== -AthenaEventLoopMgr INFO ===>>> start processing event #186539903, run #327265 13 events processed so far <<<=== -AtlasFieldMapCo... INFO execute: entering -AtlasFieldCache... INFO execute: entering -AthenaEventLoopMgr INFO ===>>> done processing event #186539903, run #327265 14 events processed so far <<<=== -AthenaEventLoopMgr INFO ===>>> start processing event #186552713, run #327265 14 events processed so far <<<=== -AtlasFieldMapCo... INFO execute: entering -AtlasFieldCache... INFO execute: entering -AthenaEventLoopMgr INFO ===>>> done processing event #186552713, run #327265 15 events processed so far <<<=== -AthenaEventLoopMgr INFO ===>>> start processing event #186524730, run #327265 15 events processed so far <<<=== -AtlasFieldMapCo... INFO execute: entering -AtlasFieldCache... INFO execute: entering -AthenaEventLoopMgr INFO ===>>> done processing event #186524730, run #327265 16 events processed so far <<<=== -AthenaEventLoopMgr INFO ===>>> start processing event #186547632, run #327265 16 events processed so far <<<=== -AtlasFieldMapCo... INFO execute: entering -AtlasFieldCache... INFO execute: entering -AthenaEventLoopMgr INFO ===>>> done processing event #186547632, run #327265 17 events processed so far <<<=== -AthenaEventLoopMgr INFO ===>>> start processing event #186555621, run #327265 17 events processed so far <<<=== -AtlasFieldMapCo... INFO execute: entering -AtlasFieldCache... INFO execute: entering -AthenaEventLoopMgr INFO ===>>> done processing event #186555621, run #327265 18 events processed so far <<<=== -AthenaEventLoopMgr INFO ===>>> start processing event #186568452, run #327265 18 events processed so far <<<=== -AtlasFieldMapCo... INFO execute: entering -AtlasFieldCache... INFO execute: entering -AthenaEventLoopMgr INFO ===>>> done processing event #186568452, run #327265 19 events processed so far <<<=== -AthenaEventLoopMgr INFO ===>>> start processing event #186580451, run #327265 19 events processed so far <<<=== -AtlasFieldMapCo... INFO execute: entering -AtlasFieldCache... INFO execute: entering -AthenaEventLoopMgr INFO ===>>> done processing event #186580451, run #327265 20 events processed so far <<<=== -Domain[ROOT_All] INFO > Deaccess DbDomain READ [ROOT_All] -ApplicationMgr INFO Application Manager Stopped successfully -IncidentProcAlg1 INFO Finalize -CondInputLoader INFO Finalizing CondInputLoader... -AtlasFieldMapCo... INFO in finalize -AtlasFieldCache... INFO in finalize -IncidentProcAlg2 INFO Finalize -AtlasFieldSvc INFO finalize() successful -IOVDbFolder INFO Folder /CSC/FTHOLD (AttrListColl) db-read 1/1 objs/chan/bytes 32/32/322656 (( 0.15 ))s -IOVDbFolder INFO Folder /CSC/NOISE (AttrListColl) db-read 1/1 objs/chan/bytes 32/32/350062 (( 0.08 ))s -IOVDbFolder INFO Folder /CSC/PED (AttrListColl) db-read 1/1 objs/chan/bytes 32/32/411187 (( 0.08 ))s -IOVDbFolder INFO Folder /CSC/PSLOPE (AttrListColl) db-read 1/1 objs/chan/bytes 32/32/353376 (( 0.09 ))s -IOVDbFolder INFO Folder /CSC/RMS (AttrListColl) db-read 1/1 objs/chan/bytes 32/32/411395 (( 0.07 ))s -IOVDbFolder INFO Folder /CSC/STAT (AttrListColl) db-read 1/1 objs/chan/bytes 32/32/230496 (( 0.06 ))s -IOVDbFolder INFO Folder /CSC/T0BASE (AttrListColl) db-read 1/1 objs/chan/bytes 32/32/314380 (( 0.17 ))s -IOVDbFolder INFO Folder /CSC/T0PHASE (AttrListColl) db-read 1/1 objs/chan/bytes 32/32/3136 (( 0.05 ))s -IOVDbFolder INFO Folder /EXT/DCS/MAGNETS/SENSORDATA (AttrListColl) db-read 1/2 objs/chan/bytes 4/4/20 (( 0.90 ))s -IOVDbFolder INFO Folder /GLOBAL/BField/Maps (AttrListColl) db-read 1/2 objs/chan/bytes 3/3/202 (( 0.19 ))s -IOVDbFolder INFO Folder /MDT/CABLING/MAP_SCHEMA (AttrListColl) db-read 1/1 objs/chan/bytes 2312/2437/216520 (( 0.16 ))s -IOVDbFolder INFO Folder /MDT/CABLING/MEZZANINE_SCHEMA (AttrListColl) db-read 1/1 objs/chan/bytes 24/24/288 (( 0.14 ))s -IOVDbFolder INFO Folder /MDT/RTBLOB (AttrListColl) db-read 1/1 objs/chan/bytes 2372/1186/2251209 (( 0.16 ))s -IOVDbFolder INFO Folder /MDT/T0BLOB (AttrListColl) db-read 1/1 objs/chan/bytes 1186/1186/1374284 (( 0.25 ))s -IOVDbFolder INFO Folder /MUONALIGN/CSC/ILINES (AttrListColl) db-read 1/1 objs/chan/bytes 1/1/10814 (( 0.04 ))s -IOVDbFolder INFO Folder /MUONALIGN/MDT/ASBUILTPARAMS (AttrListColl) db-read 1/1 objs/chan/bytes 1/1/128992 (( 0.03 ))s -IOVDbFolder INFO Folder /MUONALIGN/MDT/BARREL (AttrListColl) db-read 1/1 objs/chan/bytes 1/1/140293 (( 0.07 ))s -IOVDbFolder INFO Folder /MUONALIGN/MDT/ENDCAP/SIDEA (AttrListColl) db-read 1/1 objs/chan/bytes 1/1/65494 (( 0.07 ))s -IOVDbFolder INFO Folder /MUONALIGN/MDT/ENDCAP/SIDEC (AttrListColl) db-read 1/1 objs/chan/bytes 1/1/65497 (( 0.05 ))s -IOVDbFolder INFO Folder /MUONALIGN/TGC/SIDEA (AttrListColl) db-read 1/1 objs/chan/bytes 1/1/165643 (( 0.07 ))s -IOVDbFolder INFO Folder /MUONALIGN/TGC/SIDEC (AttrListColl) db-read 1/1 objs/chan/bytes 1/1/165643 (( 0.04 ))s -IOVDbFolder INFO Folder /RPC/CABLING/MAP_SCHEMA (AttrListColl) db-read 1/2 objs/chan/bytes 1/1/222235 (( 0.08 ))s -IOVDbFolder INFO Folder /RPC/CABLING/MAP_SCHEMA_CORR (AttrListColl) db-read 1/2 objs/chan/bytes 1/1/29402 (( 0.15 ))s -IOVDbFolder INFO Folder /RPC/DCS/DeadRopanels (AttrListColl) db-read 1/1 objs/chan/bytes 32/48/6200 (( 0.24 ))s -IOVDbFolder INFO Folder /RPC/DCS/OffRopanels (AttrListColl) db-read 1/1 objs/chan/bytes 4/48/16 (( 0.06 ))s -IOVDbFolder INFO Folder /RPC/DQMF/ELEMENT_STATUS (AttrListColl) db-read 1/1 objs/chan/bytes 8320/8320/6180700 (( 0.27 ))s -IOVDbFolder INFO Folder /RPC/TRIGGER/CM_THR_ETA (AttrListColl) db-read 1/2 objs/chan/bytes 1613/1613/7562651 (( 0.19 ))s -IOVDbFolder INFO Folder /RPC/TRIGGER/CM_THR_PHI (AttrListColl) db-read 1/2 objs/chan/bytes 1612/1612/8096306 (( 0.14 ))s -IOVDbFolder INFO Folder /TDAQ/RunCtrl/SOR_Params (AttrListColl) db-read 0/0 objs/chan/bytes 0/1/0 (( 0.00 ))s -IOVDbFolder INFO Folder /TGC/CABLING/MAP_SCHEMA (AttrListColl) db-read 0/0 objs/chan/bytes 0/1/0 (( 0.00 ))s -IOVDbSvc INFO bytes in (( 4.06 ))s -IOVDbSvc INFO Connection sqlite://;schema=mycool.db;dbname=CONDBR2 : nConnect: 0 nFolders: 0 ReadTime: (( 0.00 ))s -IOVDbSvc INFO Connection COOLONL_TDAQ/CONDBR2 : nConnect: 1 nFolders: 1 ReadTime: (( 0.00 ))s -IOVDbSvc INFO Connection COOLOFL_MUONALIGN/CONDBR2 : nConnect: 2 nFolders: 7 ReadTime: (( 0.38 ))s -IOVDbSvc INFO Connection COOLONL_RPC/CONDBR2 : nConnect: 2 nFolders: 4 ReadTime: (( 0.57 ))s -IOVDbSvc INFO Connection COOLONL_TGC/CONDBR2 : nConnect: 1 nFolders: 1 ReadTime: (( 0.00 ))s -IOVDbSvc INFO Connection COOLONL_MDT/CONDBR2 : nConnect: 2 nFolders: 2 ReadTime: (( 0.30 ))s -IOVDbSvc INFO Connection COOLONL_GLOBAL/CONDBR2 : nConnect: 2 nFolders: 1 ReadTime: (( 0.19 ))s -IOVDbSvc INFO Connection COOLOFL_DCS/CONDBR2 : nConnect: 2 nFolders: 3 ReadTime: (( 1.19 ))s -IOVDbSvc INFO Connection COOLOFL_RPC/CONDBR2 : nConnect: 2 nFolders: 1 ReadTime: (( 0.27 ))s -IOVDbSvc INFO Connection COOLOFL_MDT/CONDBR2 : nConnect: 2 nFolders: 2 ReadTime: (( 0.42 ))s -IOVDbSvc INFO Connection COOLOFL_CSC/CONDBR2 : nConnect: 2 nFolders: 8 ReadTime: (( 0.75 ))s -ToolSvc INFO Removing all tools created by ToolSvc -TgcRdoToTgcPrep... INFO finalize(): input RDOs->output PRDs [Hit: 6807->6807, Tracklet: 28->28, TrackletEIFI: 692->692, HiPt: 4031->4031, SL: 3->3] MdtRawDataProvi... INFO Fraction of fills that use the cache = 0 TgcRawDataProvi... INFO Fraction of fills that use the cache = 0 RpcROD_Decoder:... INFO ============ FINAL RPC DATA FORMAT STAT. =========== @@ -1137,15 +50,3 @@ RpcROD_Decoder:... INFO SL Footer Errors.............0 RpcROD_Decoder:... INFO RX Footer Errors.............0 RpcROD_Decoder:... INFO CRC8 check Failures..........0 RpcROD_Decoder:... INFO ==================================================== -ToolSvc.ByteStr... INFO in finalize() -ToolSvc.TGCCabl... INFO finalize -IdDictDetDescrCnv INFO in finalize -*****Chrono***** INFO **************************************************************************************************** -*****Chrono***** INFO The Final CPU consumption ( Chrono ) Table (ordered) -*****Chrono***** INFO **************************************************************************************************** -cObj_ALL INFO Time User : Tot= 0 [us] Ave/Min/Max= 0(+- 0)/ 0/ 0 [us] #= 34 -ChronoStatSvc INFO Time User : Tot= 17.9 [s] #= 1 -*****Chrono***** INFO **************************************************************************************************** -ChronoStatSvc.f... INFO Service finalized successfully -ApplicationMgr INFO Application Manager Finalized successfully -ApplicationMgr INFO Application Manager Terminated successfully diff --git a/MuonSpectrometer/MuonConfig/share/MuonDataDecodeTest_Cache.ref b/MuonSpectrometer/MuonConfig/share/MuonDataDecodeTest_Cache.ref index e4eff2366ed1afa97a75d4b0f099420c6e8147e1..e80eb113ac0ce5c253102dd66a21a8c9a7920827 100644 --- a/MuonSpectrometer/MuonConfig/share/MuonDataDecodeTest_Cache.ref +++ b/MuonSpectrometer/MuonConfig/share/MuonDataDecodeTest_Cache.ref @@ -1,570 +1,23 @@ -Py:Athena INFO using release [WorkDir-22.0.12] [x86_64-centos7-gcc8-opt] [GaudiConfig2_tidy/da3ab39] -- built on [2020-04-12T1103] -Flag Name : Value -Beam.BunchSpacing : 25 -Beam.Energy : [function] -Beam.NumberOfCollisions : [function] -Beam.Type : [function] -Beam.estimatedLuminosity : [function] -Common.Project : 'Athena' -Common.bunchCrossingSource : [function] -Common.doExpressProcessing : False -Common.isOnline : False -Common.useOnlineLumi : [function] -Concurrency.NumConcurrentEvents : 0 -Concurrency.NumProcs : 0 -Concurrency.NumThreads : 0 -GeoModel.Align.Dynamic : [function] -GeoModel.AtlasVersion : 'ATLAS-R2-2016-01-00-01' -GeoModel.IBLLayout : [function] -GeoModel.Layout : 'atlas' -GeoModel.Run : [function] -GeoModel.StripGeoType : [function] -GeoModel.Type : [function] -IOVDb.DatabaseInstance : [function] -IOVDb.GlobalTag : 'CONDBR2-BLKPA-2018-13' -Input.Collections : [function] -Input.Files : ['/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/TrigP1Test/data17_13TeV.00327265.physics_EnhancedBias.merge.RAW._lb0100._SFO-1._0001.1'] -Input.Format : [function] -Input.ProjectName : [function] -Input.RunNumber : [function] -Input.SecondaryCollections : [function] -Input.SecondaryFiles : [] -Input.isMC : [function] -Output.AODFileName : '' -Output.ESDFileName : '' -Output.EVNTFileName : '' -Output.HISTFileName : '' -Output.HITSFileName : '' -Output.RDOFileName : '' -Output.RDO_SGNLFileName : '' -Output.doESD : [function] -Output.doWriteAOD : [function] -Output.doWriteBS : False -Output.doWriteESD : [function] -Output.doWriteRDO : [function] -Output.doWriteRDO_SGNL : [function] -Random.Engine : 'dSFMT' -Scheduler.CheckDependencies : True -Scheduler.ShowControlFlow : True -Scheduler.ShowDataDeps : True -Scheduler.ShowDataFlow : True -TrackingGeometry.MagneticFileMode : 6 -TrackingGeometry.MaterialSource : 'COOL' -Flag categories that can be loaded dynamically -Category : Generator name : Defined in -BTagging : __btagging : AthenaConfiguration/AllConfigFlags.py -Calo : __calo : AthenaConfiguration/AllConfigFlags.py -DQ : __dq : AthenaConfiguration/AllConfigFlags.py -Detector : __detector : AthenaConfiguration/AllConfigFlags.py -Digitization : __digitization : AthenaConfiguration/AllConfigFlags.py -Egamma : __egamma : AthenaConfiguration/AllConfigFlags.py -InDet : __indet : AthenaConfiguration/AllConfigFlags.py -LAr : __lar : AthenaConfiguration/AllConfigFlags.py -Muon : __muon : AthenaConfiguration/AllConfigFlags.py -MuonCombined : __muoncombined : AthenaConfiguration/AllConfigFlags.py -Overlay : __overlay : AthenaConfiguration/AllConfigFlags.py -PF : __pflow : AthenaConfiguration/AllConfigFlags.py -Sim : __simulation : AthenaConfiguration/AllConfigFlags.py -Tile : __tile : AthenaConfiguration/AllConfigFlags.py -Trigger : __trigger : AthenaConfiguration/AllConfigFlags.py -Py:Athena INFO About to setup Raw data decoding -Py:AutoConfigFlags INFO Obtaining metadata of auto-configuration by peeking into /cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/TrigP1Test/data17_13TeV.00327265.physics_EnhancedBias.merge.RAW._lb0100._SFO-1._0001.1 -Py:MetaReader INFO Current mode used: peeker -Py:MetaReader INFO Current filenames: ['/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/TrigP1Test/data17_13TeV.00327265.physics_EnhancedBias.merge.RAW._lb0100._SFO-1._0001.1'] -Py:ConfigurableDb INFO Read module info for 5552 configurables from 93 genConfDb files -Py:ConfigurableDb INFO No duplicates have been found: that's good ! -EventInfoMgtInit: Got release version Athena-22.0.12 -Py:IOVDbSvc.CondDB INFO Setting up conditions DB access to instance OFLP200 -Py:Athena INFO Print Config -Py:ComponentAccumulator INFO Event Inputs -Py:ComponentAccumulator INFO Event Algorithm Sequences -Py:ComponentAccumulator INFO AthSequencer('AthAlgSeq', Sequential=True, Members=[MuonCacheCreator('MuonCacheCreator', RpcCacheKey='RpcRdoCache', TgcCacheKey='TgcRdoCache', CscCacheKey='CscRdoCache', MdtCsmCacheKey='MdtCsmRdoCache'), RpcRawDataProvider('RpcRawDataProvider', ProviderTool=RPC_RawDataProviderToolMT('RPC_RawDataProviderToolMT', Decoder=RpcROD_Decoder('RpcROD_Decoder'), RpcContainerCacheKey='RpcRdoCache', WriteOutRpcSectorLogic=False, RdoLocation='RPCPAD'), RoIs='HLT_MURoIs'), TgcRawDataProvider('TgcRawDataProvider', ProviderTool=TGC_RawDataProviderToolMT('TGC_RawDataProviderToolMT', TgcContainerCacheKey='TgcRdoCache', Decoder=TGC_RodDecoderReadout('TgcROD_Decoder'), RdoLocation='TGCRDO')), MdtRawDataProvider('MdtRawDataProvider', ProviderTool=MDT_RawDataProviderToolMT('MDT_RawDataProviderToolMT', CsmContainerCacheKey='MdtCsmRdoCache', Decoder=MdtROD_Decoder('MdtROD_Decoder'), RdoLocation='MDTCSM')), CscRawDataProvider('CscRawDataProvider', ProviderTool=CSC_RawDataProviderToolMT('CSC_RawDataProviderToolMT', CscContainerCacheKey='CscRdoCache', Decoder=CscROD_Decoder('CscROD_Decoder'), RdoLocation='CSCRDO')), RpcRdoToRpcPrepData('RpcRdoToRpcPrepData', DecodingTool=RpcRdoToPrepDataToolMT('RpcRdoToRpcPrepDataTool'), PrintPrepData=False), TgcRdoToTgcPrepData('TgcRdoToTgcPrepData', DecodingTool=TgcRdoToPrepDataToolMT('TgcRdoToTgcPrepDataTool'), PrintPrepData=False), MdtRdoToMdtPrepData('MdtRdoToMdtPrepData', DecodingTool=MdtRdoToPrepDataToolMT('MdtRdoToMdtPrepDataTool'), PrintPrepData=False), CscRdoToCscPrepData('CscRdoToCscPrepData', PrintPrepData=False, CscRdoToCscPrepDataTool=CscRdoToCscPrepDataToolMT('CscRdoToCscPrepDataTool')), CscThresholdClusterBuilder('CscThresholdClusterBuilder', cluster_builder='CscThresholdClusterBuilderTool/CscThresholdClusterBuilderTool')]) -Py:ComponentAccumulator INFO Condition Algorithms -Py:ComponentAccumulator INFO \__ CondInputLoader (cond alg) -Py:ComponentAccumulator INFO \__ MuonAlignmentCondAlg (cond alg) -Py:ComponentAccumulator INFO \__ MuonDetectorCondAlg (cond alg) -Py:ComponentAccumulator INFO \__ RpcCablingCondAlg (cond alg) -Py:ComponentAccumulator INFO \__ MuonMDT_CablingAlg (cond alg) -Py:ComponentAccumulator INFO \__ AtlasFieldMapCondAlg (cond alg) -Py:ComponentAccumulator INFO \__ AtlasFieldCacheCondAlg (cond alg) -Py:ComponentAccumulator INFO \__ RpcCondDbAlg (cond alg) -Py:ComponentAccumulator INFO \__ MdtCalibDbAlg (cond alg) -Py:ComponentAccumulator INFO \__ CscCondDbAlg (cond alg) -Py:ComponentAccumulator INFO Services -Py:ComponentAccumulator INFO ['EventSelector', 'ByteStreamInputSvc', 'EventPersistencySvc', 'ByteStreamCnvSvc', 'ROBDataProviderSvc', 'ByteStreamAddressProviderSvc', 'MetaDataStore', 'InputMetaDataStore', 'MetaDataSvc', 'ProxyProviderSvc', 'IOVDbSvc', 'PoolSvc', 'CondSvc', 'DBReplicaSvc', 'TagInfoMgr', 'GeoModelSvc', 'DetDescrCnvSvc', 'AthenaPoolCnvSvc', 'MuonIdHelperSvc', 'RPCcablingServerSvc', 'MuonRPC_CablingSvc', 'LVL1TGC::TGCRecRoiSvc', 'TGCcablingServerSvc', 'MuonMDT_CablingSvc', 'AtlasFieldSvc', 'CSCcablingSvc'] -Py:ComponentAccumulator INFO Public Tools -Py:ComponentAccumulator INFO [ -Py:ComponentAccumulator INFO IOVDbMetaDataTool/IOVDbMetaDataTool, -Py:ComponentAccumulator INFO ByteStreamMetadataTool/ByteStreamMetadataTool, -Py:ComponentAccumulator INFO RPCCablingDbTool/RPCCablingDbTool, -Py:ComponentAccumulator INFO Muon::RPC_RawDataProviderToolMT/RPC_RawDataProviderToolMT, -Py:ComponentAccumulator INFO Muon::TGC_RawDataProviderToolMT/TGC_RawDataProviderToolMT, -Py:ComponentAccumulator INFO MDTCablingDbTool/MDTCablingDbTool, -Py:ComponentAccumulator INFO Muon::MDT_RawDataProviderToolMT/MDT_RawDataProviderToolMT, -Py:ComponentAccumulator INFO Muon::CSC_RawDataProviderToolMT/CSC_RawDataProviderToolMT, -Py:ComponentAccumulator INFO Muon::RpcRdoToPrepDataToolMT/RpcRdoToRpcPrepDataTool, -Py:ComponentAccumulator INFO Muon::TgcRdoToPrepDataToolMT/TgcRdoToTgcPrepDataTool, -Py:ComponentAccumulator INFO Muon::MdtRdoToPrepDataToolMT/MdtRdoToMdtPrepDataTool, -Py:ComponentAccumulator INFO Muon::CscRdoToCscPrepDataToolMT/CscRdoToCscPrepDataTool, -Py:ComponentAccumulator INFO CscThresholdClusterBuilderTool/CscThresholdClusterBuilderTool, -Py:ComponentAccumulator INFO ] -Py:ComponentAccumulator INFO Private Tools -Py:ComponentAccumulator INFO [ -Py:ComponentAccumulator INFO ] -Py:ComponentAccumulator INFO TheApp properties -Py:ComponentAccumulator INFO EvtSel : EventSelector -Py:Athena INFO Save Config - -JOs reading stage finished, launching CARunner from pickle file - -Py:Athena INFO using release [WorkDir-22.0.12] [x86_64-centos7-gcc8-opt] [GaudiConfig2_tidy/da3ab39] -- built on [2020-04-12T1103] -ApplicationMgr SUCCESS -==================================================================================================================================== - Welcome to ApplicationMgr (GaudiCoreSvc v33r1) - running on pcaz004 on Sun Apr 12 12:32:45 2020 -==================================================================================================================================== -ApplicationMgr INFO Application Manager Configured successfully -PublicTool IOVDbMetaDataTool -PublicTool ByteStreamMetadataTool -PublicTool RPCCablingDbTool -PublicTool RPC_RawDataProviderToolMT -PublicTool TGC_RawDataProviderToolMT -PublicTool MDTCablingDbTool -PublicTool MDT_RawDataProviderToolMT -PublicTool CSC_RawDataProviderToolMT -PublicTool RpcRdoToRpcPrepDataTool -PublicTool TgcRdoToTgcPrepDataTool -PublicTool MdtRdoToMdtPrepDataTool -PublicTool CscRdoToCscPrepDataTool -PublicTool CscThresholdClusterBuilderTool -CoreDumpSvc INFO install f-a-t-a-l handler... (flag = 438) -CoreDumpSvc INFO Handling signals: 11(Segmentation fault) 7(Bus error) 4(Illegal instruction) 8(Floating point exception) -ClassIDSvc INFO getRegistryEntries: read 3838 CLIDRegistry entries for module ALL -MetaDataSvc INFO Initializing MetaDataSvc - package version AthenaServices-00-00-00 -AthenaPoolCnvSvc INFO Initializing AthenaPoolCnvSvc - package version AthenaPoolCnvSvc-00-00-00 -PoolSvc INFO io_register[PoolSvc](xmlcatalog_file:PoolFileCatalog.xml) [ok] -PoolSvc INFO Set connectionsvc retry/timeout/IDLE timeout to 'ConnectionRetrialPeriod':300/ 'ConnectionRetrialTimeOut':3600/ 'ConnectionTimeOut':5 seconds with connection cleanup disabled -PoolSvc INFO Frontier compression level set to 5 -DBReplicaSvc INFO Frontier server at (serverurl=http://atlasfrontier-local.cern.ch:8000/atlr)(serverurl=http://atlasfrontier-ai.cern.ch:8000/atlr)(serverurl=http://ccfrontier.in2p3.fr:23128/ccin2p3-AtlasFrontier)(proxyurl=http://ca-proxy-atlas.cern.ch:3128)(proxyurl=http://ca-proxy-meyrin.cern.ch:3128)(proxyurl=http://ca-proxy.cern.ch:3128)(proxyurl=http://atlasbpfrontier.cern.ch:3127)(proxyurl=http://atlasbpfrontier.fnal.gov:3127) will be considered for COOL data -DBReplicaSvc INFO Read replica configuration from /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2020-04-11T2140/Athena/22.0.12/InstallArea/x86_64-centos7-gcc8-opt/share/dbreplica.config -DBReplicaSvc INFO Total of 10 servers found for host pcaz004.dyndns.cern.ch [ATLF ATLAS_COOLPROD atlas_dd ATLAS_CONFIG INT8R INTR ATONR_COOL ATONR_CONF DEVDB11 ATLF ] -DBReplicaSvc INFO COOL SQLite replicas will be excluded if matching pattern /DBRelease/ -PoolSvc INFO Successfully setup replica sorting algorithm -PoolSvc INFO Setting up APR FileCatalog and Streams -PoolSvc INFO Resolved path (via ATLAS_POOLCOND_PATH) is /cvmfs/atlas-condb.cern.ch/repo/conditions/poolcond/PoolFileCatalog.xml -PoolSvc WARNING Unable to locate catalog for prfile:poolcond/PoolCat_oflcond.xml check your ATLAS_POOLCOND_PATH and DATAPATH variables -PoolSvc WARNING Unable to locate catalog for apcfile:poolcond/PoolCat_oflcond.xml check your ATLAS_POOLCOND_PATH and DATAPATH variables -PoolSvc WARNING Unable to locate catalog for prfile:poolcond/PoolCat_comcond.xml check your ATLAS_POOLCOND_PATH and DATAPATH variables -PoolSvc WARNING Unable to locate catalog for apcfile:poolcond/PoolCat_comcond.xml check your ATLAS_POOLCOND_PATH and DATAPATH variables -PoolSvc INFO POOL WriteCatalog is xmlcatalog_file:PoolFileCatalog.xml -DbSession INFO Open DbSession -Domain[ROOT_All] INFO > Access DbDomain READ [ROOT_All] -ToolSvc.ByteStr... INFO Initializing ToolSvc.ByteStreamMetadataTool - package version ByteStreamCnvSvc-00-00-00 -MetaDataSvc INFO Found MetaDataTools = PublicToolHandleArray(['IOVDbMetaDataTool/IOVDbMetaDataTool','ByteStreamMetadataTool/ByteStreamMetadataTool']) -ByteStreamAddre... INFO Initializing ByteStreamAddressProviderSvc - package version ByteStreamCnvSvcBase-00-00-00 -ByteStreamAddre... INFO initialized -ByteStreamAddre... INFO -- Will fill Store with id = 0 -IOVDbSvc INFO Opened read transaction for POOL PersistencySvc -IOVDbSvc INFO Only 5 POOL conditions files will be open at once -IOVDbSvc INFO Cache alignment will be done in 3 slices -IOVDbSvc INFO Global tag: CONDBR2-BLKPA-2018-13 set from joboptions -IOVDbFolder INFO Inputfile tag override disabled for /GLOBAL/BField/Maps -IOVDbSvc INFO Initialised with 11 connections and 30 folders -IOVDbSvc INFO Service IOVDbSvc initialised successfully -ClassIDSvc INFO getRegistryEntries: read 3039 CLIDRegistry entries for module ALL -IOVDbSvc INFO Opening COOL connection for COOLONL_TDAQ/CONDBR2 -ClassIDSvc INFO getRegistryEntries: read 268 CLIDRegistry entries for module ALL -ClassIDSvc INFO getRegistryEntries: read 230 CLIDRegistry entries for module ALL -ClassIDSvc INFO getRegistryEntries: read 4057 CLIDRegistry entries for module ALL -ClassIDSvc INFO getRegistryEntries: read 139 CLIDRegistry entries for module ALL -ClassIDSvc INFO getRegistryEntries: read 3327 CLIDRegistry entries for module ALL -IOVSvc INFO No IOVSvcTool associated with store "StoreGateSvc" -IOVSvc.IOVSvcTool INFO IOVRanges will be checked at every Event -IOVDbSvc INFO Opening COOL connection for COOLOFL_MUONALIGN/CONDBR2 -IOVDbSvc INFO Disconnecting from COOLONL_TDAQ/CONDBR2 -IOVDbSvc INFO Opening COOL connection for COOLONL_RPC/CONDBR2 -IOVDbSvc INFO Disconnecting from COOLOFL_MUONALIGN/CONDBR2 -IOVDbSvc INFO Opening COOL connection for COOLONL_TGC/CONDBR2 -IOVDbSvc INFO Disconnecting from COOLONL_RPC/CONDBR2 -IOVDbSvc INFO Opening COOL connection for COOLONL_MDT/CONDBR2 -IOVDbSvc INFO Disconnecting from COOLONL_TGC/CONDBR2 -IOVDbSvc INFO Opening COOL connection for COOLONL_GLOBAL/CONDBR2 -IOVDbSvc INFO Disconnecting from COOLONL_MDT/CONDBR2 -IOVDbSvc INFO Opening COOL connection for COOLOFL_DCS/CONDBR2 -IOVDbSvc INFO Disconnecting from COOLONL_GLOBAL/CONDBR2 -IOVDbSvc INFO Opening COOL connection for COOLOFL_RPC/CONDBR2 -IOVDbSvc INFO Disconnecting from COOLOFL_DCS/CONDBR2 -IOVDbSvc INFO Opening COOL connection for COOLOFL_MDT/CONDBR2 -IOVDbSvc INFO Disconnecting from COOLOFL_RPC/CONDBR2 -IOVDbSvc INFO Opening COOL connection for COOLOFL_CSC/CONDBR2 -IOVDbSvc INFO Disconnecting from COOLOFL_MDT/CONDBR2 -IOVDbSvc INFO Disconnecting from COOLOFL_CSC/CONDBR2 -IOVDbSvc INFO Added taginfo remove for /CSC/FTHOLD -IOVDbSvc INFO Added taginfo remove for /CSC/NOISE -IOVDbSvc INFO Added taginfo remove for /CSC/PED -IOVDbSvc INFO Added taginfo remove for /CSC/PSLOPE -IOVDbSvc INFO Added taginfo remove for /CSC/RMS -IOVDbSvc INFO Added taginfo remove for /CSC/STAT -IOVDbSvc INFO Added taginfo remove for /CSC/T0BASE -IOVDbSvc INFO Added taginfo remove for /CSC/T0PHASE -IOVDbSvc INFO Added taginfo remove for /EXT/DCS/MAGNETS/SENSORDATA -IOVDbSvc INFO Added taginfo remove for /GLOBAL/BField/Maps -IOVDbSvc INFO Added taginfo remove for /MDT/CABLING/MAP_SCHEMA -IOVDbSvc INFO Added taginfo remove for /MDT/CABLING/MEZZANINE_SCHEMA -IOVDbSvc INFO Added taginfo remove for /MDT/RTBLOB -IOVDbSvc INFO Added taginfo remove for /MDT/T0BLOB -IOVDbSvc INFO Added taginfo remove for /MUONALIGN/CSC/ILINES -IOVDbSvc INFO Added taginfo remove for /MUONALIGN/MDT/ASBUILTPARAMS -IOVDbSvc INFO Added taginfo remove for /MUONALIGN/MDT/BARREL -IOVDbSvc INFO Added taginfo remove for /MUONALIGN/MDT/ENDCAP/SIDEA -IOVDbSvc INFO Added taginfo remove for /MUONALIGN/MDT/ENDCAP/SIDEC -IOVDbSvc INFO Added taginfo remove for /MUONALIGN/TGC/SIDEA -IOVDbSvc INFO Added taginfo remove for /MUONALIGN/TGC/SIDEC -IOVDbSvc INFO Added taginfo remove for /RPC/CABLING/MAP_SCHEMA -IOVDbSvc INFO Added taginfo remove for /RPC/CABLING/MAP_SCHEMA_CORR -IOVDbSvc INFO Added taginfo remove for /RPC/DCS/DeadRopanels -IOVDbSvc INFO Added taginfo remove for /RPC/DCS/OffRopanels -IOVDbSvc INFO Added taginfo remove for /RPC/DQMF/ELEMENT_STATUS -IOVDbSvc INFO Added taginfo remove for /RPC/TRIGGER/CM_THR_ETA -IOVDbSvc INFO Added taginfo remove for /RPC/TRIGGER/CM_THR_PHI -IOVDbSvc INFO Added taginfo remove for /TDAQ/RunCtrl/SOR_Params -IOVDbSvc INFO Added taginfo remove for /TGC/CABLING/MAP_SCHEMA -GeoModelSvc INFO Explicitly initializing DetDescrCnvSvc -DetDescrCnvSvc INFO initializing -DetDescrCnvSvc INFO Found DetectorStore service -DetDescrCnvSvc INFO filling proxies for detector managers -DetDescrCnvSvc INFO filling address for CaloTTMgr with CLID 117659265 and storage type 68 to detector store -DetDescrCnvSvc INFO filling address for CaloMgr with CLID 4548337 and storage type 68 to detector store -DetDescrCnvSvc INFO filling address for CaloSuperCellMgr with CLID 241807251 and storage type 68 to detector store -DetDescrCnvSvc INFO filling address for CaloIdManager with CLID 125856940 and storage type 68 to detector store -DetDescrCnvSvc INFO filling address for LArIdManager with CLID 79554919 and storage type 68 to detector store -DetDescrCnvSvc INFO filling address for IdDict with CLID 2411 and storage type 68 to detector store -DetDescrCnvSvc INFO filling address for AtlasID with CLID 164875623 and storage type 68 to detector store -DetDescrCnvSvc INFO filling address for PixelID with CLID 2516 and storage type 68 to detector store -DetDescrCnvSvc INFO filling address for SCT_ID with CLID 2517 and storage type 68 to detector store -DetDescrCnvSvc INFO filling address for TRT_ID with CLID 2518 and storage type 68 to detector store -DetDescrCnvSvc INFO filling address for SiliconID with CLID 129452393 and storage type 68 to detector store -DetDescrCnvSvc INFO filling address for LArEM_ID with CLID 163583365 and storage type 68 to detector store -DetDescrCnvSvc INFO filling address for LArEM_SuperCell_ID with CLID 99488227 and storage type 68 to detector store -DetDescrCnvSvc INFO filling address for LArHEC_ID with CLID 3870484 and storage type 68 to detector store -DetDescrCnvSvc INFO filling address for LArHEC_SuperCell_ID with CLID 254277678 and storage type 68 to detector store -DetDescrCnvSvc INFO filling address for LArFCAL_ID with CLID 45738051 and storage type 68 to detector store -DetDescrCnvSvc INFO filling address for LArFCAL_SuperCell_ID with CLID 12829437 and storage type 68 to detector store -DetDescrCnvSvc INFO filling address for LArMiniFCAL_ID with CLID 79264204 and storage type 68 to detector store -DetDescrCnvSvc INFO filling address for LArOnlineID with CLID 158698068 and storage type 68 to detector store -DetDescrCnvSvc INFO filling address for TTOnlineID with CLID 38321944 and storage type 68 to detector store -DetDescrCnvSvc INFO filling address for LArOnline_SuperCellID with CLID 115600394 and storage type 68 to detector store -DetDescrCnvSvc INFO filling address for LArHVLineID with CLID 27863673 and storage type 68 to detector store -DetDescrCnvSvc INFO filling address for LArElectrodeID with CLID 80757351 and storage type 68 to detector store -DetDescrCnvSvc INFO filling address for TileID with CLID 2901 and storage type 68 to detector store -DetDescrCnvSvc INFO filling address for Tile_SuperCell_ID with CLID 49557789 and storage type 68 to detector store -DetDescrCnvSvc INFO filling address for TileHWID with CLID 2902 and storage type 68 to detector store -DetDescrCnvSvc INFO filling address for TileTBID with CLID 2903 and storage type 68 to detector store -DetDescrCnvSvc INFO filling address for MDTIDHELPER with CLID 4170 and storage type 68 to detector store -DetDescrCnvSvc INFO filling address for CSCIDHELPER with CLID 4171 and storage type 68 to detector store -DetDescrCnvSvc INFO filling address for RPCIDHELPER with CLID 4172 and storage type 68 to detector store -DetDescrCnvSvc INFO filling address for TGCIDHELPER with CLID 4173 and storage type 68 to detector store -DetDescrCnvSvc INFO filling address for CaloLVL1_ID with CLID 108133391 and storage type 68 to detector store -DetDescrCnvSvc INFO filling address for CaloCell_ID with CLID 123500438 and storage type 68 to detector store -DetDescrCnvSvc INFO filling address for CaloCell_SuperCell_ID with CLID 128365736 and storage type 68 to detector store -DetDescrCnvSvc INFO filling address for CaloDM_ID with CLID 167756483 and storage type 68 to detector store -DetDescrCnvSvc INFO filling address for ZdcID with CLID 190591643 and storage type 68 to detector store -GeoModelSvc.Muo... INFO Initializing ... -GeoModelSvc::RD...WARNING Getting PixTBMatComponents with default tag -GeoModelSvc::RD...WARNING Getting PixTBMaterials with default tag -GeoModelSvc::RD...WARNING Getting InDetMatComponents with default tag -GeoModelSvc::RD...WARNING Getting InDetMaterials with default tag -MuonGeoModel INFO MuonDetectorFactory - constructor MuonSystem OuterRadius 13000 Length 22030 -GeoModelSvc.Muo... INFO create MuonDetectorTool - package version = MuonGeoModel-00-00-00 -GeoModelSvc.Muo... INFO (from GeoModelSvc) AtlasVersion = <ATLAS-R2-2016-01-00-01> MuonVersion = <> -GeoModelSvc.Muo... INFO Keys for Muon Switches are (key) ATLAS-R2-2016-01-00-01 (node) ATLAS -GeoModelSvc.Muo... INFO (from GeoModelSvc) in AtlasVersion = <ATLAS-R2-2016-01-00-01> default MuonVersion is <MuonSpectrometer-R.08.01> -GeoModelSvc.Muo... INFO Properties have been set as follows: -GeoModelSvc.Muo... INFO LayoutName R -GeoModelSvc.Muo... INFO IncludeCutouts 0 -GeoModelSvc.Muo... INFO IncludeCutoutsBog 0 -GeoModelSvc.Muo... INFO IncludeCtbBis 0 -GeoModelSvc.Muo... INFO ControlAlines 111111 -GeoModelSvc.Muo... INFO MinimalGeoFlag 0 -GeoModelSvc.Muo... INFO EnableCscIntAlignment 1 -GeoModelSvc.Muo... INFO EnableCscIntAlignmentFromGM 0 -GeoModelSvc.Muo... INFO ControlCscIntAlines 111111 -GeoModelSvc.Muo... INFO EnableMdtDeformations 1 -GeoModelSvc.Muo... INFO EnableMdtAsBuiltParameters 1 -MuGM:MuonFactory INFO MuonLayout set to <R.08.01> = Development version for DC3 - infrastructures -MuGM:MuonFactory INFO BOG cutouts are activated 1 , all other cutouts are disabled 1 -MuGM:MuonFactory INFO Manager created for geometry version R.08.01 from DB MuonVersion <MuonSpectrometer-R.08.01> -MuonGeoModel.MYSQL INFO GeometryVersion set to <R.08.01> -MuGM:MuonFactory INFO Mysql helper class created here for geometry version R.08.01 from DB MuonVersion <MuonSpectrometer-R.08.01> -MuGM:MuonFactory INFO MDTIDHELPER retrieved from DetStore -EventPersistenc... INFO Added successfully Conversion service:ByteStreamCnvSvc -EventPersistenc... INFO Added successfully Conversion service:TagInfoMgr -EventPersistenc... INFO Added successfully Conversion service:DetDescrCnvSvc -MDT_IDDetDescrCnv INFO in createObj: creating a MdtIdHelper object in the detector store -IdDictDetDescrCnv INFO in initialize -IdDictDetDescrCnv INFO in createObj: creating a IdDictManager object in the detector store -IdDictDetDescrCnv INFO IdDictName: IdDictParser/ATLAS_IDS.xml -IdDictDetDescrCnv INFO Reading InnerDetector IdDict file InDetIdDictFiles/IdDictInnerDetector_IBL3D25-03.xml -IdDictDetDescrCnv INFO Reading LArCalorimeter IdDict file IdDictParser/IdDictLArCalorimeter_DC3-05-Comm-01.xml -IdDictDetDescrCnv INFO Reading TileCalorimeter IdDict file IdDictParser/IdDictTileCalorimeter.xml -IdDictDetDescrCnv INFO Reading Calorimeter IdDict file IdDictParser/IdDictCalorimeter_L1Onl.xml -IdDictDetDescrCnv INFO Reading MuonSpectrometer IdDict file IdDictParser/IdDictMuonSpectrometer_R.03.xml -IdDictDetDescrCnv INFO Reading ForwardDetectors IdDict file IdDictParser/IdDictForwardDetectors_2010.xml -IdDictDetDescrCnv INFO Found id dicts: -IdDictDetDescrCnv INFO Using dictionary tag: null -IdDictDetDescrCnv INFO Dictionary ATLAS version default DetDescr tag (using default) file -IdDictDetDescrCnv INFO Dictionary Calorimeter version default DetDescr tag CaloIdentifier-LVL1-02 file IdDictParser/IdDictCalorimeter_L1Onl.xml -IdDictDetDescrCnv INFO Dictionary ForwardDetectors version default DetDescr tag ForDetIdentifier-01 file IdDictParser/IdDictForwardDetectors_2010.xml -IdDictDetDescrCnv INFO Dictionary InnerDetector version IBL-DBM DetDescr tag InDetIdentifier-IBL3D25-02 file InDetIdDictFiles/IdDictInnerDetector_IBL3D25-03.xml -IdDictDetDescrCnv INFO Dictionary LArCalorimeter version fullAtlas DetDescr tag LArIdentifier-DC3-05-Comm file IdDictParser/IdDictLArCalorimeter_DC3-05-Comm-01.xml -IdDictDetDescrCnv INFO Dictionary LArElectrode version fullAtlas DetDescr tag (using default) file -IdDictDetDescrCnv INFO Dictionary LArHighVoltage version fullAtlas DetDescr tag (using default) file -IdDictDetDescrCnv INFO Dictionary MuonSpectrometer version R.03 DetDescr tag MuonIdentifier-08 file IdDictParser/IdDictMuonSpectrometer_R.03.xml -IdDictDetDescrCnv INFO Dictionary TileCalorimeter version fullAtlasAndTestBeam DetDescr tag TileIdentifier-00 file IdDictParser/IdDictTileCalorimeter.xml -AtlasDetectorIDHelper::initialize_from_dictionary - Warning: unable to find mm region index: group, region size 0 0 -AtlasDetectorIDHelper::initialize_from_dictionary - Warning: unable to find stgc region index: group, region size 0 0 -AtlasDetectorID::initLevelsFromDict - there are no sTGC entries in the dictionary! -AtlasDetectorID::initLevelsFromDict - there are no MM entries in the dictionary! - AtlasDetectorID::initialize_from_dictionary - OK -MdtIdHelper INFO MultiRange built successfully to Technology: MultiRange size is 210 -MdtIdHelper INFO MultiRange built successfully to detector element: Multilayer MultiRange size is 241 -MdtIdHelper INFO MultiRange built successfully to tube: MultiRange size is 241 -MdtIdHelper INFO Initializing MDT hash indices ... -MdtIdHelper INFO The element hash max is 1188 -MdtIdHelper INFO The detector element hash max is 2328 -MdtIdHelper INFO Initializing MDT hash indices for finding neighbors ... -MuGM:MuonFactory INFO RPCIDHELPER retrieved from DetStore -RPC_IDDetDescrCnv INFO in createObj: creating a RpcIdHelper object in the detector store -AtlasDetectorIDHelper::initialize_from_dictionary - Warning: unable to find mm region index: group, region size 0 0 -AtlasDetectorIDHelper::initialize_from_dictionary - Warning: unable to find stgc region index: group, region size 0 0 -AtlasDetectorID::initLevelsFromDict - there are no sTGC entries in the dictionary! -AtlasDetectorID::initLevelsFromDict - there are no MM entries in the dictionary! - AtlasDetectorID::initialize_from_dictionary - OK -RpcIdHelper INFO MultiRange built successfully to doubletR: MultiRange size is 241 -RpcIdHelper INFO MultiRange built successfully to detectorElement: DetectorElement MultiRange size is 241 -RpcIdHelper INFO MultiRange built successfully to rpcStrip: MultiRange size is 241 -RpcIdHelper INFO Initializing RPC hash indices ... -RpcIdHelper INFO The element hash max is 600 -RpcIdHelper INFO The detector element hash max is 1122 -RpcIdHelper INFO Initializing RPC hash indices for finding neighbors ... -MuGM:MuonFactory INFO TGCIDHELPER retrieved from DetStore -TGC_IDDetDescrCnv INFO in createObj: creating a TgcIdHelper object in the detector store -AtlasDetectorIDHelper::initialize_from_dictionary - Warning: unable to find mm region index: group, region size 0 0 -AtlasDetectorIDHelper::initialize_from_dictionary - Warning: unable to find stgc region index: group, region size 0 0 -AtlasDetectorID::initLevelsFromDict - there are no sTGC entries in the dictionary! -AtlasDetectorID::initLevelsFromDict - there are no MM entries in the dictionary! - AtlasDetectorID::initialize_from_dictionary - OK -TgcIdHelper INFO MultiRange built successfully to Technology: MultiRange size is 210 -TgcIdHelper INFO MultiRange built successfully to detector element: Multilayer MultiRange size is 210 -TgcIdHelper INFO MultiRange built successfully to channel: MultiRange size is 241 -TgcIdHelper INFO Initializing TGC hash indices ... -TgcIdHelper INFO The element hash max is 1578 -TgcIdHelper INFO The detector element hash max is 1578 -TgcIdHelper INFO Initializing TGC hash indices for finding neighbors ... -MuGM:MuonFactory INFO CSCIDHELPER retrieved from DetStore -CSC_IDDetDescrCnv INFO in createObj: creating a CcscIdHelper object in the detector store -AtlasDetectorIDHelper::initialize_from_dictionary - Warning: unable to find mm region index: group, region size 0 0 -AtlasDetectorIDHelper::initialize_from_dictionary - Warning: unable to find stgc region index: group, region size 0 0 -AtlasDetectorID::initLevelsFromDict - there are no sTGC entries in the dictionary! -AtlasDetectorID::initLevelsFromDict - there are no MM entries in the dictionary! - AtlasDetectorID::initialize_from_dictionary - OK -CscIdHelper INFO MultiRange built successfully to Technology: MultiRange size is 210 -CscIdHelper INFO MultiRange built successfully to detector element: Multilayer MultiRange size is 237 -CscIdHelper INFO MultiRange built successfully to cscStrip: MultiRange size is 241 -CscIdHelper INFO Initializing CSC hash indices ... -CscIdHelper INFO The element hash max is 32 -CscIdHelper INFO The detector element hash max is 64 -CscIdHelper INFO The channel hash max is 61440 -CscIdHelper INFO Initializing CSC hash indices for finding neighbors ... -MuGM:MuonFactory INFO **************** MuonDetectorFactory001 ************************ -MuGM:MuonFactory INFO *** Start building the Muon Geometry Tree ********************** -MuGM:RDBReadAtlas INFO Start retriving dbObjects with tag = <ATLAS-R2-2016-01-00-01> node <ATLAS> -RDBAccessSvc WARNING Could not get the tag for XtomoData node. Returning 0 pointer to IRDBQuery -MuGM:RDBReadAtlas INFO After getQuery XtomoData -In DblQ00Xtomo(data) -No XtomoData table in the MuonDD Database -MuGM:RDBReadAtlas INFO After new DblQ00Xtomo -MuGM:RDBReadAtlas INFO After m_dhxtomo.data() -MuGM:RDBReadAtlas INFO No Ascii aszt input found: looking for A-lines in ORACLE -MuGM:RDBReadAtlas INFO ASZT table found in Oracle -MuGM:RDBReadAtlas INFO ASZT size is 32 -MuGM:RDBReadAtlas INFO No Ascii iacsc input found: looking for A-lines in ORACLE -RDBAccessSvc WARNING Could not get the tag for ISZT node. Returning 0 pointer to IRDBQuery -MuGM:RDBReadAtlas INFO No ISZT table in Oracle -MuGM:RDBReadAtlas INFO Access granted for all dbObjects needed by muon detectors -MuonGeoModel.MYSQL INFO LayoutName (from DBAM) set to <R.08> -- relevant for CTB2004 -MuGM:ProcStations INFO Processing Stations and Components -MuGM:ProcStations INFO Processing Stations and Components DONE -MuGM:ProcTechnol.s INFO nMDT 13 nCSC 2 nTGC 22 nRPC 25 -MuGM:ProcTechnol.s INFO nDED 2 nSUP 4 nSPA 2 -MuGM:ProcTechnol.s INFO nCHV 7 nCRO 7 nCMI 6 nLBI 6 -MuGM:ProcPosition INFO *** N. of stations positioned in the setup 234 -MuGM:ProcPosition INFO *** N. of stations described in mysql 234 -MuGM:ProcPosition INFO *** N. of types 32 size of jtypvec 32 -MuGM:ProcPosition INFO *** : 234 kinds of stations (type*sub_type) -MuGM:ProcPosition INFO *** : 1758 physical stations in space - according to the MuonDD DataBase -MuGM:ProcCutouts INFO Processing Cutouts for geometry layout R.08 -MuGM:ProcCutouts INFO Processing Cutouts DONE -MuGM:RDBReadAtlas INFO ProcessTGCreadout - version 7 wirespacing 1.8 -MuGM:RDBReadAtlas INFO Intermediate Objects built from primary numbers -MuGM:MuonFactory INFO theMaterialManager retrieven successfully from the DetStore -MuGM:MuonFactory INFO MuonSystem description from OracleTag=<ATLAS-R2-2016-01-00-01> and node=<ATLAS> -MuGM:MuonFactory INFO TreeTop added to the Manager -MuGM:MuonFactory INFO Muon Layout R.08.01 -MuGM:MuonFactory INFO Fine Clash Fixing disabled: (should be ON/OFF for Simulation/Reconstruction) -MuGM:MuonFactory INFO **************** MuonDetectorFactory001 **************************** -MuGM:MuonFactory INFO *** The Muon Chamber Geometry Tree is built with -MuGM:MuonFactory INFO *** 1758 child volumes -MuGM:MuonFactory INFO *** 1839 independent elements and -MuGM:MuonFactory INFO *** 11473 elements cloned or shared -MuGM:MuonFactory INFO *** 234 kinds of stations -MuGM:MuonFactory INFO *** 1758 stations with alignable transforms -MuGM:MuonFactory INFO *** 148 stations are described as Assemblies -MuGM:MuonFactory INFO *** 1758 MuonStations -MuGM:MuonFactory INFO *** 2324 MDT Readout Elements 1186 MDT Detector Elements -MuGM:MuonFactory INFO *** 32 CSC Readout Elements 32 CSC Detector Elements -MuGM:MuonFactory INFO *** 1122 RPC Readout Elements 600 RPC Detector Elements -MuGM:MuonFactory INFO *** 1578 TGC Readout Elements 1578 TGC Detector Elements -MuGM:MuonFactory INFO ******************************************************************** -MuGM:MuonFactory INFO *** Inert Material built according to DB switches and config. ****** -MuGM:MuonFactory INFO *** The Muon Geometry Tree has 1758 child vol.s in total ******** -MuGM:MuonFactory INFO ******************************************************************** - -MGM::MuonDetect... INFO Init A/B Line Containers - done - size is respectively 1758/0 -MGM::MuonDetect... INFO Init of CSC I-Lines will be done via Conditions DB -MGM::MuonDetect... INFO Init I-Line Container - done - size is respectively 128 -MGM::MuonDetect... INFO I-Line for CSC wire layers loaded (Csc Internal Alignment) -MGM::MuonDetect... INFO According to configuration they WILL be used -MGM::MuonDetect... INFO Filling cache -GeoModelSvc INFO GeoModelSvc.MuonDetectorTool SZ= 230480Kb Time = 0.97S -ClassIDSvc INFO getRegistryEntries: read 1582 CLIDRegistry entries for module ALL -AthenaEventLoopMgr INFO Initializing AthenaEventLoopMgr - package version AthenaServices-00-00-00 -ClassIDSvc INFO getRegistryEntries: read 1948 CLIDRegistry entries for module ALL -ClassIDSvc INFO getRegistryEntries: read 436 CLIDRegistry entries for module ALL -ClassIDSvc INFO getRegistryEntries: read 305 CLIDRegistry entries for module ALL -ClassIDSvc INFO getRegistryEntries: read 289 CLIDRegistry entries for module ALL -CondInputLoader INFO Initializing CondInputLoader... -CondInputLoader INFO Adding base classes: - + ( 'CondAttrListCollection' , 'ConditionStore+/CSC/FTHOLD' ) -> - + ( 'CondAttrListCollection' , 'ConditionStore+/CSC/NOISE' ) -> - + ( 'CondAttrListCollection' , 'ConditionStore+/CSC/PED' ) -> - + ( 'CondAttrListCollection' , 'ConditionStore+/CSC/PSLOPE' ) -> - + ( 'CondAttrListCollection' , 'ConditionStore+/CSC/RMS' ) -> - + ( 'CondAttrListCollection' , 'ConditionStore+/CSC/STAT' ) -> - + ( 'CondAttrListCollection' , 'ConditionStore+/CSC/T0BASE' ) -> - + ( 'CondAttrListCollection' , 'ConditionStore+/CSC/T0PHASE' ) -> - + ( 'CondAttrListCollection' , 'ConditionStore+/EXT/DCS/MAGNETS/SENSORDATA' ) -> - + ( 'CondAttrListCollection' , 'ConditionStore+/GLOBAL/BField/Maps' ) -> - + ( 'CondAttrListCollection' , 'ConditionStore+/MDT/CABLING/MAP_SCHEMA' ) -> - + ( 'CondAttrListCollection' , 'ConditionStore+/MDT/CABLING/MEZZANINE_SCHEMA' ) -> - + ( 'CondAttrListCollection' , 'ConditionStore+/MDT/RTBLOB' ) -> - + ( 'CondAttrListCollection' , 'ConditionStore+/MDT/T0BLOB' ) -> - + ( 'CondAttrListCollection' , 'ConditionStore+/MUONALIGN/CSC/ILINES' ) -> - + ( 'CondAttrListCollection' , 'ConditionStore+/MUONALIGN/MDT/ASBUILTPARAMS' ) -> - + ( 'CondAttrListCollection' , 'ConditionStore+/MUONALIGN/MDT/BARREL' ) -> - + ( 'CondAttrListCollection' , 'ConditionStore+/MUONALIGN/MDT/ENDCAP/SIDEA' ) -> - + ( 'CondAttrListCollection' , 'ConditionStore+/MUONALIGN/MDT/ENDCAP/SIDEC' ) -> - + ( 'CondAttrListCollection' , 'ConditionStore+/MUONALIGN/TGC/SIDEA' ) -> - + ( 'CondAttrListCollection' , 'ConditionStore+/MUONALIGN/TGC/SIDEC' ) -> - + ( 'CondAttrListCollection' , 'ConditionStore+/RPC/CABLING/MAP_SCHEMA' ) -> - + ( 'CondAttrListCollection' , 'ConditionStore+/RPC/CABLING/MAP_SCHEMA_CORR' ) -> - + ( 'CondAttrListCollection' , 'ConditionStore+/RPC/DCS/DeadRopanels' ) -> - + ( 'CondAttrListCollection' , 'ConditionStore+/RPC/DCS/OffRopanels' ) -> - + ( 'CondAttrListCollection' , 'ConditionStore+/RPC/DQMF/ELEMENT_STATUS' ) -> - + ( 'CondAttrListCollection' , 'ConditionStore+/RPC/TRIGGER/CM_THR_ETA' ) -> - + ( 'CondAttrListCollection' , 'ConditionStore+/RPC/TRIGGER/CM_THR_PHI' ) -> -CondInputLoader INFO Will create WriteCondHandle dependencies for the following DataObjects: - + ( 'CondAttrListCollection' , 'ConditionStore+/CSC/FTHOLD' ) - + ( 'CondAttrListCollection' , 'ConditionStore+/CSC/NOISE' ) - + ( 'CondAttrListCollection' , 'ConditionStore+/CSC/PED' ) - + ( 'CondAttrListCollection' , 'ConditionStore+/CSC/PSLOPE' ) - + ( 'CondAttrListCollection' , 'ConditionStore+/CSC/RMS' ) - + ( 'CondAttrListCollection' , 'ConditionStore+/CSC/STAT' ) - + ( 'CondAttrListCollection' , 'ConditionStore+/CSC/T0BASE' ) - + ( 'CondAttrListCollection' , 'ConditionStore+/CSC/T0PHASE' ) - + ( 'CondAttrListCollection' , 'ConditionStore+/EXT/DCS/MAGNETS/SENSORDATA' ) - + ( 'CondAttrListCollection' , 'ConditionStore+/GLOBAL/BField/Maps' ) - + ( 'CondAttrListCollection' , 'ConditionStore+/MDT/CABLING/MAP_SCHEMA' ) - + ( 'CondAttrListCollection' , 'ConditionStore+/MDT/CABLING/MEZZANINE_SCHEMA' ) - + ( 'CondAttrListCollection' , 'ConditionStore+/MDT/RTBLOB' ) - + ( 'CondAttrListCollection' , 'ConditionStore+/MDT/T0BLOB' ) - + ( 'CondAttrListCollection' , 'ConditionStore+/MUONALIGN/CSC/ILINES' ) - + ( 'CondAttrListCollection' , 'ConditionStore+/MUONALIGN/MDT/ASBUILTPARAMS' ) - + ( 'CondAttrListCollection' , 'ConditionStore+/MUONALIGN/MDT/BARREL' ) - + ( 'CondAttrListCollection' , 'ConditionStore+/MUONALIGN/MDT/ENDCAP/SIDEA' ) - + ( 'CondAttrListCollection' , 'ConditionStore+/MUONALIGN/MDT/ENDCAP/SIDEC' ) - + ( 'CondAttrListCollection' , 'ConditionStore+/MUONALIGN/TGC/SIDEA' ) - + ( 'CondAttrListCollection' , 'ConditionStore+/MUONALIGN/TGC/SIDEC' ) - + ( 'CondAttrListCollection' , 'ConditionStore+/RPC/CABLING/MAP_SCHEMA' ) - + ( 'CondAttrListCollection' , 'ConditionStore+/RPC/CABLING/MAP_SCHEMA_CORR' ) - + ( 'CondAttrListCollection' , 'ConditionStore+/RPC/DCS/DeadRopanels' ) - + ( 'CondAttrListCollection' , 'ConditionStore+/RPC/DCS/OffRopanels' ) - + ( 'CondAttrListCollection' , 'ConditionStore+/RPC/DQMF/ELEMENT_STATUS' ) - + ( 'CondAttrListCollection' , 'ConditionStore+/RPC/TRIGGER/CM_THR_ETA' ) - + ( 'CondAttrListCollection' , 'ConditionStore+/RPC/TRIGGER/CM_THR_PHI' ) -MuonAlignmentCo... INFO Initilalizing -MuonAlignmentCo... INFO In initialize ---- # of folders registered is 7 -MuonAlignmentCo... INFO geometry version from the MuonDetectorManager = R.08.01 -MuonDetectorCon... INFO Initializing ... -AtlasFieldMapCo... INFO Initialize -AtlasFieldMapCo... INFO Initialize: Key ( 'AtlasFieldMapCondObj' , 'ConditionStore+fieldMapCondObj' ) has been succesfully registered -AtlasFieldMapCo... INFO Initialize: Will update the field map from conditions -AtlasFieldCache... INFO Initialize -AtlasFieldCache... INFO Initialize: Key ( 'AtlasFieldCacheCondObj' , 'ConditionStore+fieldCondObj' ) has been succesfully registered -AtlasFieldCache... INFO Initialize: Will update current from conditions -AtlasFieldCache... INFO Initialize: useDCS, useSoleCurrent, useToroCurrent. 1, 'UseSoleCurrent':7730.0000, 'UseToroCurrent':20400.000 -ClassIDSvc INFO getRegistryEntries: read 2342 CLIDRegistry entries for module ALL -ClassIDSvc INFO getRegistryEntries: read 1043 CLIDRegistry entries for module ALL RpcRawDataProvider INFO RpcRawDataProvider::initialize RpcRawDataProvider INFO 'DoSeededDecoding':False -ClassIDSvc INFO getRegistryEntries: read 2109 CLIDRegistry entries for module ALL -MuonRPC_CablingSvc INFO Initializing MuonRPC_CablingSvc - package version MuonRPC_Cabling-00-00-00 -ToolSvc.RPCCabl... INFO Initializing - folders names are: conf /RPC/CABLING/MAP_SCHEMA / corr /RPC/CABLING/MAP_SCHEMA_CORR -MuonRPC_CablingSvc INFO RPCCablingDbTool retrieved with handle TheRpcCablingDbTool = PublicToolHandle('RPCCablingDbTool/RPCCablingDbTool') -MuonRPC_CablingSvc INFO Register call-back against 2 folders listed below -MuonRPC_CablingSvc INFO Folder n. 1 </RPC/CABLING/MAP_SCHEMA> found in the DetStore -ClassIDSvc INFO getRegistryEntries: read 348 CLIDRegistry entries for module ALL -MuonRPC_CablingSvc INFO initMappingModel registered for call-back against folder </RPC/CABLING/MAP_SCHEMA> -MuonRPC_CablingSvc INFO Folder n. 2 </RPC/CABLING/MAP_SCHEMA_CORR> found in the DetStore -MuonRPC_CablingSvc INFO initMappingModel registered for call-back against folder </RPC/CABLING/MAP_SCHEMA_CORR> -MuonRPC_CablingSvc INFO RPCTriggerDbTool retrieved with statusCode = SUCCESS pointer = TheRpcTriggerDbTool = PublicToolHandle('RPCTriggerDbTool') -MuonRPC_CablingSvc INFO Register call-back against 2 folders listed below -MuonRPC_CablingSvc INFO Folder n. 1 </RPC/TRIGGER/CM_THR_ETA> found in the DetStore -MuonRPC_CablingSvc INFO initTrigRoadsModel registered for call-back against folder </RPC/TRIGGER/CM_THR_ETA> -MuonRPC_CablingSvc INFO Folder n. 2 </RPC/TRIGGER/CM_THR_PHI> found in the DetStore -MuonRPC_CablingSvc INFO initTrigRoadsModel registered for call-back against folder </RPC/TRIGGER/CM_THR_PHI> -ROBDataProviderSvc INFO Initializing ROBDataProviderSvc - package version ByteStreamCnvSvcBase-00-00-00 -ROBDataProviderSvc INFO ---> Filter out empty ROB fragments = 'filterEmptyROB':False -ROBDataProviderSvc INFO ---> Filter out specific ROBs by Status Code: # ROBs = 0 -ROBDataProviderSvc INFO ---> Filter out Sub Detector ROBs by Status Code: # Sub Detectors = 0 RpcRawDataProvi... INFO initialize() successful in RpcRawDataProvider.RPC_RawDataProviderToolMT TgcRawDataProvider INFO TgcRawDataProvider::initialize TgcRawDataProvider INFO 'DoSeededDecoding':False -ClassIDSvc INFO getRegistryEntries: read 1223 CLIDRegistry entries for module ALL TgcRawDataProvi... INFO initialize() successful in TgcRawDataProvider.TGC_RawDataProviderToolMT.TgcROD_Decoder TgcRawDataProvi... INFO Retrieved tool Decoder = PrivateToolHandle('Muon::TGC_RodDecoderReadout/TgcROD_Decoder') TgcRawDataProvi... INFO Retrieved service ServiceHandle('ROBDataProviderSvc') -MuonTGC_CablingSvc INFO for 1/12 sector initialize -ToolSvc.TGCCabl... INFO initialize -ToolSvc.TGCCabl... INFO readTGCMap from text -ToolSvc.TGCCabl... INFO readTGCMap found file /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2020-04-11T2140/Athena/22.0.12/InstallArea/x86_64-centos7-gcc8-opt/share/ASD2PP_diff_12_ONL.db -ToolSvc.TGCCabl... INFO giveASD2PP_DIFF_12 (m_ASD2PP_DIFF_12 is not NULL) TgcRawDataProvi... INFO initialize() successful in TgcRawDataProvider.TGC_RawDataProviderToolMT MdtRawDataProvider INFO MdtRawDataProvider::initialize MdtRawDataProvider INFO 'DoSeededDecoding':False -ClassIDSvc INFO getRegistryEntries: read 1209 CLIDRegistry entries for module ALL MdtRawDataProvi... INFO Retrieved service ServiceHandle('ROBDataProviderSvc') MdtRawDataProvi... INFO Processing configuration for layouts with BME chambers. MdtRawDataProvi... INFO Processing configuration for layouts with BMG chambers. MdtRawDataProvi... INFO Retrieved tool Decoder = PrivateToolHandle('MdtROD_Decoder/MdtROD_Decoder') MdtRawDataProvi... INFO initialize() successful in MdtRawDataProvider.MDT_RawDataProviderToolMT -ClassIDSvc INFO getRegistryEntries: read 1116 CLIDRegistry entries for module ALL CscRawDataProvi... INFO Retrieved service ServiceHandle('ROBDataProviderSvc') CscRawDataProvi... INFO Retrieved tool Decoder = PrivateToolHandle('Muon::CscROD_Decoder/CscROD_Decoder') CscRawDataProvi... INFO The Muon Geometry version is R.08.01 CscRawDataProvi... INFO initialize() successful in CscRawDataProvider.CSC_RawDataProviderToolMT -ClassIDSvc INFO getRegistryEntries: read 53 CLIDRegistry entries for module ALL -RpcRdoToRpcPrep... INFO package version = MuonRPC_CnvTools-00-00-00 RpcRdoToRpcPrep... INFO properties are RpcRdoToRpcPrep... INFO processingData 0 RpcRdoToRpcPrep... INFO produceRpcCoinDatafromTriggerWords 1 @@ -578,549 +31,8 @@ RpcRdoToRpcPrep... INFO Rpc Cabling Svc name is dataLike RpcRdoToRpcPrep... INFO Retrieved DecodingTool = PrivateToolHandle('Muon::RpcRdoToPrepDataToolMT/RpcRdoToRpcPrepDataTool') TgcRdoToTgcPrep... INFO initialize() successful in TgcRdoToTgcPrepData.TgcRdoToTgcPrepDataTool TgcRdoToTgcPrep... INFO Retrieved DecodingTool = PrivateToolHandle('Muon::TgcRdoToPrepDataToolMT/TgcRdoToTgcPrepDataTool') -MdtRdoToMdtPrep... INFO Processing configuration for layouts with BMG chambers. -AtlasFieldSvc INFO initialize() ... -AtlasFieldSvc INFO maps will be chosen reading COOL folder /GLOBAL/BField/Maps -AtlasFieldSvc INFO magnet currents will be read from COOL folder /EXT/DCS/MAGNETS/SENSORDATA -AtlasFieldSvc INFO Booked callback for /EXT/DCS/MAGNETS/SENSORDATA -AtlasFieldSvc INFO initialize() successful -MdtRdoToMdtPrep... INFO Processing configuration for layouts with BME chambers. -MdtRdoToMdtPrep... INFO Processing configuration for layouts with BMG chambers. -MdtRdoToMdtPrep... INFO Retrieved DecodingTool = PrivateToolHandle('Muon::MdtRdoToPrepDataToolMT/MdtRdoToMdtPrepDataTool') CscRdoToCscPrep... INFO The Geometry version is MuonSpectrometer-R.08.01 -ClassIDSvc INFO getRegistryEntries: read 114 CLIDRegistry entries for module ALL CscRdoToCscPrep... INFO Retrieved CscRdoToCscPrepDataTool = PrivateToolHandle('Muon::CscRdoToCscPrepDataToolMT/CscRdoToCscPrepDataTool') -EventSelector WARNING InputCollections not properly set, checking EventStorageInputSvc properties -EventSelector INFO reinitialization... -ClassIDSvc INFO getRegistryEntries: read 440 CLIDRegistry entries for module ALL -EventSelector INFO Retrieved InputCollections from InputSvc -ByteStreamInputSvc INFO Initializing ByteStreamInputSvc - package version ByteStreamCnvSvc-00-00-00 -EventSelector INFO reinitialization... -AthenaEventLoopMgr INFO Setup EventSelector service EventSelector -ApplicationMgr INFO Application Manager Initialized successfully -ApplicationMgr SUCCESS ****************************** Algorithm Sequence **************************** -ApplicationMgr SUCCESS AthSequencer/AthMasterSeq -ApplicationMgr SUCCESS AthSequencer/AthAlgEvtSeq -ApplicationMgr SUCCESS AthSequencer/AthBeginSeq -ApplicationMgr SUCCESS AthIncFirerAlg/BeginIncFiringAlg -ApplicationMgr SUCCESS IncidentProcAlg/IncidentProcAlg1 -ApplicationMgr SUCCESS AthSequencer/AthAllAlgSeq -ApplicationMgr SUCCESS AthSequencer/AthCondSeq -ApplicationMgr SUCCESS CondInputLoader/CondInputLoader -ApplicationMgr SUCCESS MuonAlignmentCondAlg/MuonAlignmentCondAlg -ApplicationMgr SUCCESS MuonDetectorCondAlg/MuonDetectorCondAlg -ApplicationMgr SUCCESS RpcCablingCondAlg/RpcCablingCondAlg -ApplicationMgr SUCCESS MuonMDT_CablingAlg/MuonMDT_CablingAlg -ApplicationMgr SUCCESS MagField::AtlasFieldMapCondAlg/AtlasFieldMapCondAlg -ApplicationMgr SUCCESS MagField::AtlasFieldCacheCondAlg/AtlasFieldCacheCondAlg -ApplicationMgr SUCCESS RpcCondDbAlg/RpcCondDbAlg -ApplicationMgr SUCCESS MdtCalibDbAlg/MdtCalibDbAlg -ApplicationMgr SUCCESS CscCondDbAlg/CscCondDbAlg -ApplicationMgr SUCCESS AthSequencer/AthAlgSeq -ApplicationMgr SUCCESS MuonCacheCreator/MuonCacheCreator -ApplicationMgr SUCCESS Muon::RpcRawDataProvider/RpcRawDataProvider -ApplicationMgr SUCCESS Muon::TgcRawDataProvider/TgcRawDataProvider -ApplicationMgr SUCCESS Muon::MdtRawDataProvider/MdtRawDataProvider -ApplicationMgr SUCCESS Muon::CscRawDataProvider/CscRawDataProvider -ApplicationMgr SUCCESS RpcRdoToRpcPrepData/RpcRdoToRpcPrepData -ApplicationMgr SUCCESS TgcRdoToTgcPrepData/TgcRdoToTgcPrepData -ApplicationMgr SUCCESS MdtRdoToMdtPrepData/MdtRdoToMdtPrepData -ApplicationMgr SUCCESS CscRdoToCscPrepData/CscRdoToCscPrepData -ApplicationMgr SUCCESS CscThresholdClusterBuilder/CscThresholdClusterBuilder -ApplicationMgr SUCCESS AthSequencer/AthEndSeq -ApplicationMgr SUCCESS AthIncFirerAlg/EndIncFiringAlg -ApplicationMgr SUCCESS IncidentProcAlg/IncidentProcAlg2 -ApplicationMgr SUCCESS AthSequencer/AthOutSeq -ApplicationMgr SUCCESS AthSequencer/AthRegSeq -ApplicationMgr SUCCESS ****************************************************************************** -ByteStreamInputSvc INFO Picked valid file: /cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/TrigP1Test/data17_13TeV.00327265.physics_EnhancedBias.merge.RAW._lb0100._SFO-1._0001.1 -CondInputLoader INFO created CondCont<CondAttrListCollection> with key 'ConditionStore+/CSC/FTHOLD' -CondInputLoader INFO created CondCont<CondAttrListCollection> with key 'ConditionStore+/CSC/NOISE' -CondInputLoader INFO created CondCont<CondAttrListCollection> with key 'ConditionStore+/CSC/PED' -CondInputLoader INFO created CondCont<CondAttrListCollection> with key 'ConditionStore+/CSC/PSLOPE' -CondInputLoader INFO created CondCont<CondAttrListCollection> with key 'ConditionStore+/CSC/RMS' -CondInputLoader INFO created CondCont<CondAttrListCollection> with key 'ConditionStore+/CSC/STAT' -CondInputLoader INFO created CondCont<CondAttrListCollection> with key 'ConditionStore+/CSC/T0BASE' -CondInputLoader INFO created CondCont<CondAttrListCollection> with key 'ConditionStore+/CSC/T0PHASE' -CondInputLoader INFO created CondCont<CondAttrListCollection> with key 'ConditionStore+/EXT/DCS/MAGNETS/SENSORDATA' -CondInputLoader INFO created CondCont<CondAttrListCollection> with key 'ConditionStore+/GLOBAL/BField/Maps' -CondInputLoader INFO created CondCont<CondAttrListCollection> with key 'ConditionStore+/MDT/CABLING/MAP_SCHEMA' -CondInputLoader INFO created CondCont<CondAttrListCollection> with key 'ConditionStore+/MDT/CABLING/MEZZANINE_SCHEMA' -CondInputLoader INFO created CondCont<CondAttrListCollection> with key 'ConditionStore+/MDT/RTBLOB' -CondInputLoader INFO created CondCont<CondAttrListCollection> with key 'ConditionStore+/MDT/T0BLOB' -CondInputLoader INFO created CondCont<CondAttrListCollection> with key 'ConditionStore+/MUONALIGN/CSC/ILINES' -CondInputLoader INFO created CondCont<CondAttrListCollection> with key 'ConditionStore+/MUONALIGN/MDT/ASBUILTPARAMS' -CondInputLoader INFO created CondCont<CondAttrListCollection> with key 'ConditionStore+/MUONALIGN/MDT/BARREL' -CondInputLoader INFO created CondCont<CondAttrListCollection> with key 'ConditionStore+/MUONALIGN/MDT/ENDCAP/SIDEA' -CondInputLoader INFO created CondCont<CondAttrListCollection> with key 'ConditionStore+/MUONALIGN/MDT/ENDCAP/SIDEC' -CondInputLoader INFO created CondCont<CondAttrListCollection> with key 'ConditionStore+/MUONALIGN/TGC/SIDEA' -CondInputLoader INFO created CondCont<CondAttrListCollection> with key 'ConditionStore+/MUONALIGN/TGC/SIDEC' -CondInputLoader INFO created CondCont<CondAttrListCollection> with key 'ConditionStore+/RPC/CABLING/MAP_SCHEMA' -CondInputLoader INFO created CondCont<CondAttrListCollection> with key 'ConditionStore+/RPC/CABLING/MAP_SCHEMA_CORR' -CondInputLoader INFO created CondCont<CondAttrListCollection> with key 'ConditionStore+/RPC/DCS/DeadRopanels' -CondInputLoader INFO created CondCont<CondAttrListCollection> with key 'ConditionStore+/RPC/DCS/OffRopanels' -CondInputLoader INFO created CondCont<CondAttrListCollection> with key 'ConditionStore+/RPC/DQMF/ELEMENT_STATUS' -CondInputLoader INFO created CondCont<CondAttrListCollection> with key 'ConditionStore+/RPC/TRIGGER/CM_THR_ETA' -CondInputLoader INFO created CondCont<CondAttrListCollection> with key 'ConditionStore+/RPC/TRIGGER/CM_THR_PHI' -ApplicationMgr INFO Application Manager Started successfully -EventInfoByteSt... INFO IsSimulation : 0 -EventInfoByteSt... INFO IsTestbeam : 0 -EventInfoByteSt... INFO IsCalibration : 0 -AthenaEventLoopMgr INFO ===>>> start of run 327265 <<<=== -IOVDbSvc INFO Opening COOL connection for COOLOFL_DCS/CONDBR2 -IOVDbSvc INFO Disconnecting from COOLOFL_DCS/CONDBR2 -EventPersistenc... INFO Added successfully Conversion service:AthenaPoolCnvSvc -IOVDbSvc INFO Opening COOL connection for COOLONL_GLOBAL/CONDBR2 -IOVDbFolder INFO HVS tag CONDBR2-BLKPA-2018-13 resolved to BFieldMap-Run1-14m-v01 for folder /GLOBAL/BField/Maps -IOVDbSvc INFO Disconnecting from COOLONL_GLOBAL/CONDBR2 -IOVDbSvc INFO Opening COOL connection for COOLONL_RPC/CONDBR2 -IOVDbFolder INFO HVS tag CONDBR2-BLKPA-2018-13 resolved to RPCCablingMapSchema_2016_2017_01 for folder /RPC/CABLING/MAP_SCHEMA -IOVDbFolder INFO HVS tag CONDBR2-BLKPA-2018-13 resolved to RPCCablingMapSchemaCorr_2016_2017_01 for folder /RPC/CABLING/MAP_SCHEMA_CORR -IOVDbFolder INFO HVS tag CONDBR2-BLKPA-2018-13 resolved to RPCTriggerCMThrEta_RUN1-RUN2-HI-02 for folder /RPC/TRIGGER/CM_THR_ETA -IOVDbFolder INFO HVS tag CONDBR2-BLKPA-2018-13 resolved to RPCTriggerCMThrPhi_RUN1-RUN2-HI-02 for folder /RPC/TRIGGER/CM_THR_PHI -IOVDbSvc INFO Disconnecting from COOLONL_RPC/CONDBR2 -MuonRPC_CablingSvc INFO initMappingModel has been called -MuonRPC_CablingSvc INFO ToolHandle in initMappingModel - <TheRpcCablingDbTool = PublicToolHandle('RPCCablingDbTool/RPCCablingDbTool')> -MuonRPC_CablingSvc INFO Retrieving cabling singleton; to create an empty one or to get the existing one -RPCcabling INFO CablingRPC---singleton constructor ---- this must be executed just once -RPCcabling INFO CablingRPC---The singleton will fill the maps from the COOL streams -RPCcabling INFO CablingRPC---InitMaps from COOL cannot be executed NOW: empty string -RPCcabling INFO CablingRPC---The singleton is created here -RPCcabling INFO CablingRPC--- cacheCleared: s_status = 0 -MuonRPC_CablingSvc INFO Cabling singleton cache has been cleared -MuonRPC_CablingSvc INFO Trigger roads will be loaded from COOL -ToolSvc.RPCCabl... INFO LoadParameters /RPC/CABLING/MAP_SCHEMA I=2 -ToolSvc.RPCCabl... INFO loadRPCMap --- Load Map from DB -ToolSvc.RPCCabl... INFO Try to read from folder </RPC/CABLING/MAP_SCHEMA> -ToolSvc.RPCCabl... INFO CondAttrListCollection from DB folder have been obtained with size 1 -ToolSvc.RPCCabl... INFO Loop over CondAttrListCollection ic = 1 -ToolSvc.RPCCabl... INFO After Reading folder, Configuration string size is 222202 -ToolSvc.RPCCabl... INFO LoadParameters /RPC/CABLING/MAP_SCHEMA_CORR I=2 -ToolSvc.RPCCabl... INFO loadRPCCorr --- Load Corrections from DB -ToolSvc.RPCCabl... INFO Try to read from folder </RPC/CABLING/MAP_SCHEMA_CORR> -ToolSvc.RPCCabl... INFO CondAttrListCollection from DB folder have been obtained with size 1 -ToolSvc.RPCCabl... INFO After Reading folder, Correction string size is 29369 -MuonRPC_CablingSvc INFO InitMappingModel: Trigger roads not yet loaded from COOL - postpone cabling initialization -MuonRPC_CablingSvc INFO initTrigRoadsModel has been called -MuonRPC_CablingSvc INFO Trigger roads will be loaded from COOL -MuonRPC_CablingSvc INFO Retrieve the pointer to the cabling singleton -RPCcabling INFO CablingRPC--- cacheCleared: s_status = 0 -MuonRPC_CablingSvc INFO Cabling singleton cache has been cleared -ToolSvc.RPCTrig... INFO LoadParameters /RPC/TRIGGER/CM_THR_ETA I=2 -ToolSvc.RPCTrig... INFO LoadParameters /RPC/TRIGGER/CM_THR_PHI I=2 -MuonRPC_CablingSvc INFO ======== RPC Trigger Roads from COOL - Header infos ======== -MuonRPC_CablingSvc INFO -RPC LVL1 Configuration 10.6 with roads from Feb 2012 -L1 THRESHOLDS: MU4 MU6 MU10 MU11 MU15 MU20 -Road version: "road_files_120209" -CMA th0 th1 th2 -eta low-pt mu4 mu6 mu10 -phi low-pt mu4 mu6 mu10 -eta high-pt mu11 mu15 mu20 -phi high-pt mu11 mu15 mu15 - - -RPCcabling INFO CablingRPC---InitMaps from COOL: going to read configuration -RPCcabling INFO CablingRPC--->> RPC cabling map from COOL << -RPCcabling INFO CablingRPC--- ReadConf: map has size 222202 -RPCcabling INFO CablingRPC--- ReadConf: map n. of lines read is 924 -RPCcabling INFO CablingRPC--- ReadConf: version is 5.0 Atlas R_07_03_RUN2ver104 -RPCcabling INFO CablingRPC--- buildRDOmap -RPCcabling INFO CablingRPC---InitMaps from COOL: going to read corrections to configuration -RPCcabling INFO CablingRPC--->> RPC cabling corrections from COOL << -RPCcabling INFO CablingRPC--- ReadCorr: CorrMap has size 29369 -RPCcabling INFO CablingRPC--- ReadConf: CorrMap n. of lines read is 743 -RPCcabling INFO CablingRPC---InitMaps from COOL - maps have been parsed -MuonRPC_CablingSvc INFO InitTrigRoadsModel: RPC cabling model is loaded! -Level-1 configuration database version 5.0 Atlas R_07_03_RUN2ver104 read. -Contains 26 Trigger Sector Types: -negative sectors 0 - 15 ==> 18 2 24 3 19 2 24 4 20 2 24 1 18 5 25 6 -negative sectors 16 - 31 ==> 21 13 26 6 21 7 16 8 14 7 16 6 21 13 26 1 -positive sectors 32 - 47 ==> 9 24 2 22 9 24 2 23 10 24 2 18 1 25 5 18 -positive sectors 48 - 63 ==> 1 26 13 21 6 17 12 15 11 17 12 21 6 26 13 22 - -MuonRPC_CablingSvc INFO buildOfflineOnlineMap -MuonRPC_CablingSvc INFO Applying FeetPadThresholds : 0,2,5 -MuonRPC_CablingSvc INFO MuonRPC_CablingSvc initialized succesfully -AtlasFieldSvc INFO reading magnetic field map filenames from COOL -AtlasFieldSvc INFO found map of type GlobalMap with soleCur=7730 toroCur=20400 (path file:MagneticFieldMaps/bfieldmap_7730_20400_14m.root) -AtlasFieldSvc INFO found map of type SolenoidMap with soleCur=7730 toroCur=0 (path file:MagneticFieldMaps/bfieldmap_7730_0_14m.root) -AtlasFieldSvc INFO found map of type ToroidMap with soleCur=0 toroCur=20400 (path file:MagneticFieldMaps/bfieldmap_0_20400_14m.root) -AtlasFieldSvc INFO no need to update map set -AtlasFieldSvc INFO Attempt 1 at reading currents from DCS (using channel name) -AtlasFieldSvc INFO Trying to read from DCS: [channel name, index, value] CentralSol_Current , 1 , 7729.99 -AtlasFieldSvc INFO Trying to read from DCS: [channel name, index, value] CentralSol_SCurrent , 2 , 7730 -AtlasFieldSvc INFO Trying to read from DCS: [channel name, index, value] Toroids_Current , 3 , 20399.9 -AtlasFieldSvc INFO Trying to read from DCS: [channel name, index, value] Toroids_SCurrent , 4 , 20397.7 -AtlasFieldSvc INFO Currents read from DCS: solenoid 7729.99 toroid 20399.9 -AtlasFieldSvc INFO Initializing the field map (solenoidCurrent=7729.99 toroidCurrent=20399.9) -AtlasFieldSvc INFO reading the map from /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/atlas/offline/ReleaseData/v20/MagneticFieldMaps/bfieldmap_7730_20400_14m.root -AtlasFieldSvc INFO Initialized the field map from /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/atlas/offline/ReleaseData/v20/MagneticFieldMaps/bfieldmap_7730_20400_14m.root -AtlasFieldSvc INFO Solenoid zone id 7000 -ByteStreamCnvSvc INFO problem adding converter for CLID [2101] -ByteStreamCnvSvc WARNING Cannot get converter for EventInfo -AthenaEventLoopMgr INFO ===>>> start processing event #186525031, run #327265 0 events processed so far <<<=== -IOVDbSvc INFO Opening COOL connection for COOLOFL_CSC/CONDBR2 -IOVDbFolder INFO HVS tag CONDBR2-BLKPA-2018-13 resolved to CscFthold-RUN2-BLK-UPD1-007-00 for folder /CSC/FTHOLD -IOVDbFolder INFO HVS tag CONDBR2-BLKPA-2018-13 resolved to CscNoise-RUN2-BLK-UPD1-007-00 for folder /CSC/NOISE -IOVDbFolder INFO HVS tag CONDBR2-BLKPA-2018-13 resolved to CscPed-RUN2-BLK-UPD1-007-00 for folder /CSC/PED -IOVDbFolder INFO HVS tag CONDBR2-BLKPA-2018-13 resolved to CscPslope-RUN2-BLK-UPD1-000-00 for folder /CSC/PSLOPE -IOVDbFolder INFO HVS tag CONDBR2-BLKPA-2018-13 resolved to CscRms-RUN2-BLK-UPD1-003-00 for folder /CSC/RMS -IOVDbFolder INFO HVS tag CONDBR2-BLKPA-2018-13 resolved to CscStat-RUN2-BLK-UPD1-008-00 for folder /CSC/STAT -IOVDbFolder INFO HVS tag CONDBR2-BLKPA-2018-13 resolved to CscT0base-RUN2-BLK-UPD1-001-00 for folder /CSC/T0BASE -IOVDbFolder INFO HVS tag CONDBR2-BLKPA-2018-13 resolved to CscT0phase-RUN2-BLK-UPD2-001-00 for folder /CSC/T0PHASE -IOVDbSvc INFO Disconnecting from COOLOFL_CSC/CONDBR2 -IOVDbSvc INFO Opening COOL connection for COOLONL_MDT/CONDBR2 -IOVDbFolder INFO HVS tag CONDBR2-BLKPA-2018-13 resolved to MDTCablingMapSchema_BMG_01 for folder /MDT/CABLING/MAP_SCHEMA -IOVDbFolder INFO HVS tag CONDBR2-BLKPA-2018-13 resolved to MDTCablingMezzanineSchema_M5-RUN2 for folder /MDT/CABLING/MEZZANINE_SCHEMA -IOVDbSvc INFO Disconnecting from COOLONL_MDT/CONDBR2 -IOVDbSvc INFO Opening COOL connection for COOLOFL_MDT/CONDBR2 -IOVDbFolder INFO HVS tag CONDBR2-BLKPA-2018-13 resolved to MDTRT-RUN2-UPD4-21 for folder /MDT/RTBLOB -IOVDbFolder INFO HVS tag CONDBR2-BLKPA-2018-13 resolved to MDTT0-RUN2-UPD4-21 for folder /MDT/T0BLOB -IOVDbSvc INFO Disconnecting from COOLOFL_MDT/CONDBR2 -IOVDbSvc INFO Opening COOL connection for COOLOFL_MUONALIGN/CONDBR2 -IOVDbFolder INFO HVS tag CONDBR2-BLKPA-2018-13 resolved to MuonAlignCscIlines-UPD1-02 for folder /MUONALIGN/CSC/ILINES -IOVDbFolder INFO HVS tag CONDBR2-BLKPA-2018-13 resolved to MuonAlignMdtAsbuiltparams-RUN2-BA_ONLY-UPD4-00 for folder /MUONALIGN/MDT/ASBUILTPARAMS -IOVDbFolder INFO HVS tag CONDBR2-BLKPA-2018-13 resolved to MuonAlignMDTBarrelAlign-RUN2-BA_ROLLING_11-BLKP-UPD4-00 for folder /MUONALIGN/MDT/BARREL -IOVDbFolder INFO HVS tag CONDBR2-BLKPA-2018-13 resolved to MuonAlignMDTEndCapAAlign-RUN2-ECA_ROLLING_2015_03_01-UPD4-02 for folder /MUONALIGN/MDT/ENDCAP/SIDEA -IOVDbFolder INFO HVS tag CONDBR2-BLKPA-2018-13 resolved to MuonAlignMDTEndCapCAlign-RUN2-ECC_ROLLING_2015_03_01-UPD4-02 for folder /MUONALIGN/MDT/ENDCAP/SIDEC -IOVDbFolder INFO HVS tag CONDBR2-BLKPA-2018-13 resolved to MuonAlignTGCEndCapAAlign-RUN2-TGCA_ROLLING_2011_01-ES1-UPD1-03 for folder /MUONALIGN/TGC/SIDEA -IOVDbFolder INFO HVS tag CONDBR2-BLKPA-2018-13 resolved to MuonAlignTGCEndCapCAlign-RUN2-TGCC_ROLLING_2011_01-ES1-UPD1-03 for folder /MUONALIGN/TGC/SIDEC -IOVDbSvc INFO Disconnecting from COOLOFL_MUONALIGN/CONDBR2 -IOVDbSvc INFO Opening COOL connection for COOLOFL_RPC/CONDBR2 -IOVDbFolder INFO HVS tag CONDBR2-BLKPA-2018-13 resolved to RPCDQMFElementStatus_Run1_UPD4-RUN2-01 for folder /RPC/DQMF/ELEMENT_STATUS -IOVDbSvc INFO Disconnecting from COOLOFL_RPC/CONDBR2 -MuonAlignmentCo... INFO Load alignment parameters from DB folder </MUONALIGN/CSC/ILINES> -MuonAlignmentCo... INFO Size of CSC/ILINES CondAttrListCollection ( 'CondAttrListCollection' , 'ConditionStore+/MUONALIGN/CSC/ILINES' ) readCscILinesCdo->size()= 1 -MuonAlignmentCo... INFO Range of CSC/ILINES input is {[0,0,t:1425168000] - [t:4294967294.854775807]} -MGM::MuonDetect... INFO temporary CSC I-line container with size = 128 -MGM::MuonDetect... INFO # of CSC I-lines read from the ILineMapContainer in StoreGate is 128 -MGM::MuonDetect... INFO # of deltaTransforms updated according to A-lines is 128 -MGM::MuonDetect... INFO # of entries in the CSC I-lines historical container is 128 -MuonAlignmentCo... INFO recorded new CscInternalAlignmentMapContainer with range {[0,0,t:1425168000] - [t:4294967294.854775807]} into Conditions Store -MuonAlignmentCo... INFO Load alignment parameters from DB folder </MUONALIGN/MDT/ASBUILTPARAMS> -MuonAlignmentCo... INFO Size of MDT/ASBUILTPARAMS CondAttrListCollection ( 'CondAttrListCollection' , 'ConditionStore+/MUONALIGN/MDT/ASBUILTPARAMS' ) ->size()= 1 -MuonAlignmentCo... INFO Range of MDT/ASBUILTPARAMS input is {[0,0,t:0] - [t:4294967294.854775807]} -MGM::MuonDetect... INFO temporary As-Built container with size = 628 -MGM::MuonDetect... INFO # of MDT As-Built read from the MdtAsBuiltMapContainer in StoreGate is 628 -MGM::MuonDetect... INFO # of deltaTransforms updated according to As-Built is 628 -MGM::MuonDetect... INFO # of entries in the MdtAsBuilt historical container is 628 -MuonAlignmentCo... INFO recorded new MdtAsBuiltMapContainer with range {[0,0,t:0] - [t:4294967294.854775807]} into Conditions Store -MuonAlignmentCo... INFO Load alignment parameters from DB folder </MUONALIGN/MDT/BARREL> -MuonAlignmentCo... INFO Size of /MUONALIGN/MDT/BARREL CondAttrListCollection ( 'CondAttrListCollection' , 'ConditionStore+/MUONALIGN/MDT/BARREL' ) readCdo->size()= 1 -MuonAlignmentCo... INFO Range of /MUONALIGN/MDT/BARREL input is, ALines: {[0,0,t:1497851700] - [t:1498737300]} BLines: {[0,0,t:1497851700] - [t:1498737300]} -MuonAlignmentCo... INFO Data read from folder /MUONALIGN/MDT/BARREL have IoV = 195569 -MuonAlignmentCo... INFO A- and B-Lines parameters from DB folder </MUONALIGN/MDT/BARREL> loaded -MuonAlignmentCo... INFO Load alignment parameters from DB folder </MUONALIGN/MDT/ENDCAP/SIDEA> -MuonAlignmentCo... INFO Size of /MUONALIGN/MDT/ENDCAP/SIDEA CondAttrListCollection ( 'CondAttrListCollection' , 'ConditionStore+/MUONALIGN/MDT/ENDCAP/SIDEA' ) readCdo->size()= 1 -MuonAlignmentCo... INFO Range of /MUONALIGN/MDT/ENDCAP/SIDEA input is, ALines: {[0,0,t:1497891240] - [t:1497898380]} BLines: {[0,0,t:1497891240] - [t:1497898380]} -MuonAlignmentCo... INFO Data read from folder /MUONALIGN/MDT/ENDCAP/SIDEA have IoV = 195588 -MuonAlignmentCo... INFO A- and B-Lines parameters from DB folder </MUONALIGN/MDT/ENDCAP/SIDEA> loaded -MuonAlignmentCo... INFO Load alignment parameters from DB folder </MUONALIGN/MDT/ENDCAP/SIDEC> -MuonAlignmentCo... INFO Size of /MUONALIGN/MDT/ENDCAP/SIDEC CondAttrListCollection ( 'CondAttrListCollection' , 'ConditionStore+/MUONALIGN/MDT/ENDCAP/SIDEC' ) readCdo->size()= 1 -MuonAlignmentCo... INFO Range of /MUONALIGN/MDT/ENDCAP/SIDEC input is, ALines: {[0,0,t:1497892260] - [t:1497899460]} BLines: {[0,0,t:1497892260] - [t:1497899460]} -MuonAlignmentCo... INFO Data read from folder /MUONALIGN/MDT/ENDCAP/SIDEC have IoV = 195599 -MuonAlignmentCo... INFO A- and B-Lines parameters from DB folder </MUONALIGN/MDT/ENDCAP/SIDEC> loaded -MuonAlignmentCo... INFO Load alignment parameters from DB folder </MUONALIGN/TGC/SIDEA> -MuonAlignmentCo... INFO No BLines decoding will be attempted for folder named /MUONALIGN/TGC/SIDEA -MuonAlignmentCo... INFO Size of /MUONALIGN/TGC/SIDEA CondAttrListCollection ( 'CondAttrListCollection' , 'ConditionStore+/MUONALIGN/TGC/SIDEA' ) readCdo->size()= 1 -MuonAlignmentCo... INFO Range of /MUONALIGN/TGC/SIDEA input is, ALines: {[0,0,t:0] - [t:4294967294.854775807]} -MuonAlignmentCo... INFO Data read from folder /MUONALIGN/TGC/SIDEA have IoV = 82360 -MuonAlignmentCo... INFO A- and B-Lines parameters from DB folder </MUONALIGN/TGC/SIDEA> loaded -MuonAlignmentCo... INFO Load alignment parameters from DB folder </MUONALIGN/TGC/SIDEC> -MuonAlignmentCo... INFO No BLines decoding will be attempted for folder named /MUONALIGN/TGC/SIDEC -MuonAlignmentCo... INFO Size of /MUONALIGN/TGC/SIDEC CondAttrListCollection ( 'CondAttrListCollection' , 'ConditionStore+/MUONALIGN/TGC/SIDEC' ) readCdo->size()= 1 -MuonAlignmentCo... INFO Range of /MUONALIGN/TGC/SIDEC input is, ALines: {[0,0,t:0] - [t:4294967294.854775807]} -MuonAlignmentCo... INFO Data read from folder /MUONALIGN/TGC/SIDEC have IoV = 82359 -MuonAlignmentCo... INFO A- and B-Lines parameters from DB folder </MUONALIGN/TGC/SIDEC> loaded -MGM::MuonDetect... INFO temporary A-line container with size = 2694 -MGM::MuonDetect... INFO # of A-lines read from the ALineMapContainer in StoreGate is 2694 -MGM::MuonDetect... INFO # of deltaTransforms updated according to A-lines is 2694 -MGM::MuonDetect... INFO # of entries in the A-lines historical container is 2814 -MuonAlignmentCo... INFO recorded new ALineMapContainer with range {[0,0,t:1497892260,l:0] - [t:1497898380]} into Conditions Store -MGM::MuonDetect... INFO In updateDeformations() -MGM::MuonDetect... INFO temporary B-line container with size = 1206 -MGM::MuonDetect... INFO # of B-lines read from the ALineMapContainer in StoreGate is 1206 -MGM::MuonDetect... INFO # of deform-Transforms updated according to B-lines is 1174 -MGM::MuonDetect... INFO # of entries in the B-lines historical container is 1174 -MuonAlignmentCo... INFO recorded new BLineMapContainer with range {[0,0,t:1497892260,l:0] - [t:1497898380]} into Conditions Store -MuonGeoModel INFO MuonDetectorFactory - constructor MuonSystem OuterRadius 13000 Length 22030 -MuonDetectorCon... INFO create MuonDetectorTool - package version = MuonGeoModel-00-00-00 -MuonDetectorCon... INFO (from GeoModelSvc) AtlasVersion = <ATLAS-R2-2016-01-00-01> MuonVersion = <> -MuonDetectorCon... INFO Keys for Muon Switches are (key) ATLAS-R2-2016-01-00-01 (node) ATLAS -MuonDetectorCon... INFO (from GeoModelSvc) in AtlasVersion = <ATLAS-R2-2016-01-00-01> default MuonVersion is <MuonSpectrometer-R.08.01> -MuonDetectorCon... INFO Properties have been set as follows: -MuonDetectorCon... INFO LayoutName R -MuonDetectorCon... INFO IncludeCutouts 0 -MuonDetectorCon... INFO IncludeCutoutsBog 0 -MuonDetectorCon... INFO IncludeCtbBis 0 -MuonDetectorCon... INFO ControlAlines 111111 -MuonDetectorCon... INFO MinimalGeoFlag 0 -MuonDetectorCon... INFO EnableCscIntAlignment 1 -MuonDetectorCon... INFO EnableCscIntAlignmentFromGM 0 -MuonDetectorCon... INFO ControlCscIntAlines 111111 -MuonDetectorCon... INFO EnableMdtDeformations 1 -MuonDetectorCon... INFO EnableMdtAsBuiltParameters 1 -MuGM:MuonFactory INFO MuonLayout set to <R.08.01> = Development version for DC3 - infrastructures -MuGM:MuonFactory INFO BOG cutouts are activated 1 , all other cutouts are disabled 1 -MuGM:MuonFactory INFO Manager created for geometry version R.08.01 from DB MuonVersion <MuonSpectrometer-R.08.01> -MuonGeoModel.MYSQL INFO GeometryVersion set to <R.08.01> -MuGM:MuonFactory INFO Mysql helper class created here for geometry version R.08.01 from DB MuonVersion <MuonSpectrometer-R.08.01> -MuGM:MuonFactory INFO MDTIDHELPER retrieved from DetStore -MuGM:MuonFactory INFO RPCIDHELPER retrieved from DetStore -MuGM:MuonFactory INFO TGCIDHELPER retrieved from DetStore -MuGM:MuonFactory INFO CSCIDHELPER retrieved from DetStore -MuGM:MuonFactory INFO **************** MuonDetectorFactory001 ************************ -MuGM:MuonFactory INFO *** Start building the Muon Geometry Tree ********************** -MuGM:RDBReadAtlas INFO Start retriving dbObjects with tag = <ATLAS-R2-2016-01-00-01> node <ATLAS> -RDBAccessSvc WARNING Could not get the tag for XtomoData node. Returning 0 pointer to IRDBQuery -MuGM:RDBReadAtlas INFO After getQuery XtomoData -In DblQ00Xtomo(data) -No XtomoData table in the MuonDD Database -MuGM:RDBReadAtlas INFO After new DblQ00Xtomo -MuGM:RDBReadAtlas INFO After m_dhxtomo.data() -MuGM:RDBReadAtlas INFO No Ascii aszt input found: looking for A-lines in ORACLE -MuGM:RDBReadAtlas INFO ASZT table found in Oracle -MuGM:RDBReadAtlas INFO ASZT size is 32 -MuGM:RDBReadAtlas INFO No Ascii iacsc input found: looking for A-lines in ORACLE -RDBAccessSvc WARNING Could not get the tag for ISZT node. Returning 0 pointer to IRDBQuery -MuGM:RDBReadAtlas INFO No ISZT table in Oracle -MuGM:RDBReadAtlas INFO Access granted for all dbObjects needed by muon detectors -MuonGeoModel.MYSQL INFO LayoutName (from DBAM) set to <R.08> -- relevant for CTB2004 -MuGM:ProcStations INFO Processing Stations and Components -MuGM:ProcStations INFO Processing Stations and Components DONE -MuGM:ProcTechnol.s INFO nMDT 26 nCSC 4 nTGC 44 nRPC 50 -MuGM:ProcTechnol.s INFO nDED 4 nSUP 8 nSPA 4 -MuGM:ProcTechnol.s INFO nCHV 14 nCRO 14 nCMI 12 nLBI 12 -MuGM:ProcPosition INFO *** N. of stations positioned in the setup 234 -MuGM:ProcPosition INFO *** N. of stations described in mysql 234 -MuGM:ProcPosition INFO *** N. of types 32 size of jtypvec 32 -MuGM:ProcPosition INFO *** : 234 kinds of stations (type*sub_type) -MuGM:ProcPosition INFO *** : 1758 physical stations in space - according to the MuonDD DataBase -MuGM:ProcCutouts INFO Processing Cutouts for geometry layout R.08 -MuGM:ProcCutouts INFO Processing Cutouts DONE -MuGM:RDBReadAtlas INFO ProcessTGCreadout - version 7 wirespacing 1.8 -MuGM:RDBReadAtlas INFO Intermediate Objects built from primary numbers -MuGM:MuonFactory INFO theMaterialManager retrieven successfully from the DetStore -MuGM:MuonFactory INFO MuonSystem description from OracleTag=<ATLAS-R2-2016-01-00-01> and node=<ATLAS> -MuGM:MuonFactory INFO TreeTop added to the Manager -MuGM:MuonFactory INFO Muon Layout R.08.01 -MuGM:MuonFactory INFO Fine Clash Fixing disabled: (should be ON/OFF for Simulation/Reconstruction) -MuGM:MuonFactory INFO **************** MuonDetectorFactory001 **************************** -MuGM:MuonFactory INFO *** The Muon Chamber Geometry Tree is built with -MuGM:MuonFactory INFO *** 1758 child volumes -MuGM:MuonFactory INFO *** 1839 independent elements and -MuGM:MuonFactory INFO *** 11473 elements cloned or shared -MuGM:MuonFactory INFO *** 234 kinds of stations -MuGM:MuonFactory INFO *** 1758 stations with alignable transforms -MuGM:MuonFactory INFO *** 148 stations are described as Assemblies -MuGM:MuonFactory INFO *** 1758 MuonStations -MuGM:MuonFactory INFO *** 2324 MDT Readout Elements 1186 MDT Detector Elements -MuGM:MuonFactory INFO *** 32 CSC Readout Elements 32 CSC Detector Elements -MuGM:MuonFactory INFO *** 1122 RPC Readout Elements 600 RPC Detector Elements -MuGM:MuonFactory INFO *** 1578 TGC Readout Elements 1578 TGC Detector Elements -MuGM:MuonFactory INFO ******************************************************************** -MuGM:MuonFactory INFO *** Inert Material built according to DB switches and config. ****** -MuGM:MuonFactory INFO *** The Muon Geometry Tree has 1758 child vol.s in total ******** -MuGM:MuonFactory INFO ******************************************************************** - -MGM::MuonDetect... INFO Init A/B Line Containers - done - size is respectively 1758/0 -MGM::MuonDetect... INFO Init of CSC I-Lines will be done via Conditions DB -MGM::MuonDetect... INFO Init I-Line Container - done - size is respectively 128 -MGM::MuonDetect... INFO I-Line for CSC wire layers loaded (Csc Internal Alignment) -MGM::MuonDetect... INFO According to configuration they WILL be used -MGM::MuonDetect... INFO Filling cache -MGM::MuonDetect... INFO temporary CSC I-line container with size = 128 -MGM::MuonDetect... INFO # of CSC I-lines read from the ILineMapContainer in StoreGate is 128 -MGM::MuonDetect... INFO # of deltaTransforms updated according to A-lines is 128 -MGM::MuonDetect... INFO # of entries in the CSC I-lines historical container is 128 -MGM::MuonDetect... INFO temporary As-Built container with size = 628 -MGM::MuonDetect... INFO # of MDT As-Built read from the MdtAsBuiltMapContainer in StoreGate is 628 -MGM::MuonDetect... INFO # of deltaTransforms updated according to As-Built is 628 -MGM::MuonDetect... INFO # of entries in the MdtAsBuilt historical container is 628 -MGM::MuonDetect... INFO temporary A-line container with size = 2694 -MGM::MuonDetect... INFO # of A-lines read from the ALineMapContainer in StoreGate is 2694 -MGM::MuonDetect... INFO # of deltaTransforms updated according to A-lines is 2694 -MGM::MuonDetect... INFO # of entries in the A-lines historical container is 2814 -MGM::MuonDetect... INFO In updateDeformations() -MGM::MuonDetect... INFO temporary B-line container with size = 1206 -MGM::MuonDetect... INFO # of B-lines read from the ALineMapContainer in StoreGate is 1206 -MGM::MuonDetect... INFO # of deform-Transforms updated according to B-lines is 1174 -MGM::MuonDetect... INFO # of entries in the B-lines historical container is 1174 -MuonDetectorCon... INFO recorded new MuonDetectorManager with range {[0,0,t:1497892260,l:0] - [t:1497898380]} into Conditions Store -RpcCablingCondAlg INFO maps configuration have been parsed -RpcCablingCondAlg INFO recorded new RpcCablingCondData with range {[315000,l:0] - [999999,l:0]} -MuonMDT_CablingAlg INFO Size of CondAttrListCollection ( 'CondAttrListCollection' , 'ConditionStore+/MDT/CABLING/MEZZANINE_SCHEMA' ) readCdoMez->size()= 24 -MuonMDT_CablingAlg INFO Range of input is {[0,l:0] - [INVALID]} -MuonMDT_CablingAlg INFO Size of CondAttrListCollection ( 'CondAttrListCollection' , 'ConditionStore+/MDT/CABLING/MAP_SCHEMA' ) readCdoMap->size()= 2312 -MuonMDT_CablingAlg INFO Range of input is {[327264,l:4294640031] - [327265,l:4294640030]} -MuonMDT_CablingAlg INFO recorded new MuonMDT_CablingMap with range {[327264,t:0,l:4294640031] - [327265,l:4294640030]} into Conditions Store -AtlasFieldMapCo... INFO execute: entering -AtlasFieldMapCo... INFO updateFieldMap: Update map from conditions -AtlasFieldMapCo... INFO updateFieldMap: Update map from conditions: Range of input/output is {[0,l:0] - [INVALID]} -AtlasFieldMapCo... INFO updateFieldMap: reading magnetic field map filenames from COOL -AtlasFieldMapCo... INFO updateFieldMap: found map of type GlobalMap with soleCur=7730 toroCur=20400 (path file:MagneticFieldMaps/bfieldmap_7730_20400_14m.root) -AtlasFieldMapCo... INFO updateFieldMap: found map of type SolenoidMap with soleCur=7730 toroCur=0 (path file:MagneticFieldMaps/bfieldmap_7730_0_14m.root) -AtlasFieldMapCo... INFO updateFieldMap: found map of type ToroidMap with soleCur=0 toroCur=20400 (path file:MagneticFieldMaps/bfieldmap_0_20400_14m.root) -AtlasFieldMapCo... INFO updateFieldMap: Set map currents from FieldSvc: solenoid/toroid 7730,20400 -AtlasFieldMapCo... INFO updateFieldMap: Use map file MagneticFieldMaps/bfieldmap_7730_20400_14m.root -AtlasFieldMapCo... INFO updateFieldMap: Initialized the field map from /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/atlas/offline/ReleaseData/v20/MagneticFieldMaps/bfieldmap_7730_20400_14m.root -AtlasFieldMapCo... INFO execute: solenoid zone id 7000 -AtlasFieldMapCo... INFO execute: recored AtlasFieldMapCondObj with field map -AtlasFieldCache... INFO execute: entering -AtlasFieldCache... INFO UpdateCurrentFromConditions -AtlasFieldCache... INFO UpdateCurrentFromConditions: Range of input/output is {[0,0,t:1497895317.371000000] - [t:1497898549.609000000]} -AtlasFieldCache... INFO UpdateCurrentFromConditions: Attempt 1 at reading currents from DCS (using channel name) -AtlasFieldCache... INFO UpdateCurrentFromConditions: Trying to read from DCS: [channel name, index, value] CentralSol_Current , 1 , 7729.99 -AtlasFieldCache... INFO UpdateCurrentFromConditions: Trying to read from DCS: [channel name, index, value] CentralSol_SCurrent , 2 , 7730 -AtlasFieldCache... INFO UpdateCurrentFromConditions: Trying to read from DCS: [channel name, index, value] Toroids_Current , 3 , 20399.9 -AtlasFieldCache... INFO UpdateCurrentFromConditions: Trying to read from DCS: [channel name, index, value] Toroids_SCurrent , 4 , 20397.7 -AtlasFieldCache... INFO UpdateCurrentFromConditions: Currents read from DCS - solenoid 7729.99 toroid 20399.9 -AtlasFieldCache... INFO scaleField: Solenoid field scale factor 1. Solenoid and map currents: 7729.99,7730 -AtlasFieldCache... INFO scaleField: Toroid field scale factor 1. Toroid and map currents: 20399.9,20400 -AtlasFieldCache... INFO execute: initialized AtlasFieldCacheCondObj and cache with SFs - sol/tor 1/1 -AtlasFieldCache... INFO execute: solenoid zone id 7000 -AtlasFieldCache... INFO execute: useNewBfieldCache 'UseNewBfieldCache':True -MdtCalibDbAlg INFO Size of CondAttrListCollection ( 'CondAttrListCollection' , 'ConditionStore+/MDT/RTBLOB' ) readCdoRt->size()= 1186 -MdtCalibDbAlg INFO Range of input is {[327265,l:0] - [327342,l:0]} -MdtCalibDbAlg INFO MdtCalibDbAlg::loadRt Read 1188RTs from COOL -MdtCalibDbAlg INFO recorded new MdtRtRelationCollection with range {[327265,l:0] - [327342,l:0]} into Conditions Store -MdtCalibDbAlg INFO recorded new MdtCorFuncSetCollection with range {[327265,l:0] - [327342,l:0]} into Conditions Store -MdtCalibDbAlg INFO Ignoring nonexistant station in calibration DB: MuonSpectrometer BML -6 stationPhi 7 MDT multiLayer 1 tubeLayer 1 tube 1 -MdtCalibDbAlg INFO Ignoring nonexistant station in calibration DB: MuonSpectrometer BML stationEta 6 stationPhi 7 MDT multiLayer 1 tubeLayer 1 tube 1 -MdtCalibDbAlg INFO Size of CondAttrListCollection ( 'CondAttrListCollection' , 'ConditionStore+/MDT/T0BLOB' ) readCdoTube->size()= 1186 -MdtCalibDbAlg INFO Range of input is {[319000,l:0] - [INVALID]} -MdtCalibDbAlg INFO recorded new MdtTubeCalibContainerCollection with range {[319000,l:0] - [INVALID]} into Conditions Store -CscCondDbData INFO Maximum Layer hash is 255 -AthenaEventLoopMgr INFO ===>>> done processing event #186525031, run #327265 1 events processed so far <<<=== -AthenaEventLoopMgr INFO ===>>> start processing event #186524665, run #327265 1 events processed so far <<<=== -AtlasFieldMapCo... INFO execute: entering -AtlasFieldCache... INFO execute: entering -AthenaEventLoopMgr INFO ===>>> done processing event #186524665, run #327265 2 events processed so far <<<=== -AthenaEventLoopMgr INFO ===>>> start processing event #186542447, run #327265 2 events processed so far <<<=== -AtlasFieldMapCo... INFO execute: entering -AtlasFieldCache... INFO execute: entering -AthenaEventLoopMgr INFO ===>>> done processing event #186542447, run #327265 3 events processed so far <<<=== -AthenaEventLoopMgr INFO ===>>> start processing event #186543405, run #327265 3 events processed so far <<<=== -AtlasFieldMapCo... INFO execute: entering -AtlasFieldCache... INFO execute: entering -AthenaEventLoopMgr INFO ===>>> done processing event #186543405, run #327265 4 events processed so far <<<=== -AthenaEventLoopMgr INFO ===>>> start processing event #186548387, run #327265 4 events processed so far <<<=== -AtlasFieldMapCo... INFO execute: entering -AtlasFieldCache... INFO execute: entering -AthenaEventLoopMgr INFO ===>>> done processing event #186548387, run #327265 5 events processed so far <<<=== -AthenaEventLoopMgr INFO ===>>> start processing event #186515186, run #327265 5 events processed so far <<<=== -AtlasFieldMapCo... INFO execute: entering -AtlasFieldCache... INFO execute: entering -AthenaEventLoopMgr INFO ===>>> done processing event #186515186, run #327265 6 events processed so far <<<=== -AthenaEventLoopMgr INFO ===>>> start processing event #186556019, run #327265 6 events processed so far <<<=== -AtlasFieldMapCo... INFO execute: entering -AtlasFieldCache... INFO execute: entering -AthenaEventLoopMgr INFO ===>>> done processing event #186556019, run #327265 7 events processed so far <<<=== -AthenaEventLoopMgr INFO ===>>> start processing event #186542866, run #327265 7 events processed so far <<<=== -AtlasFieldMapCo... INFO execute: entering -AtlasFieldCache... INFO execute: entering -AthenaEventLoopMgr INFO ===>>> done processing event #186542866, run #327265 8 events processed so far <<<=== -AthenaEventLoopMgr INFO ===>>> start processing event #186537901, run #327265 8 events processed so far <<<=== -AtlasFieldMapCo... INFO execute: entering -AtlasFieldCache... INFO execute: entering -AthenaEventLoopMgr INFO ===>>> done processing event #186537901, run #327265 9 events processed so far <<<=== -AthenaEventLoopMgr INFO ===>>> start processing event #186517811, run #327265 9 events processed so far <<<=== -AtlasFieldMapCo... INFO execute: entering -AtlasFieldCache... INFO execute: entering -AthenaEventLoopMgr INFO ===>>> done processing event #186517811, run #327265 10 events processed so far <<<=== -AthenaEventLoopMgr INFO ===>>> start processing event #186534221, run #327265 10 events processed so far <<<=== -AtlasFieldMapCo... INFO execute: entering -AtlasFieldCache... INFO execute: entering -AthenaEventLoopMgr INFO ===>>> done processing event #186534221, run #327265 11 events processed so far <<<=== -AthenaEventLoopMgr INFO ===>>> start processing event #186540986, run #327265 11 events processed so far <<<=== -AtlasFieldMapCo... INFO execute: entering -AtlasFieldCache... INFO execute: entering -AthenaEventLoopMgr INFO ===>>> done processing event #186540986, run #327265 12 events processed so far <<<=== -AthenaEventLoopMgr INFO ===>>> start processing event #186535104, run #327265 12 events processed so far <<<=== -AtlasFieldMapCo... INFO execute: entering -AtlasFieldCache... INFO execute: entering -AthenaEventLoopMgr INFO ===>>> done processing event #186535104, run #327265 13 events processed so far <<<=== -AthenaEventLoopMgr INFO ===>>> start processing event #186539903, run #327265 13 events processed so far <<<=== -AtlasFieldMapCo... INFO execute: entering -AtlasFieldCache... INFO execute: entering -AthenaEventLoopMgr INFO ===>>> done processing event #186539903, run #327265 14 events processed so far <<<=== -AthenaEventLoopMgr INFO ===>>> start processing event #186552713, run #327265 14 events processed so far <<<=== -AtlasFieldMapCo... INFO execute: entering -AtlasFieldCache... INFO execute: entering -AthenaEventLoopMgr INFO ===>>> done processing event #186552713, run #327265 15 events processed so far <<<=== -AthenaEventLoopMgr INFO ===>>> start processing event #186524730, run #327265 15 events processed so far <<<=== -AtlasFieldMapCo... INFO execute: entering -AtlasFieldCache... INFO execute: entering -AthenaEventLoopMgr INFO ===>>> done processing event #186524730, run #327265 16 events processed so far <<<=== -AthenaEventLoopMgr INFO ===>>> start processing event #186547632, run #327265 16 events processed so far <<<=== -AtlasFieldMapCo... INFO execute: entering -AtlasFieldCache... INFO execute: entering -AthenaEventLoopMgr INFO ===>>> done processing event #186547632, run #327265 17 events processed so far <<<=== -AthenaEventLoopMgr INFO ===>>> start processing event #186555621, run #327265 17 events processed so far <<<=== -AtlasFieldMapCo... INFO execute: entering -AtlasFieldCache... INFO execute: entering -AthenaEventLoopMgr INFO ===>>> done processing event #186555621, run #327265 18 events processed so far <<<=== -AthenaEventLoopMgr INFO ===>>> start processing event #186568452, run #327265 18 events processed so far <<<=== -AtlasFieldMapCo... INFO execute: entering -AtlasFieldCache... INFO execute: entering -AthenaEventLoopMgr INFO ===>>> done processing event #186568452, run #327265 19 events processed so far <<<=== -AthenaEventLoopMgr INFO ===>>> start processing event #186580451, run #327265 19 events processed so far <<<=== -AtlasFieldMapCo... INFO execute: entering -AtlasFieldCache... INFO execute: entering -AthenaEventLoopMgr INFO ===>>> done processing event #186580451, run #327265 20 events processed so far <<<=== -Domain[ROOT_All] INFO > Deaccess DbDomain READ [ROOT_All] -ApplicationMgr INFO Application Manager Stopped successfully -IncidentProcAlg1 INFO Finalize -CondInputLoader INFO Finalizing CondInputLoader... -AtlasFieldMapCo... INFO in finalize -AtlasFieldCache... INFO in finalize -IncidentProcAlg2 INFO Finalize -AtlasFieldSvc INFO finalize() successful -IOVDbFolder INFO Folder /CSC/FTHOLD (AttrListColl) db-read 1/1 objs/chan/bytes 32/32/322656 (( 0.03 ))s -IOVDbFolder INFO Folder /CSC/NOISE (AttrListColl) db-read 1/1 objs/chan/bytes 32/32/350062 (( 0.02 ))s -IOVDbFolder INFO Folder /CSC/PED (AttrListColl) db-read 1/1 objs/chan/bytes 32/32/411187 (( 0.06 ))s -IOVDbFolder INFO Folder /CSC/PSLOPE (AttrListColl) db-read 1/1 objs/chan/bytes 32/32/353376 (( 0.02 ))s -IOVDbFolder INFO Folder /CSC/RMS (AttrListColl) db-read 1/1 objs/chan/bytes 32/32/411395 (( 0.05 ))s -IOVDbFolder INFO Folder /CSC/STAT (AttrListColl) db-read 1/1 objs/chan/bytes 32/32/230496 (( 0.05 ))s -IOVDbFolder INFO Folder /CSC/T0BASE (AttrListColl) db-read 1/1 objs/chan/bytes 32/32/314380 (( 0.02 ))s -IOVDbFolder INFO Folder /CSC/T0PHASE (AttrListColl) db-read 1/1 objs/chan/bytes 32/32/3136 (( 0.06 ))s -IOVDbFolder INFO Folder /EXT/DCS/MAGNETS/SENSORDATA (AttrListColl) db-read 1/2 objs/chan/bytes 4/4/20 (( 0.02 ))s -IOVDbFolder INFO Folder /GLOBAL/BField/Maps (AttrListColl) db-read 1/2 objs/chan/bytes 3/3/202 (( 0.03 ))s -IOVDbFolder INFO Folder /MDT/CABLING/MAP_SCHEMA (AttrListColl) db-read 1/1 objs/chan/bytes 2312/2437/216520 (( 0.17 ))s -IOVDbFolder INFO Folder /MDT/CABLING/MEZZANINE_SCHEMA (AttrListColl) db-read 1/1 objs/chan/bytes 24/24/288 (( 0.11 ))s -IOVDbFolder INFO Folder /MDT/RTBLOB (AttrListColl) db-read 1/1 objs/chan/bytes 2372/1186/2251209 (( 0.36 ))s -IOVDbFolder INFO Folder /MDT/T0BLOB (AttrListColl) db-read 1/1 objs/chan/bytes 1186/1186/1374284 (( 0.19 ))s -IOVDbFolder INFO Folder /MUONALIGN/CSC/ILINES (AttrListColl) db-read 1/1 objs/chan/bytes 1/1/10814 (( 0.04 ))s -IOVDbFolder INFO Folder /MUONALIGN/MDT/ASBUILTPARAMS (AttrListColl) db-read 1/1 objs/chan/bytes 1/1/128992 (( 0.04 ))s -IOVDbFolder INFO Folder /MUONALIGN/MDT/BARREL (AttrListColl) db-read 1/1 objs/chan/bytes 1/1/140293 (( 0.03 ))s -IOVDbFolder INFO Folder /MUONALIGN/MDT/ENDCAP/SIDEA (AttrListColl) db-read 1/1 objs/chan/bytes 1/1/65494 (( 0.04 ))s -IOVDbFolder INFO Folder /MUONALIGN/MDT/ENDCAP/SIDEC (AttrListColl) db-read 1/1 objs/chan/bytes 1/1/65497 (( 0.04 ))s -IOVDbFolder INFO Folder /MUONALIGN/TGC/SIDEA (AttrListColl) db-read 1/1 objs/chan/bytes 1/1/165643 (( 0.08 ))s -IOVDbFolder INFO Folder /MUONALIGN/TGC/SIDEC (AttrListColl) db-read 1/1 objs/chan/bytes 1/1/165643 (( 0.05 ))s -IOVDbFolder INFO Folder /RPC/CABLING/MAP_SCHEMA (AttrListColl) db-read 1/2 objs/chan/bytes 1/1/222235 (( 0.04 ))s -IOVDbFolder INFO Folder /RPC/CABLING/MAP_SCHEMA_CORR (AttrListColl) db-read 1/2 objs/chan/bytes 1/1/29402 (( 0.04 ))s -IOVDbFolder INFO Folder /RPC/DCS/DeadRopanels (AttrListColl) db-read 1/1 objs/chan/bytes 32/48/6200 (( 0.01 ))s -IOVDbFolder INFO Folder /RPC/DCS/OffRopanels (AttrListColl) db-read 1/1 objs/chan/bytes 4/48/16 (( 0.01 ))s -IOVDbFolder INFO Folder /RPC/DQMF/ELEMENT_STATUS (AttrListColl) db-read 1/1 objs/chan/bytes 8320/8320/6180700 (( 0.18 ))s -IOVDbFolder INFO Folder /RPC/TRIGGER/CM_THR_ETA (AttrListColl) db-read 1/2 objs/chan/bytes 1613/1613/7562651 (( 0.10 ))s -IOVDbFolder INFO Folder /RPC/TRIGGER/CM_THR_PHI (AttrListColl) db-read 1/2 objs/chan/bytes 1612/1612/8096306 (( 0.12 ))s -IOVDbFolder INFO Folder /TDAQ/RunCtrl/SOR_Params (AttrListColl) db-read 0/0 objs/chan/bytes 0/1/0 (( 0.00 ))s -IOVDbFolder INFO Folder /TGC/CABLING/MAP_SCHEMA (AttrListColl) db-read 0/0 objs/chan/bytes 0/1/0 (( 0.00 ))s -IOVDbSvc INFO bytes in (( 2.00 ))s -IOVDbSvc INFO Connection sqlite://;schema=mycool.db;dbname=CONDBR2 : nConnect: 0 nFolders: 0 ReadTime: (( 0.00 ))s -IOVDbSvc INFO Connection COOLONL_TDAQ/CONDBR2 : nConnect: 1 nFolders: 1 ReadTime: (( 0.00 ))s -IOVDbSvc INFO Connection COOLOFL_MUONALIGN/CONDBR2 : nConnect: 2 nFolders: 7 ReadTime: (( 0.31 ))s -IOVDbSvc INFO Connection COOLONL_RPC/CONDBR2 : nConnect: 2 nFolders: 4 ReadTime: (( 0.30 ))s -IOVDbSvc INFO Connection COOLONL_TGC/CONDBR2 : nConnect: 1 nFolders: 1 ReadTime: (( 0.00 ))s -IOVDbSvc INFO Connection COOLONL_MDT/CONDBR2 : nConnect: 2 nFolders: 2 ReadTime: (( 0.28 ))s -IOVDbSvc INFO Connection COOLONL_GLOBAL/CONDBR2 : nConnect: 2 nFolders: 1 ReadTime: (( 0.03 ))s -IOVDbSvc INFO Connection COOLOFL_DCS/CONDBR2 : nConnect: 2 nFolders: 3 ReadTime: (( 0.04 ))s -IOVDbSvc INFO Connection COOLOFL_RPC/CONDBR2 : nConnect: 2 nFolders: 1 ReadTime: (( 0.18 ))s -IOVDbSvc INFO Connection COOLOFL_MDT/CONDBR2 : nConnect: 2 nFolders: 2 ReadTime: (( 0.55 ))s -IOVDbSvc INFO Connection COOLOFL_CSC/CONDBR2 : nConnect: 2 nFolders: 8 ReadTime: (( 0.31 ))s -ToolSvc INFO Removing all tools created by ToolSvc -TgcRdoToTgcPrep... INFO finalize(): input RDOs->output PRDs [Hit: 6807->6807, Tracklet: 28->28, TrackletEIFI: 692->692, HiPt: 4031->4031, SL: 3->3] MdtRawDataProvi... INFO Fraction of fills that use the cache = 0 TgcRawDataProvi... INFO Fraction of fills that use the cache = 0 RpcROD_Decoder:... INFO ============ FINAL RPC DATA FORMAT STAT. =========== @@ -1138,15 +50,3 @@ RpcROD_Decoder:... INFO SL Footer Errors.............0 RpcROD_Decoder:... INFO RX Footer Errors.............0 RpcROD_Decoder:... INFO CRC8 check Failures..........0 RpcROD_Decoder:... INFO ==================================================== -ToolSvc.ByteStr... INFO in finalize() -ToolSvc.TGCCabl... INFO finalize -IdDictDetDescrCnv INFO in finalize -*****Chrono***** INFO **************************************************************************************************** -*****Chrono***** INFO The Final CPU consumption ( Chrono ) Table (ordered) -*****Chrono***** INFO **************************************************************************************************** -cObj_ALL INFO Time User : Tot= 0 [us] Ave/Min/Max= 0(+- 0)/ 0/ 0 [us] #= 34 -ChronoStatSvc INFO Time User : Tot= 17.6 [s] #= 1 -*****Chrono***** INFO **************************************************************************************************** -ChronoStatSvc.f... INFO Service finalized successfully -ApplicationMgr INFO Application Manager Finalized successfully -ApplicationMgr INFO Application Manager Terminated successfully diff --git a/MuonSpectrometer/MuonDetDescr/MuonRegionSelector/CMakeLists.txt b/MuonSpectrometer/MuonDetDescr/MuonRegionSelector/CMakeLists.txt index 26b202427f4fdd61f33d7e33ae29f3d73604f624..a5c7fb8fbb291e86484e82406a54bc17ce23bf13 100644 --- a/MuonSpectrometer/MuonDetDescr/MuonRegionSelector/CMakeLists.txt +++ b/MuonSpectrometer/MuonDetDescr/MuonRegionSelector/CMakeLists.txt @@ -8,18 +8,20 @@ atlas_subdir( MuonRegionSelector ) # Declare the package's dependencies: atlas_depends_on_subdirs( PUBLIC Control/AthenaBaseComps + Control/StoreGate DetectorDescription/GeoPrimitives DetectorDescription/RegSelLUT GaudiKernel + MuonSpectrometer/MuonConditions/MuonCondCabling/RPC_CondCabling + MuonSpectrometer/MuonCablings/RPCcablingInterface PRIVATE DetectorDescription/Identifier DetectorDescription/IRegionSelector - MuonSpectrometer/MuonCablings/MuonCablingData + MuonSpectrometer/MuonCablings/MuonCablingData MuonSpectrometer/MuonCablings/CSCcabling MuonSpectrometer/MuonCablings/MuonTGC_Cabling - MuonSpectrometer/MuonCablings/RPCcablingInterface MuonSpectrometer/MuonDetDescr/MuonReadoutGeometry - MuonSpectrometer/MuonDetDescr/MuonAGDDDescription ) + MuonSpectrometer/MuonDetDescr/MuonAGDDDescription ) # External dependencies: find_package( CLHEP ) @@ -37,12 +39,9 @@ atlas_add_component( MuonRegionSelector src/components/*.cxx INCLUDE_DIRS ${CLHEP_INCLUDE_DIRS} ${EIGEN_INCLUDE_DIRS} LINK_LIBRARIES ${CLHEP_LIBRARIES} ${EIGEN_LIBRARIES} AthenaBaseComps GeoPrimitives - RegSelLUT GaudiKernel Identifier CSCcablingLib - MuonCablingData - MuonMDT_CablingLib MuonTGC_CablingLib RPCcablingInterfaceLib - MuonReadoutGeometry - - MuonAGDDDescription MuonRegionSelectorLib ) + RegSelLUT GaudiKernel Identifier CSCcablingLib StoreGateLib MuonCablingData + MuonMDT_CablingLib MuonTGC_CablingLib RPC_CondCablingLib RPCcablingInterfaceLib + MuonReadoutGeometry MuonAGDDDescription MuonRegionSelectorLib ) # Install files from the package: atlas_install_joboptions( share/*.py ) diff --git a/MuonSpectrometer/MuonDetDescr/MuonRegionSelector/src/RPC_RegSelCondAlg.cxx b/MuonSpectrometer/MuonDetDescr/MuonRegionSelector/src/RPC_RegSelCondAlg.cxx index 34b375b253c908bd4979e1516b111c5e0b1b35ad..440e412f305b9c1907a00ec5eac5a8611dffa7c2 100644 --- a/MuonSpectrometer/MuonDetDescr/MuonRegionSelector/src/RPC_RegSelCondAlg.cxx +++ b/MuonSpectrometer/MuonDetDescr/MuonRegionSelector/src/RPC_RegSelCondAlg.cxx @@ -1,3 +1,7 @@ +/* + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration +*/ + /** ** @file RPC_RegSelCondAlg.cxx ** @@ -8,23 +12,15 @@ ** @date Sun 22 Sep 2019 10:21:50 BST ** ** - ** Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration **/ +#include "RPC_RegSelCondAlg.h" #include "GaudiKernel/EventIDRange.h" #include "StoreGate/WriteCondHandle.h" - #include "CLHEP/Units/SystemOfUnits.h" #include "Identifier/IdentifierHash.h" - -#include <iostream> -#include <fstream> -#include <string> - - #include "MuonCablingData/MuonMDT_CablingMap.h" - #include "MuonReadoutGeometry/MuonDetectorManager.h" #include "MuonReadoutGeometry/MuonReadoutElement.h" #include "MuonReadoutGeometry/MdtReadoutElement.h" @@ -34,38 +30,22 @@ #include "MuonReadoutGeometry/RpcReadoutSet.h" #include "MuonReadoutGeometry/MuonStation.h" -#include "RPC_RegSelCondAlg.h" - -#include "RPCcablingInterface/IRPCcablingServerSvc.h" -#include "RPCcablingInterface/IRPCcablingSvc.h" - - - RPC_RegSelCondAlg::RPC_RegSelCondAlg(const std::string& name, ISvcLocator* pSvcLocator): MuonRegSelCondAlg( name, pSvcLocator ) { ATH_MSG_DEBUG( "RPC_RegSelCondAlg::RPC_RegSelCondAlg() " << name ); } - +StatusCode RPC_RegSelCondAlg::initialize() { + ATH_CHECK(MuonRegSelCondAlg::initialize()); + ATH_CHECK(m_rpcReadKey.initialize()); + return StatusCode::SUCCESS; +} std::unique_ptr<RegSelSiLUT> RPC_RegSelCondAlg::createTable( const MuonMDT_CablingMap* /* mdtCabling */ ) const { - /// now get the RPC cabling service ... - - const IRPCcablingServerSvc* cabling_server = nullptr; - - if ( service( "RPCcablingServerSvc", cabling_server ).isFailure() ) { - ATH_MSG_ERROR( "Could not retieve RPC cabling server"); - return std::unique_ptr<RegSelSiLUT>(nullptr); - } - - const IRPCcablingSvc* cabling = nullptr; - - if ( cabling_server->giveCabling( cabling ).isFailure() ) { - ATH_MSG_ERROR( "Could not retieve RPC cabling service"); - return std::unique_ptr<RegSelSiLUT>(nullptr); - } + SG::ReadCondHandle<RpcCablingCondData> cablingCondData{m_rpcReadKey, Gaudi::Hive::currentContext()}; + const RpcCablingCondData* rpcCabling{*cablingCondData}; const MuonGM::MuonDetectorManager* manager = nullptr; @@ -98,8 +78,7 @@ std::unique_ptr<RegSelSiLUT> RPC_RegSelCondAlg::createTable( const MuonMDT_Cabli } std::vector<uint32_t> robIds; - StatusCode sc = cabling->giveROB_fromPRD(prdHashId, robIds); - if ( (cabling->giveROB_fromPRD(prdHashId, robIds)).isFailure() ) { + if ( (rpcCabling->giveROB_fromPRD(prdHashId, robIds)).isFailure() ) { ATH_MSG_ERROR( "RegSelCondAlg_RPC could not get ROBid" ); return std::unique_ptr<RegSelSiLUT>(nullptr); } @@ -125,14 +104,8 @@ std::unique_ptr<RegSelSiLUT> RPC_RegSelCondAlg::createTable( const MuonMDT_Cabli if ( layerid==0 ) layerid = 11; // this line should never be executed MuonGM::RpcReadoutSet Set( manager, prdId ); - //int nmod = Set.NreadoutElements(); int ndbz = Set.NdoubletZ(); - //std::cout<<" Number of modules in this RpcSet "<<nmod<<" Number of doubletZ in this RpcSet "<<Set.NdoubletZ()<<std::endl; - //std::cout<<" Number of modules in Phi/DoubletZ: "; - //for (int i=1; i<=ndbz; i++) std::cout<<Set.NPhimodules(i)<<" "; - //std::cout<<std::endl; - double zmin = 99999999; double zmax = -99999999; double rmin = 99999999; @@ -162,13 +135,11 @@ std::unique_ptr<RegSelSiLUT> RPC_RegSelCondAlg::createTable( const MuonMDT_Cabli double zminMod = rpcPos.z()-0.5*rpc->getZsize(); double zmaxMod = rpcPos.z()+0.5*rpc->getZsize(); - //double rcen = std::sqrt(rpcPos.r()*rpcPos.r()-rpcPos.z()*rpcPos.z()); double rcen = std::sqrt(rpcPos.mag()*rpcPos.mag()-rpcPos.z()*rpcPos.z()); double rminMod = rcen-0.5*rpc->getRsize(); double rmaxMod = rcen+0.5*rpc->getRsize(); - // double dphi = std::atan2(rpc->getSsize()/2.,rpcPos.perp()); double dphi = std::atan2(rpc->getSsize()/2,rpcPos.perp()); double pminMod = rpcPos.phi() - dphi; double pmaxMod = rpcPos.phi() + dphi; @@ -176,13 +147,11 @@ std::unique_ptr<RegSelSiLUT> RPC_RegSelCondAlg::createTable( const MuonMDT_Cabli if (zminMod < zmin) { zmin = zminMod; Pzmin = rpcPos; - //Pzmin.setZ(zmin); Pzmin[2] = zmin; } if (zmaxMod > zmax) { zmax = zmaxMod; Pzmax = rpcPos; - //Pzmax.setZ(zmax); Pzmax[2] = zmax; } if (rminMod < rmin) { @@ -262,10 +231,3 @@ std::unique_ptr<RegSelSiLUT> RPC_RegSelCondAlg::createTable( const MuonMDT_Cabli return lut; } - - - - - - - diff --git a/MuonSpectrometer/MuonDetDescr/MuonRegionSelector/src/RPC_RegSelCondAlg.h b/MuonSpectrometer/MuonDetDescr/MuonRegionSelector/src/RPC_RegSelCondAlg.h index e68633d44664ff0a3ff01212febd6a96aeed0908..11f8b1fcc0bee9312ec31bb4f08d87d67650e4f9 100755 --- a/MuonSpectrometer/MuonDetDescr/MuonRegionSelector/src/RPC_RegSelCondAlg.h +++ b/MuonSpectrometer/MuonDetDescr/MuonRegionSelector/src/RPC_RegSelCondAlg.h @@ -1,11 +1,15 @@ /** emacs: this is -*- c++ -*- **/ + +/* + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration +*/ + /** ** @file RPC_RegSelCondAlg.h ** ** @author sutt ** @date Tue 4 Feb 2020 15:25:00 CET ** - ** Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration **/ #ifndef RPC_RegSelCondAlg_h @@ -13,6 +17,10 @@ #include "MuonRegSelCondAlg.h" +#include "RPC_CondCabling/RpcCablingCondData.h" +#include "StoreGate/ReadCondHandleKey.h" + +#include <string> class RPC_RegSelCondAlg : public MuonRegSelCondAlg { @@ -22,6 +30,10 @@ public: std::unique_ptr<RegSelSiLUT> createTable( const MuonMDT_CablingMap* mdtCabling ) const override; + virtual StatusCode initialize() override; +private: + SG::ReadCondHandleKey<RpcCablingCondData> m_rpcReadKey{this, "RpcCablingKey", "RpcCablingCondData", "Key of RpcCablingCondData"}; + }; #endif // RPC_RegSelCondAlg_h diff --git a/MuonSpectrometer/MuonDetDescr/MuonTrackingGeometry/src/MuonInertMaterialBuilder.cxx b/MuonSpectrometer/MuonDetDescr/MuonTrackingGeometry/src/MuonInertMaterialBuilder.cxx index b8bb8c1741ac97e4a6bd2a550727ec793381e4e6..c7bfe492c34fb482521ead9a2cf41056e2a90c1b 100644 --- a/MuonSpectrometer/MuonDetDescr/MuonTrackingGeometry/src/MuonInertMaterialBuilder.cxx +++ b/MuonSpectrometer/MuonDetDescr/MuonTrackingGeometry/src/MuonInertMaterialBuilder.cxx @@ -2,16 +2,11 @@ Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ -/////////////////////////////////////////////////////////////////// -// MuonInertMaterialBuilder.cxx, (c) ATLAS Detector software -/////////////////////////////////////////////////////////////////// - // Muon #include "MuonTrackingGeometry/MuonInertMaterialBuilder.h" #include "MuonTrackingGeometry/MuonStationTypeBuilder.h" //MuonSpectrometer include #include "MuonReadoutGeometry/MuonDetectorManager.h" -#include "MuonIdHelpers/MuonIdHelper.h" // Amg #include "GeoPrimitives/GeoPrimitives.h" #include "GeoPrimitives/CLHEPtoEigenConverter.h" @@ -41,9 +36,6 @@ #include "TrkGeometry/SubtractedCylinderLayer.h" #include "TrkGeometry/TrackingVolume.h" #include "TrkGeometry/TrackingGeometry.h" -//#include "TrkGeometry/HomogeneousLayerMaterial.h" - -//#include "PathResolver/PathResolver.h" // STD #include <map> diff --git a/MuonSpectrometer/MuonDetDescr/MuonTrackingGeometry/src/MuonStationTypeBuilder.cxx b/MuonSpectrometer/MuonDetDescr/MuonTrackingGeometry/src/MuonStationTypeBuilder.cxx index 97f9d951db3bdb1ae18f8f6f6a4168192cf29bd7..68b06409ca8d8af2a9b297b92c76ea8050c70d91 100644 --- a/MuonSpectrometer/MuonDetDescr/MuonTrackingGeometry/src/MuonStationTypeBuilder.cxx +++ b/MuonSpectrometer/MuonDetDescr/MuonTrackingGeometry/src/MuonStationTypeBuilder.cxx @@ -8,7 +8,6 @@ #include "MuonReadoutGeometry/MuonDetectorManager.h" #include "MuonReadoutGeometry/MMReadoutElement.h" #include "MuonReadoutGeometry/sTgcReadoutElement.h" -#include "MuonIdHelpers/MuonIdHelper.h" // Amg #include "GeoPrimitives/GeoPrimitives.h" // Trk diff --git a/MuonSpectrometer/MuonDigitization/CSC_Digitization/src/CscDigitizationTool.cxx b/MuonSpectrometer/MuonDigitization/CSC_Digitization/src/CscDigitizationTool.cxx index 3a268cc9e4253dae5186c4a0b3c1a00623681cb8..2504cfe9c99f1b3c7e94c06707f7d00a2f981ff1 100644 --- a/MuonSpectrometer/MuonDigitization/CSC_Digitization/src/CscDigitizationTool.cxx +++ b/MuonSpectrometer/MuonDigitization/CSC_Digitization/src/CscDigitizationTool.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ // Author: Ketevi A. Assamagan @@ -169,6 +169,7 @@ StatusCode CscDigitizationTool::CoreDigitization(CscDigitContainer* cscDigits,Cs return StatusCode::FAILURE; } + const EBC_EVCOLL evColl = EBC_MAINEVCOLL; // get the iterator pairs for this DetEl while( m_thpcCSC->nextDetectorElement(i, e) ) { @@ -203,7 +204,6 @@ StatusCode CscDigitizationTool::CoreDigitization(CscDigitContainer* cscDigits,Cs std::vector<IdentifierHash>::const_iterator vecBeg = hashVec.begin(); std::vector<IdentifierHash>::const_iterator vecEnd = hashVec.end(); - //const HepMcParticleLink & particleLink = hit.particleLink(); // Fetch the energy deposit. const double energy = hit.energyDeposit(); // Determine where hit crosses the wire plane (x=0). @@ -229,9 +229,10 @@ StatusCode CscDigitizationTool::CoreDigitization(CscDigitContainer* cscDigits,Cs hashVec.clear(); continue; } - + const HepMcParticleLink::PositionFlag idxFlag = (phit.eventId()==0) ? HepMcParticleLink::IS_POSITION: HepMcParticleLink::IS_INDEX; + const HepMcParticleLink trackLink(phit->trackNumber(), phit.eventId(), evColl, idxFlag); for (; vecBeg != vecEnd; vecBeg++) { - CscSimData::Deposit deposit(HepMcParticleLink(phit->trackNumber(),phit.eventId()), CscMcData(energy, ypos, zpos)); + CscSimData::Deposit deposit(trackLink, CscMcData(energy, ypos, zpos)); myDeposits[(*vecBeg)].push_back(deposit); } hashVec.clear(); diff --git a/MuonSpectrometer/MuonDigitization/MDT_Digitization/MDT_Digitization/chargeCalculator.h b/MuonSpectrometer/MuonDigitization/MDT_Digitization/MDT_Digitization/chargeCalculator.h index c0c90afa301f57ed3b01f2acb3ee5cecd2b1ad07..11b1235138e2e7613e24cb1b935faae30737525e 100644 --- a/MuonSpectrometer/MuonDigitization/MDT_Digitization/MDT_Digitization/chargeCalculator.h +++ b/MuonSpectrometer/MuonDigitization/MDT_Digitization/MDT_Digitization/chargeCalculator.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ #ifndef MDT_DIGITIZATION_CHARGECALCULATOR_H @@ -46,9 +46,11 @@ to the third digit of decimal number of the pdgid. // SB #include "AtlasHepMC/GenParticle.h" // -double chargeCalculator(const MDTSimHit& hit){ +double chargeCalculator(const MDTSimHit& hit, unsigned short eventId=0){ - const HepMcParticleLink& trkParticle = hit.particleLink(); + const EBC_EVCOLL evColl = EBC_MAINEVCOLL; + const HepMcParticleLink::PositionFlag idxFlag = (eventId==0) ? HepMcParticleLink::IS_POSITION: HepMcParticleLink::IS_INDEX; + const HepMcParticleLink trkParticle(hit.trackNumber(),eventId,evColl,idxFlag); const HepMC::GenParticle* genParticle = trkParticle.cptr(); double qcharge=1.; if (genParticle){ diff --git a/MuonSpectrometer/MuonDigitization/MDT_Digitization/MDT_Digitization/chargeCalculator_PileUp.h b/MuonSpectrometer/MuonDigitization/MDT_Digitization/MDT_Digitization/chargeCalculator_PileUp.h index 5f018d695f7863bdc38d2abc2fef2ccc00993471..3bb032a48041ce6010ec7eba1b0aa016404b8f55 100644 --- a/MuonSpectrometer/MuonDigitization/MDT_Digitization/MDT_Digitization/chargeCalculator_PileUp.h +++ b/MuonSpectrometer/MuonDigitization/MDT_Digitization/MDT_Digitization/chargeCalculator_PileUp.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ #ifndef MDT_DIGITIZATION_CHARGECALCULATOR2_H @@ -50,9 +50,11 @@ to the third digit of decimal number of the pdgid. #include "AtlasHepMC/GenParticle.h" // -double chargeCalculator_PileUp(const MDTSimHit& hit){ +double chargeCalculator_PileUp(const MDTSimHit& hit, unsigned short eventId=0){ - const HepMcParticleLink& trkParticle = hit.particleLink(); + const EBC_EVCOLL evColl = EBC_MAINEVCOLL; + const HepMcParticleLink::PositionFlag idxFlag = (eventId==0) ? HepMcParticleLink::IS_POSITION: HepMcParticleLink::IS_INDEX; + const HepMcParticleLink trkParticle(hit.trackNumber(),eventId,evColl,idxFlag); const HepMC::GenParticle* genParticle = trkParticle.cptr(); double qcharge=1.; if (genParticle){ diff --git a/MuonSpectrometer/MuonDigitization/MDT_Digitization/MDT_Digitization/particleGamma.h b/MuonSpectrometer/MuonDigitization/MDT_Digitization/MDT_Digitization/particleGamma.h index 19d4c23b82bbe2dbe0b97a4334ac4b17c88a755c..bbca95f9fbfaa03fc7359909ddb3725e66418fa7 100644 --- a/MuonSpectrometer/MuonDigitization/MDT_Digitization/MDT_Digitization/particleGamma.h +++ b/MuonSpectrometer/MuonDigitization/MDT_Digitization/MDT_Digitization/particleGamma.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ #ifndef MDT_DIGITIZATION_PARTICLEGAMMA_H @@ -43,11 +43,12 @@ Function particleGamma returns the value of gamma factor for Qball particle. #include "AtlasHepMC/GenParticle.h" // -double particleGamma(const MDTSimHit& hit){ +double particleGamma(const MDTSimHit& hit, unsigned short eventId=0){ - double QGamma=-9999.; - - const HepMcParticleLink& trkParticle = hit.particleLink(); + double QGamma=-9999.; + const EBC_EVCOLL evColl = EBC_MAINEVCOLL; + const HepMcParticleLink::PositionFlag idxFlag = (eventId==0) ? HepMcParticleLink::IS_POSITION: HepMcParticleLink::IS_INDEX; + const HepMcParticleLink trkParticle(hit.trackNumber(),eventId,evColl,idxFlag); const HepMC::GenParticle* genParticle = trkParticle.cptr(); if (genParticle){ diff --git a/MuonSpectrometer/MuonDigitization/MDT_Digitization/MDT_Digitization/particleGamma_PileUp.h b/MuonSpectrometer/MuonDigitization/MDT_Digitization/MDT_Digitization/particleGamma_PileUp.h index a4f92cde40d0dae0f90f5f7306b0cdbcf5fad5ee..9a5690fc5b61e262e3d7c7c02a77eac650a77e7a 100644 --- a/MuonSpectrometer/MuonDigitization/MDT_Digitization/MDT_Digitization/particleGamma_PileUp.h +++ b/MuonSpectrometer/MuonDigitization/MDT_Digitization/MDT_Digitization/particleGamma_PileUp.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ #ifndef MDT_DIGITIZATION_PARTICLEGAMMA2_H @@ -43,11 +43,12 @@ Function particleGamma returns the value of gamma factor for Qball particle. #include "AtlasHepMC/GenParticle.h" // -double particleGamma_PileUp(const MDTSimHit& hit){ +double particleGamma_PileUp(const MDTSimHit& hit, unsigned short eventId=0){ - double QGamma=-9999.; - - const HepMcParticleLink& trkParticle = hit.particleLink(); + double QGamma=-9999.; + const EBC_EVCOLL evColl = EBC_MAINEVCOLL; + const HepMcParticleLink::PositionFlag idxFlag = (eventId==0) ? HepMcParticleLink::IS_POSITION: HepMcParticleLink::IS_INDEX; + const HepMcParticleLink trkParticle(hit.trackNumber(),eventId,evColl,idxFlag); const HepMC::GenParticle* genParticle = trkParticle.cptr(); if (genParticle){ diff --git a/MuonSpectrometer/MuonDigitization/MDT_Digitization/src/MdtDigitizationTool.cxx b/MuonSpectrometer/MuonDigitization/MDT_Digitization/src/MdtDigitizationTool.cxx index 10426219edfa234a01ee3c718190fc68255f54be..59971a65df0aaf7e53382fd4e83148fe4adbf4c8 100644 --- a/MuonSpectrometer/MuonDigitization/MDT_Digitization/src/MdtDigitizationTool.cxx +++ b/MuonSpectrometer/MuonDigitization/MDT_Digitization/src/MdtDigitizationTool.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ //////////////////////////////////////////////////////////////////////////////// @@ -503,8 +503,8 @@ bool MdtDigitizationTool::handleMDTSimhit(const TimedHitPtr<MDTSimHit>& phit, CL if(m_DoQballCharge == true ) { // chargeCalculator returns the value of electric charge for Qball particle. // particleGamma returns the value of gamma for Qball particle. - qgamma=particleGamma(hit); - qcharge=chargeCalculator(hit); + qgamma=particleGamma(hit, phit.eventId()); + qcharge=chargeCalculator(hit, phit.eventId()); MdtDigiToolInput digiInput1(fabs(driftRadius),distRO,0.,0.,qcharge,qgamma); digiInput = digiInput1; @@ -903,7 +903,9 @@ bool MdtDigitizationTool::createDigits(MdtDigitContainer* digitContainer, MuonSi } //Create the Deposit for MuonSimData - MuonSimData::Deposit deposit(HepMcParticleLink(phit->trackNumber(),phit.eventId()), MuonMCData((float)driftRadius,localZPos)); + const EBC_EVCOLL evColl = EBC_MAINEVCOLL; + const HepMcParticleLink::PositionFlag idxFlag = (phit.eventId()==0) ? HepMcParticleLink::IS_POSITION: HepMcParticleLink::IS_INDEX; + MuonSimData::Deposit deposit(HepMcParticleLink(phit->trackNumber(),phit.eventId(),evColl,idxFlag), MuonMCData((float)driftRadius,localZPos)); //Record the SDO collection in StoreGate std::vector<MuonSimData::Deposit> deposits; diff --git a/MuonSpectrometer/MuonDigitization/MM_Digitization/src/MM_DigitizationTool.cxx b/MuonSpectrometer/MuonDigitization/MM_Digitization/src/MM_DigitizationTool.cxx index 56dca652ea14e7d4c4154dff4572e562b68edd9d..630bd3fc6e5a1c32f0eff1383dab087db7ee5956 100644 --- a/MuonSpectrometer/MuonDigitization/MM_Digitization/src/MM_DigitizationTool.cxx +++ b/MuonSpectrometer/MuonDigitization/MM_Digitization/src/MM_DigitizationTool.cxx @@ -648,7 +648,9 @@ StatusCode MM_DigitizationTool::doDigitization(const EventContext& ctx) { continue; } } - + const EBC_EVCOLL evColl = EBC_MAINEVCOLL; + const HepMcParticleLink::PositionFlag idxFlag = (phit.eventId()==0) ? HepMcParticleLink::IS_POSITION: HepMcParticleLink::IS_INDEX; + const HepMcParticleLink particleLink(phit->trackNumber(),phit.eventId(),evColl,idxFlag); // Read the information about the Micro Megas hit ATH_MSG_DEBUG ( "> hitID " << hitID @@ -665,7 +667,7 @@ StatusCode MM_DigitizationTool::doDigitization(const EventContext& ctx) { << " z " << globalHitPosition.z() << " mclink " - << hit.particleLink() + << particleLink << " station eta " << m_idHelperSvc->mmIdHelper().stationEta(layerID) << " station phi " @@ -683,7 +685,7 @@ StatusCode MM_DigitizationTool::doDigitization(const EventContext& ctx) { hit.kineticEnergy(), hit.globalDirection(), hit.depositEnergy(), - hit.trackNumber() + particleLink ); inputSimHitColl->Insert(*copyHit); @@ -998,7 +1000,7 @@ StatusCode MM_DigitizationTool::doDigitization(const EventContext& ctx) { // // digitize input for strip response - MuonSimData::Deposit deposit(hit.particleLink(), MuonMCData(hitOnSurface.x(),hitOnSurface.y())); + MuonSimData::Deposit deposit(particleLink, MuonMCData(hitOnSurface.x(),hitOnSurface.y())); //Record the SDO collection in StoreGate std::vector<MuonSimData::Deposit> deposits; diff --git a/MuonSpectrometer/MuonDigitization/RPC_Digitization/RPC_Digitization/RpcDigitizationTool.h b/MuonSpectrometer/MuonDigitization/RPC_Digitization/RPC_Digitization/RpcDigitizationTool.h index ef3348c714d7682b6423a2c37f61517ad9cb2119..fa8b740b62fc623c71c00b66fe38d3bb10d47a82 100644 --- a/MuonSpectrometer/MuonDigitization/RPC_Digitization/RPC_Digitization/RpcDigitizationTool.h +++ b/MuonSpectrometer/MuonDigitization/RPC_Digitization/RPC_Digitization/RpcDigitizationTool.h @@ -1,7 +1,7 @@ /* -*- C++ -*- */ /* - Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ #ifndef RPC_DIGITIZATIONTOOL_H @@ -157,7 +157,7 @@ private: /** Average calibration methods and parameters */ StatusCode PrintCalibrationVector(); /** Evaluate detection efficiency */ - StatusCode DetectionEfficiency(const EventContext& ctx, const Identifier* ideta, const Identifier* idphi, bool& undefinedPhiStripStatus, CLHEP::HepRandomEngine* rndmEngine, const RPCSimHit& thehit); + StatusCode DetectionEfficiency(const EventContext& ctx, const Identifier* ideta, const Identifier* idphi, bool& undefinedPhiStripStatus, CLHEP::HepRandomEngine* rndmEngine, const HepMcParticleLink& trkParticle); double FCPEfficiency(const HepMC::GenParticle* genParticle); /** */ int ClusterSizeEvaluation(const EventContext& ctx, const Identifier* id, float xstripnorm, CLHEP::HepRandomEngine* rndmEngine); diff --git a/MuonSpectrometer/MuonDigitization/RPC_Digitization/src/RpcDigitizationTool.cxx b/MuonSpectrometer/MuonDigitization/RPC_Digitization/src/RpcDigitizationTool.cxx index 2c6d12678a4b08f2c02eba34189901502fce9272..314c150ef5d94e8f978303756ce680c62d3c3c23 100644 --- a/MuonSpectrometer/MuonDigitization/RPC_Digitization/src/RpcDigitizationTool.cxx +++ b/MuonSpectrometer/MuonDigitization/RPC_Digitization/src/RpcDigitizationTool.cxx @@ -604,8 +604,11 @@ StatusCode RpcDigitizationTool::doDigitization(const EventContext& ctx, RpcDigit doubletZ, doubletPhi,gasGap, 1, pcsphi[1] ); const RpcReadoutElement* ele= m_GMmgr->getRpcReadoutElement(atlasRpcIdeta);// first add time jitter to the time: + const EBC_EVCOLL evColl = EBC_MAINEVCOLL; + const HepMcParticleLink::PositionFlag idxFlag = (phit.eventId()==0) ? HepMcParticleLink::IS_POSITION: HepMcParticleLink::IS_INDEX; + const HepMcParticleLink particleLink(phit->trackNumber(),phit.eventId(),evColl,idxFlag); - if (DetectionEfficiency(ctx, &atlasRpcIdeta,&atlasRpcIdphi, undefPhiStripStat, rndmEngine, hit).isFailure()) return StatusCode::FAILURE ; + ATH_CHECK(DetectionEfficiency(ctx, &atlasRpcIdeta,&atlasRpcIdphi, undefPhiStripStat, rndmEngine, particleLink)); ATH_MSG_DEBUG ( "SetPhiOn " << m_SetPhiOn << " SetEtaOn " << m_SetEtaOn ); for( int imeasphi=0 ; imeasphi!=2; ++imeasphi){ @@ -658,7 +661,7 @@ StatusCode RpcDigitizationTool::doDigitization(const EventContext& ctx, RpcDigit // ME unused: const HepMcParticleLink & particleLink = hit.particleLink(); // MuonMCData first word is the packing of : proptime, bunchTime, posy, posz // MuonMCData second word is the total hit time: bunchcTime+tof+proptime+correlatedJitter / ns - MuonSimData::Deposit deposit(HepMcParticleLink(phit->trackNumber(),phit.eventId()), + MuonSimData::Deposit deposit(particleLink, MuonMCData((*b),time)); // store tof+strip_propagation+corr.jitter // MuonMCData((*b),G4Time+bunchTime+proptime )); // store tof+strip_propagation @@ -1686,7 +1689,7 @@ StatusCode RpcDigitizationTool::readParameters(){ } //-------------------------------------------- -StatusCode RpcDigitizationTool::DetectionEfficiency(const EventContext& ctx, const Identifier* IdEtaRpcStrip, const Identifier* IdPhiRpcStrip, bool& undefinedPhiStripStatus, CLHEP::HepRandomEngine* rndmEngine, const RPCSimHit& thehit) { +StatusCode RpcDigitizationTool::DetectionEfficiency(const EventContext& ctx, const Identifier* IdEtaRpcStrip, const Identifier* IdPhiRpcStrip, bool& undefinedPhiStripStatus, CLHEP::HepRandomEngine* rndmEngine, const HepMcParticleLink& trkParticle) { ATH_MSG_DEBUG ( "RpcDigitizationTool::in DetectionEfficiency" ); @@ -2039,7 +2042,6 @@ StatusCode RpcDigitizationTool::DetectionEfficiency(const EventContext& ctx, con //Efficiency correction factor for fractional-charged particles(added by Quanyin Li: quli@cern.ch) //link to truth particles and calculate the charge and betagamma - const HepMcParticleLink& trkParticle = thehit.particleLink(); const HepMC::GenParticle* genparticle = trkParticle.cptr(); if(genparticle){ const int particlePdgId = genparticle->pdg_id(); diff --git a/MuonSpectrometer/MuonDigitization/TGC_Digitization/src/TgcDigitizationTool.cxx b/MuonSpectrometer/MuonDigitization/TGC_Digitization/src/TgcDigitizationTool.cxx index 3dacd198f7ada4aef58bfea230adcbfc04a485c0..4416a237901b0f8f118c573ecba7d30bddecc85a 100644 --- a/MuonSpectrometer/MuonDigitization/TGC_Digitization/src/TgcDigitizationTool.cxx +++ b/MuonSpectrometer/MuonDigitization/TGC_Digitization/src/TgcDigitizationTool.cxx @@ -383,7 +383,9 @@ StatusCode TgcDigitizationTool::digitizeCore(const EventContext& ctx) const { // link to MC info //const HepMcParticleLink & particleLink = hit.particleLink(); // create here deposit for MuonSimData, link and tof - MuonSimData::Deposit deposit(HepMcParticleLink(phit->trackNumber(), phit.eventId()), MuonMCData(tof, 0)); + const EBC_EVCOLL evColl = EBC_MAINEVCOLL; + const HepMcParticleLink::PositionFlag idxFlag = (phit.eventId()==0) ? HepMcParticleLink::IS_POSITION: HepMcParticleLink::IS_INDEX; + MuonSimData::Deposit deposit(HepMcParticleLink(phit->trackNumber(), phit.eventId(), evColl, idxFlag), MuonMCData(tof, 0)); std::vector<MuonSimData::Deposit> deposits; deposits.push_back(deposit); diff --git a/MuonSpectrometer/MuonDigitization/sTGC_Digitization/src/sTgcDigitizationTool.cxx b/MuonSpectrometer/MuonDigitization/sTGC_Digitization/src/sTgcDigitizationTool.cxx index 48c2bd2e76e352b9f62d5b4f5c610039fbf73715..36b207538b8f12df4ebd7db8c9c43f1c63d07b56 100644 --- a/MuonSpectrometer/MuonDigitization/sTGC_Digitization/src/sTgcDigitizationTool.cxx +++ b/MuonSpectrometer/MuonDigitization/sTGC_Digitization/src/sTgcDigitizationTool.cxx @@ -519,13 +519,17 @@ StatusCode sTgcDigitizationTool::doDigitization(const EventContext& ctx) { ATH_MSG_DEBUG("sTgcDigitizationTool::doDigitization hits mapped"); - const sTGCSimHit temp_hit(hit.sTGCId(), hit.globalTime(), - G_HITONSURFACE_WIRE, - hit.particleEncoding(), - hit.globalDirection(), - hit.depositEnergy(), - hit.particleLink() - ); + const EBC_EVCOLL evColl = EBC_MAINEVCOLL; + const HepMcParticleLink::PositionFlag idxFlag = (eventId==0) ? HepMcParticleLink::IS_POSITION: HepMcParticleLink::IS_INDEX; + const int barcode = hit.particleLink().barcode(); + const HepMcParticleLink particleLink(barcode, eventId, evColl, idxFlag); + const sTGCSimHit temp_hit(hit.sTGCId(), hit.globalTime(), + G_HITONSURFACE_WIRE, + hit.particleEncoding(), + hit.globalDirection(), + hit.depositEnergy(), + particleLink + ); float globalHitTime = temp_hit.globalTime() + eventTime; @@ -590,7 +594,7 @@ StatusCode sTgcDigitizationTool::doDigitization(const EventContext& ctx) { ATH_MSG_VERBOSE(" charge = " << newDigit->charge()) ; // Create a MuonSimData (SDO) corresponding to the digit - MuonSimData::Deposit deposit(hit.particleLink(), MuonMCData(hit.depositEnergy(), tof)); + MuonSimData::Deposit deposit(particleLink, MuonMCData(hit.depositEnergy(), tof)); std::vector<MuonSimData::Deposit> deposits; deposits.push_back(deposit); MuonSimData simData(deposits, hit.particleEncoding()); diff --git a/MuonSpectrometer/MuonGeoModelTest/MuonGeoModelTest/MuonGMCheck.h b/MuonSpectrometer/MuonGeoModelTest/MuonGeoModelTest/MuonGMCheck.h index bda5fa9d80196daae108496b055f0b611a205261..f2183343329f7b6b8f79d8f753104837b41696b0 100644 --- a/MuonSpectrometer/MuonGeoModelTest/MuonGeoModelTest/MuonGMCheck.h +++ b/MuonSpectrometer/MuonGeoModelTest/MuonGeoModelTest/MuonGMCheck.h @@ -2,26 +2,21 @@ Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ - /*************************************************************************** test MuonGeoModel from digits to pos. in space ---------------------------------------------- ***************************************************************************/ -//<doc><file> $Id: MuonGMCheck.h,v 1.15 2009-03-28 10:59:00 stefspa Exp $ -//<version> $Name: not supported by cvs2svn $ - #ifndef MUONGEOMODEL_MUONGMCHECK_H # define MUONGEOMODEL_MUONGMCHECK_H #include "AthenaBaseComps/AthAlgorithm.h" - +#include "GaudiKernel/ServiceHandle.h" #include "GaudiKernel/ToolHandle.h" #include "MuonCalibITools/IIdToFixedIdTool.h" -#include "MuonIdHelpers/MuonIdHelperTool.h" -#include <cmath> +#include "MuonIdHelpers/IMuonIdHelperSvc.h" -class Identifier; +#include <cmath> namespace MuonGM { @@ -35,11 +30,10 @@ class MuonGMCheck: public AthAlgorithm public: MuonGMCheck(const std::string& name, ISvcLocator* pSvcLocator); - ~MuonGMCheck(); + ~MuonGMCheck()=default; StatusCode initialize(); StatusCode execute(); - StatusCode finalize(); void clearCache() const; private: @@ -86,8 +80,7 @@ private: MuonGM::MuonDetectorManager* p_MuonMgr; ToolHandle<MuonCalib::IIdToFixedIdTool> m_fixedIdTool; - ToolHandle<Muon::MuonIdHelperTool> m_muonIdHelperTool{this, "idHelper", - "Muon::MuonIdHelperTool/MuonIdHelperTool", "Handle to the MuonIdHelperTool"}; + ServiceHandle<Muon::IMuonIdHelperSvc> m_idHelperSvc {this, "MuonIdHelperSvc", "Muon::MuonIdHelperSvc/MuonIdHelperSvc"}; int m_mem; //<! counter for memory allocated VmSize values read from /proc/<pid>/status int m_cpu[2]; //<! counter for cpu time read from /proc/<pid>/cpu diff --git a/MuonSpectrometer/MuonGeoModelTest/share/readPrdFromRdo.py b/MuonSpectrometer/MuonGeoModelTest/share/readPrdFromRdo.py index 9016257762db12ecc7efee43469c6ac15d38da82..bd65f381e5bd8df8a954279c33dc22a21a8fc575 100644 --- a/MuonSpectrometer/MuonGeoModelTest/share/readPrdFromRdo.py +++ b/MuonSpectrometer/MuonGeoModelTest/share/readPrdFromRdo.py @@ -85,5 +85,7 @@ include ("MuonRdoToPrepData/MuonRdoToMuonPrepData_jobOptions.py") #from MuonRdoToPrepData.MuonRdoToPrepDataGenConf import MdtRdoToMdtPrepData #MdtRdoToMdtPrepData = MdtRdoToMdtPrepData() MdtRdoToMdtPrepData.CalibratePrepData = False +from RegionSelector.RegSelToolConfig import makeRegSelTool_MDT +MdtRdoToMdtPrepData.RegSel_MDT = makeRegSelTool_MDT() topSequence += MuonGMTestOnPrd diff --git a/MuonSpectrometer/MuonGeoModelTest/src/MuonGMCheck.cxx b/MuonSpectrometer/MuonGeoModelTest/src/MuonGMCheck.cxx index d2bf6ff0bf3845aa731dfea8399941a617ca8e0e..d07a9c428528995cb4e53612a0a46bb741352d5f 100644 --- a/MuonSpectrometer/MuonGeoModelTest/src/MuonGMCheck.cxx +++ b/MuonSpectrometer/MuonGeoModelTest/src/MuonGMCheck.cxx @@ -7,11 +7,7 @@ ----------------------------------------- ***************************************************************************/ -#include "GaudiKernel/MsgStream.h" -#include "StoreGate/StoreGateSvc.h" - #include "MuonGeoModelTest/PerfUtils.h" - #include "MuonGeoModelTest/MuonGMCheck.h" #include "MuonDigitContainer/RpcDigitContainer.h" @@ -20,15 +16,6 @@ #include "MuonDigitContainer/MdtDigitContainer.h" #include "MuonDigitContainer/MdtDigitCollection.h" #include "MuonDigitContainer/MdtDigit.h" - -#include "MuonIdHelpers/MuonIdHelper.h" -#include "MuonIdHelpers/CscIdHelper.h" -#include "MuonIdHelpers/RpcIdHelper.h" -#include "MuonIdHelpers/MdtIdHelper.h" -#include "MuonIdHelpers/TgcIdHelper.h" -#include "MuonIdHelpers/sTgcIdHelper.h" -#include "MuonIdHelpers/MmIdHelper.h" - #include "MuonReadoutGeometry/MuonDetectorManager.h" #include "MuonReadoutGeometry/MuonReadoutElement.h" #include "MuonReadoutGeometry/MdtReadoutElement.h" @@ -39,15 +26,11 @@ #include "MuonReadoutGeometry/TgcReadoutElement.h" #include "MuonReadoutGeometry/RpcReadoutSet.h" #include "MuonReadoutGeometry/MuonStation.h" - +#include "MuonReadoutGeometry/TgcReadoutParams.h" #include "MuonAlignmentData/ALinePar.h" #include "MuonAlignmentData/BLinePar.h" - -#include "MuonReadoutGeometry/TgcReadoutParams.h" - #include "TrkSurfaces/Surface.h" #include "RegionSelector/IRegSelSvc.h" - #include "GeoPrimitives/CLHEPtoEigenConverter.h" #include <boost/format.hpp> @@ -57,12 +40,15 @@ typedef std::istringstream mystream; -using namespace MuonGM; +namespace { + static constexpr double const& invRad = 180/M_PI; +} +using namespace MuonGM; -MuonGMCheck::MuonGMCheck(const std::string& name, ISvcLocator* pSvcLocator) - : AthAlgorithm ( name, pSvcLocator ), - p_MuonMgr ( 0 ), +MuonGMCheck::MuonGMCheck(const std::string& name, ISvcLocator* pSvcLocator) : + AthAlgorithm(name, pSvcLocator), + p_MuonMgr(nullptr), m_fixedIdTool("MuonCalib::IdToFixedIdTool") { m_mem = 0; @@ -133,9 +119,6 @@ MuonGMCheck::MuonGMCheck(const std::string& name, ISvcLocator* pSvcLocator) } -MuonGMCheck::~MuonGMCheck() -{ } - StatusCode MuonGMCheck::initialize() { @@ -145,7 +128,7 @@ MuonGMCheck::initialize() // first get helpers ATH_MSG_DEBUG("Get Muon Id Helpers from the det store (through their converters)" ); - ATH_CHECK( m_muonIdHelperTool.retrieve() ); + ATH_CHECK( m_idHelperSvc.retrieve() ); ATH_MSG_DEBUG( " Muon Id Helper retrieved from handle " ); showVmemCpu("initialize (IDHELPER retrieved from handle)"); @@ -234,14 +217,6 @@ void MuonGMCheck::clearCache() const if (p_MuonMgr->cachingFlag() == 0) p_MuonMgr->clearCache(); } - -StatusCode -MuonGMCheck::finalize() -{ - ATH_MSG_DEBUG( "Finalizing" ); - return StatusCode::SUCCESS; -} - void MuonGMCheck::checkreadoutrpcgeo() { ATH_MSG_INFO( " *************************** Global Check for Rpc" ); @@ -313,7 +288,7 @@ void MuonGMCheck::checkreadoutrpcgeo() dbr_index, dbz_index); - if (rpc == NULL) continue; + if (!rpc) continue; fout<<" ///////////////////// Found a RpcReadoutElement for indices = " <<sname_index<<" "<<seta_index<<" "<< sphi_index<<" " <<dbr_index<<" "<<dbz_index @@ -321,27 +296,27 @@ void MuonGMCheck::checkreadoutrpcgeo() Identifier idr = rpc->identify(); int ndbphi = rpc->NphiStripPanels(); fout<<" its offline hash Id = "<<rpc->identifyHash()<<std::endl; - fout<<" its offline Id = "<<m_muonIdHelperTool->rpcIdHelper().show_to_string(idr) + fout<<" its offline Id = "<<m_idHelperSvc->rpcIdHelper().show_to_string(idr) <<" ////////////////// belongs to module " <<rpc->getTechnologyName()<<"/" <<rpc->getStationName()<<" # doubletPhi = "<<ndbphi<<std::endl; - Identifier idp = m_muonIdHelperTool->rpcIdHelper().parentID(idr); - fout<<" parent Id = "<<m_muonIdHelperTool->rpcIdHelper().show_to_string(idp)<<std::endl; + Identifier idp = m_idHelperSvc->rpcIdHelper().parentID(idr); + fout<<" parent Id = "<<m_idHelperSvc->rpcIdHelper().show_to_string(idp)<<std::endl; fout<<" Center of the RpcReadoutElement at "<<rpc->center()<<std::endl; - int doubletR = m_muonIdHelperTool->rpcIdHelper().doubletR(idr); - int doubletZ = m_muonIdHelperTool->rpcIdHelper().doubletZ(idr); + int doubletR = m_idHelperSvc->rpcIdHelper().doubletR(idr); + int doubletZ = m_idHelperSvc->rpcIdHelper().doubletZ(idr); int stEta = rpc->getStationEta(); int stPhi = rpc->getStationPhi(); - int stNameInt = m_muonIdHelperTool->rpcIdHelper().stationName(idr); - std::string stNameString = m_muonIdHelperTool->rpcIdHelper().stationNameString(stNameInt); + int stNameInt = m_idHelperSvc->rpcIdHelper().stationName(idr); + std::string stNameString = m_idHelperSvc->rpcIdHelper().stationNameString(stNameInt); RpcReadoutSet Set(p_MuonMgr, idr); int ndbz = Set.NdoubletZ(); - fout1<<" its offline Id = "<<m_muonIdHelperTool->rpcIdHelper().show_to_string(idr)<<" means "<<stNameString<<" eta "<<stEta<<" phi "<<stPhi<<" doubletR "<<doubletR<<" dbZ "<<doubletZ<<"(out of "<<ndbz<<" in the set); n. of dbPhi in this chamber = "<< ndbphi<<std::endl; + fout1<<" its offline Id = "<<m_idHelperSvc->rpcIdHelper().show_to_string(idr)<<" means "<<stNameString<<" eta "<<stEta<<" phi "<<stPhi<<" doubletR "<<doubletR<<" dbZ "<<doubletZ<<"(out of "<<ndbz<<" in the set); n. of dbPhi in this chamber = "<< ndbphi<<std::endl; const MuonStation* ms = rpc->parentMuonStation(); if (ms) fout<<"Parent MuonStation found "<<std::endl; - else fout<<"Parent MuonStation NOT found for element "<<m_muonIdHelperTool->rpcIdHelper().show_to_string(idr)<<std::endl; + else fout<<"Parent MuonStation NOT found for element "<<m_idHelperSvc->rpcIdHelper().show_to_string(idr)<<std::endl; fout<<" For this Module, gasGapSsize() "<<rpc->gasGapSsize() <<" and stripPanelSsize() "<<rpc->stripPanelSsize(1) @@ -354,20 +329,20 @@ void MuonGMCheck::checkreadoutrpcgeo() for (int idbphi = 1; idbphi<=ndbphi; ++idbphi) { - int dbp = m_muonIdHelperTool->rpcIdHelper().doubletPhi(idr); + int dbp = m_idHelperSvc->rpcIdHelper().doubletPhi(idr); if (ndbphi>1 && idbphi>1) dbp = idbphi; - fout<<" Changing doubletPhi for "<<m_muonIdHelperTool->rpcIdHelper().show_to_string(idr) + fout<<" Changing doubletPhi for "<<m_idHelperSvc->rpcIdHelper().show_to_string(idr) <<" "<<rpc->getTechnologyName()<<"/" <<rpc->getStationName()<<" dbr, dbz, dbp "<<doubletR<<" " - <<m_muonIdHelperTool->rpcIdHelper().doubletZ(idr)<<" "<<dbp<<std::endl; + <<m_idHelperSvc->rpcIdHelper().doubletZ(idr)<<" "<<dbp<<std::endl; for ( int igg=1; igg<3; igg++) { // - fout<<" Changing gas-gap "<<igg<<" for "<<m_muonIdHelperTool->rpcIdHelper().show_to_string(idr) + fout<<" Changing gas-gap "<<igg<<" for "<<m_idHelperSvc->rpcIdHelper().show_to_string(idr) <<" "<<rpc->getTechnologyName()<<"/" <<rpc->getStationName()<<" dbr, dbz, dbp "<<doubletR<<" " - <<m_muonIdHelperTool->rpcIdHelper().doubletZ(idr)<<" "<< dbp<<std::endl; + <<m_idHelperSvc->rpcIdHelper().doubletZ(idr)<<" "<< dbp<<std::endl; int measphi = 1; fout<<" Gas Gap "<<igg<<" measphi = "<<measphi<<" phi strip pitch = "<<rpc->StripPitch(measphi)<<" n. phi strips = "<<rpc->NphiStrips()<<std::endl; phistr_pitch += rpc->StripPitch(measphi) * rpc->NphiStrips(); @@ -381,8 +356,8 @@ void MuonGMCheck::checkreadoutrpcgeo() //here (gasgap-level) perform checks on local to global transform // BMF1 at stEta = 3 stPhi = 6, dbR=1,dbZ=1,dbPhi=1->should be 2 gg=1 or 2 Amg::Vector3D aLocalPoint = Amg::Vector3D(-1.,62.882732,-47.88338); - Identifier idgg = m_muonIdHelperTool->rpcIdHelper().channelID(idp, - m_muonIdHelperTool->rpcIdHelper().doubletZ(idr), + Identifier idgg = m_idHelperSvc->rpcIdHelper().channelID(idp, + m_idHelperSvc->rpcIdHelper().doubletZ(idr), dbp, igg, measphi, 1); Amg::Vector3D aGlobalPoint = rpc->localToGlobalCoords(aLocalPoint, idgg); fout<<" Global point = "<<aGlobalPoint<<std::endl; @@ -401,13 +376,13 @@ void MuonGMCheck::checkreadoutrpcgeo() if (m_check_first_last) stripStep = rpc->NphiStrips()-1; for (int strip = 1; strip<=rpc->NphiStrips();) { - Identifier chid = m_muonIdHelperTool->rpcIdHelper().channelID(idp, - m_muonIdHelperTool->rpcIdHelper().doubletZ(idr), + Identifier chid = m_idHelperSvc->rpcIdHelper().channelID(idp, + m_idHelperSvc->rpcIdHelper().doubletZ(idr), dbp, igg, measphi, strip); if (strip==1) { - fpanelidh<<"IdCodes "<<m_muonIdHelperTool->rpcIdHelper().show_to_string(chid)<<" " - <<m_muonIdHelperTool->rpcIdHelper().stationNameString(m_muonIdHelperTool->rpcIdHelper().stationName(chid))<<" " + fpanelidh<<"IdCodes "<<m_idHelperSvc->rpcIdHelper().show_to_string(chid)<<" " + <<m_idHelperSvc->rpcIdHelper().stationNameString(m_idHelperSvc->rpcIdHelper().stationName(chid))<<" " <<chid<<" " <<chid.get_identifier32().get_compact()<<" " <<chid.get_compact()<<" n phi strips = "<<rpc->NphiStrips()<<std::endl; @@ -416,10 +391,10 @@ void MuonGMCheck::checkreadoutrpcgeo() int layerType=0; if ( doubletR==2 ) layerType=1; if ( (stNameInt>3&&(stNameInt!=53 && stNameInt!=8)) && doubletR==1 ) layerType=2; - layerType = layerType*2+m_muonIdHelperTool->rpcIdHelper().gasGap(chid); + layerType = layerType*2+m_idHelperSvc->rpcIdHelper().gasGap(chid); fpanelid<<layerType<<" " <<stNameString<<" phi " - <<m_muonIdHelperTool->rpcIdHelper().show_to_string(chid)<<" " + <<m_idHelperSvc->rpcIdHelper().show_to_string(chid)<<" " <<chid.get_identifier32().get_compact()<<" " <<etamin<<" "<<etamax<<" "<<phimin<<" "<<phimax<<" "<<zmin<<" "<<zmax<<std::endl; bool anyPad=true; @@ -441,10 +416,10 @@ void MuonGMCheck::checkreadoutrpcgeo() if (ndbz==1 || (stNameString.substr(0,3)=="BMS" && abs(stEta)==4 && dbz_index==0)){ fpanelid<<"Pad box position " <<stNameString.substr(0,3)<<" eta/phi "<<stEta<<"/"<<stPhi<<" "<<planeString - <<m_muonIdHelperTool->rpcIdHelper().show_to_string(chid)<<" "<<xC<<" "<<yC<<" "<<zC<<std::endl; + <<m_idHelperSvc->rpcIdHelper().show_to_string(chid)<<" "<<xC<<" "<<yC<<" "<<zC<<std::endl; fout1<<"Pad box position " <<stNameString.substr(0,3)<<" eta/phi "<<stEta<<"/"<<stPhi<<" "<<planeString - <<m_muonIdHelperTool->rpcIdHelper().show_to_string(chid)<<" "<<xC<<" "<<yC<<" "<<zC<<std::endl; + <<m_idHelperSvc->rpcIdHelper().show_to_string(chid)<<" "<<xC<<" "<<yC<<" "<<zC<<std::endl; fpad<<stNameString.substr(0,3)<<" "<<xC<<" "<<yC<<" "<<zC<<std::endl; } @@ -460,10 +435,10 @@ void MuonGMCheck::checkreadoutrpcgeo() else {xC = 0.5*(keepxLS + xC); yC = 0.5*(keepyLS + yC); zC = 0.5*(keepzLS + zC);} fpanelid<<"Pad box position " <<stNameString.substr(0,3)<<" eta/phi "<<stEta<<"/"<<stPhi<<" "<<planeString - <<m_muonIdHelperTool->rpcIdHelper().show_to_string(chid)<<" "<<xC<<" "<<yC<<" "<<zC<<std::endl; + <<m_idHelperSvc->rpcIdHelper().show_to_string(chid)<<" "<<xC<<" "<<yC<<" "<<zC<<std::endl; fout1<<"Pad box position " <<stNameString.substr(0,3)<<" eta/phi "<<stEta<<"/"<<stPhi<<" "<<planeString - <<m_muonIdHelperTool->rpcIdHelper().show_to_string(chid)<<" "<<xC<<" "<<yC<<" "<<zC<<std::endl; + <<m_idHelperSvc->rpcIdHelper().show_to_string(chid)<<" "<<xC<<" "<<yC<<" "<<zC<<std::endl; fpad<<stNameString.substr(0,3)<<" "<<xC<<" "<<yC<<" "<<zC<<std::endl; } } @@ -478,19 +453,19 @@ void MuonGMCheck::checkreadoutrpcgeo() if (dbp==1) { fpanelid<<"Pad box position " <<stNameString.substr(0,3)<<" eta/phi "<<stEta<<"/"<<stPhi<<" "<<planeString - <<m_muonIdHelperTool->rpcIdHelper().show_to_string(chid)<<" "<<xFirstPhiS<<" "<<yFirstPhiS<<" "<<zFirstPhiS<<std::endl; + <<m_idHelperSvc->rpcIdHelper().show_to_string(chid)<<" "<<xFirstPhiS<<" "<<yFirstPhiS<<" "<<zFirstPhiS<<std::endl; fout1<<"Pad box position " <<stNameString.substr(0,3)<<" eta/phi "<<stEta<<"/"<<stPhi<<" "<<planeString - <<m_muonIdHelperTool->rpcIdHelper().show_to_string(chid)<<" "<<xFirstPhiS<<" "<<yFirstPhiS<<" "<<zFirstPhiS<<std::endl; + <<m_idHelperSvc->rpcIdHelper().show_to_string(chid)<<" "<<xFirstPhiS<<" "<<yFirstPhiS<<" "<<zFirstPhiS<<std::endl; fpad<<stNameString.substr(0,3)<<" "<<xFirstPhiS<<" "<<yFirstPhiS<<" "<<zFirstPhiS<<std::endl; } else { fpanelid<<"Pad box position " <<stNameString.substr(0,3)<<" eta/phi "<<stEta<<"/"<<stPhi<<" "<<planeString - <<m_muonIdHelperTool->rpcIdHelper().show_to_string(chid)<<" "<<xLastPhiS<<" "<<yLastPhiS<<" "<<zLastPhiS<<std::endl; + <<m_idHelperSvc->rpcIdHelper().show_to_string(chid)<<" "<<xLastPhiS<<" "<<yLastPhiS<<" "<<zLastPhiS<<std::endl; fout1<<"Pad box position " <<stNameString.substr(0,3)<<" eta/phi "<<stEta<<"/"<<stPhi<<" "<<planeString - <<m_muonIdHelperTool->rpcIdHelper().show_to_string(chid)<<" "<<xLastPhiS<<" "<<yLastPhiS<<" "<<zLastPhiS<<std::endl; + <<m_idHelperSvc->rpcIdHelper().show_to_string(chid)<<" "<<xLastPhiS<<" "<<yLastPhiS<<" "<<zLastPhiS<<std::endl; fpad<<stNameString.substr(0,3)<<" "<<xLastPhiS<<" "<<yLastPhiS<<" "<<zLastPhiS<<std::endl; xC = rpc->center().x(); yC = rpc->center().y();zC = rpc->center().z(); } @@ -511,11 +486,11 @@ void MuonGMCheck::checkreadoutrpcgeo() zFirstPhiS = 0.5*(keepzFS + zFirstPhiS); fpanelid<<"Pad box position " <<stNameString.substr(0,3)<<" eta/phi "<<stEta<<"/"<<stPhi<<" "<<planeString - <<m_muonIdHelperTool->rpcIdHelper().show_to_string(chid)<<" "<<xFirstPhiS<<" "<<yFirstPhiS<<" "<<zFirstPhiS<<std::endl; + <<m_idHelperSvc->rpcIdHelper().show_to_string(chid)<<" "<<xFirstPhiS<<" "<<yFirstPhiS<<" "<<zFirstPhiS<<std::endl; fpad<<stNameString.substr(0,3)<<" "<<xFirstPhiS<<" "<<yFirstPhiS<<" "<<zFirstPhiS<<std::endl; fout1<<"Pad box position " <<stNameString.substr(0,3)<<" eta/phi "<<stEta<<"/"<<stPhi<<" "<<planeString - <<m_muonIdHelperTool->rpcIdHelper().show_to_string(chid)<<" "<<xFirstPhiS<<" "<<yFirstPhiS<<" "<<zFirstPhiS<<std::endl; + <<m_idHelperSvc->rpcIdHelper().show_to_string(chid)<<" "<<xFirstPhiS<<" "<<yFirstPhiS<<" "<<zFirstPhiS<<std::endl; } else { xLastPhiS = 0.5*(keepxLS + xLastPhiS); @@ -523,10 +498,10 @@ void MuonGMCheck::checkreadoutrpcgeo() zLastPhiS = 0.5*(keepzLS + zLastPhiS); fpanelid<<"Pad box position " <<stNameString.substr(0,3)<<" eta/phi "<<stEta<<"/"<<stPhi<<" "<<planeString - <<m_muonIdHelperTool->rpcIdHelper().show_to_string(chid)<<" "<<xLastPhiS<<" "<<yLastPhiS<<" "<<zLastPhiS<<std::endl; + <<m_idHelperSvc->rpcIdHelper().show_to_string(chid)<<" "<<xLastPhiS<<" "<<yLastPhiS<<" "<<zLastPhiS<<std::endl; fout1<<"Pad box position " <<stNameString.substr(0,3)<<" eta/phi "<<stEta<<"/"<<stPhi<<" "<<planeString - <<m_muonIdHelperTool->rpcIdHelper().show_to_string(chid)<<" "<<xLastPhiS<<" "<<yLastPhiS<<" "<<zLastPhiS<<std::endl; + <<m_idHelperSvc->rpcIdHelper().show_to_string(chid)<<" "<<xLastPhiS<<" "<<yLastPhiS<<" "<<zLastPhiS<<std::endl; fpad<<stNameString.substr(0,3)<<" "<<xLastPhiS<<" "<<yLastPhiS<<" "<<zLastPhiS<<std::endl; xC = 0.5*(keepxC + rpc->center().x()); yC = 0.5*(keepyC + rpc->center().y()); zC = 0.5*(keepzC + rpc->center().z()); } @@ -538,7 +513,7 @@ void MuonGMCheck::checkreadoutrpcgeo() } - fout<<" StripGlobalPosition "<<m_muonIdHelperTool->rpcIdHelper().show_to_string(chid)<<" pos " + fout<<" StripGlobalPosition "<<m_idHelperSvc->rpcIdHelper().show_to_string(chid)<<" pos " <<rpc->stripPos(chid)<<" Local Position = "<<rpc->localStripPos(chid) <<std::endl; Amg::Vector3D xxSD = rpc->globalToLocalCoords(rpc->stripPos(chid), chid); Amg::Vector3D xxMod = rpc->SDtoModuleCoords(xxSD, chid); @@ -551,32 +526,32 @@ void MuonGMCheck::checkreadoutrpcgeo() if (strip == 1 && m_check_rpc_distToReadout > 0) { - Identifier chtest0 = m_muonIdHelperTool->rpcIdHelper().channelID(idp, - m_muonIdHelperTool->rpcIdHelper().doubletZ(idr), + Identifier chtest0 = m_idHelperSvc->rpcIdHelper().channelID(idp, + m_idHelperSvc->rpcIdHelper().doubletZ(idr), dbp, igg, measphi, 1); - Identifier chtest1 = m_muonIdHelperTool->rpcIdHelper().channelID(idp, - m_muonIdHelperTool->rpcIdHelper().doubletZ(idr), + Identifier chtest1 = m_idHelperSvc->rpcIdHelper().channelID(idp, + m_idHelperSvc->rpcIdHelper().doubletZ(idr), dbp, igg, measphi, rpc->NphiStrips()); - Identifier chtest2 = m_muonIdHelperTool->rpcIdHelper().channelID(idp, - m_muonIdHelperTool->rpcIdHelper().doubletZ(idr), + Identifier chtest2 = m_idHelperSvc->rpcIdHelper().channelID(idp, + m_idHelperSvc->rpcIdHelper().doubletZ(idr), dbp, igg, 0, 1); - Identifier chtest3 = m_muonIdHelperTool->rpcIdHelper().channelID(idp, - m_muonIdHelperTool->rpcIdHelper().doubletZ(idr), + Identifier chtest3 = m_idHelperSvc->rpcIdHelper().channelID(idp, + m_idHelperSvc->rpcIdHelper().doubletZ(idr), dbp, igg, 0, rpc->NetaStrips()); fout<<"distance to Phi/Eta RO for center of strip " - <<m_muonIdHelperTool->rpcIdHelper().show_to_string(chtest0)<<" are " + <<m_idHelperSvc->rpcIdHelper().show_to_string(chtest0)<<" are " <<rpc->distanceToPhiReadout(rpc->stripPos(chtest0),chtest0)<<" " <<rpc->distanceToEtaReadout(rpc->stripPos(chtest0),chtest0)<<std::endl; fout<<"distance to Phi/Eta RO for center of strip " - <<m_muonIdHelperTool->rpcIdHelper().show_to_string(chtest1)<<" are " + <<m_idHelperSvc->rpcIdHelper().show_to_string(chtest1)<<" are " <<rpc->distanceToPhiReadout(rpc->stripPos(chtest1),chtest1)<<" " <<rpc->distanceToEtaReadout(rpc->stripPos(chtest1),chtest1)<<std::endl; fout<<"distance to Phi/Eta RO for center of strip " - <<m_muonIdHelperTool->rpcIdHelper().show_to_string(chtest2)<<" are " + <<m_idHelperSvc->rpcIdHelper().show_to_string(chtest2)<<" are " <<rpc->distanceToPhiReadout(rpc->stripPos(chtest2),chtest2)<<" " <<rpc->distanceToEtaReadout(rpc->stripPos(chtest2),chtest2)<<std::endl; fout<<"distance to Phi/Eta RO for center of strip " - <<m_muonIdHelperTool->rpcIdHelper().show_to_string(chtest3)<<" are " + <<m_idHelperSvc->rpcIdHelper().show_to_string(chtest3)<<" are " <<rpc->distanceToPhiReadout(rpc->stripPos(chtest3),chtest3)<<" " <<rpc->distanceToEtaReadout(rpc->stripPos(chtest3),chtest3)<<std::endl; } @@ -616,13 +591,13 @@ void MuonGMCheck::checkreadoutrpcgeo() if (m_check_first_last) stripStep = rpc->NetaStrips()-1; for (int strip = 1; strip<=rpc->NetaStrips();) { - Identifier chid = m_muonIdHelperTool->rpcIdHelper().channelID(idp, - m_muonIdHelperTool->rpcIdHelper().doubletZ(idr), + Identifier chid = m_idHelperSvc->rpcIdHelper().channelID(idp, + m_idHelperSvc->rpcIdHelper().doubletZ(idr), dbp, igg, measphi, strip); if (strip==1) { - fpanelidh<<"IdCodes "<<m_muonIdHelperTool->rpcIdHelper().show_to_string(chid)<<" " - <<m_muonIdHelperTool->rpcIdHelper().stationNameString(m_muonIdHelperTool->rpcIdHelper().stationName(chid))<<" " + fpanelidh<<"IdCodes "<<m_idHelperSvc->rpcIdHelper().show_to_string(chid)<<" " + <<m_idHelperSvc->rpcIdHelper().stationNameString(m_idHelperSvc->rpcIdHelper().stationName(chid))<<" " <<chid<<" " <<chid.get_identifier32().get_compact()<<" " <<chid.get_compact()<<" n eta strips = "<<rpc->NetaStrips()<<std::endl; @@ -630,17 +605,17 @@ void MuonGMCheck::checkreadoutrpcgeo() int layerType=0; if ( doubletR==2 ) layerType=1; if ( (stNameInt>3&&(stNameInt!=53 && stNameInt!=8)) && doubletR==1 ) layerType=2; - layerType = layerType*2+m_muonIdHelperTool->rpcIdHelper().gasGap(chid); + layerType = layerType*2+m_idHelperSvc->rpcIdHelper().gasGap(chid); fpanelid<<layerType<<" " <<stNameString<<" eta " - <<m_muonIdHelperTool->rpcIdHelper().show_to_string(chid)<<" " + <<m_idHelperSvc->rpcIdHelper().show_to_string(chid)<<" " <<chid.get_identifier32().get_compact()<<" " <<etamin<<" "<<etamax<<" "<<phimin<<" "<<phimax<<" "<<zmin<<" "<<zmax<<std::endl; } - fout<<" StripGlobalPosition "<<m_muonIdHelperTool->rpcIdHelper().show_to_string(chid)<<" pos " + fout<<" StripGlobalPosition "<<m_idHelperSvc->rpcIdHelper().show_to_string(chid)<<" pos " <<rpc->stripPos(chid)<<" Local Position = "<<rpc->localStripPos(chid)<<std::endl; @@ -672,12 +647,12 @@ void MuonGMCheck::checkreadoutrpcgeo() if (m_check_surfaces_details){ for (int strip = 1; strip<=rpc->NphiStrips(); strip++) { - Identifier chid = m_muonIdHelperTool->rpcIdHelper().channelID(idp, - m_muonIdHelperTool->rpcIdHelper().doubletZ(idr), + Identifier chid = m_idHelperSvc->rpcIdHelper().channelID(idp, + m_idHelperSvc->rpcIdHelper().doubletZ(idr), dbp, igg, 1, strip); // Global position Amg::Vector3D tempGlobalPosition = rpc->stripPos(chid); - fout<<"GG: "<<igg<<" dbZ: "<<m_muonIdHelperTool->rpcIdHelper().doubletZ(idr)<<" dbP: "<<dbp<<" Phi strip: "<<strip + fout<<"GG: "<<igg<<" dbZ: "<<m_idHelperSvc->rpcIdHelper().doubletZ(idr)<<" dbP: "<<dbp<<" Phi strip: "<<strip <<" glob.pos. " <<tempGlobalPosition.x()<<", " <<tempGlobalPosition.y()<<", " @@ -692,12 +667,12 @@ void MuonGMCheck::checkreadoutrpcgeo() } for (int strip = 1; strip<=rpc->NetaStrips(); strip++) { - Identifier chid = m_muonIdHelperTool->rpcIdHelper().channelID(idp, - m_muonIdHelperTool->rpcIdHelper().doubletZ(idr), + Identifier chid = m_idHelperSvc->rpcIdHelper().channelID(idp, + m_idHelperSvc->rpcIdHelper().doubletZ(idr), dbp, igg, 0, strip); // Global position Amg::Vector3D tempGlobalPosition = rpc->stripPos(chid); - fout<<"GG: "<<igg<<" dbZ: "<<m_muonIdHelperTool->rpcIdHelper().doubletZ(idr)<<" dbP: "<<dbp<<" Eta strip: "<<strip + fout<<"GG: "<<igg<<" dbZ: "<<m_idHelperSvc->rpcIdHelper().doubletZ(idr)<<" dbP: "<<dbp<<" Eta strip: "<<strip <<" glob.pos. " <<tempGlobalPosition.x()<<", " <<tempGlobalPosition.y()<<", " @@ -782,7 +757,7 @@ void MuonGMCheck::getPanelEdgeCenter(const MuonGM::RpcReadoutElement* rpc, Ident { int n_strips = 0; // in phi or eta dir. depening on measphi-field of chid int view =-1; - if (m_muonIdHelperTool->rpcIdHelper().measuresPhi(chid)) + if (m_idHelperSvc->rpcIdHelper().measuresPhi(chid)) { // phi panel view = 1; @@ -794,17 +769,17 @@ void MuonGMCheck::getPanelEdgeCenter(const MuonGM::RpcReadoutElement* rpc, Ident view = 0; n_strips = rpc->NetaStrips(); } - Identifier idp = m_muonIdHelperTool->rpcIdHelper().parentID(chid); - Identifier chidFirst = m_muonIdHelperTool->rpcIdHelper().channelID(idp, - m_muonIdHelperTool->rpcIdHelper().doubletZ(chid), - m_muonIdHelperTool->rpcIdHelper().doubletPhi(chid), - m_muonIdHelperTool->rpcIdHelper().gasGap(chid), + Identifier idp = m_idHelperSvc->rpcIdHelper().parentID(chid); + Identifier chidFirst = m_idHelperSvc->rpcIdHelper().channelID(idp, + m_idHelperSvc->rpcIdHelper().doubletZ(chid), + m_idHelperSvc->rpcIdHelper().doubletPhi(chid), + m_idHelperSvc->rpcIdHelper().gasGap(chid), view, 1); - Identifier chidLast = m_muonIdHelperTool->rpcIdHelper().channelID(idp, - m_muonIdHelperTool->rpcIdHelper().doubletZ(chid), - m_muonIdHelperTool->rpcIdHelper().doubletPhi(chid), - m_muonIdHelperTool->rpcIdHelper().gasGap(chid), + Identifier chidLast = m_idHelperSvc->rpcIdHelper().channelID(idp, + m_idHelperSvc->rpcIdHelper().doubletZ(chid), + m_idHelperSvc->rpcIdHelper().doubletPhi(chid), + m_idHelperSvc->rpcIdHelper().gasGap(chid), view, n_strips); @@ -845,7 +820,7 @@ void MuonGMCheck::getPanelBoundaries(const MuonGM::RpcReadoutElement* rpc, Ident int n_stripsOtherView = 0; int view =-1; int otherview =-1; - if (m_muonIdHelperTool->rpcIdHelper().measuresPhi(chid)) + if (m_idHelperSvc->rpcIdHelper().measuresPhi(chid)) { // phi panel view = 1; @@ -861,29 +836,29 @@ void MuonGMCheck::getPanelBoundaries(const MuonGM::RpcReadoutElement* rpc, Ident n_strips = rpc->NetaStrips(); n_stripsOtherView = rpc->NphiStrips(); } - Identifier idp = m_muonIdHelperTool->rpcIdHelper().parentID(chid); - Identifier chidFirst = m_muonIdHelperTool->rpcIdHelper().channelID(idp, - m_muonIdHelperTool->rpcIdHelper().doubletZ(chid), - m_muonIdHelperTool->rpcIdHelper().doubletPhi(chid), - m_muonIdHelperTool->rpcIdHelper().gasGap(chid), + Identifier idp = m_idHelperSvc->rpcIdHelper().parentID(chid); + Identifier chidFirst = m_idHelperSvc->rpcIdHelper().channelID(idp, + m_idHelperSvc->rpcIdHelper().doubletZ(chid), + m_idHelperSvc->rpcIdHelper().doubletPhi(chid), + m_idHelperSvc->rpcIdHelper().gasGap(chid), view, 1); - Identifier chidLast = m_muonIdHelperTool->rpcIdHelper().channelID(idp, - m_muonIdHelperTool->rpcIdHelper().doubletZ(chid), - m_muonIdHelperTool->rpcIdHelper().doubletPhi(chid), - m_muonIdHelperTool->rpcIdHelper().gasGap(chid), + Identifier chidLast = m_idHelperSvc->rpcIdHelper().channelID(idp, + m_idHelperSvc->rpcIdHelper().doubletZ(chid), + m_idHelperSvc->rpcIdHelper().doubletPhi(chid), + m_idHelperSvc->rpcIdHelper().gasGap(chid), view, n_strips); - Identifier chidFirstOtherView = m_muonIdHelperTool->rpcIdHelper().channelID(idp, - m_muonIdHelperTool->rpcIdHelper().doubletZ(chid), - m_muonIdHelperTool->rpcIdHelper().doubletPhi(chid), - m_muonIdHelperTool->rpcIdHelper().gasGap(chid), + Identifier chidFirstOtherView = m_idHelperSvc->rpcIdHelper().channelID(idp, + m_idHelperSvc->rpcIdHelper().doubletZ(chid), + m_idHelperSvc->rpcIdHelper().doubletPhi(chid), + m_idHelperSvc->rpcIdHelper().gasGap(chid), otherview, 1); - Identifier chidLastOtherView = m_muonIdHelperTool->rpcIdHelper().channelID(idp, - m_muonIdHelperTool->rpcIdHelper().doubletZ(chid), - m_muonIdHelperTool->rpcIdHelper().doubletPhi(chid), - m_muonIdHelperTool->rpcIdHelper().gasGap(chid), + Identifier chidLastOtherView = m_idHelperSvc->rpcIdHelper().channelID(idp, + m_idHelperSvc->rpcIdHelper().doubletZ(chid), + m_idHelperSvc->rpcIdHelper().doubletPhi(chid), + m_idHelperSvc->rpcIdHelper().gasGap(chid), otherview, n_stripsOtherView); @@ -945,7 +920,7 @@ void MuonGMCheck::getActivePanelBoundaries(const MuonGM::RpcReadoutElement* rpc, int n_stripsOtherView = 0; int view =-1; int otherview =-1; - if (m_muonIdHelperTool->rpcIdHelper().measuresPhi(chid)) + if (m_idHelperSvc->rpcIdHelper().measuresPhi(chid)) { // phi panel view = 1; @@ -961,29 +936,29 @@ void MuonGMCheck::getActivePanelBoundaries(const MuonGM::RpcReadoutElement* rpc, n_strips = rpc->NetaStrips(); n_stripsOtherView = rpc->NphiStrips(); } - Identifier idp = m_muonIdHelperTool->rpcIdHelper().parentID(chid); - Identifier chidFirst = m_muonIdHelperTool->rpcIdHelper().channelID(idp, - m_muonIdHelperTool->rpcIdHelper().doubletZ(chid), - m_muonIdHelperTool->rpcIdHelper().doubletPhi(chid), - m_muonIdHelperTool->rpcIdHelper().gasGap(chid), + Identifier idp = m_idHelperSvc->rpcIdHelper().parentID(chid); + Identifier chidFirst = m_idHelperSvc->rpcIdHelper().channelID(idp, + m_idHelperSvc->rpcIdHelper().doubletZ(chid), + m_idHelperSvc->rpcIdHelper().doubletPhi(chid), + m_idHelperSvc->rpcIdHelper().gasGap(chid), view, 1); - Identifier chidLast = m_muonIdHelperTool->rpcIdHelper().channelID(idp, - m_muonIdHelperTool->rpcIdHelper().doubletZ(chid), - m_muonIdHelperTool->rpcIdHelper().doubletPhi(chid), - m_muonIdHelperTool->rpcIdHelper().gasGap(chid), + Identifier chidLast = m_idHelperSvc->rpcIdHelper().channelID(idp, + m_idHelperSvc->rpcIdHelper().doubletZ(chid), + m_idHelperSvc->rpcIdHelper().doubletPhi(chid), + m_idHelperSvc->rpcIdHelper().gasGap(chid), view, n_strips); - Identifier chidFirstOtherView = m_muonIdHelperTool->rpcIdHelper().channelID(idp, - m_muonIdHelperTool->rpcIdHelper().doubletZ(chid), - m_muonIdHelperTool->rpcIdHelper().doubletPhi(chid), - m_muonIdHelperTool->rpcIdHelper().gasGap(chid), + Identifier chidFirstOtherView = m_idHelperSvc->rpcIdHelper().channelID(idp, + m_idHelperSvc->rpcIdHelper().doubletZ(chid), + m_idHelperSvc->rpcIdHelper().doubletPhi(chid), + m_idHelperSvc->rpcIdHelper().gasGap(chid), otherview, 1); - Identifier chidLastOtherView = m_muonIdHelperTool->rpcIdHelper().channelID(idp, - m_muonIdHelperTool->rpcIdHelper().doubletZ(chid), - m_muonIdHelperTool->rpcIdHelper().doubletPhi(chid), - m_muonIdHelperTool->rpcIdHelper().gasGap(chid), + Identifier chidLastOtherView = m_idHelperSvc->rpcIdHelper().channelID(idp, + m_idHelperSvc->rpcIdHelper().doubletZ(chid), + m_idHelperSvc->rpcIdHelper().doubletPhi(chid), + m_idHelperSvc->rpcIdHelper().gasGap(chid), otherview, n_stripsOtherView); @@ -1065,32 +1040,31 @@ void MuonGMCheck::checkParentStation() seta_index, sphi_index, dbr_index); - if (mdt == NULL) continue; - std::cout<<" ///////////////////// Found a MdtReadoutElement for indices = " + if (!mdt) continue; + ATH_MSG_INFO(" ///////////////////// Found a MdtReadoutElement for indices = " <<sname_index<<" "<<seta_index<<" "<< sphi_index<<" " <<dbr_index - <<std::endl; + ); Identifier idr = mdt->identify(); - std::cout<<" its offline Id = "<<m_muonIdHelperTool->mdtIdHelper().show_to_string(idr) + ATH_MSG_INFO(" its offline Id = "<<m_idHelperSvc->mdtIdHelper().show_to_string(idr) <<" ////////////////// belongs to module " <<mdt->getTechnologyName()<<"/" - <<mdt->getStationName()<<std::endl; - Identifier idp = m_muonIdHelperTool->mdtIdHelper().parentID(idr); - std::cout<<" parent Id = "<<m_muonIdHelperTool->mdtIdHelper().show_to_string(idp)<<std::endl; - std::cerr<<" now the positions "<<std::endl; + <<mdt->getStationName()); + Identifier idp = m_idHelperSvc->mdtIdHelper().parentID(idr); + ATH_MSG_INFO(" parent Id = "<<m_idHelperSvc->mdtIdHelper().show_to_string(idp)); + ATH_MSG_ERROR(" now the positions "); Amg::Vector3D stc = mdt->parentMuonStationPos(); - //HepGeom::Point3D<double> stcm = mdt->parentMuonStationPos(); - std::cout<<" Station centre is at "<<stc - <<" cyl. coords R,phi,Z "<<stc.perp()<<" "<<stc.phi()<<" "<<stc.z()<<std::endl; - std::cout<<" New Station centre is at " //<<stcm + ATH_MSG_INFO(" Station centre is at "<<stc + <<" cyl. coords R,phi,Z "<<stc.perp()<<" "<<stc.phi()<<" "<<stc.z()); + ATH_MSG_INFO(" New Station centre is at " //<<stcm <<" s_amdb "<<mdt->parentStation_s_amdb()<<" S,Z,R sizes " <<mdt->parentStationSsize()<<" " <<mdt->parentStationZsize()<<" " <<mdt->parentStationRsize()<<" " - <<std::endl; + ); Amg::Vector3D elc = mdt->globalPosition(); - std::cout<<" Element centre is at "<<elc - <<" cyl. coords R,phi,Z "<<elc.perp()<<" "<<elc.phi()<<" "<<elc.z()<<std::endl; + ATH_MSG_INFO(" Element centre is at "<<elc + <<" cyl. coords R,phi,Z "<<elc.perp()<<" "<<elc.phi()<<" "<<elc.z()); } } @@ -1109,7 +1083,7 @@ void MuonGMCheck::checkreadoutmmgeo() return; } else ATH_MSG_INFO(p_MuonMgr->nMMRE() << " MMReadoutElements found " ); - const MmIdHelper& helper = m_muonIdHelperTool->mmIdHelper(); + const MmIdHelper& helper = m_idHelperSvc->mmIdHelper(); std::string gVersion = p_MuonMgr->geometryVersion(); @@ -1146,9 +1120,9 @@ void MuonGMCheck::checkreadoutmmgeo() fout<<"------------------------------------- ISL, etaA, iphi8, ml "<<iSL<<" "<<etaA<<" "<<iphi8<<" "<<iml+1<<std::endl; const MMReadoutElement* mmA=p_MuonMgr->getMMRElement_fromIdFields(iSL, etaA, iphi8, iml+1); - if (mmC==NULL) std::cout<<" Something not found on the C side - ISL, etaC, iphi8, ml "<<iSL<<" "<<etaC<<" "<<iphi8<<" "<<iml+1<<std::endl; - if (mmA==NULL) std::cout<<" Something not found in the A side - ISL, etaA, iphi8, ml "<<iSL<<" "<<etaA<<" "<<iphi8<<" "<<iml+1<<std::endl; - if (mmC!=NULL && mmA!=NULL) + if (!mmC) ATH_MSG_INFO(" Something not found on the C side - ISL, etaC, iphi8, ml "<<iSL<<" "<<etaC<<" "<<iphi8<<" "<<iml+1); + if (!mmA) ATH_MSG_INFO(" Something not found in the A side - ISL, etaA, iphi8, ml "<<iSL<<" "<<etaA<<" "<<iphi8<<" "<<iml+1); + if (mmC && mmA) { Identifier idA = mmA->identify(); Identifier idC = mmC->identify(); @@ -1163,8 +1137,8 @@ void MuonGMCheck::checkreadoutmmgeo() fout<<helper.show_to_string(idC)<<" # of gas gaps = "<<helper.gasGapMax(idC)-helper.gasGapMin(idC)+1<<" ggMax = "<<helper.gasGapMax(idC)<<" number of layers(from geo)= "<<mmC->numberOfLayers(true)<<" nStrips = "<<mmC->numberOfStrips(idC)<<std::endl; Amg::Vector3D chCenterC = (mmC->absTransform())*Amg::Vector3D(0.,0.,0.); Amg::Vector3D chCenterA = (mmA->absTransform())*Amg::Vector3D(0.,0.,0.); - fout<<"center of the chamber on the A-side = "<<chCenterA<<" cyl coord (r,phi)-> "<<chCenterA.perp()<<" "<<chCenterA.phi()*180./M_PI<<std::endl; - fout<<"center of the chamber on the C-side = "<<chCenterC<<" cyl coord (r,phi)-> "<<chCenterC.perp()<<" "<<chCenterC.phi()*180./M_PI<<std::endl; + fout<<"center of the chamber on the A-side = "<<chCenterA<<" cyl coord (r,phi)-> "<<chCenterA.perp()<<" "<<chCenterA.phi()*invRad<<std::endl; + fout<<"center of the chamber on the C-side = "<<chCenterC<<" cyl coord (r,phi)-> "<<chCenterC.perp()<<" "<<chCenterC.phi()*invRad<<std::endl; Amg::Vector2D lpos(0.,0.); for (int igg=1;igg<mmA->numberOfLayers(true)+1;++igg) { @@ -1177,9 +1151,9 @@ void MuonGMCheck::checkreadoutmmgeo() const Amg::Vector3D *chCenter_fC = mmC->surface(idgg_fC).Trk::Surface::localToGlobal(lpos); const Amg::Vector3D *chCenter_lC = mmC->surface(idgg_lC).Trk::Surface::localToGlobal(lpos); fout<<"A-side: center of surface for gg "<<igg<<" 1st ch, "<<mmA->numberOfStrips(idA)<<"-th ch: r "<<chCenter_fA->perp()<<" "<<chCenter_lA->perp() - <<" phi "<<chCenter_fA->phi()*180./M_PI<<" "<<chCenter_lA->phi()*180./M_PI<<" z "<<chCenter_fA->z()<<" "<<chCenter_lA->z()<<" "<<helper.show_to_string(idgg_fA)<<std::endl; + <<" phi "<<chCenter_fA->phi()*invRad<<" "<<chCenter_lA->phi()*invRad<<" z "<<chCenter_fA->z()<<" "<<chCenter_lA->z()<<" "<<helper.show_to_string(idgg_fA)<<std::endl; fout<<"C-side: center of surface for gg "<<igg<<" 1st ch, "<<mmC->numberOfStrips(idC)<<"-th ch: r "<<chCenter_fC->perp()<<" "<<chCenter_lC->perp() - <<" phi "<<chCenter_fC->phi()*180./M_PI<<" "<<chCenter_lC->phi()*180./M_PI<<" z "<<chCenter_fC->z()<<" "<<chCenter_lC->z()<<" "<<helper.show_to_string(idgg_fC)<<std::endl; + <<" phi "<<chCenter_fC->phi()*invRad<<" "<<chCenter_lC->phi()*invRad<<" z "<<chCenter_fC->z()<<" "<<chCenter_lC->z()<<" "<<helper.show_to_string(idgg_fC)<<std::endl; } } @@ -1203,7 +1177,7 @@ void MuonGMCheck::checkreadoutstgcgeo() std::string fileName = "sTgc_current_"+gVersion; std::ofstream fout(fileName.c_str()); ATH_MSG_INFO( " ***** Writing file "<< fileName ); - const sTgcIdHelper& helper = m_muonIdHelperTool->stgcIdHelper(); + const sTgcIdHelper& helper = m_idHelperSvc->stgcIdHelper(); for (int ieta=0; ieta<MuonDetectorManager::NsTgStatEta/2; ++ieta) @@ -1233,9 +1207,9 @@ void MuonGMCheck::checkreadoutstgcgeo() fout<<"------------------------------------- ISL, etaA, iphi8, ml "<<iSL<<" "<<etaA<<" "<<iphi8<<" "<<iml+1<<std::endl; const sTgcReadoutElement* mmA=p_MuonMgr->getsTgcRElement_fromIdFields(iSL, etaA, iphi8, iml+1); - if (mmC==NULL) std::cout<<" Something not found on the C side - ISL, etaC, iphi8, ml "<<iSL<<" "<<etaC<<" "<<iphi8<<" "<<iml+1<<std::endl; - if (mmA==NULL) std::cout<<" Something not found in the A side - ISL, etaA, iphi8, ml "<<iSL<<" "<<etaA<<" "<<iphi8<<" "<<iml+1<<std::endl; - if (mmC!=NULL && mmA!=NULL) + if (!mmC) ATH_MSG_INFO(" Something not found on the C side - ISL, etaC, iphi8, ml "<<iSL<<" "<<etaC<<" "<<iphi8<<" "<<iml+1); + if (!mmA) ATH_MSG_INFO(" Something not found in the A side - ISL, etaA, iphi8, ml "<<iSL<<" "<<etaA<<" "<<iphi8<<" "<<iml+1); + if (mmC && mmA) { Identifier idA = mmA->identify(); Identifier idC = mmC->identify(); @@ -1245,13 +1219,13 @@ void MuonGMCheck::checkreadoutstgcgeo() fout<<"Found MMRE in C side; identified with: "<< helper.show_to_string(idC) <<" From Id: StName/Eta/Phi/ML = <"<<helper.stationNameString(helper.stationName(idA))<<">="<<helper.stationName(idC)<<"/"<<helper.stationEta(idC)<<"/"<<helper.stationPhi(idC)<<"/"<<helper.multilayer(idC)<<" CollHash = "<<mmC->collectionHash()<<" REhash = "/*<<mmC->detectorElementHash()<<" number of layers= "<<mmC->numberOfLayers()*/ <<std::endl; - fout<<"# of gas gaps = "<<helper.gasGapMax(idA)-helper.gasGapMin(idA)+1/*<<" isLargeSector = "<<helper.LargeSector(helper.stationName(idA))*/<<std::endl; + fout<<"# of gas gaps = "<<helper.gasGapMax(idA)-helper.gasGapMin(idA)+1<<std::endl; Amg::Vector3D chCenterC = (mmC->absTransform())*Amg::Vector3D(0.,0.,0.); Amg::Vector3D chCenterA = (mmA->absTransform())*Amg::Vector3D(0.,0.,0.); - fout<<"center of the chamber on the A-side = "<<chCenterA<<" cyl coord (r,phi)-> "<<chCenterA.perp()<<" "<<chCenterA.phi()*180./M_PI<<std::endl; - fout<<"center of the chamber on the C-side = "<<chCenterC<<" cyl coord (r,phi)-> "<<chCenterC.perp()<<" "<<chCenterC.phi()*180./M_PI<<std::endl; + fout<<"center of the chamber on the A-side = "<<chCenterA<<" cyl coord (r,phi)-> "<<chCenterA.perp()<<" "<<chCenterA.phi()*invRad<<std::endl; + fout<<"center of the chamber on the C-side = "<<chCenterC<<" cyl coord (r,phi)-> "<<chCenterC.perp()<<" "<<chCenterC.phi()*invRad<<std::endl; } } @@ -1301,7 +1275,7 @@ void MuonGMCheck::checkreadoutmdtgeo() seta_index, sphi_index, dbr_index); - if (mdt == NULL) continue; + if (!mdt) continue; fout<<" ///////////////////// Found a MdtReadoutElement for indices = " <<sname_index<<" "<<seta_index<<" "<< sphi_index<<" " @@ -1309,7 +1283,7 @@ void MuonGMCheck::checkreadoutmdtgeo() <<std::endl; Identifier idr = mdt->identify(); fout<<" its offline hash Id = "<<mdt->identifyHash()<<std::endl; - fout<<" its offline Id = "<<m_muonIdHelperTool->mdtIdHelper().show_to_string(idr) + fout<<" its offline Id = "<<m_idHelperSvc->mdtIdHelper().show_to_string(idr) <<" ////////////////// belongs to module " <<mdt->getTechnologyName()<<"/" <<mdt->getStationName(); @@ -1317,12 +1291,12 @@ void MuonGMCheck::checkreadoutmdtgeo() else fout<<std::endl; // here get B-line - const BLinePar* bLine = NULL; + const BLinePar* bLine = nullptr; bLine = mdt->getBLinePar();// - Identifier idp = m_muonIdHelperTool->mdtIdHelper().parentID(idr); - fout<<" parent Id = "<<m_muonIdHelperTool->mdtIdHelper().show_to_string(idp)<<std::endl; + Identifier idp = m_idHelperSvc->mdtIdHelper().parentID(idr); + fout<<" parent Id = "<<m_idHelperSvc->mdtIdHelper().show_to_string(idp)<<std::endl; const MuonStation* pms = mdt->parentMuonStation(); @@ -1336,7 +1310,7 @@ void MuonGMCheck::checkreadoutmdtgeo() fout<<" tube layer = "<<tl<<std::endl; for (int tube = 1; tube<mdt->getNtubesperlayer(); tube++) { - Identifier chid = m_muonIdHelperTool->mdtIdHelper().channelID(idp,mdt->getMultilayer(), tl, tube); + Identifier chid = m_idHelperSvc->mdtIdHelper().channelID(idp,mdt->getMultilayer(), tl, tube); Amg::Vector3D locPos = gToStation*mdt->tubePos(chid); const Amg::Vector3D locTubePos = mdt->AmdbLRStubePos( chid ); fout<<" locPos = "<<locPos<<" locTubePos "<<locTubePos<<std::endl; @@ -1387,8 +1361,8 @@ void MuonGMCheck::checkreadoutmdtgeo() } gotTube = tube; - chid = m_muonIdHelperTool->mdtIdHelper().channelID(idp,mdt->getMultilayer(), tl, tube); - fout<<m_muonIdHelperTool->mdtIdHelper().show_to_string(chid) + chid = m_idHelperSvc->mdtIdHelper().channelID(idp,mdt->getMultilayer(), tl, tube); + fout<<m_idHelperSvc->mdtIdHelper().show_to_string(chid) <<" wire global pos "<<mdt->tubePos(chid); fout<<" Tube length is "<<mdt->tubeLength(chid); if (mdt->hasCutouts()) fout<<" HAS CUTOUTS"<<std::endl; @@ -1423,8 +1397,8 @@ void MuonGMCheck::checkreadoutmdtgeo() Amg::Vector3D pz0 = mdt->center(chid); fout<<" point on the wire at 1m from the center @ RO side "<<mdt->transform(chid)*Amg::Vector3D(0.,0., z1000RO)<<std::endl; fout<<" point on the wire at 1m from the center @ HV side "<<mdt->transform(chid)*Amg::Vector3D(0.,0.,-z1000RO)<<std::endl; - fout<<" RO side tube end-point "<<pzRO<<std::endl;//mdt->transform(chid)*Amg::Vector3D(0.,0., zRO)<<std::endl; - fout<<" HV side tube end-point "<<pzHV<<std::endl;//mdt->transform(chid)*Amg::Vector3D(0.,0.,-zRO)<<std::endl; + fout<<" RO side tube end-point "<<pzRO<<std::endl; + fout<<" HV side tube end-point "<<pzHV<<std::endl; fout<<" s+ half-tube end-point "<<pzEPsplus<<std::endl; fout<<" s- half-tube end-point "<<pzEPsminus<<std::endl; if (doHeader) @@ -1432,8 +1406,6 @@ void MuonGMCheck::checkreadoutmdtgeo() doHeader = false; fendpoints<<"================================================="<<std::endl; - // fendpoints - // <<" Atlas id RO end-point x,y,z center x,y,z HV end-point x,y,z MGM_nativeFrameZRO"<<std::endl; fendpoints <<" Atlas id s+ end-point x,y,z center x,y,z s- end-point x,y,z halfTubeLength"<<std::endl; fendpoints<<"================================================="<<std::endl; @@ -1443,7 +1415,7 @@ void MuonGMCheck::checkreadoutmdtgeo() doChHeader = false; - fendpoints<<" ----------- New MDT Station --------- id = "<<m_muonIdHelperTool->mdtIdHelper().print_to_string(chid)<<"----------------------------------------------------------------------- "<<std::endl; + fendpoints<<" ----------- New MDT Station --------- id = "<<m_idHelperSvc->mdtIdHelper().print_to_string(chid)<<"----------------------------------------------------------------------- "<<std::endl; fendpoints<<" A-line in use is s,z,t rots,z,t "<<std::setw(10)<<setiosflags(std::ios::fixed)<<std::setprecision(7) <<pms->getALine_tras()<<" " <<pms->getALine_traz()<<" " @@ -1451,10 +1423,10 @@ void MuonGMCheck::checkreadoutmdtgeo() <<pms->getALine_rots()<<" " <<pms->getALine_rotz()<<" " <<pms->getALine_rott()<<std::setw(10)<<setiosflags(std::ios::fixed)<<std::setprecision(4)<<std::endl; - if (bLine==NULL) - fendpoints<<m_muonIdHelperTool->mdtIdHelper().show_to_string(chid)<<" B-line is NOT defined "<<std::endl; + if (!bLine) + fendpoints<<m_idHelperSvc->mdtIdHelper().show_to_string(chid)<<" B-line is NOT defined "<<std::endl; else { - fendpoints<<m_muonIdHelperTool->mdtIdHelper().show_to_string(chid)<<" B-line in use is: bz,bp,bn,sp,sn,tw,pg,tr,eg,ep,en "<<std::setw(10)<<setiosflags(std::ios::fixed)<<std::setprecision(7) + fendpoints<<m_idHelperSvc->mdtIdHelper().show_to_string(chid)<<" B-line in use is: bz,bp,bn,sp,sn,tw,pg,tr,eg,ep,en "<<std::setw(10)<<setiosflags(std::ios::fixed)<<std::setprecision(7) <<bLine->bz()<<" " <<bLine->bp()<<" " <<bLine->bn()<<" " @@ -1468,12 +1440,12 @@ void MuonGMCheck::checkreadoutmdtgeo() <<bLine->en()<<std::setw(10)<<setiosflags(std::ios::fixed)<<std::setprecision(4)<<std::endl; } if (mdt->barrel()) - fendpoints<<m_muonIdHelperTool->mdtIdHelper().show_to_string(chid) + fendpoints<<m_idHelperSvc->mdtIdHelper().show_to_string(chid) <<" MDT envelop Ssize, LongSsize, Rsize=Height, Zsize=Length " <<pms->Ssize()<<" "<<pms->LongSsize()<<" " <<pms->RsizeMdtStation()<<" "<<pms->ZsizeMdtStation()<<std::endl; else - fendpoints<<m_muonIdHelperTool->mdtIdHelper().show_to_string(chid) + fendpoints<<m_idHelperSvc->mdtIdHelper().show_to_string(chid) <<" MDT envelop Ssize, LongSsize, Zsize=Height, Rsize=Length " <<pms->Ssize()<<" "<<pms->LongSsize()<<" " <<pms->ZsizeMdtStation()<<" "<<pms->RsizeMdtStation()<<std::endl; @@ -1481,19 +1453,19 @@ void MuonGMCheck::checkreadoutmdtgeo() Amg::Vector3D bLineFixedPointAMDBl(temp[0],temp[1],temp[2]); Amg::Vector3D aLineFixedPoint = mdt->AmdbLRSToGlobalCoords(Amg::Vector3D(0.,0.,0.)); Amg::Vector3D bLineFixedPoint = mdt->AmdbLRSToGlobalCoords(bLineFixedPointAMDBl); - fendpoints<<m_muonIdHelperTool->mdtIdHelper().show_to_string(chid) + fendpoints<<m_idHelperSvc->mdtIdHelper().show_to_string(chid) <<" A-line szt frame origine: " <<std::setw(15)<<setiosflags(std::ios::fixed) <<std::setprecision(4)<<" " <<aLineFixedPoint.x()<<" "<<aLineFixedPoint.y()<<" " <<aLineFixedPoint.z()<<std::endl; - fendpoints<<m_muonIdHelperTool->mdtIdHelper().show_to_string(chid) + fendpoints<<m_idHelperSvc->mdtIdHelper().show_to_string(chid) <<" B-line fixed point in A-line szt frame: " <<std::setw(15)<<setiosflags(std::ios::fixed) <<std::setprecision(4)<<" " <<bLineFixedPointAMDBl.x()<<" "<<bLineFixedPointAMDBl.y()<<" " <<bLineFixedPointAMDBl.z()<<std::endl; - fendpoints<<m_muonIdHelperTool->mdtIdHelper().show_to_string(chid) + fendpoints<<m_idHelperSvc->mdtIdHelper().show_to_string(chid) <<" B-line fixed point: " <<std::setw(15)<<setiosflags(std::ios::fixed) <<std::setprecision(4)<<" " @@ -1505,7 +1477,7 @@ void MuonGMCheck::checkreadoutmdtgeo() Amg::Vector3D amdbpos = mdt->AmdbLRStubePos(chid); fendpoints << "Amdb LRS rubePos " << amdbpos.x() << " " << amdbpos.y() << " " << amdbpos.z() << std::endl; - fendpoints<<std::setw(20)<<setiosflags(std::ios::fixed)<<m_muonIdHelperTool->mdtIdHelper().show_to_string(chid) + fendpoints<<std::setw(20)<<setiosflags(std::ios::fixed)<<m_idHelperSvc->mdtIdHelper().show_to_string(chid) <<" s+ " <<std::setw(12)<<setiosflags(std::ios::fixed) <<std::setprecision(4)<<" " @@ -1523,7 +1495,7 @@ void MuonGMCheck::checkreadoutmdtgeo() fendpoints2 << boost::format("%10d %25s %12.4f %12.4f %12.4f %12.4f %12.4f %12.4f %12.4f %12.4f %12.4f\n") - % m_fixedIdTool->idToFixedId(chid).getIdInt() % m_muonIdHelperTool->mdtIdHelper().show_to_string(chid) + % m_fixedIdTool->idToFixedId(chid).getIdInt() % m_idHelperSvc->mdtIdHelper().show_to_string(chid) % pzEPsplus.x() % pzEPsplus.y() % pzEPsplus.z() % pz0.x() % pz0.y() % pz0.z() % pzEPsminus.x() % pzEPsminus.y() % pzEPsminus.z() @@ -1536,7 +1508,7 @@ void MuonGMCheck::checkreadoutmdtgeo() <<pms->getALine_rots()<<" " <<pms->getALine_rotz()<<" " <<pms->getALine_rott()<<std::setw(10)<<setiosflags(std::ios::fixed)<<std::setprecision(4)<<std::endl; - if (bLine==NULL) + if (!bLine) fout<<" B-line is NOT defined "<<std::endl; else { fout<<" B-line in use is: bz,bp,bn,sp,sn,tw,pg,tr,eg,ep,en "<<std::setw(10)<<setiosflags(std::ios::fixed)<<std::setprecision(7) @@ -1621,26 +1593,26 @@ void MuonGMCheck::checkreadouttgcgeo() const TgcReadoutElement* tgc = p_MuonMgr->getTgcReadoutElement(sname_index, seta_index, sphi_index); - if (tgc == NULL) continue; + if (!tgc) continue; fout<<" ///////////////////// Found a TgcReadoutElement for indices = " <<sname_index<<" "<<seta_index<<" "<< sphi_index<<" " <<std::endl; Identifier idr = tgc->identify(); fout<<" its offline hash Id = "<<tgc->identifyHash()<<std::endl; - fout<<" its offline Id = "<<m_muonIdHelperTool->tgcIdHelper().show_to_string(idr) + fout<<" its offline Id = "<<m_idHelperSvc->tgcIdHelper().show_to_string(idr) <<" ////////////////// belongs to module " <<tgc->getTechnologyName()<<"/" <<tgc->getStationName() <<" stEta/stPhi "<<tgc->getStationEta()<<" "<<tgc->getStationPhi()<<std::endl; - Identifier idp = m_muonIdHelperTool->tgcIdHelper().parentID(idr); - Identifier idp1 = m_muonIdHelperTool->tgcIdHelper().elementID(m_muonIdHelperTool->tgcIdHelper().stationName(idp), - -m_muonIdHelperTool->tgcIdHelper().stationEta(idp), - m_muonIdHelperTool->tgcIdHelper().stationPhi(idp)); - fout<<" parent Id = "<<m_muonIdHelperTool->tgcIdHelper().show_to_string(idp); - fout<<" opposite stEta = "<<m_muonIdHelperTool->tgcIdHelper().show_to_string(idp1); + Identifier idp = m_idHelperSvc->tgcIdHelper().parentID(idr); + Identifier idp1 = m_idHelperSvc->tgcIdHelper().elementID(m_idHelperSvc->tgcIdHelper().stationName(idp), + -m_idHelperSvc->tgcIdHelper().stationEta(idp), + m_idHelperSvc->tgcIdHelper().stationPhi(idp)); + fout<<" parent Id = "<<m_idHelperSvc->tgcIdHelper().show_to_string(idp); + fout<<" opposite stEta = "<<m_idHelperSvc->tgcIdHelper().show_to_string(idp1); const TgcReadoutElement* tgc1 = p_MuonMgr->getTgcReadoutElement(idp1); if (!tgc1) { - ATH_MSG_FATAL( " TGC readout Element at z<0, with id = "<<m_muonIdHelperTool->tgcIdHelper().show_to_string(idp1)<<" not found " ); + ATH_MSG_FATAL( " TGC readout Element at z<0, with id = "<<m_idHelperSvc->tgcIdHelper().show_to_string(idp1)<<" not found " ); ATH_MSG_FATAL( " is the geometry COMPLETE ? Any StationSelection active ? Exiting" ); return; } @@ -1648,11 +1620,11 @@ void MuonGMCheck::checkreadouttgcgeo() const MuonStation* ms = tgc->parentMuonStation(); if (ms) fout<<"Parent MuonStation found for element at z>0"<<std::endl; - else fout<<"Parent MuonStation NOT found for element "<<m_muonIdHelperTool->tgcIdHelper().show_to_string(idp)<<std::endl; + else fout<<"Parent MuonStation NOT found for element "<<m_idHelperSvc->tgcIdHelper().show_to_string(idp)<<std::endl; const MuonStation* ms1 = tgc1->parentMuonStation(); if (ms1) fout<<"Parent MuonStation found for element at z<0"<<std::endl; - else fout<<"Parent MuonStation NOT found for element "<<m_muonIdHelperTool->tgcIdHelper().show_to_string(idp1)<<std::endl; + else fout<<"Parent MuonStation NOT found for element "<<m_idHelperSvc->tgcIdHelper().show_to_string(idp1)<<std::endl; fout<<" N gasgaps layers = "<<tgc->NwirePlanes(); fout<<" N strip planes = "<<tgc->NstripPlanes()<<std::endl; @@ -1672,70 +1644,70 @@ void MuonGMCheck::checkreadouttgcgeo() <<rpar->nWires(ngg+1,2)<<"/" <<rpar->nWires(ngg+1,3)<<std::endl; - Identifier idch = m_muonIdHelperTool->tgcIdHelper().channelID(idp, ngg+1, 0, 1); + Identifier idch = m_idHelperSvc->tgcIdHelper().channelID(idp, ngg+1, 0, 1); Amg::Vector3D ggcentre = tgc->localToGlobalCoords(Amg::Vector3D(0.,0.,0.), idch); - fout<<" For Chamber id "<<m_muonIdHelperTool->tgcIdHelper().show_to_string(idch) + fout<<" For Chamber id "<<m_idHelperSvc->tgcIdHelper().show_to_string(idch) <<" gasgap centre is "<<ggcentre<<std::endl; - idch = m_muonIdHelperTool->tgcIdHelper().channelID(idp1, ngg+1, 0, 1); + idch = m_idHelperSvc->tgcIdHelper().channelID(idp1, ngg+1, 0, 1); ggcentre = tgc1->localToGlobalCoords(Amg::Vector3D(0.,0.,0.), idch); - fout<<" For Chamber id "<<m_muonIdHelperTool->tgcIdHelper().show_to_string(idch) + fout<<" For Chamber id "<<m_idHelperSvc->tgcIdHelper().show_to_string(idch) <<" gasgap centre is "<<ggcentre<<std::endl; - idch = m_muonIdHelperTool->tgcIdHelper().channelID(idp, ngg+1, 1, 1); + idch = m_idHelperSvc->tgcIdHelper().channelID(idp, ngg+1, 1, 1); ggcentre = tgc->localToGlobalCoords(Amg::Vector3D(0.,0.,0.), idch); - fout<<" For Chamber id "<<m_muonIdHelperTool->tgcIdHelper().show_to_string(idch) + fout<<" For Chamber id "<<m_idHelperSvc->tgcIdHelper().show_to_string(idch) <<" gasgap centre is "<<ggcentre<<std::endl; - idch = m_muonIdHelperTool->tgcIdHelper().channelID(idp1, ngg+1, 1, 1); + idch = m_idHelperSvc->tgcIdHelper().channelID(idp1, ngg+1, 1, 1); ggcentre = tgc1->localToGlobalCoords(Amg::Vector3D(0.,0.,0.), idch); - fout<<" For Chamber id "<<m_muonIdHelperTool->tgcIdHelper().show_to_string(idch) + fout<<" For Chamber id "<<m_idHelperSvc->tgcIdHelper().show_to_string(idch) <<" gasgap centre is "<<ggcentre<<std::endl; - Identifier fg = m_muonIdHelperTool->tgcIdHelper().channelID(idp, ngg+1, 0, 1); - Identifier lg = m_muonIdHelperTool->tgcIdHelper().channelID(idp, ngg+1, 0, tgc->getNGangs(ngg+1)); - Identifier fgn = m_muonIdHelperTool->tgcIdHelper().channelID(idp1, ngg+1, 0, 1); - Identifier lgn = m_muonIdHelperTool->tgcIdHelper().channelID(idp1, ngg+1, 0, tgc1->getNGangs(ngg+1)); + Identifier fg = m_idHelperSvc->tgcIdHelper().channelID(idp, ngg+1, 0, 1); + Identifier lg = m_idHelperSvc->tgcIdHelper().channelID(idp, ngg+1, 0, tgc->getNGangs(ngg+1)); + Identifier fgn = m_idHelperSvc->tgcIdHelper().channelID(idp1, ngg+1, 0, 1); + Identifier lgn = m_idHelperSvc->tgcIdHelper().channelID(idp1, ngg+1, 0, tgc1->getNGangs(ngg+1)); Amg::Vector3D xfg = tgc->channelPos(fg); Amg::Vector3D xlg = tgc->channelPos(lg); Amg::Vector3D xfgn = tgc1->channelPos(fgn); Amg::Vector3D xlgn = tgc1->channelPos(lgn); - fout<<"\n gg "<<ngg+1<<" "<<m_muonIdHelperTool->tgcIdHelper().show_to_string(fg) + fout<<"\n gg "<<ngg+1<<" "<<m_idHelperSvc->tgcIdHelper().show_to_string(fg) <<"GM:: first eta gang z>0 r,p,z " - <<xfg.perp()<<" "<<xfg.phi()*180./M_PI<<" "<<xfg.z()<<" last " - <<xlg.perp()<<" "<<xlg.phi()*180./M_PI<<" "<<xlg.z()<<std::endl; - fout<<"gg "<<ngg+1<<" "<<m_muonIdHelperTool->tgcIdHelper().show_to_string(fgn) + <<xfg.perp()<<" "<<xfg.phi()*invRad<<" "<<xfg.z()<<" last " + <<xlg.perp()<<" "<<xlg.phi()*invRad<<" "<<xlg.z()<<std::endl; + fout<<"gg "<<ngg+1<<" "<<m_idHelperSvc->tgcIdHelper().show_to_string(fgn) <<"GM:: first eta gang z<0 r,p,z " - <<xfgn.perp()<<" "<<xfgn.phi()*180./M_PI<<" "<<xfgn.z()<<" last " - <<xlgn.perp()<<" "<<xlgn.phi()*180./M_PI<<" "<<xlgn.z()<<std::endl; + <<xfgn.perp()<<" "<<xfgn.phi()*invRad<<" "<<xfgn.z()<<" last " + <<xlgn.perp()<<" "<<xlgn.phi()*invRad<<" "<<xlgn.z()<<std::endl; - Identifier fs = m_muonIdHelperTool->tgcIdHelper().channelID(idp, ngg+1, 1, 1); - Identifier ls = m_muonIdHelperTool->tgcIdHelper().channelID(idp, ngg+1, 1, tgc->getNStrips(ngg+1)); - Identifier fsn = m_muonIdHelperTool->tgcIdHelper().channelID(idp1, ngg+1, 1, 1); - Identifier lsn = m_muonIdHelperTool->tgcIdHelper().channelID(idp1, ngg+1, 1, tgc1->getNStrips(ngg+1)); + Identifier fs = m_idHelperSvc->tgcIdHelper().channelID(idp, ngg+1, 1, 1); + Identifier ls = m_idHelperSvc->tgcIdHelper().channelID(idp, ngg+1, 1, tgc->getNStrips(ngg+1)); + Identifier fsn = m_idHelperSvc->tgcIdHelper().channelID(idp1, ngg+1, 1, 1); + Identifier lsn = m_idHelperSvc->tgcIdHelper().channelID(idp1, ngg+1, 1, tgc1->getNStrips(ngg+1)); xfg = tgc->channelPos(fs); xlg = tgc->channelPos(ls); xfgn = tgc1->channelPos(fsn); xlgn = tgc1->channelPos(lsn); - fout<<"\n gg "<<ngg+1<<" "<<m_muonIdHelperTool->tgcIdHelper().show_to_string(fs) + fout<<"\n gg "<<ngg+1<<" "<<m_idHelperSvc->tgcIdHelper().show_to_string(fs) <<"GM:: first phi strip z>0 r,p,z " - <<xfg.perp()<<" "<<xfg.phi()*180./M_PI<<" "<<xfg.z()<<" last " - <<xlg.perp()<<" "<<xlg.phi()*180./M_PI<<" "<<xlg.z()<<std::endl; - fout<<"gg "<<ngg+1<<" "<<m_muonIdHelperTool->tgcIdHelper().show_to_string(fsn) + <<xfg.perp()<<" "<<xfg.phi()*invRad<<" "<<xfg.z()<<" last " + <<xlg.perp()<<" "<<xlg.phi()*invRad<<" "<<xlg.z()<<std::endl; + fout<<"gg "<<ngg+1<<" "<<m_idHelperSvc->tgcIdHelper().show_to_string(fsn) <<"GM:: first phi strip z<0 r,p,z " - <<xfgn.perp()<<" "<<xfgn.phi()*180./M_PI<<" "<<xfgn.z()<<" last " - <<xlgn.perp()<<" "<<xlgn.phi()*180./M_PI<<" "<<xlgn.z()<<std::endl; + <<xfgn.perp()<<" "<<xfgn.phi()*invRad<<" "<<xfgn.z()<<" last " + <<xlgn.perp()<<" "<<xlgn.phi()*invRad<<" "<<xlgn.z()<<std::endl; xfg = tgc->localChannelPos(fs); xlg = tgc->localChannelPos(ls); xfgn = tgc1->localChannelPos(fsn); xlgn = tgc1->localChannelPos(lsn); - fout<<"\n gg "<<ngg+1<<" "<<m_muonIdHelperTool->tgcIdHelper().show_to_string(fs) + fout<<"\n gg "<<ngg+1<<" "<<m_idHelperSvc->tgcIdHelper().show_to_string(fs) <<"GM:: first p_S local z>0 r,p,z " - <<xfg.perp()<<" "<<xfg.phi()*180./M_PI<<" "<<xfg.z()<<" last " - <<xlg.perp()<<" "<<xlg.phi()*180./M_PI<<" "<<xlg.z()<<std::endl; - fout<<"gg "<<ngg+1<<" "<<m_muonIdHelperTool->tgcIdHelper().show_to_string(fsn) + <<xfg.perp()<<" "<<xfg.phi()*invRad<<" "<<xfg.z()<<" last " + <<xlg.perp()<<" "<<xlg.phi()*invRad<<" "<<xlg.z()<<std::endl; + fout<<"gg "<<ngg+1<<" "<<m_idHelperSvc->tgcIdHelper().show_to_string(fsn) <<"GM:: first p_S local z<0 r,p,z " - <<xfgn.perp()<<" "<<xfgn.phi()*180./M_PI<<" "<<xfgn.z()<<" last " - <<xlgn.perp()<<" "<<xlgn.phi()*180./M_PI<<" "<<xlgn.z()<<std::endl; + <<xfgn.perp()<<" "<<xfgn.phi()*invRad<<" "<<xfgn.z()<<" last " + <<xlgn.perp()<<" "<<xlgn.phi()*invRad<<" "<<xlgn.z()<<std::endl; if (m_check_surfaces) { @@ -1824,8 +1796,8 @@ void MuonGMCheck::checkreadouttgcgeo() if (m_check_surfaces_details){ for (int strip = 1; strip<=tgc->getNStrips(ngg+1); strip++) { - Identifier chid = m_muonIdHelperTool->tgcIdHelper().channelID(idp, ngg+1, 1, strip); - Identifier chid1 = m_muonIdHelperTool->tgcIdHelper().channelID(idp1, ngg+1, 1, strip); + Identifier chid = m_idHelperSvc->tgcIdHelper().channelID(idp, ngg+1, 1, strip); + Identifier chid1 = m_idHelperSvc->tgcIdHelper().channelID(idp1, ngg+1, 1, strip); // Global position Amg::Vector3D tempGlobalPosition = tgc->channelPos(chid); Amg::Vector3D tempGlobalPosition1 = tgc1->channelPos(chid1); @@ -1856,8 +1828,8 @@ void MuonGMCheck::checkreadouttgcgeo() } for (int gang = 1; gang<=tgc->getNGangs(ngg+1); gang++) { - Identifier chid = m_muonIdHelperTool->tgcIdHelper().channelID(idp, ngg+1, 0, gang); - Identifier chid1 = m_muonIdHelperTool->tgcIdHelper().channelID(idp1, ngg+1, 0, gang); + Identifier chid = m_idHelperSvc->tgcIdHelper().channelID(idp, ngg+1, 0, gang); + Identifier chid1 = m_idHelperSvc->tgcIdHelper().channelID(idp1, ngg+1, 0, gang); // Global position Amg::Vector3D tempGlobalPosition = tgc->channelPos(chid); Amg::Vector3D tempGlobalPosition1 = tgc1->channelPos(chid1); @@ -1931,33 +1903,33 @@ void MuonGMCheck::checkreadoutcscgeo() seta_index, sphi_index, ml); - if (csc == NULL) continue; + if (!csc) continue; fout<<" ///////////////////// Found a CscReadoutElement for indices = " <<sname_index<<" "<<seta_index<<" "<< sphi_index<<" "<<ml <<std::endl; Identifier idr = csc->identify(); fout<<" its offline hash Id = "<<csc->identifyHash()<<std::endl; - fout<<" its offline Id = "<<m_muonIdHelperTool->cscIdHelper().show_to_string(idr) + fout<<" its offline Id = "<<m_idHelperSvc->cscIdHelper().show_to_string(idr) <<" ////////////////// belongs to module " <<csc->getTechnologyName()<<"/" <<csc->getStationName()<<" centre at "<<(csc->transform())*Amg::Vector3D(0.,0.,0.)<<std::endl; - Identifier idp = m_muonIdHelperTool->cscIdHelper().parentID(idr); - fout<<" parent Id = "<<m_muonIdHelperTool->cscIdHelper().show_to_string(idp)<<std::endl; + Identifier idp = m_idHelperSvc->cscIdHelper().parentID(idr); + fout<<" parent Id = "<<m_idHelperSvc->cscIdHelper().show_to_string(idp)<<std::endl; - Identifier idp1 = m_muonIdHelperTool->cscIdHelper().elementID(m_muonIdHelperTool->cscIdHelper().stationName(idp), - -m_muonIdHelperTool->cscIdHelper().stationEta(idp), - m_muonIdHelperTool->cscIdHelper().stationPhi(idp)); + Identifier idp1 = m_idHelperSvc->cscIdHelper().elementID(m_idHelperSvc->cscIdHelper().stationName(idp), + -m_idHelperSvc->cscIdHelper().stationEta(idp), + m_idHelperSvc->cscIdHelper().stationPhi(idp)); - Identifier idp1ch = m_muonIdHelperTool->cscIdHelper().channelID(idp1, csc->ChamberLayer(), 1, 0, 1); + Identifier idp1ch = m_idHelperSvc->cscIdHelper().channelID(idp1, csc->ChamberLayer(), 1, 0, 1); const CscReadoutElement* csc1 = p_MuonMgr->getCscReadoutElement(idp1ch); if (!csc1) { - ATH_MSG_FATAL( " CSC readout Element at z<0, with id = "<<m_muonIdHelperTool->cscIdHelper().show_to_string(idp1ch)<<" not found " ); + ATH_MSG_FATAL( " CSC readout Element at z<0, with id = "<<m_idHelperSvc->cscIdHelper().show_to_string(idp1ch)<<" not found " ); ATH_MSG_FATAL( " is the geometry COMPLETE ? Any StationSelection active ? Exiting" ); return; } - fout<<" at opposite z = "<<m_muonIdHelperTool->cscIdHelper().show_to_string(csc1->identify()) + fout<<" at opposite z = "<<m_idHelperSvc->cscIdHelper().show_to_string(csc1->identify()) <<" ////////////////// belongs to module " <<csc1->getTechnologyName()<<"/" <<csc1->getStationName()<<" centre at "<<(csc1->transform())*Amg::Vector3D(0.,0.,0.)<<std::endl; @@ -1966,11 +1938,11 @@ void MuonGMCheck::checkreadoutcscgeo() const MuonStation* ms = csc->parentMuonStation(); if (ms) fout<<"Parent MuonStation found for element at z>0"<<std::endl; - else fout<<"Parent MuonStation NOT found for element "<<m_muonIdHelperTool->cscIdHelper().show_to_string(idp)<<std::endl; + else fout<<"Parent MuonStation NOT found for element "<<m_idHelperSvc->cscIdHelper().show_to_string(idp)<<std::endl; const MuonStation* ms1 = csc1->parentMuonStation(); if (ms1) fout<<"Parent MuonStation found for element at z<0"<<std::endl; - else fout<<"Parent MuonStation NOT found for element "<<m_muonIdHelperTool->cscIdHelper().show_to_string(idp1)<<std::endl; + else fout<<"Parent MuonStation NOT found for element "<<m_idHelperSvc->cscIdHelper().show_to_string(idp1)<<std::endl; int netastrips = csc->NetaStrips(1); int nphistrips = csc->NphiStrips(1); fout<<"N or eta / phi strips in this chamber = "<<netastrips<<" "<<nphistrips @@ -2027,14 +1999,14 @@ void MuonGMCheck::checkreadoutcscgeo() fout<<"Side-C: in AmdbLRS Gas Gap center (after internal alignment) = "<<csc1->GlobalToAmdbLRSCoords(ggCenter1)<<std::endl; - Identifier fwzp = m_muonIdHelperTool->cscIdHelper().channelID(idp, ml+1, gg, 0, 1); - Identifier fszp = m_muonIdHelperTool->cscIdHelper().channelID(idp, ml+1, gg, 1, 1); - Identifier lwzp = m_muonIdHelperTool->cscIdHelper().channelID(idp, ml+1, gg, 0, csc->NetaStrips(gg)); - Identifier lszp = m_muonIdHelperTool->cscIdHelper().channelID(idp, ml+1, gg, 1, csc->NphiStrips(gg)); - Identifier fwzp1 = m_muonIdHelperTool->cscIdHelper().channelID(idp1, ml+1, gg, 0, 1); - Identifier fszp1 = m_muonIdHelperTool->cscIdHelper().channelID(idp1, ml+1, gg, 1, 1); - Identifier lwzp1 = m_muonIdHelperTool->cscIdHelper().channelID(idp1, ml+1, gg, 0, csc1->NetaStrips(gg)); - Identifier lszp1 = m_muonIdHelperTool->cscIdHelper().channelID(idp1, ml+1, gg, 1, csc1->NphiStrips(gg)); + Identifier fwzp = m_idHelperSvc->cscIdHelper().channelID(idp, ml+1, gg, 0, 1); + Identifier fszp = m_idHelperSvc->cscIdHelper().channelID(idp, ml+1, gg, 1, 1); + Identifier lwzp = m_idHelperSvc->cscIdHelper().channelID(idp, ml+1, gg, 0, csc->NetaStrips(gg)); + Identifier lszp = m_idHelperSvc->cscIdHelper().channelID(idp, ml+1, gg, 1, csc->NphiStrips(gg)); + Identifier fwzp1 = m_idHelperSvc->cscIdHelper().channelID(idp1, ml+1, gg, 0, 1); + Identifier fszp1 = m_idHelperSvc->cscIdHelper().channelID(idp1, ml+1, gg, 1, 1); + Identifier lwzp1 = m_idHelperSvc->cscIdHelper().channelID(idp1, ml+1, gg, 0, csc1->NetaStrips(gg)); + Identifier lszp1 = m_idHelperSvc->cscIdHelper().channelID(idp1, ml+1, gg, 1, csc1->NphiStrips(gg)); Amg::Vector3D AoriginGlobalF = csc->AmdbLRSToGlobalCoords(Amg::Vector3D(0.,0.,0.)); Amg::Vector3D AoriginTrkF = csc->transform(fszp).inverse()*AoriginGlobalF; fout<<" Side-A: A-line origin Global Frame " @@ -2058,70 +2030,60 @@ void MuonGMCheck::checkreadoutcscgeo() Amg::Vector3D xfszp1 = csc1->stripPos(fszp1); Amg::Vector3D xlwzp1 = csc1->stripPos(lwzp1); Amg::Vector3D xlszp1 = csc1->stripPos(lszp1); - /* - Amg::Vector3D xfwzpNew = csc->transform(fwzp)*Amg::Vector3D(0.,0.,0.); - Amg::Vector3D xfszpNew = csc->transform(fszp)*Amg::Vector3D(0.,0.,0.); - Amg::Vector3D xlwzpNew = csc->transform(lwzp)*Amg::Vector3D(0.,0.,0.); - Amg::Vector3D xlszpNew = csc->transform(lszp)*Amg::Vector3D(0.,0.,0.); - Amg::Vector3D xfwzp1New = csc1->transform(fwzp1)*Amg::Vector3D(0.,0.,0.); - Amg::Vector3D xfszp1New = csc1->transform(fszp1)*Amg::Vector3D(0.,0.,0.); - Amg::Vector3D xlwzp1New = csc1->transform(lwzp1)*Amg::Vector3D(0.,0.,0.); - Amg::Vector3D xlszp1New = csc1->transform(lszp1)*Amg::Vector3D(0.,0.,0.); - */ - fout<<"gg "<<gg<<" "<<m_muonIdHelperTool->cscIdHelper().show_to_string(fwzp) + fout<<"gg "<<gg<<" "<<m_idHelperSvc->cscIdHelper().show_to_string(fwzp) <<"GM:: first eta wire is at z>0 local coord "<<csc->localStripPos(fwzp) <<" last "<<csc->localStripPos(lwzp)<<std::endl; - fout<<"gg "<<gg<<" "<<m_muonIdHelperTool->cscIdHelper().show_to_string(fwzp) + fout<<"gg "<<gg<<" "<<m_idHelperSvc->cscIdHelper().show_to_string(fwzp) <<"GM:: first eta wire is at z>0 AMDB lcoord "<<csc->GlobalToAmdbLRSCoords(csc->stripPos(fwzp)) <<" last "<<csc->GlobalToAmdbLRSCoords(csc->stripPos(lwzp))<<std::endl; - fout<<"gg "<<gg<<" "<<m_muonIdHelperTool->cscIdHelper().show_to_string(fwzp1) + fout<<"gg "<<gg<<" "<<m_idHelperSvc->cscIdHelper().show_to_string(fwzp1) <<"GM:: first eta wire is at z<0 AMDB lcoord "<<csc1->GlobalToAmdbLRSCoords(csc1->stripPos(fwzp1)) <<" last "<<csc1->GlobalToAmdbLRSCoords(csc1->stripPos(lwzp1))<<std::endl; - fout<<"gg "<<gg<<" "<<m_muonIdHelperTool->cscIdHelper().show_to_string(fwzp) + fout<<"gg "<<gg<<" "<<m_idHelperSvc->cscIdHelper().show_to_string(fwzp) <<"Nom:: first eta wire is at z>0 local coord "<<csc->nominalLocalStripPos(fwzp) <<" last "<<csc->nominalLocalStripPos(lwzp)<<std::endl; - fout<<"gg "<<gg<<" "<<m_muonIdHelperTool->cscIdHelper().show_to_string(fwzp) + fout<<"gg "<<gg<<" "<<m_idHelperSvc->cscIdHelper().show_to_string(fwzp) <<"TRK:: first eta wire on TrackingSurface "<<csc->stripPosOnTrackingSurface(fwzp) <<" last "<<csc->stripPosOnTrackingSurface(lwzp)<<std::endl; - fout<<"gg "<<gg<<" "<<m_muonIdHelperTool->cscIdHelper().show_to_string(fwzp) + fout<<"gg "<<gg<<" "<<m_idHelperSvc->cscIdHelper().show_to_string(fwzp) <<"GM:: first eta wire is at z>0 "<<xfwzp <<" last "<<xlwzp<<std::endl; - fout<<"gg "<<gg<<" "<<m_muonIdHelperTool->cscIdHelper().show_to_string(fwzp) + fout<<"gg "<<gg<<" "<<m_idHelperSvc->cscIdHelper().show_to_string(fwzp) <<"Nom:: first eta wire is at z>0 "<<xfwzpNom <<" last "<<xlwzpNom<<std::endl; - fout<<"gg "<<gg<<" "<<m_muonIdHelperTool->cscIdHelper().show_to_string(fwzp1) + fout<<"gg "<<gg<<" "<<m_idHelperSvc->cscIdHelper().show_to_string(fwzp1) <<"GM:: first eta wire is at z<0 "<<xfwzp1<<" last "<<xlwzp1<<std::endl; - fout<<"gg "<<gg<<" "<<m_muonIdHelperTool->cscIdHelper().show_to_string(fszp) + fout<<"gg "<<gg<<" "<<m_idHelperSvc->cscIdHelper().show_to_string(fszp) <<"GM:: first phi strip is at z>0 local coord "<<csc->localStripPos(fszp) <<" last "<<csc->localStripPos(lszp)<<std::endl; - fout<<"gg "<<gg<<" "<<m_muonIdHelperTool->cscIdHelper().show_to_string(fszp) + fout<<"gg "<<gg<<" "<<m_idHelperSvc->cscIdHelper().show_to_string(fszp) <<"GM:: first phi wire is at z>0 AMDB lcoord "<<csc->GlobalToAmdbLRSCoords(csc->stripPos(fszp)) <<" last "<<csc->GlobalToAmdbLRSCoords(csc->stripPos(lszp))<<std::endl; - fout<<"gg "<<gg<<" "<<m_muonIdHelperTool->cscIdHelper().show_to_string(fszp1) + fout<<"gg "<<gg<<" "<<m_idHelperSvc->cscIdHelper().show_to_string(fszp1) <<"GM:: first phi wire is at z<0 AMDB lcoord "<<csc1->GlobalToAmdbLRSCoords(csc->stripPos(fszp1)) <<" last "<<csc1->GlobalToAmdbLRSCoords(csc1->stripPos(lszp1))<<std::endl; - fout<<"gg "<<gg<<" "<<m_muonIdHelperTool->cscIdHelper().show_to_string(fszp) + fout<<"gg "<<gg<<" "<<m_idHelperSvc->cscIdHelper().show_to_string(fszp) <<"Nom:: first phi strip is at z>0 local coord "<<csc->nominalLocalStripPos(fszp) <<" last "<<csc->nominalLocalStripPos(lszp)<<std::endl; - fout<<"gg "<<gg<<" "<<m_muonIdHelperTool->cscIdHelper().show_to_string(fwzp) + fout<<"gg "<<gg<<" "<<m_idHelperSvc->cscIdHelper().show_to_string(fwzp) <<"TRK:: first phi strip on TrackingSurface "<<csc->stripPosOnTrackingSurface(fszp) <<" last "<<csc->stripPosOnTrackingSurface(lszp)<<std::endl; - fout<<"gg "<<gg<<" "<<m_muonIdHelperTool->cscIdHelper().show_to_string(fszp) + fout<<"gg "<<gg<<" "<<m_idHelperSvc->cscIdHelper().show_to_string(fszp) <<"GM:: first phi strip is at z>0 "<<xfszp <<" last "<<xlszp<<std::endl; - fout<<"gg "<<gg<<" "<<m_muonIdHelperTool->cscIdHelper().show_to_string(fszp) + fout<<"gg "<<gg<<" "<<m_idHelperSvc->cscIdHelper().show_to_string(fszp) <<"Nom:: first phi strip is at z>0 "<<xfszpNom <<" last "<<xlszpNom<<std::endl; - fout<<"gg "<<gg<<" "<<m_muonIdHelperTool->cscIdHelper().show_to_string(fszp1) + fout<<"gg "<<gg<<" "<<m_idHelperSvc->cscIdHelper().show_to_string(fszp1) <<"GM:: first phi strip is at z<0 "<<xfszp1<<" last "<<xlszp1<<std::endl; - fout<<"gg "<<gg<<" "<<m_muonIdHelperTool->cscIdHelper().show_to_string(fwzp) + fout<<"gg "<<gg<<" "<<m_idHelperSvc->cscIdHelper().show_to_string(fwzp) <<"GM:: first eta gang z>0 r,p,z " - <<xfwzp.perp()<<" "<<xfwzp.phi()*180./M_PI<<" "<<xfwzp.z()<<" last " - <<xlwzp.perp()<<" "<<xlwzp.phi()*180./M_PI<<" "<<xlwzp.z()<<std::endl; - fout<<"gg "<<gg<<" "<<m_muonIdHelperTool->cscIdHelper().show_to_string(fwzp1) + <<xfwzp.perp()<<" "<<xfwzp.phi()*invRad<<" "<<xfwzp.z()<<" last " + <<xlwzp.perp()<<" "<<xlwzp.phi()*invRad<<" "<<xlwzp.z()<<std::endl; + fout<<"gg "<<gg<<" "<<m_idHelperSvc->cscIdHelper().show_to_string(fwzp1) <<"GM:: first eta wire z<0 r,p,z " - <<xfwzp1.perp()<<" "<<xfwzp1.phi()*180./M_PI<<" "<<xfwzp1.z()<<" last " - <<xlwzp1.perp()<<" "<<xlwzp1.phi()*180./M_PI<<" "<<xlwzp1.z()<<std::endl; + <<xfwzp1.perp()<<" "<<xfwzp1.phi()*invRad<<" "<<xfwzp1.z()<<" last " + <<xlwzp1.perp()<<" "<<xlwzp1.phi()*invRad<<" "<<xlwzp1.z()<<std::endl; - fout<<"gg "<<gg<<" "<<m_muonIdHelperTool->cscIdHelper().show_to_string(fszp) + fout<<"gg "<<gg<<" "<<m_idHelperSvc->cscIdHelper().show_to_string(fszp) <<"GM:: first phi strip z>0 r,p,z " - <<xfszp.perp()<<" "<<xfszp.phi()*180./M_PI<<" "<<xfszp.z()<<" last " - <<xlszp.perp()<<" "<<xlszp.phi()*180./M_PI<<" "<<xlszp.z()<<std::endl; - fout<<"gg "<<gg<<" "<<m_muonIdHelperTool->cscIdHelper().show_to_string(fszp1) + <<xfszp.perp()<<" "<<xfszp.phi()*invRad<<" "<<xfszp.z()<<" last " + <<xlszp.perp()<<" "<<xlszp.phi()*invRad<<" "<<xlszp.z()<<std::endl; + fout<<"gg "<<gg<<" "<<m_idHelperSvc->cscIdHelper().show_to_string(fszp1) <<"GM:: first phi strip z<0 r,p,z " - <<xfszp1.perp()<<" "<<xfszp1.phi()*180./M_PI<<" "<<xfszp1.z()<<" last " - <<xlszp1.perp()<<" "<<xlszp1.phi()*180./M_PI<<" "<<xlszp1.z()<<std::endl; + <<xfszp1.perp()<<" "<<xfszp1.phi()*invRad<<" "<<xfszp1.z()<<" last " + <<xlszp1.perp()<<" "<<xlszp1.phi()*invRad<<" "<<xlszp1.z()<<std::endl; Amg::Vector3D lxfszp = csc->localStripPos(fszp); Amg::Vector3D lxlszp = csc->localStripPos(lszp); @@ -2130,14 +2092,14 @@ void MuonGMCheck::checkreadoutcscgeo() - fout<<"gg "<<gg<<" "<<m_muonIdHelperTool->cscIdHelper().show_to_string(fszp) + fout<<"gg "<<gg<<" "<<m_idHelperSvc->cscIdHelper().show_to_string(fszp) <<"GM:: first phi_S local z>0 r,p,z " - <<lxfszp.perp()<<" "<<lxfszp.phi()*180./M_PI<<" "<<lxfszp.z()<<" last " - <<lxlszp.perp()<<" "<<lxlszp.phi()*180./M_PI<<" "<<lxlszp.z()<<std::endl; - fout<<"gg "<<gg<<" "<<m_muonIdHelperTool->cscIdHelper().show_to_string(fszp1) + <<lxfszp.perp()<<" "<<lxfszp.phi()*invRad<<" "<<lxfszp.z()<<" last " + <<lxlszp.perp()<<" "<<lxlszp.phi()*invRad<<" "<<lxlszp.z()<<std::endl; + fout<<"gg "<<gg<<" "<<m_idHelperSvc->cscIdHelper().show_to_string(fszp1) <<"GM:: first phi_S local z<0 r,p,z " - <<lxfszp1.perp()<<" "<<lxfszp1.phi()*180./M_PI<<" "<<lxfszp1.z()<<" last " - <<lxlszp1.perp()<<" "<<lxlszp1.phi()*180./M_PI<<" "<<lxlszp1.z()<<std::endl; + <<lxfszp1.perp()<<" "<<lxfszp1.phi()*invRad<<" "<<lxfszp1.z()<<" last " + <<lxlszp1.perp()<<" "<<lxlszp1.phi()*invRad<<" "<<lxlszp1.z()<<std::endl; if (m_check_surfaces) @@ -2232,10 +2194,10 @@ void MuonGMCheck::checkreadoutcscgeo() } void MuonGMCheck::buildRpcRegionSelectorMap() { - std::vector<Identifier>::const_iterator idfirst = m_muonIdHelperTool->rpcIdHelper().module_begin(); - std::vector<Identifier>::const_iterator idlast = m_muonIdHelperTool->rpcIdHelper().module_end(); + std::vector<Identifier>::const_iterator idfirst = m_idHelperSvc->rpcIdHelper().module_begin(); + std::vector<Identifier>::const_iterator idlast = m_idHelperSvc->rpcIdHelper().module_end(); - IdContext rpcModuleContext = m_muonIdHelperTool->rpcIdHelper().module_context(); + IdContext rpcModuleContext = m_idHelperSvc->rpcIdHelper().module_context(); std::ofstream fout0("RPCMapIdAndHash.txt"); fout0 <<"RPC ExtendedId HashId Etamin Etamax Phimin Phimax "<<std::endl; @@ -2245,11 +2207,11 @@ void MuonGMCheck::buildRpcRegionSelectorMap() { Identifier Id = *i; IdentifierHash Idhash; - int gethash_code = m_muonIdHelperTool->rpcIdHelper().get_hash(Id, Idhash, &rpcModuleContext); - std::string extid = m_muonIdHelperTool->rpcIdHelper().show_to_string(Id); - std::cout<<" Identifier = "<<extid; - if (gethash_code == 0) std::cout<<" its hash Id is "<<Idhash<<std::endl; - else std::cout<<" hash Id NOT computed "<<Idhash<<std::endl; + int gethash_code = m_idHelperSvc->rpcIdHelper().get_hash(Id, Idhash, &rpcModuleContext); + std::string extid = m_idHelperSvc->rpcIdHelper().show_to_string(Id); + ATH_MSG_INFO(" Identifier = "<<extid); + if (gethash_code == 0) ATH_MSG_INFO(" its hash Id is "<<Idhash); + else ATH_MSG_INFO(" hash Id NOT computed "<<Idhash); std::string new_extid=""; int aux0, aux1, aux2, aux3, aux4, aux5; @@ -2268,20 +2230,18 @@ void MuonGMCheck::buildRpcRegionSelectorMap() new_extid = rpcid_nstr.str(); } } - std::cout<<extid<<" hash Id "<<Idhash<<" new format "<<new_extid<<std::endl; + ATH_MSG_INFO(extid<<" hash Id "<<Idhash<<" new format "<<new_extid); RpcReadoutSet Set(p_MuonMgr, Id); int nmod = Set.NreadoutElements(); - std::cout<<" Number of modules in this RpcSet "<<nmod<<std::endl; - std::cout<<" Number of doubletZ in this RpcSet "<<Set.NdoubletZ()<<std::endl; + ATH_MSG_INFO(" Number of modules in this RpcSet "<<nmod); + ATH_MSG_INFO(" Number of doubletZ in this RpcSet "<<Set.NdoubletZ()); int ndbz = Set.NdoubletZ(); - std::cout<<" Number of modules in Phi/DoubletZ: "; - for (int i=1; i<=ndbz; i++) std::cout<<Set.NPhimodules(i)<<" "; - std::cout<<std::endl; - std::cout<<" Number of modules in this RpcSet "<<nmod<<" Number of doubletZ in this RpcSet "<<Set.NdoubletZ()<<std::endl; - std::cout<<" Number of modules in Phi/DoubletZ: "; - for (int i=1; i<=ndbz; i++) std::cout<<Set.NPhimodules(i)<<" "; - std::cout<<std::endl; + ATH_MSG_INFO(" Number of modules in Phi/DoubletZ: "); + for (int i=1; i<=ndbz; i++) ATH_MSG_INFO(Set.NPhimodules(i)<<" "); + ATH_MSG_INFO(" Number of modules in this RpcSet "<<nmod<<" Number of doubletZ in this RpcSet "<<Set.NdoubletZ()); + ATH_MSG_INFO(" Number of modules in Phi/DoubletZ: "); + for (int i=1; i<=ndbz; i++) ATH_MSG_INFO(Set.NPhimodules(i)<<" "); double zmin = 99999999; double zmax = -99999999; @@ -2292,13 +2252,13 @@ void MuonGMCheck::buildRpcRegionSelectorMap() unsigned int nmodules = 0; for (int dbz=1; dbz<=ndbz; dbz++) { - const RpcReadoutElement* rpcold = NULL; + const RpcReadoutElement* rpcold = nullptr; int ndbp = Set.NPhimodules(dbz); for (int dbp=1; dbp<=ndbp; dbp++) { - std::cout<<" dbz, dbp = "<<dbz<<" "<<dbp<<std::endl; + ATH_MSG_INFO(" dbz, dbp = "<<dbz<<" "<<dbp); const RpcReadoutElement* rpc = Set.readoutElement(dbz, dbp); - std::cout<<"_rpc = "<<rpc<<std::endl; + ATH_MSG_INFO("_rpc = "<<rpc); if ( rpc != rpcold ) { nmodules ++; @@ -2327,13 +2287,13 @@ void MuonGMCheck::buildRpcRegionSelectorMap() } } if (nmodules != Set.NreadoutElements()) - std::cout<<" nmod = "<<nmodules<<" != NreadoutElements() "<<nmod<<std::endl; + ATH_MSG_INFO(" nmod = "<<nmodules<<" != NreadoutElements() "<<nmod); // here define the eta and phi(0-2*pi) ranges coercePositivePhi(phimin); coercePositivePhi(phimax); double eta_min = Pzmin.eta(); double eta_max = Pzmax.eta(); - std::cout<<"eta range "<<eta_min<<" "<<eta_max<<" phi range "<<phimin<<" "<<phimax<<std::endl; + ATH_MSG_INFO("eta range "<<eta_min<<" "<<eta_max<<" phi range "<<phimin<<" "<<phimax); fout0 << new_extid << setiosflags(std::ios::fixed) << std::setprecision(0) << std::setw(6) @@ -2355,10 +2315,10 @@ void MuonGMCheck::buildRpcRegionSelectorMap() void MuonGMCheck::buildMdtRegionSelectorMap() { - std::vector<Identifier>::const_iterator idfirst = m_muonIdHelperTool->mdtIdHelper().module_begin(); - std::vector<Identifier>::const_iterator idlast = m_muonIdHelperTool->mdtIdHelper().module_end(); + std::vector<Identifier>::const_iterator idfirst = m_idHelperSvc->mdtIdHelper().module_begin(); + std::vector<Identifier>::const_iterator idlast = m_idHelperSvc->mdtIdHelper().module_end(); - IdContext mdtModuleContext = m_muonIdHelperTool->mdtIdHelper().module_context(); + IdContext mdtModuleContext = m_idHelperSvc->mdtIdHelper().module_context(); std::ofstream fout0("MDTMapIdAndHash.txt"); fout0 <<"MDT ExtendedId HashId Etamin Etamax Phimin Phimax "<<std::endl; @@ -2367,11 +2327,11 @@ void MuonGMCheck::buildMdtRegionSelectorMap() { Identifier Id = *i; IdentifierHash Idhash; - int gethash_code = m_muonIdHelperTool->mdtIdHelper().get_hash(Id, Idhash, &mdtModuleContext); - std::string extid = m_muonIdHelperTool->mdtIdHelper().show_to_string(Id); - std::cout<<"\n Identifier = "<<extid; - if (gethash_code == 0) std::cout<<" its hash Id is "<<Idhash<<std::endl; - else std::cout<<" hash Id NOT computed "<<Idhash<<std::endl; + int gethash_code = m_idHelperSvc->mdtIdHelper().get_hash(Id, Idhash, &mdtModuleContext); + std::string extid = m_idHelperSvc->mdtIdHelper().show_to_string(Id); + ATH_MSG_INFO("\n Identifier = "<<extid); + if (gethash_code == 0) ATH_MSG_INFO(" its hash Id is "<<Idhash); + else ATH_MSG_INFO(" hash Id NOT computed "<<Idhash); std::string new_extid=""; int aux0, aux1, aux2, aux3, aux4, aux5; @@ -2390,37 +2350,37 @@ void MuonGMCheck::buildMdtRegionSelectorMap() new_extid = mdtid_nstr.str(); } } - std::cout<<extid<<" hash Id "<<Idhash<<" new format "<<new_extid; + ATH_MSG_INFO(extid<<" hash Id "<<Idhash<<" new format "<<new_extid); - IdContext mdtChannelContext = m_muonIdHelperTool->mdtIdHelper().channel_context(); + IdContext mdtChannelContext = m_idHelperSvc->mdtIdHelper().channel_context(); // get the element corresponding to multilayer = 1 const MdtReadoutElement* mdt1 = p_MuonMgr->getMdtReadoutElement(Id); - if (mdt1 == NULL) { - std::cout<<" Mdt Readout Element not found for Id = "<<m_muonIdHelperTool->mdtIdHelper().show_to_string(Id)<<" go to next "<<std::endl; + if (!mdt1) { + ATH_MSG_INFO(" Mdt Readout Element not found for Id = "<<m_idHelperSvc->mdtIdHelper().show_to_string(Id)<<" go to next "); continue; } - std::cout<<" Station name / technology "<<mdt1->getStationName()<<" / "<<mdt1->getTechnologyName()<<std::endl; - Identifier Id2 = m_muonIdHelperTool->mdtIdHelper().channelID(Id, 2, 1, 1); + ATH_MSG_INFO(" Station name / technology "<<mdt1->getStationName()<<" / "<<mdt1->getTechnologyName()); + Identifier Id2 = m_idHelperSvc->mdtIdHelper().channelID(Id, 2, 1, 1); // get the element corresponding to multilayer = 2 const MdtReadoutElement* mdt2 = p_MuonMgr->getMdtReadoutElement(Id2); double tubePitch = mdt1->tubePitch(); int ntlay = mdt1->getNLayers(); int ntubesl1 = mdt1->getNtubesperlayer(); int ntubesl2 = 0; - if (mdt2 == NULL) { - std::cout<<" Mdt Readout Element not found for Id = "<<m_muonIdHelperTool->mdtIdHelper().show_to_string(Id2)<<std::endl; + if (!mdt2) { + ATH_MSG_INFO(" Mdt Readout Element not found for Id = "<<m_idHelperSvc->mdtIdHelper().show_to_string(Id2)); } else ntubesl2 = mdt2->getNtubesperlayer(); Identifier Idv[4]; - Idv[0] = m_muonIdHelperTool->mdtIdHelper().channelID(Id, 1, 1, 1); - Idv[1] = m_muonIdHelperTool->mdtIdHelper().channelID(Id, 1, 1, ntubesl1); - Idv[2] = m_muonIdHelperTool->mdtIdHelper().channelID(Id, 2, ntlay, 1); - Idv[3] = m_muonIdHelperTool->mdtIdHelper().channelID(Id, 2, ntlay, ntubesl2); + Idv[0] = m_idHelperSvc->mdtIdHelper().channelID(Id, 1, 1, 1); + Idv[1] = m_idHelperSvc->mdtIdHelper().channelID(Id, 1, 1, ntubesl1); + Idv[2] = m_idHelperSvc->mdtIdHelper().channelID(Id, 2, ntlay, 1); + Idv[3] = m_idHelperSvc->mdtIdHelper().channelID(Id, 2, ntlay, ntubesl2); - std::cout<<" Number of tube layers "<<ntlay; - std::cout<<" Number of tubes / layer (1 ,2) "<<ntubesl1<<", "<<ntubesl2; + ATH_MSG_INFO(" Number of tube layers "<<ntlay); + ATH_MSG_INFO(" Number of tubes / layer (1 ,2) "<<ntubesl1<<", "<<ntubesl2); double rmin = 99999999.; double rmax = -99999999.; @@ -2432,44 +2392,44 @@ void MuonGMCheck::buildMdtRegionSelectorMap() double phimax = -999999.; double zpos21 = 0.; - Identifier Idsl = m_muonIdHelperTool->mdtIdHelper().channelID(Id, 1, 2, 1); + Identifier Idsl = m_idHelperSvc->mdtIdHelper().channelID(Id, 1, 2, 1); if (mdt1->barrel()) { zpos21 = (mdt1->tubePos(Idsl)).z()-(mdt1->tubePos(Idv[0])).z(); - if (zpos21 > 1.) std::cout<<" staggering this way >>>>> "<<std::endl; - else if (zpos21 <-1.) std::cout<<" staggering this way <<<<< "<<std::endl; - else std::cout<<" zpos 21 = 0 ??? "<<zpos21<<std::endl; + if (zpos21 > 1.) ATH_MSG_INFO(" staggering this way >>>>> "); + else if (zpos21 <-1.) ATH_MSG_INFO(" staggering this way <<<<< "); + else ATH_MSG_INFO(" zpos 21 = 0 ??? "<<zpos21); } else { zpos21 = (mdt1->tubePos(Idsl)).perp()-(mdt1->tubePos(Idv[0])).perp(); - if (zpos21 > 1.) std::cout<<" staggering this way /\\ "<<std::endl; - else if (zpos21 <-1.) std::cout<<" staggering this way \\/ "<<std::endl; - else std::cout<<" zpos 21 = 0 ??? "<<zpos21<<std::endl; + if (zpos21 > 1.) ATH_MSG_INFO(" staggering this way /\\ "); + else if (zpos21 <-1.) ATH_MSG_INFO(" staggering this way \\/ "); + else ATH_MSG_INFO(" zpos 21 = 0 ??? "<<zpos21); } for (int i=0; i<4; i++) { // - const MdtReadoutElement* mdt = NULL; + const MdtReadoutElement* mdt = nullptr; i<2 ? mdt = mdt1: mdt = mdt2; - if (mdt == NULL) { - std::cout<<" element not found for index i = "<<i<<" --------- "<<std::endl; + if (!mdt) { + ATH_MSG_INFO(" element not found for index i = "<<i<<" --------- "); if (i==2) { - Idv[2] = m_muonIdHelperTool->mdtIdHelper().channelID(Id, 1, ntlay, 1); + Idv[2] = m_idHelperSvc->mdtIdHelper().channelID(Id, 1, ntlay, 1); mdt = p_MuonMgr->getMdtReadoutElement(Idv[2]); } else if (i==3) { - Idv[3] = m_muonIdHelperTool->mdtIdHelper().channelID(Id, 1, ntlay, ntubesl1); + Idv[3] = m_idHelperSvc->mdtIdHelper().channelID(Id, 1, ntlay, ntubesl1); mdt = p_MuonMgr->getMdtReadoutElement(Idv[3]); } } - if (mdt == NULL) { - std::cout<<" Skipping element; i = "<<i<<" ----- "<<std::endl; + if (!mdt) { + ATH_MSG_INFO(" Skipping element; i = "<<i<<" ----- "); continue; } Amg::Vector3D mdtPos = mdt->tubePos(Idv[i]); - std::cout<<m_muonIdHelperTool->mdtIdHelper().show_to_string(Idv[i])<<" index "<<i<<" posx,y,z "<<mdtPos<<" R = "<<mdtPos.perp()<<std::endl; + ATH_MSG_INFO(m_idHelperSvc->mdtIdHelper().show_to_string(Idv[i])<<" index "<<i<<" posx,y,z "<<mdtPos<<" R = "<<mdtPos.perp()); // Amg::Vector3D mdtPos1 = mdtPos; Amg::Vector3D mdtPos2 = mdtPos; @@ -2601,10 +2561,10 @@ void MuonGMCheck::buildMdtRegionSelectorMap() } double pminMod = mdtPos.phi() - dphi; double pmaxMod = mdtPos.phi() + dphi; - std::cout<<" Stack zmin, max "<<zminMod<<" "<<zmaxMod + ATH_MSG_INFO(" Stack zmin, max "<<zminMod<<" "<<zmaxMod <<" phimin, max "<<pminMod<<" "<<pmaxMod <<" Rmin, max "<<rminMod<<" "<<rmaxMod - <<" etamin, max "<<eminMod<<" "<<emaxMod<<std::endl; + <<" etamin, max "<<eminMod<<" "<<emaxMod); if (zminMod < zmin) { zmin = zminMod; @@ -2618,7 +2578,7 @@ void MuonGMCheck::buildMdtRegionSelectorMap() if (emaxMod > emax) emax = emaxMod; if (rminMod < rmin) rmin = rminMod; if (rmaxMod > rmax) rmax = rmaxMod; - std::cout<<" Module emin - emax "<<emin<<" "<<emax<<" phimin - phimax "<<phimin<<" "<<phimax<<std::endl; + ATH_MSG_INFO(" Module emin - emax "<<emin<<" "<<emax<<" phimin - phimax "<<phimin<<" "<<phimax); } @@ -2626,9 +2586,9 @@ void MuonGMCheck::buildMdtRegionSelectorMap() coercePositivePhi(phimin); coercePositivePhi(phimax); - std::cout<<" ***** Z range "<<zmin<<" "<<zmax<<" ***** R range "<<rmin<<" "<<rmax + ATH_MSG_INFO(" ***** Z range "<<zmin<<" "<<zmax<<" ***** R range "<<rmin<<" "<<rmax <<" --- eta range "<<emin<<" "<<emax - <<" phi range "<<phimin<<" "<<phimax<<std::endl; + <<" phi range "<<phimin<<" "<<phimax); fout0 << new_extid << setiosflags(std::ios::fixed) << std::setprecision(0) << std::setw(6) @@ -2650,10 +2610,10 @@ void MuonGMCheck::buildMdtRegionSelectorMap() } void MuonGMCheck::buildTgcRegionSelectorMap() { - std::vector<Identifier>::const_iterator idfirst = m_muonIdHelperTool->tgcIdHelper().module_begin(); - std::vector<Identifier>::const_iterator idlast = m_muonIdHelperTool->tgcIdHelper().module_end(); + std::vector<Identifier>::const_iterator idfirst = m_idHelperSvc->tgcIdHelper().module_begin(); + std::vector<Identifier>::const_iterator idlast = m_idHelperSvc->tgcIdHelper().module_end(); - const IdContext tgcModuleContext = m_muonIdHelperTool->tgcIdHelper().module_context(); + const IdContext tgcModuleContext = m_idHelperSvc->tgcIdHelper().module_context(); std::ofstream fout0("TGCMapIdAndHash.txt"); fout0 <<"TGC ExtendedId HashId Etamin Etamax Phimin Phimax "<<std::endl; @@ -2663,12 +2623,12 @@ void MuonGMCheck::buildTgcRegionSelectorMap() Identifier elemId = *i; IdentifierHash hashId; - int gethash_code = m_muonIdHelperTool->tgcIdHelper().get_hash(elemId,hashId,&tgcModuleContext); + int gethash_code = m_idHelperSvc->tgcIdHelper().get_hash(elemId,hashId,&tgcModuleContext); - std::string extid = m_muonIdHelperTool->tgcIdHelper().show_to_string(elemId); - std::cout<<"\n Identifier = "<<extid; - if (gethash_code == 0) std::cout<<" its hash Id is "<<hashId<<std::endl; - else std::cout<<" hash Id NOT computed "<<hashId<<std::endl; + std::string extid = m_idHelperSvc->tgcIdHelper().show_to_string(elemId); + ATH_MSG_INFO("\n Identifier = "<<extid); + if (gethash_code == 0) ATH_MSG_INFO(" its hash Id is "<<hashId); + else ATH_MSG_INFO(" hash Id NOT computed "<<hashId); std::string new_extid = ""; int aux0, aux1, aux2, aux3, aux4, aux5; @@ -2687,27 +2647,27 @@ void MuonGMCheck::buildTgcRegionSelectorMap() new_extid = mdtid_nstr.str(); } } - std::cout<<extid<<" hash Id "<<hashId<<" new format "<<new_extid; + ATH_MSG_INFO(extid<<" hash Id "<<hashId<<" new format "<<new_extid); const TgcReadoutElement* tgc = p_MuonMgr->getTgcReadoutElement(elemId); - if (tgc == NULL) + if (!tgc) { - std::cout<<" Tgc Readout Element not found for Id = "<<m_muonIdHelperTool->tgcIdHelper().show_to_string(elemId)<<" go to next "<<std::endl; + ATH_MSG_INFO(" Tgc Readout Element not found for Id = "<<m_idHelperSvc->tgcIdHelper().show_to_string(elemId)<<" go to next "); continue; } - std::cout<<" Station name / technology "<<tgc->getStationName()<<" / "<<tgc->getTechnologyName()<<std::endl; + ATH_MSG_INFO(" Station name / technology "<<tgc->getStationName()<<" / "<<tgc->getTechnologyName()); Amg::Vector3D posmin, posmax; float etamin, etamax; - int gapMin = m_muonIdHelperTool->tgcIdHelper().gasGapMin(elemId); - int gapMax = m_muonIdHelperTool->tgcIdHelper().gasGapMax(elemId); + int gapMin = m_idHelperSvc->tgcIdHelper().gasGapMin(elemId); + int gapMax = m_idHelperSvc->tgcIdHelper().gasGapMax(elemId); Identifier chId; - chId = m_muonIdHelperTool->tgcIdHelper().channelID(elemId,gapMin,0,1); - const int chmax = m_muonIdHelperTool->tgcIdHelper().channelMax(chId); + chId = m_idHelperSvc->tgcIdHelper().channelID(elemId,gapMin,0,1); + const int chmax = m_idHelperSvc->tgcIdHelper().channelMax(chId); posmax = tgc->channelPos(gapMin,0,chmax); // gapMax gives posmax! - chId = m_muonIdHelperTool->tgcIdHelper().channelID(elemId,gapMax,0,1); - const int chmin = m_muonIdHelperTool->tgcIdHelper().channelMin(chId); + chId = m_idHelperSvc->tgcIdHelper().channelID(elemId,gapMax,0,1); + const int chmin = m_idHelperSvc->tgcIdHelper().channelMin(chId); posmin = tgc->channelPos(gapMax,0,chmin); // gapMin gives posmin! // calculation based on active sensitive area @@ -2717,7 +2677,7 @@ void MuonGMCheck::buildTgcRegionSelectorMap() activeheight = tgc->length(); etamin = -logf(tan(atan((posctr.perp()-activeheight/2.)/fabs(posmin.z()))/2.)); etamax = -logf(tan(atan((posctr.perp()+activeheight/2.)/fabs(posmax.z()))/2.)); - if (m_muonIdHelperTool->tgcIdHelper().stationEta(elemId) < 0) { + if (m_idHelperSvc->tgcIdHelper().stationEta(elemId) < 0) { etamin = -etamin; etamax = -etamax; } @@ -2749,10 +2709,10 @@ void MuonGMCheck::buildTgcRegionSelectorMap() void MuonGMCheck::buildCscRegionSelectorMap() { - std::vector<Identifier>::const_iterator idfirst = m_muonIdHelperTool->cscIdHelper().module_begin(); - std::vector<Identifier>::const_iterator idlast = m_muonIdHelperTool->cscIdHelper().module_end(); + std::vector<Identifier>::const_iterator idfirst = m_idHelperSvc->cscIdHelper().module_begin(); + std::vector<Identifier>::const_iterator idlast = m_idHelperSvc->cscIdHelper().module_end(); - IdContext cscModuleContext = m_muonIdHelperTool->cscIdHelper().module_context(); + IdContext cscModuleContext = m_idHelperSvc->cscIdHelper().module_context(); std::ofstream fout0("CSCMapIdAndHash.txt"); fout0 <<"CSC ExtendedId HashId Etamin Etamax Phimin Phimax "<<std::endl; @@ -2761,11 +2721,11 @@ void MuonGMCheck::buildCscRegionSelectorMap() { Identifier Id = *i; IdentifierHash Idhash; - int gethash_code = m_muonIdHelperTool->cscIdHelper().get_hash(Id, Idhash, &cscModuleContext); - std::string extid = m_muonIdHelperTool->cscIdHelper().show_to_string(Id); - std::cout<<"\n Identifier = "<<extid; - if (gethash_code == 0) std::cout<<" its hash Id is "<<Idhash<<std::endl; - else std::cout<<" hash Id NOT computed "<<Idhash<<std::endl; + int gethash_code = m_idHelperSvc->cscIdHelper().get_hash(Id, Idhash, &cscModuleContext); + std::string extid = m_idHelperSvc->cscIdHelper().show_to_string(Id); + ATH_MSG_INFO("\n Identifier = "<<extid); + if (gethash_code == 0) ATH_MSG_INFO(" its hash Id is "<<Idhash); + else ATH_MSG_INFO(" hash Id NOT computed "<<Idhash); std::string new_extid=""; int aux0, aux1=0, aux2, aux3=0, aux4, aux5; @@ -2788,38 +2748,38 @@ void MuonGMCheck::buildCscRegionSelectorMap() // aux2 is eta region (-1,1) // aux3 is phi region (1,8) if( aux1==0 || aux3==0 ) { - std::cout<< "ERROR : There is something wrong in buildCscRegionSelectorMap!" << std::endl; - std::cout<< "ERROR : Variables aux1 and/or aux3 not initialized - Taking emergency exit!" << std::endl; + ATH_MSG_ERROR("There is something wrong in buildCscRegionSelectorMap!"); + ATH_MSG_ERROR("Variables aux1 and/or aux3 not initialized - Taking emergency exit!"); throw; } - std::cout<<extid<<" hash Id "<<Idhash<<" new format " << new_extid << std::endl; + ATH_MSG_INFO(extid<<" hash Id "<<Idhash<<" new format " << new_extid); // retrieve CscReadoutElement Identifier Id2ndLayer; int chamberLayer = 2; const CscReadoutElement *csc; csc = p_MuonMgr->getCscReadoutElement(Id); - if (csc == NULL) { - std::cout << "Csc Readout Element not found for this Id ---- try 2nd layer"<<std::endl; - Id2ndLayer = m_muonIdHelperTool->cscIdHelper().parentID(Id); - Id2ndLayer = m_muonIdHelperTool->cscIdHelper().channelID(Id2ndLayer, chamberLayer, 1, 0, 1); + if (!csc) { + ATH_MSG_INFO("Csc Readout Element not found for this Id ---- try 2nd layer"); + Id2ndLayer = m_idHelperSvc->cscIdHelper().parentID(Id); + Id2ndLayer = m_idHelperSvc->cscIdHelper().channelID(Id2ndLayer, chamberLayer, 1, 0, 1); csc = p_MuonMgr->getCscReadoutElement(Id2ndLayer); - if (csc == NULL) + if (!csc) { - std::cout << "Csc Readout Element not found for 2nd layer too ---- skip"<<std::endl; + ATH_MSG_INFO("Csc Readout Element not found for 2nd layer too ---- skip"); continue; } else { - std::cout << "Csc Readout Element found for 2nd layer"<<std::endl; + ATH_MSG_INFO("Csc Readout Element found for 2nd layer"); } } - std::cout << "number of chamber layers : " << m_muonIdHelperTool->cscIdHelper().chamberLayerMin(Id) << "," << m_muonIdHelperTool->cscIdHelper().chamberLayerMax(Id) << std::endl; - std::cout << "number of wire layers : " << m_muonIdHelperTool->cscIdHelper().wireLayerMin(Id) << "," << m_muonIdHelperTool->cscIdHelper().wireLayerMax(Id)<< std::endl; - std::cout << "strip number : " << m_muonIdHelperTool->cscIdHelper().stripMin(Id) << "," << m_muonIdHelperTool->cscIdHelper().stripMax(Id) << std::endl; + ATH_MSG_INFO("number of chamber layers : " << m_idHelperSvc->cscIdHelper().chamberLayerMin(Id) << "," << m_idHelperSvc->cscIdHelper().chamberLayerMax(Id)); + ATH_MSG_INFO("number of wire layers : " << m_idHelperSvc->cscIdHelper().wireLayerMin(Id) << "," << m_idHelperSvc->cscIdHelper().wireLayerMax(Id)); + ATH_MSG_INFO("strip number : " << m_idHelperSvc->cscIdHelper().stripMin(Id) << "," << m_idHelperSvc->cscIdHelper().stripMax(Id)); double eta_min = 99999999.; double eta_max = -99999999.; @@ -2831,11 +2791,11 @@ void MuonGMCheck::buildCscRegionSelectorMap() Identifier Id_eta_max; Identifier Id_eta_min; - for(int chlayer=1; chlayer<=m_muonIdHelperTool->cscIdHelper().chamberLayerMax(Id);chlayer++){ - for (int wlayer=1;wlayer<=m_muonIdHelperTool->cscIdHelper().wireLayerMax(Id);wlayer++){ + for(int chlayer=1; chlayer<=m_idHelperSvc->cscIdHelper().chamberLayerMax(Id);chlayer++){ + for (int wlayer=1;wlayer<=m_idHelperSvc->cscIdHelper().wireLayerMax(Id);wlayer++){ for (int phis=1; phis<=csc->NphiStrips(wlayer); phis++){ - Identifier phis_id = m_muonIdHelperTool->cscIdHelper().channelID(Id, chlayer, wlayer, 1, phis); + Identifier phis_id = m_idHelperSvc->cscIdHelper().channelID(Id, chlayer, wlayer, 1, phis); Amg::Vector3D phis_x = csc->localStripPos(phis_id); double phis_lenght = csc->stripLength(phis_id); @@ -2893,22 +2853,20 @@ void MuonGMCheck::buildCscRegionSelectorMap() Id_eta_min=phis_id; eta_min=gphis_x2.eta(); } - std::cout << "pm 1 n " << phis << " phi1 " << gphis_x1.phi() + ATH_MSG_INFO("pm 1 n " << phis << " phi1 " << gphis_x1.phi() << " phi2 " << gphis_x2.phi() << " phi_min " << phi_min - << " phi_max " << phi_max - << std::endl; + << " phi_max " << phi_max); - std::cout << "pm 1 n " << phis << " eta1 " << gphis_x1.eta() + ATH_MSG_INFO("pm 1 n " << phis << " eta1 " << gphis_x1.eta() << " eta2 " << gphis_x2.eta() << " eta_min " << eta_min - << " eta_max " << eta_max - << std::endl; - std::cout << "------------------------------------------------------------------------------------------------" << std::endl; + << " eta_max " << eta_max); + ATH_MSG_INFO("------------------------------------------------------------------------------------------------"); } for (int etas=1; etas<=csc->NetaStrips(wlayer); etas++){ - Identifier etas_id = m_muonIdHelperTool->cscIdHelper().channelID(Id, chlayer, wlayer, 0, etas); + Identifier etas_id = m_idHelperSvc->cscIdHelper().channelID(Id, chlayer, wlayer, 0, etas); Amg::Vector3D etas_x = csc->localStripPos(etas_id); double etas_lenght = csc->stripLength(etas_id); @@ -2965,48 +2923,46 @@ void MuonGMCheck::buildCscRegionSelectorMap() eta_min=getas_x2.eta(); } - std::cout << "pm 0 n " << etas << " phi1 " << getas_x1.phi() + ATH_MSG_INFO("pm 0 n " << etas << " phi1 " << getas_x1.phi() << " phi2 " << getas_x2.phi() << " phi_min " << phi_min - << " phi_max " << phi_max - << std::endl; + << " phi_max " << phi_max); - std::cout << "pm 0 n " << etas << " eta1 " << getas_x1.eta() + ATH_MSG_INFO("pm 0 n " << etas << " eta1 " << getas_x1.eta() << " eta2 " << getas_x2.eta() << " eta_min " << eta_min - << " eta_max " << eta_max - << std::endl; - std::cout << "------------------------------------------------------------------------------------------------" << std::endl; + << " eta_max " << eta_max); + ATH_MSG_INFO("------------------------------------------------------------------------------------------------"); } } //gas gaps } // chamber layers - int cl_phi_min = m_muonIdHelperTool->cscIdHelper().chamberLayer(Id_phi_min); - int cl_phi_max = m_muonIdHelperTool->cscIdHelper().chamberLayer(Id_phi_max); - int cl_eta_min = m_muonIdHelperTool->cscIdHelper().chamberLayer(Id_eta_min); - int cl_eta_max = m_muonIdHelperTool->cscIdHelper().chamberLayer(Id_eta_max); + int cl_phi_min = m_idHelperSvc->cscIdHelper().chamberLayer(Id_phi_min); + int cl_phi_max = m_idHelperSvc->cscIdHelper().chamberLayer(Id_phi_max); + int cl_eta_min = m_idHelperSvc->cscIdHelper().chamberLayer(Id_eta_min); + int cl_eta_max = m_idHelperSvc->cscIdHelper().chamberLayer(Id_eta_max); - int wl_phi_min = m_muonIdHelperTool->cscIdHelper().wireLayer(Id_phi_min); - int wl_phi_max = m_muonIdHelperTool->cscIdHelper().wireLayer(Id_phi_max); - int wl_eta_min = m_muonIdHelperTool->cscIdHelper().wireLayer(Id_eta_min); - int wl_eta_max = m_muonIdHelperTool->cscIdHelper().wireLayer(Id_eta_max); + int wl_phi_min = m_idHelperSvc->cscIdHelper().wireLayer(Id_phi_min); + int wl_phi_max = m_idHelperSvc->cscIdHelper().wireLayer(Id_phi_max); + int wl_eta_min = m_idHelperSvc->cscIdHelper().wireLayer(Id_eta_min); + int wl_eta_max = m_idHelperSvc->cscIdHelper().wireLayer(Id_eta_max); - int N_phi_min = m_muonIdHelperTool->cscIdHelper().strip(Id_phi_min); - int N_phi_max = m_muonIdHelperTool->cscIdHelper().strip(Id_phi_max); - int N_eta_min = m_muonIdHelperTool->cscIdHelper().strip(Id_eta_min); - int N_eta_max = m_muonIdHelperTool->cscIdHelper().strip(Id_eta_max); + int N_phi_min = m_idHelperSvc->cscIdHelper().strip(Id_phi_min); + int N_phi_max = m_idHelperSvc->cscIdHelper().strip(Id_phi_max); + int N_eta_min = m_idHelperSvc->cscIdHelper().strip(Id_eta_min); + int N_eta_max = m_idHelperSvc->cscIdHelper().strip(Id_eta_max); - int mp_phi_min = m_muonIdHelperTool->cscIdHelper().measuresPhi(Id_phi_min); - int mp_phi_max = m_muonIdHelperTool->cscIdHelper().measuresPhi(Id_phi_max); - int mp_eta_min = m_muonIdHelperTool->cscIdHelper().measuresPhi(Id_eta_min); - int mp_eta_max = m_muonIdHelperTool->cscIdHelper().measuresPhi(Id_eta_max); + int mp_phi_min = m_idHelperSvc->cscIdHelper().measuresPhi(Id_phi_min); + int mp_phi_max = m_idHelperSvc->cscIdHelper().measuresPhi(Id_phi_max); + int mp_eta_min = m_idHelperSvc->cscIdHelper().measuresPhi(Id_eta_min); + int mp_eta_max = m_idHelperSvc->cscIdHelper().measuresPhi(Id_eta_max); - std::cout << "--------> phi_min " << phi_min << " mp " << mp_phi_min << " chl " << cl_phi_min << " wl " << wl_phi_min << " strip " << N_phi_min << std::endl; - std::cout << "--------> phi_max " << phi_max << " mp " << mp_phi_max << " chl " << cl_phi_max << " wl " << wl_phi_max << " strip " << N_phi_max << std::endl; - std::cout << "--------> eta_min " << eta_min << " mp " << mp_eta_min << " chl " << cl_eta_min << " wl " << wl_eta_min << " strip " << N_eta_min << std::endl; - std::cout << "--------> eta_max " << eta_max << " mp " << mp_eta_max << " chl " << cl_eta_max << " wl " << wl_eta_max << " strip " << N_eta_max << std::endl; - std::cout << "--------> Dphi " << fabs(phi_max-phi_min) << " Deta " << fabs(eta_max-eta_min) << std::endl; + ATH_MSG_INFO("--------> phi_min " << phi_min << " mp " << mp_phi_min << " chl " << cl_phi_min << " wl " << wl_phi_min << " strip " << N_phi_min); + ATH_MSG_INFO("--------> phi_max " << phi_max << " mp " << mp_phi_max << " chl " << cl_phi_max << " wl " << wl_phi_max << " strip " << N_phi_max); + ATH_MSG_INFO("--------> eta_min " << eta_min << " mp " << mp_eta_min << " chl " << cl_eta_min << " wl " << wl_eta_min << " strip " << N_eta_min); + ATH_MSG_INFO("--------> eta_max " << eta_max << " mp " << mp_eta_max << " chl " << cl_eta_max << " wl " << wl_eta_max << " strip " << N_eta_max); + ATH_MSG_INFO("--------> Dphi " << fabs(phi_max-phi_min) << " Deta " << fabs(eta_max-eta_min)); if(aux1==51 && aux3==1) if (phi_min < 0) phi_min += 2.*M_PI; if(aux1==51 && aux3==1) if (phi_max < 0) phi_max += 2.*M_PI; @@ -3071,7 +3027,7 @@ void MuonGMCheck::testRpcCache_here() dbr_index, dbz_index); - if (rpc == NULL) { + if (!rpc) { continue; } nre++; @@ -3079,7 +3035,7 @@ void MuonGMCheck::testRpcCache_here() Identifier idr = rpc->identify(); - ATH_MSG_DEBUG("Filling cache for rpcRE n "<<nre<<" "<<m_muonIdHelperTool->rpcIdHelper().show_to_string(idr) ); + ATH_MSG_DEBUG("Filling cache for rpcRE n "<<nre<<" "<<m_idHelperSvc->rpcIdHelper().show_to_string(idr) ); rpc->fillCache(); } } @@ -3117,10 +3073,10 @@ void MuonGMCheck::testTgcCache_here() TgcReadoutElement* tgc = p_MuonMgr->getTgcReadoutElement(sname_index, seta_index, sphi_index); - if (tgc == NULL) continue; + if (!tgc) continue; nre++; Identifier idr = tgc->identify(); - ATH_MSG_DEBUG(" Filling cache for tgcRE n. "<<nre<<" "<<m_muonIdHelperTool->tgcIdHelper().show_to_string(idr) ); + ATH_MSG_DEBUG(" Filling cache for tgcRE n. "<<nre<<" "<<m_idHelperSvc->tgcIdHelper().show_to_string(idr) ); tgc->fillCache(); } } @@ -3158,12 +3114,12 @@ void MuonGMCheck::testCscCache_here() seta_index, sphi_index, ml); - if (csc == NULL) continue; + if (!csc) continue; nre++; Identifier idr = csc->identify(); - ATH_MSG_DEBUG(" Filling cache for cscRE n. "<<nre<<" "<<m_muonIdHelperTool->cscIdHelper().show_to_string(idr) ); + ATH_MSG_DEBUG(" Filling cache for cscRE n. "<<nre<<" "<<m_idHelperSvc->cscIdHelper().show_to_string(idr) ); csc->fillCache(); } } @@ -3202,12 +3158,12 @@ void MuonGMCheck::testMdtCache_here() dbr_index); - if (mdt == NULL) continue; + if (!mdt) continue; nre++; Identifier idr = mdt->identify(); - ATH_MSG_DEBUG(" Filling cache for mdtRE n. "<<nre<<" "<<m_muonIdHelperTool->mdtIdHelper().show_to_string(idr) ); + ATH_MSG_DEBUG(" Filling cache for mdtRE n. "<<nre<<" "<<m_idHelperSvc->mdtIdHelper().show_to_string(idr) ); mdt->fillCache(); } // end of multilayer } // end of stPhi @@ -3220,10 +3176,10 @@ void MuonGMCheck::testMdtCache_here() void MuonGMCheck::testMdtDetectorElementHash() { ATH_MSG_INFO(" start running " ); - std::vector<Identifier>::const_iterator idfirst = m_muonIdHelperTool->mdtIdHelper().detectorElement_begin(); - std::vector<Identifier>::const_iterator idlast = m_muonIdHelperTool->mdtIdHelper().detectorElement_end(); + std::vector<Identifier>::const_iterator idfirst = m_idHelperSvc->mdtIdHelper().detectorElement_begin(); + std::vector<Identifier>::const_iterator idlast = m_idHelperSvc->mdtIdHelper().detectorElement_end(); - IdContext mdtDetElemContext = m_muonIdHelperTool->mdtIdHelper().detectorElement_context(); + IdContext mdtDetElemContext = m_idHelperSvc->mdtIdHelper().detectorElement_context(); std::ofstream fout0("testDEtElemHash_MDT.txt"); fout0 <<"MDT ExtendedId HashId Etamin Etamax Phimin Phimax "<<std::endl; @@ -3233,8 +3189,8 @@ void MuonGMCheck::testMdtDetectorElementHash() { Identifier Id = *i; IdentifierHash Idhash; - int gethash_code = m_muonIdHelperTool->mdtIdHelper().get_hash(Id, Idhash, &mdtDetElemContext); - std::string extid = m_muonIdHelperTool->mdtIdHelper().show_to_string(Id); + int gethash_code = m_idHelperSvc->mdtIdHelper().get_hash(Id, Idhash, &mdtDetElemContext); + std::string extid = m_idHelperSvc->mdtIdHelper().show_to_string(Id); ATH_MSG_DEBUG("MDT Identifier = "<<extid ); if (gethash_code == 0) ATH_MSG_DEBUG(" its hash Id is "<<Idhash ); else ATH_MSG_ERROR(" hash Id NOT computed "<<Idhash<<" for Id "<<extid ); @@ -3266,7 +3222,7 @@ void MuonGMCheck::testMdtDetectorElementHash() ATH_MSG_VERBOSE(extid<<" hash Id "<<Idhash<<" new format "<<new_extid ); const MdtReadoutElement* mdt = p_MuonMgr->getMdtReadoutElement(Idhash); - if (mdt == NULL) + if (!mdt) { ATH_MSG_ERROR("MuonManager->getMdtReadoutElement(Idhash) fails ! for id = "<<extid<<" detElemhash "<<Idhash ); continue; @@ -3312,10 +3268,10 @@ void MuonGMCheck::testMdtDetectorElementHash() void MuonGMCheck::testRpcDetectorElementHash() { ATH_MSG_INFO(" start running " ); - std::vector<Identifier>::const_iterator idfirst = m_muonIdHelperTool->rpcIdHelper().detectorElement_begin(); - std::vector<Identifier>::const_iterator idlast = m_muonIdHelperTool->rpcIdHelper().detectorElement_end(); + std::vector<Identifier>::const_iterator idfirst = m_idHelperSvc->rpcIdHelper().detectorElement_begin(); + std::vector<Identifier>::const_iterator idlast = m_idHelperSvc->rpcIdHelper().detectorElement_end(); - IdContext rpcDetElemContext = m_muonIdHelperTool->rpcIdHelper().detectorElement_context(); + IdContext rpcDetElemContext = m_idHelperSvc->rpcIdHelper().detectorElement_context(); std::ofstream fout0("testDEtElemHash_RPC.txt"); fout0 <<"RPC ExtendedId HashId Etamin Etamax Phimin Phimax "<<std::endl; @@ -3325,8 +3281,8 @@ void MuonGMCheck::testRpcDetectorElementHash() { Identifier Id = *i; IdentifierHash Idhash; - int gethash_code = m_muonIdHelperTool->rpcIdHelper().get_hash(Id, Idhash, &rpcDetElemContext); - std::string extid = m_muonIdHelperTool->rpcIdHelper().show_to_string(Id); + int gethash_code = m_idHelperSvc->rpcIdHelper().get_hash(Id, Idhash, &rpcDetElemContext); + std::string extid = m_idHelperSvc->rpcIdHelper().show_to_string(Id); ATH_MSG_DEBUG("RPC Identifier = "<<extid ); if (gethash_code == 0) ATH_MSG_DEBUG(" its hash Id is "<<Idhash ); else ATH_MSG_ERROR(" hash Id NOT computed "<<Idhash ); @@ -3352,7 +3308,7 @@ void MuonGMCheck::testRpcDetectorElementHash() ATH_MSG_VERBOSE(extid<<" hash Id "<<Idhash<<" new format "<<new_extid ); const RpcReadoutElement* rpc = p_MuonMgr->getRpcReadoutElement(Idhash); - if (rpc == NULL) + if (!rpc) { ATH_MSG_ERROR("MuonManager->getRpcReadoutElement(Idhash) fails ! for id = "<<extid<<" detElemhash "<<Idhash ); continue; @@ -3401,10 +3357,10 @@ void MuonGMCheck::testTgcDetectorElementHash() { ATH_MSG_INFO(" start running " ); - std::vector<Identifier>::const_iterator idfirst = m_muonIdHelperTool->tgcIdHelper().detectorElement_begin(); - std::vector<Identifier>::const_iterator idlast = m_muonIdHelperTool->tgcIdHelper().detectorElement_end(); + std::vector<Identifier>::const_iterator idfirst = m_idHelperSvc->tgcIdHelper().detectorElement_begin(); + std::vector<Identifier>::const_iterator idlast = m_idHelperSvc->tgcIdHelper().detectorElement_end(); - IdContext tgcDetElemContext = m_muonIdHelperTool->tgcIdHelper().detectorElement_context(); + IdContext tgcDetElemContext = m_idHelperSvc->tgcIdHelper().detectorElement_context(); std::ofstream fout0("testDEtElemHash_TGC.txt"); fout0 <<"TGC ExtendedId HashId Etamin Etamax Phimin Phimax "<<std::endl; @@ -3414,8 +3370,8 @@ void MuonGMCheck::testTgcDetectorElementHash() { Identifier Id = *i; IdentifierHash Idhash; - int gethash_code = m_muonIdHelperTool->tgcIdHelper().get_hash(Id, Idhash, &tgcDetElemContext); - std::string extid = m_muonIdHelperTool->tgcIdHelper().show_to_string(Id); + int gethash_code = m_idHelperSvc->tgcIdHelper().get_hash(Id, Idhash, &tgcDetElemContext); + std::string extid = m_idHelperSvc->tgcIdHelper().show_to_string(Id); ATH_MSG_DEBUG("TGC Identifier = "<<extid ); if (gethash_code == 0) ATH_MSG_DEBUG(" its hash Id is "<<Idhash ); else ATH_MSG_ERROR(" hash Id NOT computed "<<Idhash ); @@ -3441,7 +3397,7 @@ void MuonGMCheck::testTgcDetectorElementHash() ATH_MSG_VERBOSE(extid<<" hash Id "<<Idhash<<" new format "<<new_extid ); const TgcReadoutElement* tgc = p_MuonMgr->getTgcReadoutElement(Idhash); - if (tgc == NULL) + if (!tgc) { ATH_MSG_ERROR("MuonManager->getTgcReadoutElement(Idhash) fails ! for id = "<<extid<<" detElemhash "<<Idhash ); continue; @@ -3487,10 +3443,10 @@ void MuonGMCheck::testCscDetectorElementHash() { ATH_MSG_INFO(" start running " ); - std::vector<Identifier>::const_iterator idfirst = m_muonIdHelperTool->cscIdHelper().detectorElement_begin(); - std::vector<Identifier>::const_iterator idlast = m_muonIdHelperTool->cscIdHelper().detectorElement_end(); + std::vector<Identifier>::const_iterator idfirst = m_idHelperSvc->cscIdHelper().detectorElement_begin(); + std::vector<Identifier>::const_iterator idlast = m_idHelperSvc->cscIdHelper().detectorElement_end(); - IdContext cscDetElemContext = m_muonIdHelperTool->cscIdHelper().detectorElement_context(); + IdContext cscDetElemContext = m_idHelperSvc->cscIdHelper().detectorElement_context(); std::ofstream fout0("testDEtElemHash_CSC.txt"); fout0 <<"CSC ExtendedId HashId Etamin Etamax Phimin Phimax "<<std::endl; @@ -3500,8 +3456,8 @@ void MuonGMCheck::testCscDetectorElementHash() { Identifier Id = *i; IdentifierHash Idhash; - int gethash_code = m_muonIdHelperTool->cscIdHelper().get_hash(Id, Idhash, &cscDetElemContext); - std::string extid = m_muonIdHelperTool->cscIdHelper().show_to_string(Id); + int gethash_code = m_idHelperSvc->cscIdHelper().get_hash(Id, Idhash, &cscDetElemContext); + std::string extid = m_idHelperSvc->cscIdHelper().show_to_string(Id); ATH_MSG_DEBUG("CSC Identifier = "<<extid ); if (gethash_code == 0) ATH_MSG_DEBUG(" its hash Id is "<<Idhash ); else ATH_MSG_ERROR(" hash Id NOT computed "<<Idhash ); @@ -3527,7 +3483,7 @@ void MuonGMCheck::testCscDetectorElementHash() ATH_MSG_VERBOSE(extid<<" hash Id "<<Idhash<<" new format "<<new_extid ); const CscReadoutElement* csc = p_MuonMgr->getCscReadoutElement(Idhash); - if (csc == NULL) + if (!csc) { ATH_MSG_ERROR("MuonManager->getCscReadoutElement(Idhash) fails ! for id = "<<extid<<" detElemhash "<<Idhash ); continue; diff --git a/MuonSpectrometer/MuonReconstruction/MuonRecEvent/MuonPrepRawData/MuonPrepRawData/MdtPrepData.h b/MuonSpectrometer/MuonReconstruction/MuonRecEvent/MuonPrepRawData/MuonPrepRawData/MdtPrepData.h index 193c946af02b0d0e0d7623c27afdf43edc7cc8b2..8c1bda70f6e8094f043403343747526b565ac3f3 100755 --- a/MuonSpectrometer/MuonReconstruction/MuonRecEvent/MuonPrepRawData/MuonPrepRawData/MdtPrepData.h +++ b/MuonSpectrometer/MuonReconstruction/MuonRecEvent/MuonPrepRawData/MuonPrepRawData/MdtPrepData.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ /////////////////////////////////////////////////////////////////// @@ -27,10 +27,6 @@ class MdtPrepDataContainerCnv; -namespace MuonGM { - class MdtReadoutElement; -} - namespace Muon { diff --git a/MuonSpectrometer/MuonReconstruction/MuonRecExample/share/MuonRDO_to_PRD_jobOptions.py b/MuonSpectrometer/MuonReconstruction/MuonRecExample/share/MuonRDO_to_PRD_jobOptions.py index 6705ccdb8053f9caa6ff12ee495f23a674d4edf2..f54c01917e3e5f30790f3fb6f5104cf949f41598 100644 --- a/MuonSpectrometer/MuonReconstruction/MuonRecExample/share/MuonRDO_to_PRD_jobOptions.py +++ b/MuonSpectrometer/MuonReconstruction/MuonRecExample/share/MuonRDO_to_PRD_jobOptions.py @@ -28,6 +28,8 @@ if MuonGeometryFlags.hasCSC() and muonRecFlags.doCSCs() and DetFlags.makeRIO.CSC if muonRecFlags.doMDTs() and DetFlags.makeRIO.MDT_on() and (DetFlags.haveRDO.MDT_on() or DetFlags.digitize.MDT_on()): topSequence += getAlgorithm("MdtRdoToMdtPrepData", tryDefaultConfigurable=True) topSequence.MdtRdoToMdtPrepData.DecodingTool = MdtPrepDataProviderTool() + from RegionSelector.RegSelToolConfig import makeRegSelTool_MDT + topSequence.MdtRdoToMdtPrepData.RegSel_MDT = makeRegSelTool_MDT() if muonRecFlags.doRPCs() and DetFlags.makeRIO.RPC_on() and (DetFlags.haveRDO.RPC_on() or DetFlags.digitize.RPC_on()): topSequence += getAlgorithm("RpcRdoToRpcPrepData", tryDefaultConfigurable=True ) diff --git a/MuonSpectrometer/MuonReconstruction/MuonRecTools/MuonTruthTools/CMakeLists.txt b/MuonSpectrometer/MuonReconstruction/MuonRecTools/MuonTruthTools/CMakeLists.txt index 077eae0f42d98df17f1c45e22afc59b4cc94f0dd..f323bc02c0d2c47dffdc769421d754fc0c3cc015 100644 --- a/MuonSpectrometer/MuonReconstruction/MuonRecTools/MuonTruthTools/CMakeLists.txt +++ b/MuonSpectrometer/MuonReconstruction/MuonRecTools/MuonTruthTools/CMakeLists.txt @@ -51,4 +51,4 @@ atlas_add_component( MuonTruthTools MuonRecToolInterfaces MuonTrackMakerUtils MuonSimData TrkDetElementBase TrkSurfaces TrkMeasurementBase TrkParameters TrkPrepRawData TrkPseudoMeasurementOnTrack TrkRIO_OnTrack TrkSegment TrkTrack TrkTruthData - TrkExInterfaces TrkFitterInterfaces ) + TrkExInterfaces TrkFitterInterfaces TrackRecordLib ) diff --git a/MuonSpectrometer/MuonTruthAlgs/CMakeLists.txt b/MuonSpectrometer/MuonTruthAlgs/CMakeLists.txt index 17fd949e4842dc53c2b35e13700e3cc358e29402..16edeb80c4b2cf55019860f4e1479f98ac77b38d 100644 --- a/MuonSpectrometer/MuonTruthAlgs/CMakeLists.txt +++ b/MuonSpectrometer/MuonTruthAlgs/CMakeLists.txt @@ -61,7 +61,7 @@ atlas_add_component( MuonTruthAlgs src/*.cxx src/components/*.cxx INCLUDE_DIRS - LINK_LIBRARIES AtlasHepMCLib StoreGateLib SGtests Identifier GaudiKernel MuonPrepRawData MuonRecToolInterfaces MuonSimData TrkTrack TrkTruthData TrkToolInterfaces AthenaBaseComps AthLinks AthContainers AtlasDetDescr EventPrimitives xAODMuon xAODTracking xAODTruth GeneratorObjects MuonReadoutGeometry MuonGeoModelLib MuonIdHelpersLib MuonCompetingRIOsOnTrack MuonPattern MuonRIO_OnTrack MuonSegment MuonRecHelperToolsLib MCTruthClassifierLib Particle ParticleTruth TrkDetElementBase TrkGeometry TrkSurfaces TrkCompetingRIOsOnTrack TrkEventUtils TrkMeasurementBase TrkParameters TrkPrepRawData TrkPseudoMeasurementOnTrack TrkRIO_OnTrack TrkSegment TrkExInterfaces TrkFitterInterfaces ) + LINK_LIBRARIES AtlasHepMCLib StoreGateLib SGtests Identifier GaudiKernel MuonPrepRawData MuonRecToolInterfaces MuonSimData TrkTrack TrkTruthData TrkToolInterfaces AthenaBaseComps AthLinks AthContainers AtlasDetDescr EventPrimitives xAODMuon xAODTracking xAODTruth GeneratorObjects MuonReadoutGeometry MuonGeoModelLib MuonIdHelpersLib MuonCompetingRIOsOnTrack MuonPattern MuonRIO_OnTrack MuonSegment MuonRecHelperToolsLib MCTruthClassifierLib Particle ParticleTruth TrkDetElementBase TrkGeometry TrkSurfaces TrkCompetingRIOsOnTrack TrkEventUtils TrkMeasurementBase TrkParameters TrkPrepRawData TrkPseudoMeasurementOnTrack TrkRIO_OnTrack TrkSegment TrkExInterfaces TrkFitterInterfaces TrackRecordLib ) # Install files from the package: atlas_install_headers( MuonTruthAlgs ) diff --git a/MuonSpectrometer/MuonValidation/MuonDQA/MuonCalibMonitoring/src/CscCalibMonToolBase.cxx b/MuonSpectrometer/MuonValidation/MuonDQA/MuonCalibMonitoring/src/CscCalibMonToolBase.cxx index c5ae193554ce9a1adf129ee45c0301a3fdd447ee..2e0aa7acd14698efb19c01aa8412ded512e1743e 100755 --- a/MuonSpectrometer/MuonValidation/MuonDQA/MuonCalibMonitoring/src/CscCalibMonToolBase.cxx +++ b/MuonSpectrometer/MuonValidation/MuonDQA/MuonCalibMonitoring/src/CscCalibMonToolBase.cxx @@ -58,8 +58,6 @@ StatusCode CscCalibMonToolBase::initialize() ATH_MSG_INFO( "CscCalibMonToolBase : in initialize()" ); ATH_CHECK( m_idHelperSvc.retrieve() ); - ATH_MSG_DEBUG( " Found the MuonIdHelperTool. " ); - ATH_CHECK( m_readKey.initialize() ); //m_generic_path_csccalibmonitoring = "Muon/MuonCalibrationMonitoring/CSC"; diff --git a/MuonSpectrometer/MuonValidation/MuonDQA/MuonDQAMonitoring/python/MuonDQAMonitoringConfig.py b/MuonSpectrometer/MuonValidation/MuonDQA/MuonDQAMonitoring/python/MuonDQAMonitoringConfig.py index 3120285fc856a7e4604a3a7b316e026f7e1e02e9..631bb29d22ae6422ad3ca11ba03475fb80d80f63 100644 --- a/MuonSpectrometer/MuonValidation/MuonDQA/MuonDQAMonitoring/python/MuonDQAMonitoringConfig.py +++ b/MuonSpectrometer/MuonValidation/MuonDQA/MuonDQAMonitoring/python/MuonDQAMonitoringConfig.py @@ -2,24 +2,24 @@ # Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration # def MuonDQAMonitoringConfig(flags): - print("entering muon daq") from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator result = ComponentAccumulator() - if flags.DQ.Steering.Muon.doRawMon and False: + if flags.DQ.Steering.Muon.doRawMon: # do not run in RAW->ESD, or AOD-only if flags.DQ.Environment not in ('tier0Raw', 'AOD'): from MdtRawDataMonitoring.MDTMonitorAlgorithm import MdtMonitoringConfig from RpcRawDataMonitoring.RpcMonitorAlgorithm import RpcMonitoringConfig + from TgcRawDataMonitoring.TgcRawDataMonitorAlgorithm import TgcRawDataMonitoringConfig result.merge(MdtMonitoringConfig(flags)) result.merge(RpcMonitoringConfig(flags)) - - from TgcRawDataMonitoring.TgcRawDataMonitorAlgorithm import TgcRawDataMonitoringConfig - result.merge(TgcRawDataMonitoringConfig(flags)) + result.merge(TgcRawDataMonitoringConfig(flags)) if flags.DQ.Steering.Muon.doTrackMon: - from MuonTrackMonitoring.MuonTrackMonitorAlgorithm import MuonTrackConfig - result.merge(MuonTrackConfig(flags)) + # do not run in RAW->ESD + if flags.DQ.Environment not in ('tier0Raw',): + from MuonTrackMonitoring.MuonTrackMonitorAlgorithm import MuonTrackConfig + result.merge(MuonTrackConfig(flags)) return result diff --git a/MuonSpectrometer/MuonValidation/MuonDQA/MuonDQAMonitoring/share/MuonDetMonitoring.py b/MuonSpectrometer/MuonValidation/MuonDQA/MuonDQAMonitoring/share/MuonDetMonitoring.py index ae01ee5ff721c392090f227db20b86cfc7cc54a1..575c4422d28c5211977c28f706adf98030a7fec3 100644 --- a/MuonSpectrometer/MuonValidation/MuonDQA/MuonDQAMonitoring/share/MuonDetMonitoring.py +++ b/MuonSpectrometer/MuonValidation/MuonDQA/MuonDQAMonitoring/share/MuonDetMonitoring.py @@ -161,6 +161,16 @@ if DQMonFlags.doMuonSegmentMon(): except Exception: treatException("DataQualitySteering_jobOptions.py: exception when setting up Muon CSC segment monitoring") +#------------- ---------# +# Muon track monitoring # +#------------- ---------# +if DQMonFlags.doMuonTrackMon(): + if MuonESDMon: + try: + from MuonTrackMonitoring.MuonTrackMonitorAlgorithm import MuonTrackConfig + topSequence += MuonTrackConfig(DQMonFlags,isOld=True) + except Exception: + treatException("DataQualitySteering_jobOptions.py: exception when setting up Muon track monitoring") #-------------------------# # Muon physics monitoring # diff --git a/MuonSpectrometer/MuonValidation/MuonDQA/MuonDQAUtils/src/InsituTrackTools.cxx b/MuonSpectrometer/MuonValidation/MuonDQA/MuonDQAUtils/src/InsituTrackTools.cxx index 968f750f11eced0ca3b7443088026ddfd82c9a2f..64f6d8159920607a7963ccc66c208dd6a5c65b89 100755 --- a/MuonSpectrometer/MuonValidation/MuonDQA/MuonDQAUtils/src/InsituTrackTools.cxx +++ b/MuonSpectrometer/MuonValidation/MuonDQA/MuonDQAUtils/src/InsituTrackTools.cxx @@ -27,7 +27,7 @@ namespace Muon { if (isCloseTrack(track1, track2)==true) return false; /// Invariant mass cut - if (std::fabs(getInvariantMass(track1, track2)-91187.6)>m_MaximalMassDifferenceToZBoson) return false; + if (std::abs(getInvariantMass(track1, track2)-91187.6)>m_MaximalMassDifferenceToZBoson) return false; if ((isIsolatedTrack(track1)==true) && (isIsolatedTrack(track2)==true)) return true; return false; @@ -86,8 +86,8 @@ namespace Muon { double InsituTrackTools::getDistance(const INavigable4Momentum *track1, const INavigable4Momentum *track2) { - double dphi = std::fabs(track1->phi()-track2->phi()); - if (dphi>M_PI) dphi = std::fabs(dphi-2.0*M_PI); + double dphi = std::abs(track1->phi()-track2->phi()); + if (dphi>M_PI) dphi = std::abs(dphi-2.0*M_PI); return std::sqrt(std::pow(track1->eta()-track2->eta(),2)+std::pow(dphi,2)); } diff --git a/MuonSpectrometer/MuonValidation/MuonDQA/MuonDQAUtils/src/MuonChamberNameConverter.cxx b/MuonSpectrometer/MuonValidation/MuonDQA/MuonDQAUtils/src/MuonChamberNameConverter.cxx index 14341efcd198b087a2689fa24b1f71ee7ca8abb0..9ca7a4e8f482ab734c9cbca9c73ab2637a9a9ba9 100755 --- a/MuonSpectrometer/MuonValidation/MuonDQA/MuonDQAUtils/src/MuonChamberNameConverter.cxx +++ b/MuonSpectrometer/MuonValidation/MuonDQA/MuonDQAUtils/src/MuonChamberNameConverter.cxx @@ -125,7 +125,7 @@ std::string convertChamberName(int ChamberName , int ChamberEta , int ChamberPhi } std::stringstream eta_inttostring; std::string eta_str; - eta_inttostring << abs(Eta_int); + eta_inttostring << std::abs(Eta_int); eta_inttostring >> eta_str; Eta_string += eta_str; Eta_string += "C"; diff --git a/MuonSpectrometer/MuonValidation/MuonDQA/MuonDQAUtils/src/MuonDQAFitFunc.cxx b/MuonSpectrometer/MuonValidation/MuonDQA/MuonDQAUtils/src/MuonDQAFitFunc.cxx index c752a45e4e8d72366989cb2550ba6bc7e8264e0d..70a39a59e254121e40232a8862e41a549585c8ee 100755 --- a/MuonSpectrometer/MuonValidation/MuonDQA/MuonDQAUtils/src/MuonDQAFitFunc.cxx +++ b/MuonSpectrometer/MuonValidation/MuonDQA/MuonDQAUtils/src/MuonDQAFitFunc.cxx @@ -53,8 +53,8 @@ namespace Muon { hmass->SetBinError(i+1,mass_error); hwidth->SetBinContent(i+1,width); hwidth->SetBinError(i+1,width_error); - if( (std::fabs(mass)+mass_error)>maxmass ) maxmass=std::fabs(mass)+mass_error; - if( (std::fabs(width)+width_error)>maxwidth ) maxwidth=std::fabs(width)+width_error; + if( (std::abs(mass)+mass_error)>maxmass ) maxmass=std::abs(mass)+mass_error; + if( (std::abs(width)+width_error)>maxwidth ) maxwidth=std::abs(width)+width_error; } } if (maxmass>0.1) maxmass=0.1; @@ -232,11 +232,7 @@ namespace Muon { //calculating the RMS from the above quantities float rms = (float)binerr*(std::sqrt(binentries)); -#if ROOT_VERSION_CODE >= ROOT_VERSION(6,0,0) hRms_char->SetCanExtend(TH1::kAllAxes); -#else - hRms_char->SetBit(TH1::kCanRebin); -#endif hRms_char->Fill(BinLabel_char,rms); } // Loop over bins diff --git a/MuonSpectrometer/MuonValidation/MuonDQA/MuonDQAUtils/src/MuonPTResolution.cxx b/MuonSpectrometer/MuonValidation/MuonDQA/MuonDQAUtils/src/MuonPTResolution.cxx index a200ff91924298bd1a320cdc8a441438bd1422bd..99c0310a6c590df143de8729aefe559def721159 100755 --- a/MuonSpectrometer/MuonValidation/MuonDQA/MuonDQAUtils/src/MuonPTResolution.cxx +++ b/MuonSpectrometer/MuonValidation/MuonDQA/MuonDQAUtils/src/MuonPTResolution.cxx @@ -81,19 +81,19 @@ void getMuonPTResolution( TH1F *hist, hist->Fit(&gaussian,"R"); gaussian.GetParameters(&par[0]); mean = par[1]; - sigma = fabs(par[2]); + sigma = std::abs(par[2]); gaussian.SetRange(mean-sigma*2.,mean+sigma*2.); // Check if converged, if yes then quit - if (fabs(1.0-old_sigma/sigma)<0.0001) break; + if (std::abs(1.0-old_sigma/sigma)<0.0001) break; old_sigma=sigma; } PTResMean = mean; - PTSigma = fabs(sigma); + PTSigma = std::abs(sigma); ErrMean = (gaussian.GetParError(1)); - ErrSigma = fabs((gaussian.GetParError(2))); + ErrSigma = std::abs((gaussian.GetParError(2))); int i=0; double TailContent=0; diff --git a/MuonSpectrometer/MuonValidation/MuonDQA/MuonPhysValMonitoring/src/MuonPhysValMonitoringTool.cxx b/MuonSpectrometer/MuonValidation/MuonDQA/MuonPhysValMonitoring/src/MuonPhysValMonitoringTool.cxx index 54b97ae43fdfd3fb4c15e2d33c2373be9888be2e..e0760b9afdc0418e7cb787d1e0b9c0d7c9d0c262 100644 --- a/MuonSpectrometer/MuonValidation/MuonDQA/MuonPhysValMonitoring/src/MuonPhysValMonitoringTool.cxx +++ b/MuonSpectrometer/MuonValidation/MuonDQA/MuonPhysValMonitoring/src/MuonPhysValMonitoringTool.cxx @@ -1,7 +1,5 @@ - ///////////////////////// -*- C++ -*- ///////////////////////////// - /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ // MuonPhysValMonitoringTool.cxx @@ -466,7 +464,7 @@ StatusCode MuonPhysValMonitoringTool::fillHistograms() if (M<66000 || M>116000) continue; //choose the Z candidate closest to the Z pole - if multiple exist - float dM = fabs(M-91187.); + float dM = std::abs(M-91187.); if (dM>dMmin) continue; dMmin = dM; mZ=M; @@ -612,7 +610,7 @@ StatusCode MuonPhysValMonitoringTool::fillHistograms() else ATH_MSG_DEBUG("Chain "<<L1trig <<" is passed: NO"); } for (auto mu: m_vRecoMuons) { - if (passesAcceptanceCuts(mu) && fabs(mu->eta())<2.4 ) { + if (passesAcceptanceCuts(mu) && std::abs(mu->eta())<2.4 ) { if (mu->author()==1) { m_vRecoMuons_EffDen_CB.push_back(mu); ATH_MSG_DEBUG("##### m_vRecoMuons_EffDen_CB pt:"<< mu->pt()<<" phi:"<<mu->phi()<<" eta:"<< mu->eta()); @@ -846,7 +844,7 @@ StatusCode MuonPhysValMonitoringTool::fillHistograms() if ((((*mufeat.cptr())[i]->author())==m_SelectedAuthor)&& (deltaR((*mufeat.cptr())[i],m_vRecoMuons_EffDen.at(k))<0.1) ) { break_flag=true; ATH_MSG_DEBUG(" $$$ match Reco_EffDen "<<muonItem<<" pt: "<< m_vRecoMuons_EffDen.at(k)->pt()<< " eta: "<<m_vRecoMuons_EffDen.at(k)->eta()<< " phi: "<<m_vRecoMuons_EffDen.at(k)->phi()<< " author: "<< m_vRecoMuons_EffDen.at(k)->author()); - ATH_MSG_DEBUG(" $$$ match EF MuidCo feature "<<muonItem<<" pt: "<< (*mufeat.cptr())[i]->pt()<< " eta: "<<(*mufeat.cptr())[i]->eta()<< " phi: "<<(*mufeat.cptr())[i]->phi()<< " author: "<< (*mufeat.cptr())[i]->author() << " rel_p "<< ( fabs(((*mufeat.cptr())[i]->pt()-m_vRecoMuons_EffDen.at(k)->pt())/(m_vRecoMuons_EffDen.at(k)->pt()))) ); + ATH_MSG_DEBUG(" $$$ match EF MuidCo feature "<<muonItem<<" pt: "<< (*mufeat.cptr())[i]->pt()<< " eta: "<<(*mufeat.cptr())[i]->eta()<< " phi: "<<(*mufeat.cptr())[i]->phi()<< " author: "<< (*mufeat.cptr())[i]->author() << " rel_p "<< ( std::abs(((*mufeat.cptr())[i]->pt()-m_vRecoMuons_EffDen.at(k)->pt())/(m_vRecoMuons_EffDen.at(k)->pt()))) ); for (unsigned int j=0; j<m_selectMuonCategories.size(); j++) { if (m_selectMuonCategories[j]==ALL) { m_TriggerMuonValidationPlots[j]->fillNumEff(*m_vRecoMuons_EffDen.at(k), muonItem); @@ -1271,7 +1269,7 @@ void MuonPhysValMonitoringTool::handleMuonTrack(const xAOD::TrackParticle* tp, x if (m_selectMuonCategories[i]==ALL || m_selectMuonCategories[i]==thisMuonCategory) { if (type==xAOD::Muon::InnerDetectorTrackParticle) { - if (m_fwdtracksName!="" && fabs((*truthLink)->eta())>2.5) m_muonIDForwardTrackValidationPlots[i]->fill(*truthLink, tp); + if (m_fwdtracksName!="" && std::abs((*truthLink)->eta())>2.5) m_muonIDForwardTrackValidationPlots[i]->fill(*truthLink, tp); else if (m_tracksName!="") { m_muonIDTrackValidationPlots[i]->fill(*truthLink, tp); if (passesMuonTrackSel) m_muonIDSelectedTrackValidationPlots[i]->fill(*truthLink,tp); @@ -1325,7 +1323,7 @@ void MuonPhysValMonitoringTool::L2SATriggerResolution(){ ATH_MSG_DEBUG(":: TEST: listing all Recomu pt="<<m_vRecoMuons.at(i)->pt()<<" eta=" <<m_vRecoMuons.at(i)->eta()<<" phi="<<m_vRecoMuons.at(i)->phi()<<" auth="<<m_vRecoMuons.at(i)->author()); } for (unsigned int i=0; i<m_vRecoMuons.size(); i++){ - if ((m_vRecoMuons.at(i)->author()!=1)||(fabs(m_vRecoMuons.at(i)->eta())>2.4)) continue; + if ((m_vRecoMuons.at(i)->author()!=1)||(std::abs(m_vRecoMuons.at(i)->eta())>2.4)) continue; ATH_MSG_DEBUG(":::: TEST: Recomu pt="<<m_vRecoMuons.at(i)->pt()<<" eta=" <<m_vRecoMuons.at(i)->eta()<<" phi="<<m_vRecoMuons.at(i)->phi()<<" auth="<<m_vRecoMuons.at(i)->author()); k_L2SAMu_MinDeltaR=-1; MinDeltaR=1000; @@ -1367,7 +1365,7 @@ void MuonPhysValMonitoringTool::L2CBTriggerResolution(){ ATH_MSG_DEBUG(":: TEST: listing all Recomu pt="<<m_vRecoMuons.at(i)->pt()<<" eta=" <<m_vRecoMuons.at(i)->eta()<<" phi="<<m_vRecoMuons.at(i)->phi()<<" auth="<<m_vRecoMuons.at(i)->author()); } for (unsigned int i=0; i<m_vRecoMuons.size(); i++){ - if ((m_vRecoMuons.at(i)->author()!=1)||(fabs(m_vRecoMuons.at(i)->eta())>2.4)) continue; + if ((m_vRecoMuons.at(i)->author()!=1)||(std::abs(m_vRecoMuons.at(i)->eta())>2.4)) continue; ATH_MSG_DEBUG(":::: TEST: Recomu pt="<<m_vRecoMuons.at(i)->pt()<<" eta=" <<m_vRecoMuons.at(i)->eta()<<" phi="<<m_vRecoMuons.at(i)->phi()<<" auth="<<m_vRecoMuons.at(i)->author()); k_L2CBMu_MinDeltaR=-1; MinDeltaR=1000; @@ -1424,7 +1422,7 @@ ATH_MSG_DEBUG(" m_vEFMuons.size()"<<m_vEFMuons.size()); ATH_MSG_DEBUG(":: TEST: listing all Recomu pt="<<m_vRecoMuons.at(i)->pt()<<" eta=" <<m_vRecoMuons.at(i)->eta()<<" phi="<<m_vRecoMuons.at(i)->phi()<<" auth="<<m_vRecoMuons.at(i)->author()); } for (unsigned int i=0; i<m_vRecoMuons.size(); i++){ - if ((m_vRecoMuons.at(i)->author()!=1)||(fabs(m_vRecoMuons.at(i)->eta())>2.4)) continue; + if ((m_vRecoMuons.at(i)->author()!=1)||(std::abs(m_vRecoMuons.at(i)->eta())>2.4)) continue; ATH_MSG_DEBUG(":::: TEST: Recomu pt="<<m_vRecoMuons.at(i)->pt()<<" eta=" <<m_vRecoMuons.at(i)->eta()<<" phi="<<m_vRecoMuons.at(i)->phi()<<" auth="<<m_vRecoMuons.at(i)->author()); for (unsigned int l=0; l<vAvailableAuthors.size(); l++){ k_EFMu_MinDeltaR=-1; @@ -1573,7 +1571,7 @@ MuonPhysValMonitoringTool::MUCATEGORY MuonPhysValMonitoringTool::getMuonSegmentT truthLink = truthMuSeg->auxdata<TruthLink>("truthParticleLink"); if (truthLink.isValid()) { int theBarcode = (*truthLink)->barcode(); - if (abs( (*truthLink)->pdgId() ) != 13) return REST; + if (std::abs( (*truthLink)->pdgId() ) != 13) return REST; for (const auto muTruthPart: *muonTruthContainer) { if (muTruthPart->barcode() == theBarcode) { @@ -1897,54 +1895,10 @@ void MuonPhysValMonitoringTool::modifyHistogram(TH1* hist) } -// std::vector<const xAOD::TrackParticle*> MuonPhysValMonitoringTool::getMatchedTracks(const xAOD::TrackParticleContainer* Tracks) -// { -// std::vector<const xAOD::TrackParticle*> matchedTracks; -// std::vector<const xAOD::TruthParticle*> truthParticles; - -// for (const auto trk: *Tracks){ -// // find if this is a duplicate / fake: - -// float prob = getMatchingProbability(*trk); -// if (prob<0.8) continue; //bad matching prob, probably a fake; - -// const xAOD::TruthParticle* truthMu = findTruthMuon(trk); -// if (!truthMu) continue; -// //loop over accumulated matched tracks -// bool isDuplicate=false; -// for (unsigned int i=0; i<matchedTracks.size(); i++) { -// if (truthMu==truthParticles[i]) { //two tracks pointing to the same truth particle... resolve by truthMatchProbability -// isDuplicate = true; -// if (prob > getMatchingProbability(*matchedTracks[i])) { -// matchedTracks[i] = trk; -// } -// } -// } -// if (!isDuplicate) { -// truthParticles.push_back(truthMu); -// matchedTracks.push_back(trk); -// } -// } -// truthParticles.clear(); -// return matchedTracks; -// } -// const xAOD::TruthParticle* MuonPhysValMonitoringTool::findTruthMuon(const xAOD::TrackParticle* trk) -// { -// if( !trk ) return nullptr; -// if( !trk->isAvailable<TruthLink>("truthParticleLink") ) return nullptr; -// TruthLink truthLink = trk->auxdata<TruthLink>("truthParticleLink"); -// if (!truthLink.isValid()) return nullptr; - -// int truthType = trk->auxdata< int >("truthType"); -// if (truthType<5 || truthType>8) return nullptr; //not muon - -// return (*truthLink); -// } - bool MuonPhysValMonitoringTool::passesAcceptanceCuts(const xAOD::IParticle* prt) { if( prt->pt() < 2000. ) return false; - if( fabs(prt->eta()) > 2.7 ) return false; + if( std::abs(prt->eta()) > 2.7 ) return false; return true; } diff --git a/MuonSpectrometer/MuonValidation/MuonDQA/MuonPhysValMonitoring/src/TriggerMuonValidationPlots.cxx b/MuonSpectrometer/MuonValidation/MuonDQA/MuonPhysValMonitoring/src/TriggerMuonValidationPlots.cxx index 4816df5dcd652930be725de3233db00daf4bc2db..bf6799e79102ff1ac33b70308a821abafe6f8d03 100644 --- a/MuonSpectrometer/MuonValidation/MuonDQA/MuonPhysValMonitoring/src/TriggerMuonValidationPlots.cxx +++ b/MuonSpectrometer/MuonValidation/MuonDQA/MuonPhysValMonitoring/src/TriggerMuonValidationPlots.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ #include "TriggerMuonValidationPlots.h" @@ -185,22 +185,22 @@ void TriggerMuonValidationPlots::fillTriggerMuonPlots(const xAOD::Muon &Trigmu, if (Trigmu.isAuthor( (xAOD::Muon::Author)m_selectedAuthors[i] )) { //if (Trigmu.isAuthor( (xAOD::Muon::Author)m_selectedAuthors[i] ) || m_selectedAuthors[i]==xAOD::Muon::NumberOfMuonAuthors) { m_oEFTriggerMuonResolutionPlots[i]->fill(Trigmu, Recomu); - if(fabs(Recomu.eta())<1.05) m_oEFTriggerMuonBarrelResolutionPlots[i]->fill(Trigmu, Recomu); - if(fabs(Recomu.eta())>1.05) m_oEFTriggerMuonEndcapsResolutionPlots[i]->fill(Trigmu, Recomu); + if(std::abs(Recomu.eta())<1.05) m_oEFTriggerMuonBarrelResolutionPlots[i]->fill(Trigmu, Recomu); + if(std::abs(Recomu.eta())>1.05) m_oEFTriggerMuonEndcapsResolutionPlots[i]->fill(Trigmu, Recomu); } } } void TriggerMuonValidationPlots::fillTriggerMuonPlots(const xAOD::L2StandAloneMuon &L2SAmu, const xAOD::Muon &Recomu) { m_oL2TriggerMuonResolutionPlots[0]->fill(L2SAmu, Recomu); - if(fabs(Recomu.eta())<1.05) m_oL2TriggerMuonBarrelResolutionPlots[0]->fill(L2SAmu, Recomu); - if(fabs(Recomu.eta())>1.05) m_oL2TriggerMuonEndcapsResolutionPlots[0]->fill(L2SAmu, Recomu); + if(std::abs(Recomu.eta())<1.05) m_oL2TriggerMuonBarrelResolutionPlots[0]->fill(L2SAmu, Recomu); + if(std::abs(Recomu.eta())>1.05) m_oL2TriggerMuonEndcapsResolutionPlots[0]->fill(L2SAmu, Recomu); } void TriggerMuonValidationPlots::fillTriggerMuonPlots(const xAOD::L2CombinedMuon &L2CBmu, const xAOD::Muon &Recomu) { m_oL2TriggerMuonResolutionPlots[1]->fill(L2CBmu, Recomu); - if(fabs(Recomu.eta())<1.05) m_oL2TriggerMuonBarrelResolutionPlots[1]->fill(L2CBmu, Recomu); - if(fabs(Recomu.eta())>1.05) m_oL2TriggerMuonEndcapsResolutionPlots[1]->fill(L2CBmu, Recomu); + if(std::abs(Recomu.eta())<1.05) m_oL2TriggerMuonBarrelResolutionPlots[1]->fill(L2CBmu, Recomu); + if(std::abs(Recomu.eta())>1.05) m_oL2TriggerMuonEndcapsResolutionPlots[1]->fill(L2CBmu, Recomu); } diff --git a/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/CscRawDataMonitoring/CscRawDataMonitoring/CSCSegmValAlg.h b/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/CscRawDataMonitoring/CscRawDataMonitoring/CSCSegmValAlg.h index 25015ae43a404617d2d13f0a0ef923f72a69e130..e13ed2a63f064da249da9691e3213b8f5e315503 100755 --- a/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/CscRawDataMonitoring/CscRawDataMonitoring/CSCSegmValAlg.h +++ b/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/CscRawDataMonitoring/CscRawDataMonitoring/CSCSegmValAlg.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ /* ********************************************************************** @@ -19,65 +19,38 @@ #ifndef CSCSegmValAlg_H #define CSCSegmValAlg_H -// Gaudi Tools -#include "GaudiKernel/StatusCode.h" +#include "AthenaMonitoring/ManagedMonitorToolBase.h" #include "GaudiKernel/ServiceHandle.h" #include "GaudiKernel/ToolHandle.h" -#include "GaudiKernel/MsgStream.h" - -// Athena Monitoring -#include "AthenaMonitoring/AthenaMonManager.h" -#include "AthenaMonitoring/ManagedMonitorToolBase.h" -#include "AthenaBaseComps/AthAlgorithm.h" -// Muon Segment #include "MuonSegment/MuonSegment.h" #include "TrkSegment/SegmentCollection.h" - -// Muon Track -#include "TrkParameters/TrackParameters.h" #include "TrkTrack/Track.h" -#include "TrkTrack/TrackCollection.h" -//TDT #include "TrigDecisionTool/TrigDecisionTool.h" - #include "StoreGate/ReadHandleKey.h" - #include "MuonRecHelperTools/IMuonEDMHelperSvc.h" +#include "MuonIdHelpers/IMuonIdHelperSvc.h" -// STL #include <vector> #include <string> -#include <map> #include <memory> class TH1; class TH1F; class TH2F; -class CscIdHelper; -class TgcIdHelper; - -namespace Muon { - class MuonIdHelperTool; -} - namespace Trk { - class IUpdator; - class RIO_OnTrack; - class Track; - class TrackStateOnSurface; class MeasurementBase; } - + class CSCSegmValAlg : public ManagedMonitorToolBase { public: /** Constructor */ CSCSegmValAlg( const std::string & type, const std::string & name, const IInterface* parent ); /** Destructor */ - virtual ~CSCSegmValAlg(); + virtual ~CSCSegmValAlg()=default; /** Histogram booking method */ virtual StatusCode bookHistograms(); /** Histogram filling method */ @@ -85,7 +58,6 @@ class CSCSegmValAlg : public ManagedMonitorToolBase { virtual StatusCode procHistograms(); StatusCode initialize(); - StatusCode finalize(); private: @@ -129,7 +101,6 @@ class CSCSegmValAlg : public ManagedMonitorToolBase { TH2F* m_h2CSC_Segm_NumOfSegs_EA; TH2F* m_h2CSC_Segm_NumOfSegs_EC; - //unsigned int m_ncoll; std::vector<std::string> m_clusStatWord; std::vector<std::string> m_NClusWord; @@ -186,12 +157,10 @@ class CSCSegmValAlg : public ManagedMonitorToolBase { TH2F* m_h2CSC_Segm_QsumOfGoodClus_PhiVsEta_EA; TH2F* m_h2CSC_Segm_QsumOfGoodClus_PhiVsEta_EC; - // Tool handles ServiceHandle<Muon::IMuonEDMHelperSvc> m_edmHelperSvc {this, "edmHelper", "Muon::MuonEDMHelperSvc/MuonEDMHelperSvc", "Handle to the service providing the IMuonEDMHelperSvc interface" }; - ToolHandle<Muon::MuonIdHelperTool> m_muonIdHelperTool{this, "idHelper", - "Muon::MuonIdHelperTool/MuonIdHelperTool", "Handle to the MuonIdHelperTool"}; + ServiceHandle<Muon::IMuonIdHelperSvc> m_idHelperSvc {this, "MuonIdHelperSvc", "Muon::MuonIdHelperSvc/MuonIdHelperSvc"}; }; #endif diff --git a/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/CscRawDataMonitoring/CscRawDataMonitoring/CscClusterValAlg.h b/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/CscRawDataMonitoring/CscRawDataMonitoring/CscClusterValAlg.h index f7b30ea749e2295040b9b129e2b3887afdced43f..4784221b8963f2c490eb896fbcf484aba4c10f7c 100755 --- a/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/CscRawDataMonitoring/CscRawDataMonitoring/CscClusterValAlg.h +++ b/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/CscRawDataMonitoring/CscRawDataMonitoring/CscClusterValAlg.h @@ -1,29 +1,29 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ #ifndef CscClusterValAlg_H #define CscClusterValAlg_H +#include "AthenaMonitoring/ManagedMonitorToolBase.h" #include "MuonPrepRawData/CscPrepDataContainer.h" #include "MuonPrepRawData/CscStripPrepDataContainer.h" - -#include "AthenaMonitoring/ManagedMonitorToolBase.h" #include "TrigDecisionTool/TrigDecisionTool.h" - #include "StoreGate/ReadHandleKey.h" - +#include "GaudiKernel/ServiceHandle.h" #include "GaudiKernel/ToolHandle.h" -#include "MuonIdHelpers/MuonIdHelperTool.h" +#include "MuonIdHelpers/IMuonIdHelperSvc.h" +#include "CscClusterization/ICscStripFitter.h" +#include "CscCalibTools/ICscCalibTool.h" + +#include <vector> +#include <string> class TH1; class TH1F; class TH2F; -class ICscStripFitter; -class ICscCalibTool; - class CscClusterValAlg : public ManagedMonitorToolBase { public: @@ -44,14 +44,13 @@ class CscClusterValAlg : public ManagedMonitorToolBase { virtual StatusCode fillHistograms(); // finalize - virtual StatusCode procHistograms(); + virtual StatusCode procHistograms(){return StatusCode::SUCCESS;} float stripsSum_EA; float stripsSum_EAtest; float stripsSum_EC; float stripsSum_ECtest; - private: // initialize histograms @@ -72,9 +71,7 @@ class CscClusterValAlg : public ManagedMonitorToolBase { std::string m_cscClusterPath, m_cscGenPath; unsigned int m_qmaxADCCut; - // Id helper - ToolHandle<Muon::MuonIdHelperTool> m_muonIdHelperTool{this, "idHelper", - "Muon::MuonIdHelperTool/MuonIdHelperTool", "Handle to the MuonIdHelperTool"}; + ServiceHandle<Muon::IMuonIdHelperSvc> m_idHelperSvc {this, "MuonIdHelperSvc", "Muon::MuonIdHelperSvc/MuonIdHelperSvc"}; // Strip fitter. ToolHandle<ICscStripFitter> m_stripFitter; @@ -111,11 +108,9 @@ class CscClusterValAlg : public ManagedMonitorToolBase { TH2F *m_h2csc_clus_qmax_signal_EA; TH1F *m_h1csc_clus_qmax_signal_EA_count; - //TH1F *m_h1csc_clus_qmax_signal_EA_occupancy; TH2F *m_h2csc_clus_qmax_signal_EC; TH1F *m_h1csc_clus_qmax_signal_EC_count; - //TH1F *m_h1csc_clus_qmax_signal_EC_occupancy; // q_sum = q_max + q_left + q_right of cluster TH2F *m_h2csc_clus_qsum; @@ -124,12 +119,10 @@ class CscClusterValAlg : public ManagedMonitorToolBase { TH2F *m_h2csc_clus_qsum_signal_EA; TH1F *m_h1csc_clus_qsum_signal_EA_count; - //TH1F *m_h1csc_clus_qsum_signal_EA_occupancy; TH1F *m_h1csc_clus_qsum_signal_EA_lfitmean; TH2F *m_h2csc_clus_qsum_signal_EC; TH1F *m_h1csc_clus_qsum_signal_EC_count; - //TH1F *m_h1csc_clus_qsum_signal_EC_occupancy; TH1F *m_h1csc_clus_qsum_signal_EC_lfitmean; // sampling time - eta cluster diff --git a/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/CscRawDataMonitoring/CscRawDataMonitoring/CscPrdValAlg.h b/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/CscRawDataMonitoring/CscRawDataMonitoring/CscPrdValAlg.h index 232f63c93bd7f5758b848548ca5e3046f84d6d5f..ff6dfcd8d61f21e737dc5a96b42faa5c362515fe 100755 --- a/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/CscRawDataMonitoring/CscRawDataMonitoring/CscPrdValAlg.h +++ b/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/CscRawDataMonitoring/CscRawDataMonitoring/CscPrdValAlg.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ #ifndef CscPrdValAlg_H @@ -9,15 +9,15 @@ #include "StoreGate/ReadHandleKey.h" #include "MuonPrepRawData/CscStripPrepDataContainer.h" #include "xAODEventInfo/EventInfo.h" +#include "GaudiKernel/ServiceHandle.h" #include "GaudiKernel/ToolHandle.h" -#include "MuonIdHelpers/MuonIdHelperTool.h" +#include "MuonIdHelpers/IMuonIdHelperSvc.h" +#include "CscClusterization/ICscStripFitter.h" class TH1; class TH1F; class TH2F; -class ICscStripFitter; - class CscPrdValAlg: public ManagedMonitorToolBase { public: @@ -30,7 +30,7 @@ class CscPrdValAlg: public ManagedMonitorToolBase { StatusCode bookHistograms(); StatusCode fillHistograms(); - StatusCode procHistograms(); + StatusCode procHistograms(){return StatusCode::SUCCESS;} StatusCode checkHists(bool fromFinalise); private: @@ -50,9 +50,7 @@ class CscPrdValAlg: public ManagedMonitorToolBase { // Strip fitter ToolHandle<ICscStripFitter> m_stripFitter; - // CSC identifier helper - ToolHandle<Muon::MuonIdHelperTool> m_muonIdHelperTool{this, "idHelper", - "Muon::MuonIdHelperTool/MuonIdHelperTool", "Handle to the MuonIdHelperTool"}; + ServiceHandle<Muon::IMuonIdHelperSvc> m_idHelperSvc {this, "MuonIdHelperSvc", "Muon::MuonIdHelperSvc/MuonIdHelperSvc"}; StatusCode fillLumiBlock(); int m_lumiblock; diff --git a/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/CscRawDataMonitoring/CscRawDataMonitoring/CscRdoValAlg.h b/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/CscRawDataMonitoring/CscRawDataMonitoring/CscRdoValAlg.h index cf366098c2dab44f0825e6d1adccf84525a34c27..e201d0c3e8fa7ab440e03c1db7cc0d6827797a3c 100755 --- a/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/CscRawDataMonitoring/CscRawDataMonitoring/CscRdoValAlg.h +++ b/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/CscRawDataMonitoring/CscRawDataMonitoring/CscRdoValAlg.h @@ -1,23 +1,21 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ #ifndef CscRdoValAlg_H #define CscRdoValAlg_H #include "AthenaMonitoring/ManagedMonitorToolBase.h" +#include "GaudiKernel/ServiceHandle.h" #include "GaudiKernel/ToolHandle.h" #include "StoreGate/ReadHandleKey.h" #include "MuonRDO/CscRawDataContainer.h" -#include "MuonIdHelpers/MuonIdHelperTool.h" +#include "MuonIdHelpers/IMuonIdHelperSvc.h" +#include "MuonCSC_CnvTools/ICSC_RDO_Decoder.h" class TH1F; class TH2F; -namespace Muon { - class ICSC_RDO_Decoder; -} - class CscRdoValAlg: public ManagedMonitorToolBase { @@ -32,7 +30,7 @@ class CscRdoValAlg: public ManagedMonitorToolBase StatusCode bookHistograms(); StatusCode fillHistograms(); - StatusCode procHistograms(); + StatusCode procHistograms(){return StatusCode::SUCCESS;} StatusCode checkHists(bool fromFinalise); private: @@ -46,8 +44,7 @@ class CscRdoValAlg: public ManagedMonitorToolBase size_t m_cscNoiseCut; SG::ReadHandleKey<CscRawDataContainer> m_cscRdoKey{this,"CSCRawDataKey","CSCRDO","CSC RDO"}; std::string m_cscRDOPath, m_cscGenPath; - ToolHandle<Muon::MuonIdHelperTool> m_muonIdHelperTool{this, "idHelper", - "Muon::MuonIdHelperTool/MuonIdHelperTool", "Handle to the MuonIdHelperTool"}; + ServiceHandle<Muon::IMuonIdHelperSvc> m_idHelperSvc {this, "MuonIdHelperSvc", "Muon::MuonIdHelperSvc/MuonIdHelperSvc"}; // CSC RDO Decoder ToolHandle<Muon::ICSC_RDO_Decoder> m_cscRdoDecoderTool; diff --git a/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/CscRawDataMonitoring/src/CSCSegmValAlg.cxx b/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/CscRawDataMonitoring/src/CSCSegmValAlg.cxx index 6b770d2c7d26a1d808c8715fc913295ea88bb752..609dc1436d759eca7af3304fd3ce7664e6cdf29f 100755 --- a/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/CscRawDataMonitoring/src/CSCSegmValAlg.cxx +++ b/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/CscRawDataMonitoring/src/CSCSegmValAlg.cxx @@ -17,11 +17,6 @@ #include "MuonPrepRawData/CscStripPrepDataContainer.h" #include "MuonPrepRawData/CscPrepData.h" -#include "MuonRecHelperTools/IMuonEDMHelperSvc.h" -#include "MuonIdHelpers/MuonIdHelperTool.h" -#include "MuonIdHelpers/CscIdHelper.h" -#include "MuonIdHelpers/TgcIdHelper.h" - // Track #include "TrkTrack/TrackCollection.h" #include "TrkEventPrimitives/PropDirection.h" @@ -32,11 +27,6 @@ #include "TrkCompetingRIOsOnTrack/CompetingRIOsOnTrack.h" #include "MuonRIO_OnTrack/CscClusterOnTrack.h" -// Gaudi Tools -#include "GaudiKernel/SmartDataPtr.h" -#include "GaudiKernel/INTupleSvc.h" -#include "AthenaMonitoring/AthenaMonManager.h" - // ROOT #include "TH1F.h" #include "TH2F.h" @@ -53,7 +43,6 @@ CSCSegmValAlg::CSCSegmValAlg( const std::string & type, const std::string & name m_debuglevel(false), m_bookedhistos(false) { - //declareProperty( "UseCollections", m_segmCollectionFlag); declareProperty( "SegmentSlopeCut", m_segmSlope); declareProperty( "ClusterStatus", m_clusStatWord); @@ -64,34 +53,21 @@ CSCSegmValAlg::CSCSegmValAlg( const std::string & type, const std::string & name ATH_MSG_INFO( " in CSCSegmValAlg::CSCSegmValAlg() " ); } - -//________________________________________________________________________________________________________ -CSCSegmValAlg::~CSCSegmValAlg() { - ATH_MSG_INFO( " in CSCSegmValAlg::~CSCSegmValAlg() " ); -} - - - //________________________________________________________________________________________________________ StatusCode CSCSegmValAlg::initialize() { m_bookedhistos=false; - StatusCode sc = ManagedMonitorToolBase::initialize(); - if(!sc.isSuccess()) return sc; + ATH_CHECK(ManagedMonitorToolBase::initialize()); ATH_MSG_INFO( "in CSCSegmValAlg::init()" ); - if( m_doEvtSel ) { - sc = m_trigDec.retrieve(); - if ( sc.isFailure() ) { + if (m_trigDec.retrieve().isFailure()) { ATH_MSG_WARNING ( "CSCSegmValAlg: Unable to retrieve trigger decision tool"); m_doEvtSel = false; - //return sc; } else { ATH_MSG_INFO ( "TrigDecisionTool : " << "Using TDT \"" << m_trigDec->name() << "\"" ); } - //m_doEvtSel = false; } if(m_sampSelTriggers.empty() && m_doEvtSel) { @@ -120,37 +96,12 @@ StatusCode CSCSegmValAlg::initialize() { m_NClusWord.push_back("123"); m_NClusWord.push_back("All"); - - //initializing tools - - // Initialize the IdHelper - StoreGateSvc* detStore = 0; - sc = service("DetectorStore", detStore); - if (sc.isFailure()) { - ATH_MSG_FATAL( "DetectorStore service not found !" ); - return sc; - } - if (m_debuglevel) ATH_MSG_DEBUG( "Defined DetectorStore" ); - - - // Retrieve helper tools - sc = m_edmHelperSvc.retrieve(); - if (sc.isFailure()){ - ATH_MSG_FATAL("Could not get " << m_edmHelperSvc ); - return sc; - } - if (m_debuglevel) ATH_MSG_DEBUG( "Retrieved " << m_edmHelperSvc ); - - sc = m_muonIdHelperTool.retrieve(); - if (sc.isFailure()){ - ATH_MSG_FATAL( "Could not get " << m_muonIdHelperTool ); - return sc; - } - if (m_debuglevel) ATH_MSG_DEBUG( "Retrieved " << m_muonIdHelperTool ); - + StoreGateSvc* detStore = nullptr; + ATH_CHECK(service("DetectorStore", detStore)); + ATH_CHECK(m_edmHelperSvc.retrieve()); + ATH_CHECK(m_idHelperSvc.retrieve()); ATH_CHECK(m_segmKey.initialize()); - - return sc; + return StatusCode::SUCCESS; } @@ -413,10 +364,7 @@ void CSCSegmValAlg::bookSegmentHistograms() { "Endcap A: #phi-cluster vs. good #eta-cluster;good #eta-cluster counts;good #phi-cluster counts", nqbins,nqmin,nqmax, nqbins,nqmin,nqmax); regCSCHist(m_h2CSC_Segm_QsumOfGoodClus_PhiVsEta_EA, m_segmDetail_EA.get()); regCSCHist(m_h2CSC_Segm_QsumOfGoodClus_PhiVsEta_EC, m_segmDetail_EC.get()); - - //m_h2csc_clus_r_vs_z_hitmap = new TH2F("h2csc_clus_r_vs_z_hitmap", "R vs. Z Cluster hitmap;z(CLHEP::mm);R(CLHEP::mm)",200, -10000., 10000., 40, 0., 4000); - //m_h2csc_clus_y_vs_x_hitmap = new TH2F("h2csc_clus_y_vs_x_hitmap", "Y vs. X Cluster hitmap;x(CLHEP::mm);y(CLHEP::mm)",100, -5000., 5000., 100, -5000., 5000); - + m_bookedhistos=true; } @@ -429,15 +377,10 @@ StatusCode CSCSegmValAlg::bookHistograms() { if( m_environment == AthenaMonManager::tier0 || m_environment == AthenaMonManager::tier0ESD ) { - //if(newEventsBlock){} - //if(newLumiBlock){} - //if(newRun) { if(!m_bookedhistos) bookSegmentHistograms(); - //} // if NewRun } // environment if return sc; - } @@ -457,8 +400,6 @@ StatusCode CSCSegmValAlg::fillHistograms() { // arrays to hold cluster-count // 32 chambers and 8 layers (each has one extra - index '0' is not counted) int clusCount[33][9]; - //, m_sigclusCount[33][9]; - //unsigned int m_nEtaClusWidthCnt = 0, m_nPhiClusWidthCnt = 0; for(unsigned int kl = 0; kl < 33; kl++ ) { for(unsigned int cm3 = 0; cm3 < 9; cm3++ ) { clusCount[kl][cm3] = 0; @@ -538,7 +479,6 @@ StatusCode CSCSegmValAlg::fillHistograms() { chi2 = fq->chiSquared(); ndof = fq->numberDoF(); ATH_MSG_DEBUG( "Chi2 " << chi2 ); - //chi2_histo->Fill(chi2); ATH_MSG_DEBUG( "Ndof " << ndof ); } @@ -550,7 +490,6 @@ StatusCode CSCSegmValAlg::fillHistograms() { bool segmAngle_cut = segmSlopeCut(segm_ly, segm_ayz, segm_cut); ATH_MSG_DEBUG(" local_pos: " << segm_ly << "\tangle_yz: " << segm_ayz << "\tcut: " << segm_cut << "\t pass = " << segmAngle_cut ); - //if(!segmAngle_cut) continue; //already in the new reconstruction ATH_MSG_DEBUG( "R " << segm->globalPosition().perp() ); @@ -579,10 +518,10 @@ StatusCode CSCSegmValAlg::fillHistograms() { const Trk::MeasurementBase* rio = meas.at(0); Identifier segmId = m_edmHelperSvc->getIdentifier(*rio); - int segm_stationPhi = m_muonIdHelperTool->cscIdHelper().stationPhi(segmId); - int segm_stationEta = m_muonIdHelperTool->cscIdHelper().stationEta(segmId); - int segm_stationName = m_muonIdHelperTool->cscIdHelper().stationName(segmId); - std::string segm_stationString = m_muonIdHelperTool->cscIdHelper().stationNameString(segm_stationName); + int segm_stationPhi = m_idHelperSvc->cscIdHelper().stationPhi(segmId); + int segm_stationEta = m_idHelperSvc->cscIdHelper().stationEta(segmId); + int segm_stationName = m_idHelperSvc->cscIdHelper().stationName(segmId); + std::string segm_stationString = m_idHelperSvc->cscIdHelper().stationNameString(segm_stationName); int segm_chamberType = segm_stationString == "CSS" ? 0 : 1; int segm_sectorNo = segm_stationEta * (2 * segm_stationPhi - segm_chamberType); // [-16 -> -1] and [+1 -> +16] int segm_isec = segm_sectorNo < 0 ? segm_sectorNo*(-1) : segm_sectorNo+16; // [-16 -> -1] shifted to [1 -> 16] and [+1 -> +16] shifted to [+17 -> +32] @@ -591,13 +530,11 @@ StatusCode CSCSegmValAlg::fillHistograms() { else m_h2CSC_Segm_NumOfSegs_EC->Fill(n_clust, segm_sectorNo); // Loop over clusters - // [i][j] {i == 0(EA), 1(EC) } float clus_kiloele = 1.0e-3; // multiply # of electrons by this number to get kiloElectrons (1 ke = 1 ADC) int eta_clus_count[2][2] = {{0},{0}}, phi_clus_count[2][2] = {{0},{0}}; // no. of prec/trans hits per segment float eta_clus_qsum[2][5] = {{-1.}, {-1.}}, phi_clus_qsum[2][5] = {{-1.}, {-1.}}; // qsum over each prec/trans. layer on segment float eta_clus_time[2][5] = {{-1.}, {-1.}}, phi_clus_time[2][5] = {{-1.}, {-1.}}; // time over each prec/trans. layer on segment int eta_clus_use[2][5] = {{0},{0}}, phi_clus_use[2][5] = {{0}, {0}}; - //int eta_clus_status[5] = {-1}, phi_clus_status[5] = {-1}; layerindex = 0; @@ -608,24 +545,21 @@ StatusCode CSCSegmValAlg::fillHistograms() { Identifier clusId = m_edmHelperSvc->getIdentifier(*clust_rot); // get the cluster coordinates - int clus_stationName = m_muonIdHelperTool->cscIdHelper().stationName(clusId); - std::string clus_stationString = m_muonIdHelperTool->cscIdHelper().stationNameString(clus_stationName); + int clus_stationName = m_idHelperSvc->cscIdHelper().stationName(clusId); + std::string clus_stationString = m_idHelperSvc->cscIdHelper().stationNameString(clus_stationName); int clus_chamberType = clus_stationString == "CSS" ? 0 : 1; - int clus_stationEta = m_muonIdHelperTool->cscIdHelper().stationEta(clusId); - int clus_stationPhi = m_muonIdHelperTool->cscIdHelper().stationPhi(clusId); - int clus_wireLayer = m_muonIdHelperTool->cscIdHelper().wireLayer(clusId); - int clus_measuresPhi = m_muonIdHelperTool->cscIdHelper().measuresPhi(clusId); + int clus_stationEta = m_idHelperSvc->cscIdHelper().stationEta(clusId); + int clus_stationPhi = m_idHelperSvc->cscIdHelper().stationPhi(clusId); + int clus_wireLayer = m_idHelperSvc->cscIdHelper().wireLayer(clusId); + int clus_measuresPhi = m_idHelperSvc->cscIdHelper().measuresPhi(clusId); // convert to my coordinates int clus_sectorNo = clus_stationEta * (2 * clus_stationPhi - clus_chamberType); // [-16 -> -1] and [+1 -> +16] float clus_secLayer = clus_sectorNo + 0.2 * (clus_wireLayer - 1) + 0.1; - //int xfac = clus_measuresPhi ? -1 : 1; // [-1 -> -48] / [+1 -> +192] int clus_isec = clus_sectorNo < 0 ? clus_sectorNo*(-1) : clus_sectorNo+16; // [-16 -> -1] shifted to [1 -> 16] and [+1 -> +16] shifted to [+17 -> +32] int clus_ilay = (clus_measuresPhi ? clus_wireLayer : clus_wireLayer+4); // check the cluster status; probably need to read status info from jobOptions - not done for the moment - // status = Muon::CscStatusUnspoiled (i.e 0) or Muon::CscStatusSplitUnspoiled (i.e 10) are considered good for precision clusters - // status = Muon::CscStatusSimple (i.e 1) could be good for non-precision clusters (i.e for phi-layers) Muon::CscClusterStatus status = clust_rot->status(); if(segm_stationEta == 1) { if(clus_measuresPhi == 0) m_h1CSC_Segm_StatOfClus_Eta_EA->Fill(status); @@ -634,10 +568,7 @@ StatusCode CSCSegmValAlg::fillHistograms() { if(clus_measuresPhi == 0) m_h1CSC_Segm_StatOfClus_Eta_EC->Fill(status); else m_h1CSC_Segm_StatOfClus_Phi_EC->Fill(status); } - - //if(clus_measuresPhi == 0) eta_clus_status[clus_wireLayer] = status; - //else phi_clus_status[clus_wireLayer] = status; - + std::string clus_stat = Muon::toString(status); bool clus_status = ( (clus_stat == "unspoiled") || (clus_stat == "unspoiled with split") || @@ -649,16 +580,11 @@ StatusCode CSCSegmValAlg::fillHistograms() { // get cluster const Muon::CscPrepData* theClus = clust_rot->prepRawData(); float clus_qsum = 0, clus_time = -1.; - //float clus_globx = 0., clus_globy = 0., clus_globz = 0., clus_globr = 0.; if(theClus) { clus_qsum = theClus->charge() * clus_kiloele; clus_time = theClus->time(); - //clus_globx = theClus->globalPosition().x(); - //clus_globy = theClus->globalPosition().y(); - //clus_globz = theClus->globalPosition().z(); - //clus_globr = theClus->globalPosition().perp(); - + if(clus_measuresPhi == 0) { if(clus_stationEta == 1) eta_clus_count[0][0]++; else eta_clus_count[1][0]++; @@ -687,13 +613,13 @@ StatusCode CSCSegmValAlg::fillHistograms() { eta_clus_time[0][clus_wireLayer] = clus_time; eta_clus_use[0][clus_wireLayer] = 1; m_h2CSC_Segm_QsumOfGoodClusMap_Eta_EA->Fill(clus_qsum, clus_secLayer); - if(fabs(clus_time) <= 200) m_h2CSC_Segm_TimeOfGoodClusMap_Eta_EA->Fill(clus_time, clus_secLayer); + if(std::abs(clus_time) <= 200) m_h2CSC_Segm_TimeOfGoodClusMap_Eta_EA->Fill(clus_time, clus_secLayer); } else { eta_clus_qsum[1][clus_wireLayer] = clus_qsum; eta_clus_time[1][clus_wireLayer] = clus_time; eta_clus_use[1][clus_wireLayer] = 1; m_h2CSC_Segm_QsumOfGoodClusMap_Eta_EC->Fill(clus_qsum, clus_secLayer); - if(fabs(clus_time) <= 200) m_h2CSC_Segm_TimeOfGoodClusMap_Eta_EC->Fill(clus_time, clus_secLayer); + if(std::abs(clus_time) <= 200) m_h2CSC_Segm_TimeOfGoodClusMap_Eta_EC->Fill(clus_time, clus_secLayer); } } @@ -706,14 +632,14 @@ StatusCode CSCSegmValAlg::fillHistograms() { phi_clus_use[0][clus_wireLayer] = 1; phi_clus_count[0][1]++; m_h2CSC_Segm_QsumOfGoodClusMap_Phi_EA->Fill(clus_qsum, clus_secLayer); - if(fabs(clus_time) <= 200) m_h2CSC_Segm_TimeOfGoodClusMap_Phi_EA->Fill(clus_time, clus_secLayer); + if(std::abs(clus_time) <= 200) m_h2CSC_Segm_TimeOfGoodClusMap_Phi_EA->Fill(clus_time, clus_secLayer); } else { phi_clus_qsum[1][clus_wireLayer] = clus_qsum; phi_clus_time[1][clus_wireLayer] = clus_time; phi_clus_use[1][clus_wireLayer] = 1; phi_clus_count[1][1]++; m_h2CSC_Segm_QsumOfGoodClusMap_Phi_EC->Fill(clus_qsum, clus_secLayer); - if(fabs(clus_time) <= 200) m_h2CSC_Segm_TimeOfGoodClusMap_Phi_EC->Fill(clus_time, clus_secLayer); + if(std::abs(clus_time) <= 200) m_h2CSC_Segm_TimeOfGoodClusMap_Phi_EC->Fill(clus_time, clus_secLayer); } } @@ -770,32 +696,28 @@ StatusCode CSCSegmValAlg::fillHistograms() { if(i==1) m_h1CSC_Segm_QsumOfClus_Eta_EC->Fill(eta_clus_qsum[i][j]); if(i==0) m_h1CSC_Segm_QsumOfClus_Phi_EA->Fill(phi_clus_qsum[i][j]); if(i==1) m_h1CSC_Segm_QsumOfClus_Phi_EC->Fill(phi_clus_qsum[i][j]); - if(i==0 && fabs(eta_clus_time[i][j]) <= 200) m_h1CSC_Segm_TimeOfClus_Eta_EA->Fill(eta_clus_time[i][j]); - if(i==1 && fabs(eta_clus_time[i][j]) <= 200) m_h1CSC_Segm_TimeOfClus_Eta_EC->Fill(eta_clus_time[i][j]); - if(i==0 && fabs(phi_clus_time[i][j]) <= 200) m_h1CSC_Segm_TimeOfClus_Phi_EA->Fill(phi_clus_time[i][j]); - if(i==1 && fabs(phi_clus_time[i][j]) <= 200) m_h1CSC_Segm_TimeOfClus_Phi_EC->Fill(phi_clus_time[i][j]); + if(i==0 && std::abs(eta_clus_time[i][j]) <= 200) m_h1CSC_Segm_TimeOfClus_Eta_EA->Fill(eta_clus_time[i][j]); + if(i==1 && std::abs(eta_clus_time[i][j]) <= 200) m_h1CSC_Segm_TimeOfClus_Eta_EC->Fill(eta_clus_time[i][j]); + if(i==0 && std::abs(phi_clus_time[i][j]) <= 200) m_h1CSC_Segm_TimeOfClus_Phi_EA->Fill(phi_clus_time[i][j]); + if(i==1 && std::abs(phi_clus_time[i][j]) <= 200) m_h1CSC_Segm_TimeOfClus_Phi_EC->Fill(phi_clus_time[i][j]); if(phi_clus_use[i][j] && eta_clus_use[i][j]) { eta_clus_qsum_tot += eta_clus_qsum[i][j]; if(i==0) m_h1CSC_Segm_QsumOfGoodClus_Eta_EA->Fill(eta_clus_qsum[i][j]); if(i==1) m_h1CSC_Segm_QsumOfGoodClus_Eta_EC->Fill(eta_clus_qsum[i][j]); - if(i==0 && fabs(eta_clus_time[i][j]) <= 200) m_h1CSC_Segm_TimeOfGoodClus_Eta_EA->Fill(eta_clus_time[i][j]); - if(i==1 && fabs(eta_clus_time[i][j]) <= 200) m_h1CSC_Segm_TimeOfGoodClus_Eta_EC->Fill(eta_clus_time[i][j]); + if(i==0 && std::abs(eta_clus_time[i][j]) <= 200) m_h1CSC_Segm_TimeOfGoodClus_Eta_EA->Fill(eta_clus_time[i][j]); + if(i==1 && std::abs(eta_clus_time[i][j]) <= 200) m_h1CSC_Segm_TimeOfGoodClus_Eta_EC->Fill(eta_clus_time[i][j]); phi_clus_qsum_tot += phi_clus_qsum[i][j]; if(i==0) m_h1CSC_Segm_QsumOfGoodClus_Phi_EA->Fill(phi_clus_qsum[i][j]); if(i==1) m_h1CSC_Segm_QsumOfGoodClus_Phi_EC->Fill(phi_clus_qsum[i][j]); - if(i==0 && fabs(phi_clus_time[i][j]) <= 200) m_h1CSC_Segm_TimeOfGoodClus_Phi_EA->Fill(phi_clus_time[i][j]); - if(i==1 && fabs(phi_clus_time[i][j]) <= 200) m_h1CSC_Segm_TimeOfGoodClus_Phi_EC->Fill(phi_clus_time[i][j]); + if(i==0 && std::abs(phi_clus_time[i][j]) <= 200) m_h1CSC_Segm_TimeOfGoodClus_Phi_EA->Fill(phi_clus_time[i][j]); + if(i==1 && std::abs(phi_clus_time[i][j]) <= 200) m_h1CSC_Segm_TimeOfGoodClus_Phi_EC->Fill(phi_clus_time[i][j]); } - //ATH_MSG_VERBOSE("phi charge = " << phi_clus_qsum[i][j] << "\tphi time = " << phi_clus_time[i][j]); - //ATH_MSG_VERBOSE("eta charge = " << eta_clus_qsum[i][j] << "\teta time = " << eta_clus_time[i][j]); } if(i==0) m_h2CSC_Segm_QsumOfGoodClus_PhiVsEta_EA->Fill(eta_clus_qsum_tot,phi_clus_qsum_tot); if(i==1) m_h2CSC_Segm_QsumOfGoodClus_PhiVsEta_EC->Fill(eta_clus_qsum_tot,phi_clus_qsum_tot); - //ATH_MSG_VERBOSE("eta_qsum_tot = " << eta_clus_qsum_tot << "\tphi_qsum = " << phi_clus_qsum_tot); } } // if is csc segment - // } // loop over ROTs } // loop over segms @@ -833,15 +755,6 @@ bool CSCSegmValAlg::evtSelTriggersPassed() { } // end evtSelTriggersPassed -//________________________________________________________________________________________________________ -StatusCode CSCSegmValAlg::finalize() { - StatusCode sc = ManagedMonitorToolBase::finalize(); - if(!sc.isSuccess()) return sc; - return sc; - -} - - //________________________________________________________________________________________________________ bool CSCSegmValAlg::isCscSegment( const Muon::MuonSegment* seg ) const { bool isCsc(false); @@ -857,7 +770,7 @@ bool CSCSegmValAlg::isCscSegment( const Muon::MuonSegment* seg ) const { if( !rot ) { continue; } - if( m_muonIdHelperTool->cscIdHelper().is_csc( rot->identify() ) ) isCsc=true; + if( m_idHelperSvc->cscIdHelper().is_csc( rot->identify() ) ) isCsc=true; } return isCsc; @@ -880,7 +793,7 @@ unsigned int CSCSegmValAlg::cscHits( const Muon::MuonSegment* seg ) const { if( !rot ) { continue; } - if( m_muonIdHelperTool->cscIdHelper().is_csc( rot->identify() ) ) ++nrHits; + if( m_idHelperSvc->cscIdHelper().is_csc( rot->identify() ) ) ++nrHits; } return nrHits ; @@ -940,7 +853,7 @@ bool CSCSegmValAlg::segmSlopeCut(float& csc_x, float& csc_ax, float& cut ) { float s0 = csc_x; float s1 = -tan(csc_ax); float s1corr = s1 - 0.000119 * s0; - bool good_segm = fabs(s1corr)<cut ? true : false; + bool good_segm = std::abs(s1corr)<cut ? true : false; return good_segm; } diff --git a/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/CscRawDataMonitoring/src/CscClusterValAlg.cxx b/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/CscRawDataMonitoring/src/CscClusterValAlg.cxx index 00b487faa0545fb4bf7520f6fc146b7a72bdf3cb..9e78fb49f1128cf239383b65fc4785b6da9a1e4a 100755 --- a/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/CscRawDataMonitoring/src/CscClusterValAlg.cxx +++ b/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/CscRawDataMonitoring/src/CscClusterValAlg.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~// @@ -13,12 +13,9 @@ //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~// // Athena include(s) -#include "MuonIdHelpers/CscIdHelper.h" #include "MuonPrepRawData/CscClusterStatus.h" #include "MuonPrepRawData/CscStripPrepDataCollection.h" #include "CscRawDataMonitoring/CscClusterValAlg.h" -#include "CscClusterization/ICscStripFitter.h" -#include "CscCalibTools/ICscCalibTool.h" // ROOT include(s) #include "TH1F.h" @@ -27,7 +24,7 @@ // STL include(s) #include <bitset> -#include <math.h> +#include <cmath> using namespace Muon; @@ -66,8 +63,7 @@ namespace CscBins { // // constructor ---------------------------------------------------------------- // -CscClusterValAlg::CscClusterValAlg(const std::string & type, - const std::string & name, const IInterface* parent) : +CscClusterValAlg::CscClusterValAlg(const std::string & type, const std::string & name, const IInterface* parent) : ManagedMonitorToolBase( type, name, parent ), m_stripFitter(name, this), m_cscCalibTool(name, this), @@ -104,7 +100,6 @@ CscClusterValAlg::~CscClusterValAlg() { delete m_cscclus_oviewEC; m_cscclus_oviewEC = 0; } - ATH_MSG_DEBUG( "CscClusterValAlg: in destructor" ); } @@ -118,49 +113,33 @@ StatusCode CscClusterValAlg::initialize(){ ATH_MSG_INFO ( "CSCClusterKey : " << m_cscClusterKey ); ATH_MSG_INFO ( "CSCPrepRawDataKey : " << m_cscPRDKey ); - StatusCode sc; - ATH_CHECK( m_muonIdHelperTool.retrieve() ); + ATH_CHECK(ManagedMonitorToolBase::initialize()); + + ATH_CHECK(m_idHelperSvc.retrieve()); ATH_MSG_DEBUG ("CSCIdHelper : " << "Using CscIdhelper " ); - sc = m_stripFitter.retrieve(); - if ( sc.isFailure() ) { - ATH_MSG_WARNING ( "CscClusterValAlg: Unable to retrieve strip fitter"); - return sc; - } else { - ATH_MSG_INFO ( "CSCStripFitter : " << "Using Fitter with name \"" << m_stripFitter->name() << "\"" ); - } + ATH_CHECK(m_stripFitter.retrieve()); + ATH_MSG_INFO ( "CSCStripFitter : " << "Using Fitter with name \"" << m_stripFitter->name() << "\"" ); if( m_doEvtSel ) { - sc = m_trigDec.retrieve(); - if ( sc.isFailure() ) { + if ( m_trigDec.retrieve().isFailure() ) { ATH_MSG_WARNING ( "CscClusterValAlg: Unable to retrieve trigger decision tool"); m_doEvtSel = false; - //return sc; } else { ATH_MSG_INFO ( "TrigDecisionTool : " << "Using TDT \"" << m_trigDec->name() << "\"" ); } - //m_doEvtSel = false; - } - else { - m_trigDec.disable(); - } - sc = m_cscCalibTool.retrieve(); - if ( sc.isFailure() ) { - ATH_MSG_WARNING ( "CscClusterValAlg: Unable to retrieve cluster fitter "); - return sc; } else { - ATH_MSG_INFO ( "CSCCalibTool : " << "Using calib tool with name \"" << m_cscCalibTool->name() << "\"" ); + m_trigDec.disable(); } + ATH_CHECK(m_cscCalibTool.retrieve()); + ATH_MSG_INFO ( "CSCCalibTool : " << "Using calib tool with name \"" << m_cscCalibTool->name() << "\"" ); if(m_sampSelTriggers.empty() && m_doEvtSel) { ATH_MSG_WARNING("Event selection triggers not specified. Switching off trigger-aware monitoring"); m_doEvtSel = false; } - - ManagedMonitorToolBase::initialize().ignore(); - - ATH_CHECK(m_cscClusterKey.initialize(m_muonIdHelperTool->hasCSC())); - ATH_CHECK(m_cscPRDKey.initialize(m_muonIdHelperTool->hasCSC())); + ATH_CHECK(m_cscClusterKey.initialize(m_idHelperSvc->hasCSC())); + ATH_CHECK(m_cscPRDKey.initialize(m_idHelperSvc->hasCSC())); return StatusCode::SUCCESS; } @@ -191,11 +170,9 @@ void CscClusterValAlg::initHistograms() { m_h2csc_clus_qmax_signal_EA = 0; m_h1csc_clus_qmax_signal_EA_count = 0; - //m_h1csc_clus_qmax_signal_EA_occupancy = 0; m_h2csc_clus_qmax_signal_EC = 0; m_h1csc_clus_qmax_signal_EC_count = 0; - //m_h1csc_clus_qmax_signal_EC_occupancy = 0; // q_sum = q_max + q_left + q_right of cluster m_h2csc_clus_qsum = 0; @@ -204,12 +181,10 @@ void CscClusterValAlg::initHistograms() { m_h2csc_clus_qsum_signal_EA = 0; m_h1csc_clus_qsum_signal_EA_count = 0; - //m_h1csc_clus_qsum_signal_EA_occupancy = 0; m_h1csc_clus_qsum_signal_EA_lfitmean = 0; m_h2csc_clus_qsum_signal_EC = 0; m_h1csc_clus_qsum_signal_EC_count = 0; - //m_h1csc_clus_qsum_signal_EC_occupancy = 0; m_h1csc_clus_qsum_signal_EC_lfitmean = 0; // sampling time - eta cluster @@ -374,12 +349,6 @@ void CscClusterValAlg::bookClusterHistograms() { m_h1csc_clus_qsum_signal_EA_count = new TH1F("h1csc_clus_qsum_signal_EA_count", Form("EndCap A: Cluster charge(Qsum), Qmax > %4u counts;counts;entries/20 counts;",m_qmaxADCCut),nqbins,nqmin,nqmax); - /* - m_h1csc_clus_qsum_signal_EA_occupancy = new TH1F("h1csc_clus_qsum_signal_EA_occupancy", - Form("EndCap A: Cluster charge(Qsum), Qmax > %4u counts;[sector] + [0.2 #times layer];entries/layer",m_qmaxADCCut),nybinsEA,nyminEA,nymaxEA); - CscBins::BinLabels(m_h1csc_clus_qsum_signal_EA_occupancy,1); - */ - m_h1csc_clus_qsum_signal_EA_lfitmean = new TH1F("h1csc_clus_qsum_signal_EA_lfitmean", Form("EndCap A: MPV of Landau fit to Cluster charge(Qsum);[sector] + [0.2 #times layer];counts/layer"),nybinsEA,nyminEA,nymaxEA); CscBins::BinLabels(m_h1csc_clus_qsum_signal_EA_lfitmean,1); @@ -390,13 +359,6 @@ void CscClusterValAlg::bookClusterHistograms() { m_h1csc_clus_qsum_signal_EC_count = new TH1F("h1csc_clus_qsum_signal_EC_count", Form("EndCap C: Cluster charge(Qsum), Qmax > %4u counts;counts;entries/20 counts;",m_qmaxADCCut),nqbins,nqmin,nqmax); - - /* - m_h1csc_clus_qsum_signal_EC_occupancy = new TH1F("h1csc_clus_qsum_signal_EC_occupancy", - Form("EndCap C: Cluster charge(Qsum), Qmax > %4u counts;[sector] + [0.2 #times layer];entries/layer",m_qmaxADCCut),nybinsEC,nyminEC,nymaxEC); - CscBins::BinLabels(m_h1csc_clus_qsum_signal_EC_occupancy,-1); - */ - m_h1csc_clus_qsum_signal_EC_lfitmean = new TH1F("h1csc_clus_qsum_signal_EC_lfitmean", Form("EndCap C: MPV of Landau fit to Cluster charge(Qsum);[sector] + [0.2 #times layer];counts/layer"),nybinsEC,nyminEC,nymaxEC); CscBins::BinLabels(m_h1csc_clus_qsum_signal_EC_lfitmean,-1); @@ -418,12 +380,6 @@ void CscClusterValAlg::bookClusterHistograms() { m_h1csc_clus_qmax_signal_EA_count = new TH1F("h1csc_clus_qmax_signal_EA_count", Form("EndCap A: Cluster peak-strip charge, Qmax > %4u counts;counts;entries/20 counts;",m_qmaxADCCut),nqbins,nqmin,nqmax); - /* - m_h1csc_clus_qmax_signal_EA_occupancy = new TH1F("h1csc_clus_qmax_signal_EA_occupancy", - Form("EndCap A: Cluster peak-strip charge, Qmax > %4u counts;[sector] + [0.2 #times layer];entries/layer",m_qmaxADCCut),nybinsEA,nyminEA,nymaxEA); - CscBins::BinLabels(m_h1csc_clus_qmax_signal_EA_occupancy,1); - */ - m_h2csc_clus_qmax_signal_EC = new TH2F("h2csc_clus_qmax_signal_EC", Form("EndCap C: Cluster peak-strip charge, Qmax > %4u counts;counts;[sector] + [0.2 #times layer]",m_qmaxADCCut), nqbins,nqmin,nqmax,nybinsEC,nyminEC,nymaxEC); @@ -431,12 +387,6 @@ void CscClusterValAlg::bookClusterHistograms() { m_h1csc_clus_qmax_signal_EC_count = new TH1F("h1csc_clus_qmax_signal_EC_count", Form("EndCap C: Cluster peak-strip charge, Qmax > %4u counts;counts;entries/20 counts;",m_qmaxADCCut),nqbins,nqmin,nqmax); - /* - m_h1csc_clus_qmax_signal_EC_occupancy = new TH1F("h1csc_clus_qmax_signal_EC_occupancy", - Form("EndCap C: Cluster peak-strip charge, Qmax > %4u counts;[sector] + [0.2 #times layer];entries/layer",m_qmaxADCCut),nybinsEC,nyminEC,nymaxEC); - CscBins::BinLabels(m_h1csc_clus_qmax_signal_EC_occupancy,-1); - */ - // eta-cluster sampling time m_h1csc_clus_precision_time = new TH1F("h1csc_clus_precision_time", "#eta-cluster sampling time;ns;entries/ns",ntbins,ntmin,ntmax ); @@ -530,9 +480,6 @@ void CscClusterValAlg::bookClusterHistograms() { m_h1csc_clus_count_signal = new TH1F("h1csc_clus_count_signal", Form("Clusters per event, Qmax > %4u counts;no.of clusters;entries",m_qmaxADCCut),26,-1,25); - //m_h1csc_clus_count_perlayer = new TH1F("h1csc_clus_count_perlayer", - // Form("Clusters per layer, Qmax > %4u counts;[sector] + [0.2 #times layer];# clusters",m_qmaxADCCut),170,-17,17); - // correlation histograms m_h2csc_clus_eta_vs_phi_cluscount = new TH2F("h2csc_clus_eta_vs_phi_cluscount", "Eta vs. Phi Cluster count correlation;#varphi-cluster count;#eta-cluster count",100,0,100,100,0,100); @@ -544,9 +491,6 @@ void CscClusterValAlg::bookClusterHistograms() { m_h2csc_clus_eta_vs_phi_cluswidth = new TH2F("h2csc_clus_eta_vs_phi_cluswidth", "Eta vs. Phi Cluster width correlation;#varphi-cluster width;#eta-cluster width",100,0,100,100,0,100); - //m_h2csc_clus_eta_vs_phi_hitmap = new TH2F("h2csc_clus_eta_vs_phi_hitmap", - // "Eta vs. Phi Cluster hitmap;#varphi-cluster position;#eta-cluster position",68,-3.4,3.4,68,-3.4,3.4); // 2.0 < |eta-csc| < 2.8 - m_h2csc_clus_r_vs_z_hitmap = new TH2F("h2csc_clus_r_vs_z_hitmap", "R vs. Z Cluster hitmap;z(mm);R(mm)",200, -10000., 10000., 40, 0., 4000); @@ -560,7 +504,6 @@ void CscClusterValAlg::bookClusterHistograms() { m_cscClusExpert.push_back(m_h2csc_clus_segmap_signal); // expert m_cscClusExpert.push_back(m_h2csc_clus_hitmap_noise); // expert - //m_cscClusShift.push_back(m_h2csc_clus_eta_vs_phi_hitmap); m_cscClusShift.push_back(m_h2csc_clus_r_vs_z_hitmap); // shift m_cscClusShift.push_back(m_h2csc_clus_y_vs_x_hitmap); // shift @@ -575,12 +518,10 @@ void CscClusterValAlg::bookClusterHistograms() { m_cscClusOviewEA.push_back(m_h2csc_clus_qsum_signal_EA); m_cscClusOviewEA.push_back(m_h1csc_clus_qsum_signal_EA_count); - //m_cscClusOviewEA.push_back(m_h1csc_clus_qsum_signal_EA_occupancy); m_cscClusOviewEA.push_back(m_h1csc_clus_qsum_signal_EA_lfitmean); m_cscClusOviewEC.push_back(m_h2csc_clus_qsum_signal_EC); m_cscClusOviewEC.push_back(m_h1csc_clus_qsum_signal_EC_count); - //m_cscClusOviewEC.push_back(m_h1csc_clus_qsum_signal_EC_occupancy); m_cscClusOviewEC.push_back(m_h1csc_clus_qsum_signal_EC_lfitmean); // qmax @@ -590,11 +531,9 @@ void CscClusterValAlg::bookClusterHistograms() { m_cscClusOviewEA.push_back(m_h2csc_clus_qmax_signal_EA); m_cscClusOviewEA.push_back(m_h1csc_clus_qmax_signal_EA_count); - //m_cscClusOviewEA.push_back(m_h1csc_clus_qmax_signal_EA_occupancy); m_cscClusOviewEC.push_back(m_h2csc_clus_qmax_signal_EC); m_cscClusOviewEC.push_back(m_h1csc_clus_qmax_signal_EC_count); - //m_cscClusOviewEC.push_back(m_h1csc_clus_qmax_signal_EC_occupancy); // phi time m_cscClusExpert.push_back(m_h1csc_clus_transverse_time); // expert @@ -647,8 +586,6 @@ void CscClusterValAlg::bookClusterHistograms() { m_cscClusExpert.push_back(m_h1csc_clus_count_signal); // expert m_cscClusExpert.push_back(m_h1csc_clus_count_noise); // expert - //m_cscClusShift.push_back(m_h1csc_clus_count_perlayer); - // correlation plots // eta vs. phi count (# of clusters) m_cscClusExpert.push_back(m_h2csc_clus_eta_vs_phi_cluscount); // expert @@ -721,9 +658,6 @@ StatusCode CscClusterValAlg::bookHistograms(){ return sc; } } - //} - //if(newEventsBlock){} - //if(newLumiBlock){} // if we are here return success return sc; @@ -763,8 +697,6 @@ void CscClusterValAlg::FillCSCClusters( const CscPrepDataContainer* cols, const for ( CscPrepDataContainer::const_iterator Icol = cols->begin(); Icol != cols->end(); ++Icol ) { const CscPrepDataCollection& clus = **Icol; - //Identifier coll_id = clus.identify(); - // arrays to hold cluster-count // 32 chambers and 8 layers (each has one extra - index '0' is not counted) @@ -813,23 +745,19 @@ void CscClusterValAlg::FillCSCClusters( const CscPrepDataContainer* cols, const Identifier clusId = iClus.identify(); // get the cluster coordinates - int stationName = m_muonIdHelperTool->cscIdHelper().stationName(clusId); - std::string stationString = m_muonIdHelperTool->cscIdHelper().stationNameString(stationName); + int stationName = m_idHelperSvc->cscIdHelper().stationName(clusId); + std::string stationString = m_idHelperSvc->cscIdHelper().stationNameString(stationName); int chamberType = stationString == "CSS" ? 0 : 1; - int stationEta = m_muonIdHelperTool->cscIdHelper().stationEta(clusId); - int stationPhi = m_muonIdHelperTool->cscIdHelper().stationPhi(clusId); - int wireLayer = m_muonIdHelperTool->cscIdHelper().wireLayer(clusId); - int measuresPhi = m_muonIdHelperTool->cscIdHelper().measuresPhi(clusId); + int stationEta = m_idHelperSvc->cscIdHelper().stationEta(clusId); + int stationPhi = m_idHelperSvc->cscIdHelper().stationPhi(clusId); + int wireLayer = m_idHelperSvc->cscIdHelper().wireLayer(clusId); + int measuresPhi = m_idHelperSvc->cscIdHelper().measuresPhi(clusId); float x = iClus.globalPosition().x(); float y = iClus.globalPosition().y(); float z = iClus.globalPosition().z(); float r = sqrt(x*x + y*y); - //TVector3 m_clu(x,y,z); - //ATH_MSG_DEBUG(" cluster eta = " << m_clu.Eta() << "\t pseudorapidity = " << m_clu.PseudoRapidity() << "\t phi = " << m_clu.Phi()); - //ATH_MSG_DEBUG(" cluster x = " << x << "\t y = " << y << "\t z = " << z ); - //m_h2csc_clus_eta_vs_phi_hitmap->Fill(m_clu.Phi(),m_clu.Eta()); m_h2csc_clus_r_vs_z_hitmap->Fill(z,r); m_h2csc_clus_y_vs_x_hitmap->Fill(y,x); @@ -852,12 +780,7 @@ void CscClusterValAlg::FillCSCClusters( const CscPrepDataContainer* cols, const } if(stripsSum_EC > stripsSum_ECtest) { stripsSum_ECtest = stripsSum_EC; - } - - - // check boundaries of sector/layer - redundancy - //if(!(sectorNo+16) < 33) sectorNo = 0; - //if(!(wireLayer < 5)) wireLayer = 0; + } // compute the indices to store cluster count int ns = sectorNo < 0 ? sectorNo*(-1) : sectorNo+16; // [-16 -> -1] shifted to [1 -> 16] and [+1 -> +16] shifted to [+17 -> +32] @@ -912,7 +835,7 @@ void CscClusterValAlg::FillCSCClusters( const CscPrepDataContainer* cols, const // Loop over strip id's vector / strip collection and match the id's from vector with strips in collection for ( std::vector<Identifier>::const_iterator sId = stripIds.begin(); sId != stripIds.end(); ++sId, sIdx++ ) { Identifier id = *sId; // for strip Id's - int thisStrip = m_muonIdHelperTool->cscIdHelper().strip(id); + int thisStrip = m_idHelperSvc->cscIdHelper().strip(id); float stripid = thisStrip * xfac; // x-axis fill value fStripIDs.push_back(stripid); m_h2csc_clus_hitmap->Fill(stripid, secLayer); @@ -935,11 +858,8 @@ void CscClusterValAlg::FillCSCClusters( const CscPrepDataContainer* cols, const found_strip = ( *istrip )->identify() == id ; if(found_strip) { stripVec.push_back(*istrip); - //std::ostringstream m_charges; std::vector<float> samp_charges = ( *istrip )->sampleCharges(); for(unsigned int i = 0; i < samp_charges.size(); i++ ) { - //std::string m_ch; sprintf((char *)m_ch.c_str(),"%6.2f , ",samp_charges[i]); - //m_charges << m_ch.c_str(); if(samp_charges[i] > maxsampChVal) maxsampChVal = samp_charges[i]; } if(maxsampChVal > maxStripCharge ) { @@ -947,7 +867,6 @@ void CscClusterValAlg::FillCSCClusters( const CscPrepDataContainer* cols, const maxStipId = stripid; mxIdx = sIdx; } - //ATH_MSG_DEBUG ( " " << m_charges.str() << "\t time= " << ( *istrip )->timeOfFirstSample()); break; // break from inner loop } } // end for loop on strip collection @@ -1006,10 +925,6 @@ void CscClusterValAlg::FillCSCClusters( const CscPrepDataContainer* cols, const float kiloele = 1.0e-3; // multiply # of electrons by this number to get kiloElectrons (1 ke = 1 ADC) // Assume 1000 e = 1 ADC for now = 1000 x 1.6022 x 10^{-4} fC = 0.16022 fC - //float m_fCperADC = 0.16022; // multiply ADC counts with with this to get fC - - //float m_kEperADC = 1000.; // multiply ADC counts with with this to get #of electrons - // convert qmax, qleft, qright into ADC float QmaxADC = qmax * kiloele; float QsumADC = qsum * kiloele; @@ -1054,11 +969,9 @@ void CscClusterValAlg::FillCSCClusters( const CscPrepDataContainer* cols, const if(stationEta == 1) { m_h2csc_clus_qmax_signal_EA->Fill(QmaxADC, secLayer); m_h1csc_clus_qmax_signal_EA_count->Fill(QmaxADC); - //m_h1csc_clus_qmax_signal_EA_occupancy->Fill(secLayer); } else { m_h2csc_clus_qmax_signal_EC->Fill(QmaxADC, secLayer); m_h1csc_clus_qmax_signal_EC_count->Fill(QmaxADC); - //m_h1csc_clus_qmax_signal_EC_occupancy->Fill(secLayer); } } else { m_h2csc_clus_qmax_noise->Fill(QmaxADC, secLayer); @@ -1070,11 +983,9 @@ void CscClusterValAlg::FillCSCClusters( const CscPrepDataContainer* cols, const if(stationEta == 1) { m_h2csc_clus_qsum_signal_EA->Fill(QsumADC, secLayer); m_h1csc_clus_qsum_signal_EA_count->Fill(QsumADC); - //m_h1csc_clus_qsum_signal_EA_occupancy->Fill(secLayer); } else { m_h2csc_clus_qsum_signal_EC->Fill(QsumADC, secLayer); m_h1csc_clus_qsum_signal_EC_count->Fill(QsumADC); - //m_h1csc_clus_qsum_signal_EC_occupancy->Fill(secLayer); } } else { m_h2csc_clus_qsum_noise->Fill(QsumADC, secLayer); @@ -1139,10 +1050,6 @@ void CscClusterValAlg::FillCSCClusters( const CscPrepDataContainer* cols, const if(count) { float secLayer = sec + 0.2 * (lay - 1) + 0.1; - //for(int m_cnt = 0; m_cnt < scount; m_cnt++) { - // m_h1csc_clus_count_perlayer->Fill(secLayer); - //} - ATH_MSG_DEBUG ("sec[" << sec << "]\t" << wlay << "[" << lay << "] = " << secLayer << "= " << "\tNsig = " << scount << ", Ntot = " << count); @@ -1221,78 +1128,3 @@ bool CscClusterValAlg::evtSelTriggersPassed() { return false; } // end evtSelTriggersPassed - -// -// procHistograms ---------------------------------------------------------------- -// -StatusCode CscClusterValAlg::procHistograms() { - - StatusCode sc = StatusCode::SUCCESS; - - /* book these only at the end of run - if(isEndOfRun){ - - //MonGroup m_cscclus_oviewEC( this, m_cscGenPath+"CSC/Overview/CSCEC", shift, run ); - for(unsigned int j = 0; j < m_cscClusOviewEC.size(); j++ ) { - TH1 *m_h(0); - m_h = m_cscClusOviewEC[j]; - if(m_h != NULL) { - bool m_hist2d = m_h->IsA()->InheritsFrom("TH2"); - if(m_hist2d) { - std::string m_hname = m_h->GetName(); - // Get Y-projection (sec+0.2*lay) - TH1D *m_hY = dynamic_cast<TH2F* >(m_h)->ProjectionY(Form("%s_hY",m_hname.c_str()),0,-1,""); - // set bin labels - CscBins::BinLabels(m_hY,-1); - // register histogram with Overview/CSCEC - sc = m_cscclus_oviewEC->regHist(m_hY); - if ( sc.isFailure() ) { - ATH_MSG_ERROR ( "Cannot register histogram " << m_hY->GetName() ); - return sc; - } - // Get X-projection (counts) - TH1D *m_hX = dynamic_cast<TH2F* >(m_h)->ProjectionX(Form("%s_hX",m_hname.c_str()),0,-1,"e"); - sc = m_cscclus_oviewEC->regHist(m_hX); - if ( sc.isFailure() ) { - ATH_MSG_ERROR ( "Cannot register histogram " << m_hX->GetName() ); - return sc; - } - } // end if hist2d - } // end if m_h - } // end for - - - //MonGroup m_cscclus_oviewEA( this, m_cscGenPath+"CSC/Overview/CSCEA", shift, run ); - for(unsigned int j = 0; j < m_cscClusOviewEA.size(); j++ ) { - TH1 *m_h(0); - m_h = m_cscClusOviewEA[j]; - if(m_h != NULL) { - bool m_hist2d = m_h->IsA()->InheritsFrom("TH2"); - if(m_hist2d) { - std::string m_hname = m_h->GetName(); - // Get Y-projection (sec+0.2*lay) - TH1D *m_hY = dynamic_cast<TH2F* >(m_h)->ProjectionY(Form("%s_hY",m_hname.c_str()),0,-1,""); - // set bin labels - CscBins::BinLabels(m_hY,1); - // register histogram with Overview/CSCEA - sc = m_cscclus_oviewEA->regHist(m_hY); - if ( sc.isFailure() ) { - ATH_MSG_ERROR ( "Cannot register histogram " << m_hY->GetName() ); - return sc; - } - // Get X-projection (counts) - TH1D *m_hX = dynamic_cast<TH2F* >(m_h)->ProjectionX(Form("%s_hX",m_hname.c_str()),0,-1,"e"); - sc = m_cscclus_oviewEA->regHist(m_hX); - if ( sc.isFailure() ) { - ATH_MSG_ERROR ( "Cannot register histogram " << m_hX->GetName() ); - return sc; - } - } // end if hist2d - } // end if m_h - } // end for - - - } // end isEndofRun */ - return sc; -} - diff --git a/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/CscRawDataMonitoring/src/CscPrdValAlg.cxx b/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/CscRawDataMonitoring/src/CscPrdValAlg.cxx index 28110d9ed165f16caffc31a6c91c08864090ab54..248c9939be02e89543f96c12101f8caab67278d0 100755 --- a/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/CscRawDataMonitoring/src/CscPrdValAlg.cxx +++ b/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/CscRawDataMonitoring/src/CscPrdValAlg.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~// @@ -19,9 +19,6 @@ #include "MuonPrepRawData/CscStripPrepDataCollection.h" #include "MuonPrepRawData/CscStripPrepData.h" -#include "CscClusterization/ICscStripFitter.h" -#include "MuonIdHelpers/CscIdHelper.h" - // ROOT include(s) #include "TClass.h" #include "TH1F.h" @@ -65,8 +62,7 @@ namespace CscPrdBins { // // constructor ---------------------------------------------------------------- // -CscPrdValAlg::CscPrdValAlg(const std::string & type, const std::string & name, - const IInterface* parent) : +CscPrdValAlg::CscPrdValAlg(const std::string & type, const std::string & name, const IInterface* parent) : ManagedMonitorToolBase(type, name, parent), m_stripFitter(name), m_cscprd_oviewEA(0), @@ -106,29 +102,13 @@ CscPrdValAlg::~CscPrdValAlg() { // StatusCode CscPrdValAlg::initialize() { ATH_MSG_INFO( "CscPrdValAlg: in initialize" ); - - ATH_MSG_DEBUG( "strip fitter " << m_stripFitter ); - - StatusCode sc; - - ATH_CHECK( m_muonIdHelperTool.retrieve() ); - ATH_MSG_DEBUG( " Found the MuonIdHelperTool. " ); - - //Fetch strip fitter - sc = m_stripFitter.retrieve(); - if ( !m_stripFitter || sc.isFailure() ) { - ATH_MSG_DEBUG( "CscPrdValAlg " << name() << ": unable to retrieve strip fitter " << m_stripFitter ); - return sc; - } else { - ATH_MSG_DEBUG( "CscPrdValAlg " << name() << ": retrieved " << m_stripFitter ); - } - + ATH_CHECK(ManagedMonitorToolBase::initialize()); + ATH_CHECK(m_idHelperSvc.retrieve()); + ATH_CHECK(m_stripFitter.retrieve()); + ATH_MSG_DEBUG( "CscPrdValAlg " << name() << ": retrieved " << m_stripFitter ); ATH_CHECK(m_cscPrdKey.initialize()); ATH_CHECK(m_eventInfo.initialize()); - - ManagedMonitorToolBase::initialize().ignore(); // Ignore the checking code; return StatusCode::SUCCESS; - } // end CscPrdValAlg::initialize() @@ -226,12 +206,7 @@ void CscPrdValAlg::bookPrdHistograms() { float nxmaxLB = 2500.; // /// ******************** DO NOT MODIFY (end) *********************************************** /// - //if (newEventsBlock){} - //if (newLumiBlock){} - //if (newRun) { - // book histograms - //m_h1csc_prd_maxdiffamp = new TH1F("h1csc_prd_maxdiffamp", "Max Amplitude in ROD Cluster;ADC counts;;",500,0,5000); // strip hitmap m_h2csc_prd_hitmap = new TH2F("h2csc_prd_hitmap", "Hit Occupancy;channel;[sector] + [0.2 #times layer]", @@ -383,14 +358,11 @@ void CscPrdValAlg::bookPrdHistograms() { m_regHExpert.push_back(m_h2csc_prd_eta_vs_phi_cluscount_noise); // expert m_regHExpert.push_back(m_h2csc_prd_eta_vs_phi_cluswidth); // expert - //m_regHShift.push_back(m_h2csc_prd_eta_vs_phi_hitmap); // shift if(m_mapxyrz) { m_regHShift.push_back(m_h2csc_prd_r_vs_z_hitmap); // shift m_regHShift.push_back(m_h2csc_prd_y_vs_x_hitmap); // shift } - //} - } // @@ -403,10 +375,6 @@ StatusCode CscPrdValAlg::bookHistograms() { bookPrdHistograms(); - //if (newEventsBlock){} - //if (newLumiBlock){} - //if (newRun) { - //declare a group of histograms MonGroup cscprd_shift( this, m_cscPRDPath+"/Shift", run, ATTRIB_MANAGED ); MonGroup cscprd_expert( this, m_cscPRDPath+"/Expert", run, ATTRIB_MANAGED ); @@ -526,14 +494,14 @@ StatusCode CscPrdValAlg::fillHistograms() { // Identify the PRD cluster Identifier prawId = praw.identify(); - int stationName = m_muonIdHelperTool->cscIdHelper().stationName(prawId); - std::string stationString = m_muonIdHelperTool->cscIdHelper().stationNameString(stationName); + int stationName = m_idHelperSvc->cscIdHelper().stationName(prawId); + std::string stationString = m_idHelperSvc->cscIdHelper().stationNameString(stationName); int chamberType = stationString == "CSS" ? 0 : 1; - int stationEta = m_muonIdHelperTool->cscIdHelper().stationEta(prawId); - int stationPhi = m_muonIdHelperTool->cscIdHelper().stationPhi(prawId); - int wireLayer = m_muonIdHelperTool->cscIdHelper().wireLayer(prawId); - int measuresPhi = m_muonIdHelperTool->cscIdHelper().measuresPhi(prawId); - int stripId = m_muonIdHelperTool->cscIdHelper().strip(prawId); + int stationEta = m_idHelperSvc->cscIdHelper().stationEta(prawId); + int stationPhi = m_idHelperSvc->cscIdHelper().stationPhi(prawId); + int wireLayer = m_idHelperSvc->cscIdHelper().wireLayer(prawId); + int measuresPhi = m_idHelperSvc->cscIdHelper().measuresPhi(prawId); + int stripId = m_idHelperSvc->cscIdHelper().strip(prawId); int sectorNo = stationEta * (2 * stationPhi - chamberType); @@ -637,7 +605,6 @@ StatusCode CscPrdValAlg::fillHistograms() { int numetasignal = 0, numphisignal = 0; for(int kl = 1; kl < 33; kl++ ) { - //int m_sec = kl < 17 ? kl*(-1) : kl; // [1->16](-side) [17-32] (+side) for(int km = 1; km < 9; km++ ) { int lay = (km > 4 && km < 9) ? km-4 : km; // 1,2,3,4 (phi-layers) 5-4, 6-4, 7-4, 8-4 (eta-layers) bool mphi = (km > 0 && km < 5) ? true : false; // 1,2,3,4 (phi-layers) 5,6,7,8 (eta-layers) @@ -691,55 +658,6 @@ StatusCode CscPrdValAlg::fillHistograms() { return sc; } // end CscPrdValAlg::fillHistograms() -// -// procHistograms ---------------------------------------------------------------- -// -StatusCode CscPrdValAlg::procHistograms() { - StatusCode sc = StatusCode::SUCCESS; - ATH_MSG_DEBUG( "CscPrdValAlg: in procHistograms" ); - if(endOfRunFlag()){ - /* - std::string m_cscGenPath = m_cscPRDPath.substr(0,m_cscPRDPath.find("CSC")); - //MonGroup m_cscprd_oviewEC( this, m_cscGenPath+"CSC/Overview/CSCEC", shift, run ); - for(size_t j = 0; j < m_regHOviewEC.size(); j++ ) { - TH1 *m_h(0); - m_h = m_regHOviewEC[j]; - if(m_h != NULL) { - bool m_hist2d = m_h->IsA()->InheritsFrom("TH2"); - if(m_hist2d) { - std::string m_hname = m_h->GetName(); - // Get Y-projection (sec+0.2*lay) - TH1D *m_hY = dynamic_cast<TH2F* >(m_h)->ProjectionY(Form("%s_hY",m_hname.c_str()),0,-1,""); - // set bin labels - CscPrdBins::PrdBinLabels(m_hY,-1); - // register histogram with Overview/CSCEC - sc = m_cscprd_oviewEC->regHist(m_hY); - if ( sc.isFailure() ) { - ATH_MSG_ERROR ( "Cannot register histogram " << m_hY->GetName() ); - return sc; - } - // Get X-projection (counts) - TH1D *m_hX = dynamic_cast<TH2F* >(m_h)->ProjectionX(Form("%s_hX",m_hname.c_str()),0,-1,"e"); - sc = m_cscprd_oviewEC->regHist(m_hX); - if ( sc.isFailure() ) { - ATH_MSG_ERROR ( "Cannot register histogram " << m_hX->GetName() ); - return sc; - } - } // end if hist2d - } // end if m_h - } // end for - - //MonGroup m_cscprd_oviewEA( this, m_cscGenPath+"CSC/Overview/CSCEA", shift, run ); - for(size_t j = 0; j < m_regHOviewEA.size(); j++ ) { - TH1 *m_h(0); - m_h = m_regHOviewEA[j]; - if(m_h != NULL) { - */ - } // end isEndOfRun - - return sc; - } - // // checkHists ---------------------------------------------------------------- // diff --git a/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/CscRawDataMonitoring/src/CscRdoValAlg.cxx b/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/CscRawDataMonitoring/src/CscRdoValAlg.cxx index e200d06ef91862c672eaecc3d190a3a46e0fa88b..b9c8ff76d3f817a841eb5837988b7ddccc0fdd01 100755 --- a/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/CscRawDataMonitoring/src/CscRdoValAlg.cxx +++ b/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/CscRawDataMonitoring/src/CscRdoValAlg.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~// @@ -15,9 +15,6 @@ // Athena include(s) #include "CscRawDataMonitoring/CscRdoValAlg.h" -#include "MuonIdHelpers/CscIdHelper.h" -#include "MuonCSC_CnvTools/ICSC_RDO_Decoder.h" - #include "MuonRDO/CscRawData.h" #include "MuonRDO/CscRawDataCollection.h" @@ -100,19 +97,12 @@ CscRdoValAlg::~CscRdoValAlg() { // initialize ---------------------------------------------------------------- // StatusCode CscRdoValAlg::initialize() { - - ATH_MSG_DEBUG ( "CscRdoValAlg : in initialize()" ); - - ATH_CHECK( m_muonIdHelperTool.retrieve() ); - ATH_MSG_DEBUG ( " Found the CscIdHelper. " ); - + ATH_CHECK(ManagedMonitorToolBase::initialize()); + ATH_MSG_DEBUG ("CscRdoValAlg : in initialize()"); + ATH_CHECK(m_idHelperSvc.retrieve()); ATH_CHECK(m_cscRdoDecoderTool.retrieve()); - ATH_CHECK(m_cscRdoKey.initialize()); - - ManagedMonitorToolBase::initialize().ignore(); // Ignore the checking code; return StatusCode::SUCCESS; - } @@ -212,10 +202,6 @@ void CscRdoValAlg::bookRdoHistograms(){ float nyminEC = -17.; // float nymaxEC = 0.; // ///******************** DO NOT MODIFY (end) ***********************************************/// - - //if (newEventsBlock){} - //if (newLumiBlock){} - //if (newRun) { // book histograms m_h1csc_rdo_maxdiffamp = new TH1F("h1csc_rdo_maxdiffamp", "Max Amplitude in ROD Cluster;ADC counts;;",500,0,5000); @@ -408,8 +394,6 @@ void CscRdoValAlg::bookRdoHistograms(){ m_regHExpert.push_back(m_h2csc_rdo_eta_vs_phi_cluswidth); // expert - //} - } // @@ -422,10 +406,6 @@ StatusCode CscRdoValAlg::bookHistograms(){ bookRdoHistograms(); - //if (newEventsBlock){} - //if (newLumiBlock){} - //if (newRun) { - //declare a group of histograms MonGroup cscrdo_shift( this, m_cscRDOPath+"/Shift", run, ATTRIB_MANAGED ); MonGroup cscrdo_expert( this, m_cscRDOPath+"/Expert", run, ATTRIB_MANAGED ); @@ -538,22 +518,18 @@ StatusCode CscRdoValAlg::fillHistograms() { // Identify side(A/C), sector(1-16)/layer(1-4) stationId = m_cscRdoDecoderTool->stationIdentifier(raw); channelId = m_cscRdoDecoderTool->channelIdentifier(raw,0); - int stationName = m_muonIdHelperTool->cscIdHelper().stationName(channelId); - std::string stationString = m_muonIdHelperTool->cscIdHelper().stationNameString(stationName); + int stationName = m_idHelperSvc->cscIdHelper().stationName(channelId); + std::string stationString = m_idHelperSvc->cscIdHelper().stationNameString(stationName); int chamberType = stationString == "CSS" ? 0 : 1; - int stationEta = m_muonIdHelperTool->cscIdHelper().stationEta(channelId); - int stationPhi = m_muonIdHelperTool->cscIdHelper().stationPhi(channelId); - int wireLayer = m_muonIdHelperTool->cscIdHelper().wireLayer(channelId); - int measuresPhi = m_muonIdHelperTool->cscIdHelper().measuresPhi(channelId); + int stationEta = m_idHelperSvc->cscIdHelper().stationEta(channelId); + int stationPhi = m_idHelperSvc->cscIdHelper().stationPhi(channelId); + int wireLayer = m_idHelperSvc->cscIdHelper().wireLayer(channelId); + int measuresPhi = m_idHelperSvc->cscIdHelper().measuresPhi(channelId); // determine the sector number int sectorNo = stationEta * (2 * stationPhi - chamberType); - // check boundaries of sector/layer - redundancy - //if(!(sectorNo+16) < 33) sectorNo = 0; - //if(!(wireLayer < 5)) wireLayer = 0; - // compute the indices to store cluster count int ns = sectorNo < 0 ? sectorNo*(-1) : sectorNo+16; // [-16 -> -1] shifted to [1 -> 16] and [+1 -> +16] shifted to [+17 -> +32] int nl = (measuresPhi ? wireLayer : wireLayer+4); // [ 1 -> 4] (phi-layers) and [5 -> 8] (eta-layers) @@ -574,7 +550,6 @@ StatusCode CscRdoValAlg::fillHistograms() { int xfac = measuresPhi ? -1 : 1; // -48 / +192 // this way we get 4 time samples per strip - // no of strips = width ATH_MSG_DEBUG ( " Width of ROD cluster : " << raw->width() ); uint16_t diff_max = 0, diff; std::vector<float> xVals ; /*, m_yVals;*/ @@ -594,14 +569,13 @@ StatusCode CscRdoValAlg::fillHistograms() { // identify this strip Identifier chID = m_cscRdoDecoderTool->channelIdentifier(raw, n); - int strip = m_muonIdHelperTool->cscIdHelper().strip(chID); + int strip = m_idHelperSvc->cscIdHelper().strip(chID); float stripId = strip * xfac; // x-axis fill value m_h2csc_rdo_hitmap->Fill(stripId, secLayer); // fill hitmap // for every strip that has a hit, store the X,Y values xVals.push_back(stripId); - //m_yVals.push_back(secLayer); // extract the (four) time samples for this strip std::vector<uint16_t> samples; @@ -741,78 +715,6 @@ StatusCode CscRdoValAlg::fillHistograms() { return sc; } -// -// procHistograms ---------------------------------------------------------------- -// -StatusCode CscRdoValAlg::procHistograms() { - ATH_MSG_DEBUG ( "CscRdoValAlg : in procHistograms()" ); - StatusCode sc = StatusCode::SUCCESS; - /*if(isEndOfRun){ - std::string m_cscGenPath = m_cscRDOPath.substr(0,m_cscRDOPath.find("CSC")); - //MonGroup m_cscrdo_oviewEC( this, m_cscGenPath+"CSC/Overview/CSCEC", shift, run ); - for(size_t j = 0; j < m_regHOviewEC.size(); j++ ) { - TH1 *m_h(0); - m_h = m_regHOviewEC[j]; - if(m_h != NULL) { - bool m_hist2d = m_h->IsA()->InheritsFrom("TH2"); - if(m_hist2d) { - std::string m_hname = m_h->GetName(); - // Get Y-projection (sec+0.2*lay) - TH1D *m_hY = dynamic_cast<TH2F* >(m_h)->ProjectionY(Form("%s_hY",m_hname.c_str()),0,-1,""); - // set bin labels - CscRdoBins::RdoBinLabels(m_hY,-1); - // register histogram with Overview/CSCEC - sc = m_cscrdo_oviewEC->regHist(m_hY); - if ( sc.isFailure() ) { - ATH_MSG_ERROR ( "Cannot register histogram " << m_hY->GetName() ); - return sc; - } - // Get X-projection (counts) - TH1D *m_hX = dynamic_cast<TH2F* >(m_h)->ProjectionX(Form("%s_hX",m_hname.c_str()),0,-1,"e"); - sc = m_cscrdo_oviewEC->regHist(m_hX); - if ( sc.isFailure() ) { - ATH_MSG_ERROR ( "Cannot register histogram " << m_hX->GetName() ); - return sc; - } - } // end if hist2d - } // end if m_h - } // end for - - //MonGroup m_cscrdo_oviewEA( this, m_cscGenPath+"CSC/Overview/CSCEA", shift, run ); - for(size_t j = 0; j < m_regHOviewEA.size(); j++ ) { - TH1 *m_h(0); - m_h = m_regHOviewEA[j]; - if(m_h != NULL) { - bool m_hist2d = m_h->IsA()->InheritsFrom("TH2"); - if(m_hist2d) { - std::string m_hname = m_h->GetName(); - // Get Y-projection (sec+0.2*lay) - TH1D *m_hY = dynamic_cast<TH2F* >(m_h)->ProjectionY(Form("%s_hY",m_hname.c_str()),0,-1,""); - // set bin labels - CscRdoBins::RdoBinLabels(m_hY,1); - // register histogram with Overview/CSCEA - sc = m_cscrdo_oviewEA->regHist(m_hY); - if ( sc.isFailure() ) { - ATH_MSG_ERROR ( "Cannot register histogram " << m_hY->GetName() ); - return sc; - } - // Get X-projection (counts) - TH1D *m_hX = dynamic_cast<TH2F* >(m_h)->ProjectionX(Form("%s_hX",m_hname.c_str()),0,-1,"e"); - sc = m_cscrdo_oviewEA->regHist(m_hX); - if ( sc.isFailure() ) { - ATH_MSG_ERROR ( "Cannot register histogram " << m_hX->GetName() ); - return sc; - } - } // end if hist2d - } // end if m_h - } // end for - - } // end isEndOfRun*/ - - return sc; -} - - // // checkHists ---------------------------------------------------------------- // diff --git a/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/MdtRawDataMonitoring/MdtRawDataMonitoring/MdtRawDataValAlg.h b/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/MdtRawDataMonitoring/MdtRawDataMonitoring/MdtRawDataValAlg.h index 3393a01813d1e749dc1436af2b80a2b4036fb31b..ccac9d53b25db4f80e28dd674fa7038caa0abc8e 100755 --- a/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/MdtRawDataMonitoring/MdtRawDataMonitoring/MdtRawDataValAlg.h +++ b/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/MdtRawDataMonitoring/MdtRawDataMonitoring/MdtRawDataValAlg.h @@ -14,18 +14,17 @@ #ifndef MdtRawDataValAlg_H #define MdtRawDataValAlg_H -//Core Include #include "AthenaMonitoring/ManagedMonitorToolBase.h" +#include "GaudiKernel/ServiceHandle.h" #include "GaudiKernel/ToolHandle.h" -//Helper Includes #include "MuonAnalysisInterfaces/IMuonSelectionTool.h" #include "MdtRawDataMonitoring/MuonChamberIDSelector.h" #include "MdtRawDataMonitoring/MDTMonGroupStruct.h" #include "MdtRawDataMonitoring/MDTNoisyTubes.h" #include "MdtRawDataMonitoring/MDTChamber.h" #include "MuonDQAUtils/MuonDQAHistMap.h" -#include "MuonIdHelpers/MuonIdHelperTool.h" +#include "MuonIdHelpers/IMuonIdHelperSvc.h" #include "TrkSegment/SegmentCollection.h" #include "AthenaMonitoring/DQAtlasReadyFilterTool.h" #include "EventInfo/EventInfo.h" @@ -36,13 +35,11 @@ #include "MuonReadoutGeometry/MuonDetectorManager.h" #include "xAODEventInfo/EventInfo.h" #include "StoreGate/ReadHandleKey.h" -//standard library includes + #include <fstream> #include <cstdlib> #include <iostream> -class Identifier; -class IdentifierHash; class MuonDQAHistList; namespace Muon { @@ -117,8 +114,7 @@ class MdtRawDataValAlg: public ManagedMonitorToolBase { MDTMonGroupStruct* m_mg; MDTNoisyTubes* m_masked_tubes; - ToolHandle<Muon::MuonIdHelperTool> m_muonIdHelperTool{this, "idHelper", - "Muon::MuonIdHelperTool/MuonIdHelperTool", "Handle to the MuonIdHelperTool"}; + ServiceHandle<Muon::IMuonIdHelperSvc> m_idHelperSvc {this, "MuonIdHelperSvc", "Muon::MuonIdHelperSvc/MuonIdHelperSvc"}; ToolHandle<CP::IMuonSelectionTool> m_muonSelectionTool; // MuonDetectorManager from the conditions store @@ -129,13 +125,11 @@ class MdtRawDataValAlg: public ManagedMonitorToolBase { virtual StatusCode bookMDTHistograms( MDTChamber* chamber, Identifier digcoll_id );//book chamber by chamber histos virtual StatusCode fillMDTHistograms( const Muon::MdtPrepData* );//fill chamber by chamber histos virtual StatusCode bookMDTSummaryHistograms( bool newLumiBlock, bool newRun);//Those over barrel/encap layer etc. - //virtual StatusCode fillMDTSummaryHistograms( const Muon::MdtPrepData*, bool &isNoiseBurstCandidate); virtual StatusCode fillMDTSummaryHistograms( const Muon::MdtPrepData*, std::set<std::string>, bool &isNoiseBurstCandidate); virtual StatusCode bookMDTOverviewHistograms( bool newLumiBlock, bool newRun); virtual StatusCode fillMDTOverviewHistograms(const Muon::MdtPrepData*, bool &isNoiseBurstCandidate); StatusCode handleEvent_effCalc(const Trk::SegmentCollection* segms);//, const Muon::MdtPrepDataContainer* mdt_container ); - //MDTRawDataUtils_cxx bool AinB( int A, std::vector<int> & B ); virtual StatusCode binMdtGlobal( TH2* &, char ecap ); virtual StatusCode binMdtRegional( TH2* &, std::string &xAxis); @@ -181,12 +175,8 @@ class MdtRawDataValAlg: public ManagedMonitorToolBase { uint32_t m_time; uint32_t m_firstTime; int m_numberOfEvents; - //int m_time; - // - SG::ReadHandleKey<Trk::SegmentCollection> m_segm_type{this,"Eff_segm_type","MuonSegments","muon segments"}; - /* StatusCode analyseSegments_effCalc(); */ std::string returnString(int i){ std::stringstream ss; @@ -213,7 +203,6 @@ class MdtRawDataValAlg: public ManagedMonitorToolBase { bool m_doMdtESD ; - //bool m_booked; // to book or not bookMDTTDCplots --> /Chambers/tmp/ directory bool m_doChamberHists; bool m_isOnline; @@ -236,24 +225,11 @@ class MdtRawDataValAlg: public ManagedMonitorToolBase { //Define configurable adccut and TGC/RPC keys float m_ADCCut; float m_ADCCut_Bkgrd; -// float m_TDCCut_Bkgrd; float m_curTime; -// int m_TGCKey; -// int m_RPCKey; - - - //nobody looks at these histograms --> remove for now, to improve memory consumption - //TH1* mdtevents_RPCtrig; // Total number of MDT digits RPCtrig - //TH1* mdtevents_TGCtrig; // Total number of MDT digits TGCtrig - //TH1* mdthitsvseventnum; - //TH1* mdthitsvseventnumcut; - //TH1* overalltdccut_RPCtrig; // all chambers tdc superimposed with adc cut - //TH1* overalltdccut_TGCtrig; // all chambers tdc superimposed with adc cut //From Old BS TH2* m_overalltdcadcLumi; // all chambers tdc vs adc superimposed TH2* m_overalltdcadcPRLumi[4]; // all chambers tdc vs adc superimposed - // TH1* overalltdc; // all chambers tdc superimposed TH1* m_overalltdccutLumi; // all chambers tdc superimposed with adc cut TH1* m_overalltdccut_segm_Lumi; // all chambers tdc superimposed with adc cut TH1* m_overalladc_segm_Lumi; // all chambers adc on segm @@ -277,10 +253,8 @@ class MdtRawDataValAlg: public ManagedMonitorToolBase { TH1* m_overalladcPR_HighOcc[4]; // all chambers tdc superimposed with adc cut per region TH2* m_overall_mdt_DRvsDT; - // TH2* overall_mdt_DRvsDRerr; TH2* m_overall_mdt_DRvsSegD; TH2* m_overallPR_mdt_DRvsDT[4]; - // TH2* overallPR_mdt_DRvsDRerr[4]; TH2* m_overallPR_mdt_DRvsSegD[4]; TH2* m_MdtNHitsvsRpcNHits; @@ -317,19 +291,13 @@ class MdtRawDataValAlg: public ManagedMonitorToolBase { ///////////For t0 calculations////////// TH1* m_mdttdccut_sector[4][4][16]; //// [endcap/barrel A/C][layer][sector] - //These can be left to the post-processing -/* TH1* mdttdccut_t0[4]; //Just four plot */ -/* TH1* mdttdccut_tmax[4]; //Just four plot */ -/* TH1* mdttdccut_tdrift[4]; //Just four plot */ //Chamber by Chamber Plots - // std::map< IdentifierHash, MDTChamber* >* m_hist_map; std::vector< MDTChamber* >* m_hist_hash_list; void clear_hist_map(bool reallocate=true); std::string getChamberName(const Muon::MdtPrepData*); std::string getChamberName(Identifier); - // std::string getChamberName(IdentifierHash); StatusCode getChamber(IdentifierHash id, MDTChamber* &chamber); //Control for which histograms to add @@ -362,9 +330,7 @@ class MdtRawDataValAlg: public ManagedMonitorToolBase { bool m_do_mdt_DRvsSegD; bool m_do_mdttubenoise; bool m_do_mdttdctube; - // - // NEW float m_nb_hits; //minimum number of hits in segment float m_road_width; //road width for pattern recognition float m_chi2_cut; //track chi2 cut; diff --git a/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/MdtRawDataMonitoring/MdtRawDataMonitoring/MuonChamberIDSelector.h b/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/MdtRawDataMonitoring/MdtRawDataMonitoring/MuonChamberIDSelector.h index 2a3bb85a650c9eb08019bdb2442baa6b65fde10c..f8f886aa82703da65021c1bef6a7f5cfc9edd514 100644 --- a/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/MdtRawDataMonitoring/MdtRawDataMonitoring/MuonChamberIDSelector.h +++ b/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/MdtRawDataMonitoring/MdtRawDataMonitoring/MuonChamberIDSelector.h @@ -1,59 +1,37 @@ /* - Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ -/////////////////////////////////////////////////////////////////// -// MuonChamberIDSelector.h -/////////////////////////////////////////////////////////////////// - #ifndef MUONCHAMBERIDSELECTOR_H #define MUONCHAMBERIDSELECTOR_H -//Base class #include "AthenaBaseComps/AthAlgorithm.h" +#include "GaudiKernel/ServiceHandle.h" +#include "MuonIdHelpers/IMuonIdHelperSvc.h" #include <string> #include <sstream> #include <vector> -#include "MuonIdHelpers/MuonIdHelperTool.h" - -class Identifier; - class MuonChamberIDSelector : public AthAlgorithm { public: MuonChamberIDSelector(const std::string &name,ISvcLocator *pSvcLocator); //!< Athena algorithm constructor - virtual ~MuonChamberIDSelector(); + virtual ~MuonChamberIDSelector()=default; // Basic algorithm methods: virtual StatusCode initialize(); //!< Algorithm initialization: retrieves StoreGate/DetectorStore/MuonIdHelpers/MuonPrepDataContainers virtual StatusCode execute(); //!< Retrieves and records containers, performs selection - virtual StatusCode finalize(); //!< Does nothing - - /** vector of identifiers of mdt chambers */ - // std::vector<Identifier>& mdtchambersId() const; - StatusCode ChamberperformSelection() ; - // StatusCode selectMDT(std::vector<Identifier>& mdtchambersId) ; - StatusCode selectMDT() ; - StatusCode selectRPC() ; //!< selects the RPCcollections - StatusCode selectTGC() ; //!< selects the TGCcollections - StatusCode selectCSC() ; //!< selects the CSCcollections + StatusCode selectMDT(); + StatusCode selectRPC(); //!< selects the RPCcollections + StatusCode selectTGC(){return StatusCode::SUCCESS;} //!< selects the TGCcollections + StatusCode selectCSC(){return StatusCode::SUCCESS;} //!< selects the CSCcollections - //std::vector<Identifier> m_mdtchambersId; private: - - ToolHandle<Muon::MuonIdHelperTool> m_muonIdHelperTool{this, "idHelper", - "Muon::MuonIdHelperTool/MuonIdHelperTool", "Handle to the MuonIdHelperTool"}; - + ServiceHandle<Muon::IMuonIdHelperSvc> m_idHelperSvc {this, "MuonIdHelperSvc", "Muon::MuonIdHelperSvc/MuonIdHelperSvc"}; std::vector<Identifier>* m_mdtchambersId; std::vector<Identifier>* m_rpcchambersId; - }; - -//inline std::vector<Identifier>& MuonChamberIDSelector::mdtchambersId() const { -// return m_mdtchambersId; -// } - + #endif diff --git a/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/MdtRawDataMonitoring/python/MDTMonitorAlgorithm.py b/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/MdtRawDataMonitoring/python/MDTMonitorAlgorithm.py index 3098b02cfa8c028818a1590edfc8e1167f26a50e..fa68f8426b013223e33e36eec943efb70cdc8a5d 100644 --- a/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/MdtRawDataMonitoring/python/MDTMonitorAlgorithm.py +++ b/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/MdtRawDataMonitoring/python/MDTMonitorAlgorithm.py @@ -27,9 +27,6 @@ def MdtMonitoringConfig(inputFlags): from MuonConfig.MuonGeometryConfig import MuonGeoModelCfg result.merge(MuonGeoModelCfg(inputFlags)) - # Temporary, until we move to services/private tools-- from MuonSpectrometer/MuonConfig - result.addPublicTool( CompFactory.Muon.MuonIdHelperTool() ) - # The following class will make a sequence, configure algorithms, and link # them to GenericMonitoringTools from AthenaMonitoring import AthMonitorCfgHelper diff --git a/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/MdtRawDataMonitoring/src/MDTRawDataUtils.cxx b/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/MdtRawDataMonitoring/src/MDTRawDataUtils.cxx index 5bd78d1d75d75956778f5187f08701fd1f090542..370f37cec4b51497c48bccc70ebcef20a62975b1 100644 --- a/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/MdtRawDataMonitoring/src/MDTRawDataUtils.cxx +++ b/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/MdtRawDataMonitoring/src/MDTRawDataUtils.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ /////////////////////////////////////////////////////////////////////////// @@ -723,15 +723,15 @@ StatusCode MdtRawDataValAlg::fillMDTMaskedTubes(IdentifierHash idHash, const std std::set<Identifier> noisyTubes = m_masked_tubes->getNoiseList(idHash); for(std::set<Identifier>::const_iterator itr = noisyTubes.begin(); itr != noisyTubes.end(); ++itr){ Identifier digcoll_id = *itr; - int mdtlayer = m_muonIdHelperTool->mdtIdHelper().tubeLayer(digcoll_id); - if (m_muonIdHelperTool->mdtIdHelper().multilayer(digcoll_id)==2) { + int mdtlayer = m_idHelperSvc->mdtIdHelper().tubeLayer(digcoll_id); + if (m_idHelperSvc->mdtIdHelper().multilayer(digcoll_id)==2) { if ( hardware_name.at(1) == 'I' && hardware_name.at(3) != '8' ) mdtlayer += 4; else mdtlayer += 3; } - int mdttube= m_muonIdHelperTool->mdtIdHelper().tube(digcoll_id) + (mdtlayer-1) * m_muonIdHelperTool->mdtIdHelper().tubeMax(digcoll_id); - ChamberTubeNumberCorrection(mdttube, hardware_name, m_muonIdHelperTool->mdtIdHelper().tube(digcoll_id), mdtlayer-1); + int mdttube= m_idHelperSvc->mdtIdHelper().tube(digcoll_id) + (mdtlayer-1) * m_idHelperSvc->mdtIdHelper().tubeMax(digcoll_id); + ChamberTubeNumberCorrection(mdttube, hardware_name, m_idHelperSvc->mdtIdHelper().tube(digcoll_id), mdtlayer-1); h->Fill(mdttube, 1); } return StatusCode::SUCCESS; @@ -745,20 +745,20 @@ void MdtRawDataValAlg::mdtchamberId() { ATH_MSG_DEBUG("in MDT ChambersIDvector" ); - std::vector<Identifier>::const_iterator idfirst = m_muonIdHelperTool->mdtIdHelper().module_begin(); - std::vector<Identifier>::const_iterator idlast = m_muonIdHelperTool->mdtIdHelper().module_end(); + std::vector<Identifier>::const_iterator idfirst = m_idHelperSvc->mdtIdHelper().module_begin(); + std::vector<Identifier>::const_iterator idlast = m_idHelperSvc->mdtIdHelper().module_end(); - IdContext mdtModuleContext = m_muonIdHelperTool->mdtIdHelper().module_context(); + IdContext mdtModuleContext = m_idHelperSvc->mdtIdHelper().module_context(); Identifier Id; IdentifierHash Idhash; for (std::vector<Identifier>::const_iterator i = idfirst; i != idlast; i++) { Id=*i; - int gethash_code = m_muonIdHelperTool->mdtIdHelper().get_hash(Id, Idhash, &mdtModuleContext); + int gethash_code = m_idHelperSvc->mdtIdHelper().get_hash(Id, Idhash, &mdtModuleContext); m_chambersId.push_back(Id); m_chambersIdHash.push_back(Idhash); - std::string extid = m_muonIdHelperTool->mdtIdHelper().show_to_string(Id); + std::string extid = m_idHelperSvc->mdtIdHelper().show_to_string(Id); ATH_MSG_DEBUG("Adding the chamber Identifier: " << extid ); if (gethash_code == 0) { ATH_MSG_DEBUG(" its hash Id is " << Idhash ); @@ -774,10 +774,9 @@ void MdtRawDataValAlg::mdtchamberId() // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * int MdtRawDataValAlg::mezzmdt(Identifier digcoll_id) { //int mezz_chamber, int mezz_eta, int mezz_ml, int mezz_tube, int max_tube) { int TotmezzTubes = 8; - if( m_muonIdHelperTool->mdtIdHelper().tubeLayerMax(digcoll_id) == 4 ) + if( m_idHelperSvc->mdtIdHelper().tubeLayerMax(digcoll_id) == 4 ) TotmezzTubes = 6; - // if (mezz_chamber==1 || mezz_chamber==2 || mezz_chamber==8 || mezz_chamber==13) TotmezzTubes=6 ; // old way of doing things that didn't work - int Imezz = (int)((m_muonIdHelperTool->mdtIdHelper().tube(digcoll_id)-1)/TotmezzTubes) + (int)((m_muonIdHelperTool->mdtIdHelper().multilayer(digcoll_id)-1)*((m_muonIdHelperTool->mdtIdHelper().tubeMax(digcoll_id))/TotmezzTubes)); + int Imezz = (int)((m_idHelperSvc->mdtIdHelper().tube(digcoll_id)-1)/TotmezzTubes) + (int)((m_idHelperSvc->mdtIdHelper().multilayer(digcoll_id)-1)*((m_idHelperSvc->mdtIdHelper().tubeMax(digcoll_id))/TotmezzTubes)); return Imezz; } @@ -786,9 +785,9 @@ int MdtRawDataValAlg::mezzmdt(Identifier digcoll_id) { //int mezz_chamber, int m // the 'if' statements are for chambers with ML1 != ML2 // except for BIS8 -- mdtIdHelper gets the # layers wrong in this instance int MdtRawDataValAlg::GetTubeMax( const Identifier & digcoll_id, const std::string & hardware_name ) { - int numtubes = m_muonIdHelperTool->mdtIdHelper().tubeMax(digcoll_id); - int numlayers = m_muonIdHelperTool->mdtIdHelper().tubeLayerMax(digcoll_id); - int numML = m_muonIdHelperTool->mdtIdHelper().numberOfMultilayers(digcoll_id); + int numtubes = m_idHelperSvc->mdtIdHelper().tubeMax(digcoll_id); + int numlayers = m_idHelperSvc->mdtIdHelper().tubeLayerMax(digcoll_id); + int numML = m_idHelperSvc->mdtIdHelper().numberOfMultilayers(digcoll_id); int tubeMax = numtubes * numlayers * numML; if( hardware_name.substr(0,4) == "BIS8" ) // Why does mdtIdHelper get this one wrong? @@ -922,14 +921,14 @@ std::string MdtRawDataValAlg::getChamberName(const Muon::MdtPrepData* hit){ std::string MdtRawDataValAlg::getChamberName(Identifier id){ if(m_hist_hash_list) { IdentifierHash idHash; - m_muonIdHelperTool->mdtIdHelper().get_module_hash(id, idHash); + m_idHelperSvc->mdtIdHelper().get_module_hash(id, idHash); if( idHash < m_hist_hash_list->size() ) { MDTChamber* chamber = (*m_hist_hash_list)[idHash]; if(chamber) return chamber->getName(); - else return convertChamberName(m_muonIdHelperTool->mdtIdHelper().stationName(id),m_muonIdHelperTool->mdtIdHelper().stationEta(id),m_muonIdHelperTool->mdtIdHelper().stationPhi(id),"MDT"); + else return convertChamberName(m_idHelperSvc->mdtIdHelper().stationName(id),m_idHelperSvc->mdtIdHelper().stationEta(id),m_idHelperSvc->mdtIdHelper().stationPhi(id),"MDT"); } } - return convertChamberName(m_muonIdHelperTool->mdtIdHelper().stationName(id),m_muonIdHelperTool->mdtIdHelper().stationEta(id),m_muonIdHelperTool->mdtIdHelper().stationPhi(id),"MDT"); + return convertChamberName(m_idHelperSvc->mdtIdHelper().stationName(id),m_idHelperSvc->mdtIdHelper().stationEta(id),m_idHelperSvc->mdtIdHelper().stationPhi(id),"MDT"); } StatusCode MdtRawDataValAlg::getChamber(IdentifierHash id, MDTChamber* &chamber){ diff --git a/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/MdtRawDataMonitoring/src/MdtRawDataMonAlg.cxx b/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/MdtRawDataMonitoring/src/MdtRawDataMonAlg.cxx index 43cc30ac49ddb4bb55b19882547d67b8492cfcbf..1a2ce07ad7489b2c0df79cf7ec8a084ef68d8c82 100755 --- a/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/MdtRawDataMonitoring/src/MdtRawDataMonAlg.cxx +++ b/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/MdtRawDataMonitoring/src/MdtRawDataMonAlg.cxx @@ -552,21 +552,21 @@ void MdtRawDataMonAlg::fillMDTOverviewVects( const Muon::MdtPrepData* mdtCollect if( adc>m_ADCCut ) { //barrel - if(fabs(mdt_tube_eta)>0. && fabs(mdt_tube_eta)<0.9) { + if(std::abs(mdt_tube_eta)>0. && std::abs(mdt_tube_eta)<0.9) { vects.mdt_tube_x_barrel.push_back(mdtgPos.x()); vects.mdt_tube_y_barrel.push_back(mdtgPos.y()); vects.mdt_tube_z_barrel.push_back(mdtgPos.z()); vects.mdt_tube_perp_barrel.push_back(mdtgPos.perp()); } //OverLap -->Fill MDT Global RZ and YX - if(fabs(mdt_tube_eta)>0.9 && fabs(mdt_tube_eta)<1.2) { + if(std::abs(mdt_tube_eta)>0.9 && std::abs(mdt_tube_eta)<1.2) { vects.mdt_tube_x_ovl.push_back(mdtgPos.x()); vects.mdt_tube_y_ovl.push_back(mdtgPos.y()); vects.mdt_tube_z_ovl.push_back(mdtgPos.z()); vects.mdt_tube_perp_ovl.push_back(mdtgPos.perp()); } //EndCap -->Fill MDT Global RZ and YX - if(fabs(mdt_tube_eta)>1.2 && fabs(mdt_tube_eta)<2.7){ + if(std::abs(mdt_tube_eta)>1.2 && std::abs(mdt_tube_eta)<2.7){ vects.mdt_tube_x_endcap.push_back(mdtgPos.x()); vects.mdt_tube_y_endcap.push_back(mdtgPos.y()); vects.mdt_tube_z_endcap.push_back(mdtgPos.z()); diff --git a/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/MdtRawDataMonitoring/src/MdtRawDataValAlg.cxx b/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/MdtRawDataMonitoring/src/MdtRawDataValAlg.cxx index 3cc00ba39eda01db6090c9a6d20207cabcedc91f..0bc7b9b7c7e77f59e93355c61d08cdc565e16463 100755 --- a/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/MdtRawDataMonitoring/src/MdtRawDataValAlg.cxx +++ b/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/MdtRawDataMonitoring/src/MdtRawDataValAlg.cxx @@ -27,7 +27,6 @@ #include "MuonDQAUtils/MuonChambersRange.h" #include "MuonDQAUtils/MuonDQAHistMap.h" #include "MuonCalibIdentifier/MuonFixedId.h" -#include "MuonIdHelpers/MdtIdHelper.h" #include "MdtCalibFitters/MTStraightLine.h" #include "MuonSegment/MuonSegment.h" @@ -77,8 +76,6 @@ MdtRawDataValAlg::MdtRawDataValAlg( const std::string & type, const std::string m_overalltdccut_segm_Lumi(0), m_overalladc_segm_Lumi(0), m_overalladc_Lumi(0), - //overalltdccut_RPCtrig(0), - //overalltdccut_TGCtrig(0), m_overalltdcadcHighOcc(0), m_overalltdcHighOcc(0), m_overalltdcHighOcc_ADCCut(0), @@ -90,8 +87,6 @@ MdtRawDataValAlg::MdtRawDataValAlg( const std::string & type, const std::string m_mdteventscutLumi_big(0), m_mdteventsLumi(0), m_mdteventsLumi_big(0), - //mdthitsvseventnum(0), - //mdthitsvseventnumcut(0), m_mdtglobalhitstime(0), m_nummdtchamberswithhits(0), m_nummdtchamberswithhits_ADCCut(0), @@ -113,9 +108,6 @@ MdtRawDataValAlg::MdtRawDataValAlg( const std::string & type, const std::string declareProperty("StationPhi", m_StationPhi=-100); declareProperty("ADCCut", m_ADCCut=50.); declareProperty("ADCCutForBackground", m_ADCCut_Bkgrd=80.); -// declareProperty("MaxTDCCutForBackground", m_TDCCut_Bkgrd=50.); -// declareProperty("RPCTrigKey", m_RPCKey=144); -// declareProperty("TGCTrigKey", m_TGCKey=136); declareProperty("Eff_nHits", m_nb_hits=5.); declareProperty("Eff_roadWidth", m_road_width=2.); declareProperty("Eff_chi2Cut", m_chi2_cut=10.); @@ -171,10 +163,7 @@ MdtRawDataValAlg::~MdtRawDataValAlg() StatusCode MdtRawDataValAlg::initialize() /*---------------------------------------------------------*/ { - //initialize to stop coverity bugs - //mdtevents_RPCtrig = 0; - //mdtevents_TGCtrig=0; m_MdtNHitsvsRpcNHits = 0; m_lumiblock = 0; m_eventNum = 0; @@ -212,9 +201,6 @@ StatusCode MdtRawDataValAlg::initialize() m_mdtchamberstatphislice[i]=0; } - - - // init message stream ATH_MSG_INFO("initialize MdtRawDataValAlg" ); @@ -222,8 +208,6 @@ StatusCode MdtRawDataValAlg::initialize() ATH_MSG_DEBUG("doMdtESD: " << m_doMdtESD ); ATH_MSG_DEBUG("******************" ); - StatusCode sc; - //If Online ensure that lowStat histograms are made at the runLevel and that _lowStat suffix is suppressed if(m_isOnline) m_mg = new MDTMonGroupStruct(this, m_title, ManagedMonitorToolBase::run, ManagedMonitorToolBase::MgmtAttr_t::ATTRIB_UNMANAGED, ""); else m_mg = new MDTMonGroupStruct(this, m_title, ManagedMonitorToolBase::lowStat, ManagedMonitorToolBase::MgmtAttr_t::ATTRIB_UNMANAGED, "_lowStat"); @@ -233,22 +217,8 @@ StatusCode MdtRawDataValAlg::initialize() // MuonDetectorManager from the conditions store ATH_CHECK(m_DetectorManagerKey.initialize()); - - sc = m_muonIdHelperTool.retrieve(); - if (sc.isFailure()) { - ATH_MSG_FATAL("Cannot get MuonIdHelperTool" ); - return StatusCode::FAILURE; - } - else { - ATH_MSG_DEBUG(" Found the MuonIdHelperTool. " ); - } - - sc = m_DQFilterTools.retrieve(); - if( !sc ) { - ATH_MSG_ERROR("Could Not Retrieve AtlasFilterTool " << m_DQFilterTools); - return StatusCode::FAILURE; - } - + ATH_CHECK(m_idHelperSvc.retrieve()); + ATH_CHECK(m_DQFilterTools.retrieve()); ATH_CHECK(m_muonSelectionTool.retrieve()); //back to MDTS... @@ -267,17 +237,14 @@ StatusCode MdtRawDataValAlg::initialize() // MuonDetectorManager from the Detector Store std::string managerName="Muon"; - const MuonGM::MuonDetectorManager* MuonDetMgrDS; - sc = detStore()->retrieve(MuonDetMgrDS); - if (sc.isFailure()) { - ATH_MSG_INFO("Could not find the MuonGeoModel Manager: " << managerName << " from the Detector Store! " ); - return StatusCode::FAILURE; - } else { ATH_MSG_DEBUG(" Found the MuonGeoModel Manager from the Detector Store" );} - - m_BMGpresent = m_muonIdHelperTool->mdtIdHelper().stationNameIndex("BMG") != -1; + const MuonGM::MuonDetectorManager* MuonDetMgrDS=nullptr; + ATH_CHECK(detStore()->retrieve(MuonDetMgrDS)); + ATH_MSG_DEBUG(" Found the MuonGeoModel Manager from the Detector Store" ); + + m_BMGpresent = m_idHelperSvc->mdtIdHelper().stationNameIndex("BMG") != -1; if(m_BMGpresent){ ATH_MSG_INFO("Processing configuration for layouts with BMG chambers."); - m_BMGid = m_muonIdHelperTool->mdtIdHelper().stationNameIndex("BMG"); + m_BMGid = m_idHelperSvc->mdtIdHelper().stationNameIndex("BMG"); for(int phi=6; phi<8; phi++) { // phi sectors for(int eta=1; eta<4; eta++) { // eta sectors for(int side=-1; side<2; side+=2) { // side @@ -341,8 +308,8 @@ StatusCode MdtRawDataValAlg::bookHistogramsRecurrent( /*bool isNewEventsBlock, b ATH_MSG_DEBUG("MdtRawDataValAlg::MDT RawData Monitoring Histograms being filled" ); for(std::vector<Identifier>::const_iterator itr = m_chambersId.begin(); itr != m_chambersId.end(); ++itr, ++counter){ - std::string hardware_name = convertChamberName(m_muonIdHelperTool->mdtIdHelper().stationName(*itr),m_muonIdHelperTool->mdtIdHelper().stationEta(*itr), - m_muonIdHelperTool->mdtIdHelper().stationPhi(*itr),"MDT"); + std::string hardware_name = convertChamberName(m_idHelperSvc->mdtIdHelper().stationName(*itr),m_idHelperSvc->mdtIdHelper().stationEta(*itr), + m_idHelperSvc->mdtIdHelper().stationPhi(*itr),"MDT"); //Skip Chambers That Do NOT Exist if(hardware_name=="BML6A13" || hardware_name=="BML6C13") continue; @@ -480,10 +447,10 @@ StatusCode MdtRawDataValAlg::fillHistograms() if(!rot_from_track) continue; // rot_from_track->dump(msg()); Identifier rotId = rot_from_track->identify(); - if(!m_muonIdHelperTool->mdtIdHelper().is_mdt(rotId)) continue; + if(!m_idHelperSvc->mdtIdHelper().is_mdt(rotId)) continue; IdentifierHash mdt_idHash; MDTChamber* mdt_chamber = 0; - m_muonIdHelperTool->mdtIdHelper().get_module_hash( rotId, mdt_idHash ); + m_idHelperSvc->mdtIdHelper().get_module_hash( rotId, mdt_idHash ); sc = getChamber(mdt_idHash, mdt_chamber); std::string mdt_chambername = mdt_chamber->getName(); chambers_from_tracks.insert(mdt_chambername); @@ -510,12 +477,6 @@ StatusCode MdtRawDataValAlg::fillHistograms() nPrdcut++; isHit_above_ADCCut = true; } - // Identifier digcoll_id = (*mdtCollection)->identify(); - - - //Relic from cosmic days nolonger relevant - // if (selectChambersRange(hardware_name, m_chamberName, m_muonIdHelperTool->mdtIdHelper().stationEta(digcoll_id), m_StationEta, m_muonIdHelperTool->mdtIdHelper().stationPhi(digcoll_id), m_StationPhi, m_StationSize) ) - // { sc = fillMDTOverviewHistograms(*mdtCollection, isNoiseBurstCandidate); if(sc.isSuccess()) { @@ -526,7 +487,6 @@ StatusCode MdtRawDataValAlg::fillHistograms() return sc; } - // sc = fillMDTSummaryHistograms(*mdtCollection, isNoiseBurstCandidate); sc = fillMDTSummaryHistograms(*mdtCollection, chambers_from_tracks, isNoiseBurstCandidate); if(sc.isSuccess()) { @@ -677,27 +637,6 @@ StatusCode MdtRawDataValAlg::procHistograms(/*bool isEndOfEventsBlock, bool isEn sc = regHist((TH1F*) m_overalltdccutPRLumi[enumBarrelC]->Clone(), m_mg->mongroup_brC_shift); sc = regHist((TH1F*) m_overalltdccutPRLumi[enumEndCapA]->Clone(), m_mg->mongroup_ecA_shift); sc = regHist((TH1F*) m_overalltdccutPRLumi[enumEndCapC]->Clone(), m_mg->mongroup_ecC_shift); - - /*sc = regHist((TH1F*) m_overalltdcPR_HighOcc[enumBarrelA]->Clone(), m_mg->mongroup_brA_shift); - sc = regHist((TH1F*) m_overalltdcPR_HighOcc[enumBarrelC]->Clone(), m_mg->mongroup_brC_shift); - sc = regHist((TH1F*) m_overalltdcPR_HighOcc[enumEndCapA]->Clone(), m_mg->mongroup_ecA_shift); - sc = regHist((TH1F*) m_overalltdcPR_HighOcc[enumEndCapC]->Clone(), m_mg->mongroup_ecC_shift); - - sc = regHist((TH1F*) m_overalltdcPR_HighOcc_ADCCut[enumBarrelA]->Clone(), m_mg->mongroup_brA_shift); - sc = regHist((TH1F*) m_overalltdcPR_HighOcc_ADCCut[enumBarrelC]->Clone(), m_mg->mongroup_brC_shift); - sc = regHist((TH1F*) m_overalltdcPR_HighOcc_ADCCut[enumEndCapA]->Clone(), m_mg->mongroup_ecA_shift); - sc = regHist((TH1F*) m_overalltdcPR_HighOcc_ADCCut[enumEndCapC]->Clone(), m_mg->mongroup_ecC_shift); - - sc = regHist((TH1F*) m_overalladcPR_HighOcc[enumBarrelA]->Clone(), m_mg->mongroup_brA_shift); - sc = regHist((TH1F*) m_overalladcPR_HighOcc[enumBarrelC]->Clone(), m_mg->mongroup_brC_shift); - sc = regHist((TH1F*) m_overalladcPR_HighOcc[enumEndCapA]->Clone(), m_mg->mongroup_ecA_shift); - sc = regHist((TH1F*) m_overalladcPR_HighOcc[enumEndCapC]->Clone(), m_mg->mongroup_ecC_shift); - - //Book tdcadc per region per lowStat, NoiseBurst cut - sc = regHist((TH2F*) m_overalltdcadcPR_HighOcc[enumBarrelA]->Clone(), m_mg->mongroup_brA_shift); - sc = regHist((TH2F*) m_overalltdcadcPR_HighOcc[enumBarrelC]->Clone(), m_mg->mongroup_brC_shift); - sc = regHist((TH2F*) m_overalltdcadcPR_HighOcc[enumEndCapA]->Clone(), m_mg->mongroup_ecA_shift); - sc = regHist((TH2F*) m_overalltdcadcPR_HighOcc[enumEndCapC]->Clone(), m_mg->mongroup_ecC_shift); */ //Book adc adccut per region on & off segment sc = regHist((TH1F*) m_overalladc_segm_PR_Lumi[enumBarrelA]->Clone(), m_mg->mongroup_brA_shift); @@ -863,7 +802,7 @@ StatusCode MdtRawDataValAlg::bookMDTHistograms( MDTChamber* chamber, Identifier std::string hardware_name = chamber->getName(); IdentifierHash idHash; - m_muonIdHelperTool->mdtIdHelper().get_module_hash(digcoll_id, idHash); + m_idHelperSvc->mdtIdHelper().get_module_hash(digcoll_id, idHash); int tubeIdMax = GetTubeMax(digcoll_id, hardware_name); @@ -905,34 +844,6 @@ StatusCode MdtRawDataValAlg::bookMDTHistograms( MDTChamber* chamber, Identifier sc = bookMDTHisto_chambers(chamber->mdttdc, hardware_name + "_MDT_Station_TDC", "[nsec]", "Number of Entries", 100, 0, 2000., *mongroup_chambers_expert); - ////////////////////////////////////////////////////////////////////////////////////// - //histo path for mdt tdc trigger type RPC ML1 ADC Cut - ////////////////////////////////////////////////////////////////////////////////////// - /* if(m_do_mdttdccut_RPCtrig_ML1) - sc = bookMDTHisto_chambers(chamber->mdttdccut_RPCtrig_ML1, hardware_name + "_MDT_Station_TDC_ADCCut_RPCtrig_ML1", "[nsec]", "Number of Entries", - 100, 0, 2000., *mongroup_chambers_expert); - - ////////////////////////////////////////////////////////////////////////////////////// - //histo path for mdt tdc trigger type TGC ML1 - ////////////////////////////////////////////////////////////////////////////////////// - if(m_do_mdttdccut_TGCtrig_ML1) - sc = bookMDTHisto_chambers(chamber->mdttdccut_TGCtrig_ML1, hardware_name + "_MDT_Station_TDC_ADCCut_TGCtrig_ML1", "[nsec]", "Number of Entries", - 100, 0, 2000., *mongroup_chambers_expert); - - ////////////////////////////////////////////////////////////////////////////////////// - //histo path for mdt tdc trigger type RPC ML2 ADC Cut - ////////////////////////////////////////////////////////////////////////////////////// - if(m_do_mdttdccut_RPCtrig_ML2) - sc = bookMDTHisto_chambers(chamber->mdttdccut_RPCtrig_ML2, hardware_name + "_MDT_Station_TDC_ADCCut_RPCtrig_ML2", "[nsec]", "Number of Entries", - 100, 0, 2000., *mongroup_chambers_expert); - - ////////////////////////////////////////////////////////////////////////////////////// - //histo path for mdt tdc trigger type TGC ML2 - ////////////////////////////////////////////////////////////////////////////////////// - if(m_do_mdttdccut_TGCtrig_ML2) - sc = bookMDTHisto_chambers(chamber->mdttdccut_TGCtrig_ML2, hardware_name + "_MDT_Station_TDC_ADCCut_TGCtrig_ML2", "[nsec]", "Number of Entries", - 100, 0, 2000., *mongroup_chambers_expert); -*/ ////////////////////////////////////////////////////////////////////////////////////// //histo path for mdt tdccut ML1 ////////////////////////////////////////////////////////////////////////////////////// @@ -967,12 +878,6 @@ StatusCode MdtRawDataValAlg::bookMDTHistograms( MDTChamber* chamber, Identifier sc = bookMDTHisto_chambers(chamber->mdtadc, hardware_name + "_MDT_Station_ADC", "[adc counts]", "Number of Entries", 100, 0, 400., *mongroup_chambers_expert); - ////////////////////////////////////////////////////////////////////////////////////// - //histo path for mdt multilayer -/* if(m_do_mdtmultil) - sc = bookMDTHisto_chambers(chamber->mdtmultil, hardware_name + "_MDT_Station_MULTIL_ADCCut", "multilayerID", "Number of Entries", - 4, 0, 4., *mongroup_chambers_expert); -*/ ////////////////////////////////////////////////////////////////////////////////////// //histo path for mdt layer if(m_do_mdtlayer) @@ -985,18 +890,6 @@ StatusCode MdtRawDataValAlg::bookMDTHistograms( MDTChamber* chamber, Identifier sc = bookMDTHisto_chambers(chamber->mdttube, hardware_name + "_MDT_Station_TUBE_ADCCut", "tubeID", "Number of Entries", tubeIdMax, 1, tubeIdMax+1, *mongroup_chambers_expert); - ////////////////////////////////////////////////////////////////////////////////////// - //histo path for mdt tube bkgrd hits - /*if(m_do_mdttube_bkgrd) - sc = bookMDTHisto_chambers(chamber->mdttube_bkgrd, hardware_name + "_MDT_Station_TUBE_BKGRD_ADCCut", "tubeID", "Total Number of Hits", - tubeIdMax, 1, tubeIdMax+1, *mongroup_chambers_expert); - - ////////////////////////////////////////////////////////////////////////////////////// - //histo path for mdt tube counts for offline noise calculation - if(m_do_mdttube_fornoise) - sc = bookMDTHisto_chambers(chamber->mdttube_fornoise, hardware_name + "_MDT_Station_TUBE_fornoise", "tubeID", "Number of Entries", - tubeIdMax, 1, tubeIdMax+1, *mongroup_chambers_expert); -*/ ////////////////////////////////////////////////////////////////////////////////////// //histo path for mdt tube masked info if(m_do_mdttube_masked) { @@ -1194,18 +1087,6 @@ StatusCode MdtRawDataValAlg::bookMDTSummaryHistograms(/* bool isNewEventsBlock, if(newRun){ // //Book t0 tmax tdrift summary plots // //Just create these in the post-processing - // sc = bookMDTHisto_overview(mdttdccut_t0[enumBarrelA], "MDT_t0_BA", "sector", "[nsec]", 1, 0, 1,m_mg->mongroup_brA_shift); - // sc = bookMDTHisto_overview(mdttdccut_t0[enumBarrelC], "MDT_t0_BC", "sector", "[nsec]", 1, 0, 1,m_mg->mongroup_brC_shift); - // sc = bookMDTHisto_overview(mdttdccut_t0[enumEndCapA], "MDT_t0_EA", "sector", "[nsec]", 1, 0, 1,m_mg->mongroup_ecA_shift); - // sc = bookMDTHisto_overview(mdttdccut_t0[enumEndCapC], "MDT_t0_EC", "sector", "[nsec]", 1, 0, 1,m_mg->mongroup_ecC_shift); - // sc = bookMDTHisto_overview(mdttdccut_tmax[enumBarrelA], "MDT_tmax_BA", "sector", "[nsec]", 1, 0, 1,m_mg->mongroup_brA_shift); - // sc = bookMDTHisto_overview(mdttdccut_tmax[enumBarrelC], "MDT_tmax_BC", "sector", "[nsec]", 1, 0, 1,m_mg->mongroup_brC_shift); - // sc = bookMDTHisto_overview(mdttdccut_tmax[enumEndCapA], "MDT_tmax_EA", "sector", "[nsec]", 1, 0, 1,m_mg->mongroup_ecA_shift); - // sc = bookMDTHisto_overview(mdttdccut_tmax[enumEndCapC], "MDT_tmax_EC", "sector", "[nsec]", 1, 0, 1,m_mg->mongroup_ecC_shift); - // sc = bookMDTHisto_overview(mdttdccut_tdrift[enumBarrelA], "MDT_tdrift_BA", "sector", "[nsec]", 1, 0, 1,m_mg->mongroup_brA_shift); - // sc = bookMDTHisto_overview(mdttdccut_tdrift[enumBarrelC], "MDT_tdrift_BC", "sector", "[nsec]", 1, 0, 1,m_mg->mongroup_brC_shift); - // sc = bookMDTHisto_overview(mdttdccut_tdrift[enumEndCapA], "MDT_tdrift_EA", "sector", "[nsec]", 1, 0, 1,m_mg->mongroup_ecA_shift); - // sc = bookMDTHisto_overview(mdttdccut_tdrift[enumEndCapC], "MDT_tdrift_EC", "sector", "[nsec]", 1, 0, 1,m_mg->mongroup_ecC_shift); //histo path for MDT Summary plots Barrel-EndCap std::string ecap[4]={"BA","BC","EA","EC"}; @@ -1553,27 +1434,7 @@ StatusCode MdtRawDataValAlg::bookMDTOverviewHistograms(/* bool isNewEventsBlock, //histo path for TotalNumber_of_MDT_hits_per_event without a cut on ADC (for high mult. events) sc = bookMDTHisto_overview(m_mdteventsLumi_big, "TotalNumber_of_MDT_hits_per_event_big", "[counts]", "Number of Events", 200, 0., 100000., m_mg->mongroup_overview_shiftLumi); - ////////////////////////////////////////////////////////////////////////////////////// - //histo path for TotalNumber_of_MDT_hits_per_event_RPCtrig - /* sc = bookMDTHisto_overview(mdtevents_RPCtrig, "TotalNumber_of_MDT_hits_per_event_RPCtrig_ADCCut", "[counts]", - "Number of Events", 200, 0., 800., m_mg->mongroup_overview_shiftLumi); - - ////////////////////////////////////////////////////////////////////////////////////// - //histo path for TotalNumber_of_MDT_hits_per_event_TGCtrig - sc = bookMDTHisto_overview(mdtevents_TGCtrig, "TotalNumber_of_MDT_hits_per_event_TGCtrig_ADCCut", "[counts]", - "Number of Events", 200, 0., 800., m_mg->mongroup_overview_shiftLumi); - - ////////////////////////////////////////////////////////////////////////////////////// - //histo path for overall tdccut RPCtrig spectrum - sc = bookMDTHisto_overview(m_overalltdccut_RPCtrig, "Overall_TDC_ADCCut_RPCtrig_spectrum", "[nsec]", "Number of Entries", - 120, 0., 2000., m_mg->mongroup_overview_shiftLumi); - - ////////////////////////////////////////////////////////////////////////////////////// - //histo path for overall tdccut TGCtrig spectrum - sc = bookMDTHisto_overview(m_overalltdccut_TGCtrig, "Overall_TDC_ADCCut_TGCtrig_spectrum", "[nsec]", "Number of Entries", - 120, 0., 2000., m_mg->mongroup_overview_shiftLumi); - - */ + ////////////////////////////////////////////////////////////////////////////////////// //histo path for overall tdc vs adc spectrum sc = bookMDTHisto_overview_2D(m_overalltdcadcLumi, "Overall_TDCADC_spectrum", "[nsec]", "[adc counts]", 50, 0, 2000., @@ -1587,14 +1448,7 @@ StatusCode MdtRawDataValAlg::bookMDTOverviewHistograms(/* bool isNewEventsBlock, //histo path for Time_large_global_hits with a cut on ADC sc = bookMDTHisto_overview(m_mdtglobalhitstime, "Time_large_global_hits", "time", "Number of Events", 10000, 0., 10000., m_mg->mongroup_overview_shift); - /* - //histo path for TotalNumber_of_MDT_hits_vs_event_number without a cut on ADC - sc = bookMDTHisto_overview(mdthitsvseventnum, "TotalNumber_of_MDT_hits_vs_event_number", "event #", "Number of Hits", - 10000, 0., 10000., m_mg->mongroup_overview_shift); - //histo path for TotalNumber_of_MDT_hits_vs_event_number with a cut on ADC - sc = bookMDTHisto_overview(mdthitsvseventnumcut, "TotalNumber_of_MDT_hits_vs_event_number_ADCCut", "event #", "Number of Hits", - 10000, 0., 10000., m_mg->mongroup_overview_shift); - */ + //histo path for m_MdtNHitsvsRpcNHits sc = bookMDTHisto_overview_2D(m_MdtNHitsvsRpcNHits, "m_MdtNHitsvsRpcNHits", "# MDT hits","# RPC hits", 1000, 0., 100000., 100, 0., 10000., m_mg->mongroup_overview_shift); ////////////////////////////////////////////////////////////////////////////////////// @@ -1629,8 +1483,6 @@ StatusCode MdtRawDataValAlg::bookMDTOverviewHistograms(/* bool isNewEventsBlock, 1, 0., 1., m_mg->mongroup_overview_expert); for(std::vector<Identifier>::const_iterator itr = m_chambersId.begin(); itr != m_chambersId.end(); ++itr){ std::string hardware_name = getChamberName( *itr ); - // std::string hardware_name = convertChamberName(m_muonIdHelperTool->mdtIdHelper().stationName(*itr),m_muonIdHelperTool->mdtIdHelper().stationEta(*itr), - // m_muonIdHelperTool->mdtIdHelper().stationPhi(*itr),"MDT"); //Skip Chambers That Do NOT Exist if(hardware_name=="BML6A13" || hardware_name=="BML6C13") continue; m_mdtchamberstat->Fill( hardware_name.c_str(), 0.0); @@ -1676,30 +1528,17 @@ StatusCode MdtRawDataValAlg::fillMDTHistograms( const Muon::MdtPrepData* mdtColl // //convert layer numbering from 1->4 to 1->8 // //check if we are in 2nd multilayer // //then add 4 if large chamber, 3 if small chamber - int mdtlayer = m_muonIdHelperTool->mdtIdHelper().tubeLayer(digcoll_id); - if (m_muonIdHelperTool->mdtIdHelper().multilayer(digcoll_id)==2) { + int mdtlayer = m_idHelperSvc->mdtIdHelper().tubeLayer(digcoll_id); + if (m_idHelperSvc->mdtIdHelper().multilayer(digcoll_id)==2) { if ( hardware_name.at(1) == 'I' && hardware_name.at(3) != '8' ) mdtlayer += 4; else mdtlayer += 3; } - int mdttube= m_muonIdHelperTool->mdtIdHelper().tube(digcoll_id) + (mdtlayer-1) * m_muonIdHelperTool->mdtIdHelper().tubeMax(digcoll_id); - ChamberTubeNumberCorrection(mdttube, hardware_name, m_muonIdHelperTool->mdtIdHelper().tube(digcoll_id), mdtlayer-1); + int mdttube= m_idHelperSvc->mdtIdHelper().tube(digcoll_id) + (mdtlayer-1) * m_idHelperSvc->mdtIdHelper().tubeMax(digcoll_id); + ChamberTubeNumberCorrection(mdttube, hardware_name, m_idHelperSvc->mdtIdHelper().tube(digcoll_id), mdtlayer-1); bool isNoisy = m_masked_tubes->isNoisy( mdtCollection ); - // //// Verifiy back-conversion of tubeID -> tube/layer/ML - // int test_tube = 0; - // int test_layer = 0; - // int test_ML = 0; - // TubeID_to_ID_L_ML(mdttube, hardware_name, test_tube, test_layer, test_ML, GetTubeMax(digcoll_id,hardware_name)); - // if( test_tube != m_muonIdHelperTool->mdtIdHelper().tube(digcoll_id) || test_layer != m_muonIdHelperTool->mdtIdHelper().tubeLayer(digcoll_id) || test_ML != m_muonIdHelperTool->mdtIdHelper().multilayer(digcoll_id) ) { - // ATH_MSG_DEBUG("FAIL:" << hardware_name << ": true (ML,tubeLayer,tube): (" << m_muonIdHelperTool->mdtIdHelper().multilayer(digcoll_id) << ", " << m_muonIdHelperTool->mdtIdHelper().tubeLayer(digcoll_id) << ", " << m_muonIdHelperTool->mdtIdHelper().tube(digcoll_id) << "), derived: (" << test_ML << ", " << test_layer << ", " << test_tube << "), [" << m_muonIdHelperTool->mdtIdHelper().tubeMax(digcoll_id) << "," << m_muonIdHelperTool->mdtIdHelper().tubeLayerMax(digcoll_id) << "]"); - // if( (hardware_name.substr(0,4) == "BIR1" || hardware_name.substr(0,4) == "BIR4") && m_muonIdHelperTool->mdtIdHelper().multilayer(digcoll_id) == 1 ) { - // ATH_MSG_DEBUG(" Probably OK: shift due to cutout!" ); - // } - // else ATH_MSG_DEBUG("\n"); - // } - // //// end back-conversion verification std::string tube_str = returnString(mdttube); @@ -1715,16 +1554,12 @@ StatusCode MdtRawDataValAlg::fillMDTHistograms( const Muon::MdtPrepData* mdtColl } else { ATH_MSG_DEBUG("mdttdc not in hist list!" ); } - int mdtMultLayer = m_muonIdHelperTool->mdtIdHelper().multilayer(digcoll_id); + int mdtMultLayer = m_idHelperSvc->mdtIdHelper().multilayer(digcoll_id); // trigger specific if ( adc >m_ADCCut && !isNoisy ) { if (chamber->mdttdccut_ML1 && mdtMultLayer==1) { chamber->mdttdccut_ML1->Fill(tdc); } if (chamber->mdttdccut_ML2 && mdtMultLayer==2) { chamber->mdttdccut_ML2->Fill(tdc); } - //if (chamber->mdttdccut_RPCtrig_ML1 && HasTrigBARREL() && mdtMultLayer==1) { chamber->mdttdccut_RPCtrig_ML1->Fill(tdc); } - //if (chamber->mdttdccut_TGCtrig_ML1 && HasTrigENDCAP() && mdtMultLayer==1) { chamber->mdttdccut_TGCtrig_ML1->Fill(tdc); } - //if (chamber->mdttdccut_RPCtrig_ML2 && HasTrigBARREL() && mdtMultLayer==2) { chamber->mdttdccut_RPCtrig_ML2->Fill(tdc); } - //if (chamber->mdttdccut_TGCtrig_ML2 && HasTrigENDCAP() && mdtMultLayer==2) { chamber->mdttdccut_TGCtrig_ML2->Fill(tdc); } } if (chamber->mdtadc) { chamber->mdtadc->Fill(adc); } @@ -1734,20 +1569,11 @@ StatusCode MdtRawDataValAlg::fillMDTHistograms( const Muon::MdtPrepData* mdtColl if (chamber->mdtlayer) { if((adc >m_ADCCut && !isNoisy)) chamber->mdtlayer->Fill(mdtlayer); } if (chamber->mdttube) { if((adc >m_ADCCut) ) chamber->mdttube->Fill(mdttube); } -/* - if (chamber->mdttube_bkgrd ) { - if(adc > m_ADCCut_Bkgrd && tdc < m_TDCCut_Bkgrd) chamber->mdttube_bkgrd->Fill(m_mdttube); - } - if (chamber->mdtmultil) { if((mdtCollection->adc()>m_ADCCut && !isNoisy)) chamber->mdtmultil->Fill(m_muonIdHelperTool->mdtIdHelper().multilayer(digcoll_id)); } - - if (chamber->mdttube_fornoise) { if(tdc < m_TDCCut_Bkgrd) chamber->mdttube_fornoise->Fill(mdttube); } - */ if (chamber->mdtmezz) { if( adc > m_ADCCut) chamber->mdtmezz->Fill( mezzmdt( digcoll_id ) ); } return sc; } -//StatusCode MdtRawDataValAlg::fillMDTSummaryHistograms( const Muon::MdtPrepData* mdtCollection, bool &isNoiseBurstCandidate ) { StatusCode MdtRawDataValAlg::fillMDTSummaryHistograms( const Muon::MdtPrepData* mdtCollection, std::set<std::string> chambers_from_tracks, bool &isNoiseBurstCandidate ) { StatusCode sc = StatusCode::SUCCESS; @@ -1783,7 +1609,7 @@ StatusCode MdtRawDataValAlg::fillMDTSummaryHistograms( const Muon::MdtPrepData* if( m_mdtChamberHits[iregion][ilayer][stationPhi] && adc > m_ADCCut ) m_mdtChamberHits[iregion][ilayer][stationPhi]->Fill(std::abs(stationEta)); - int mlayer_n = m_muonIdHelperTool->mdtIdHelper().multilayer(digcoll_id); + int mlayer_n = m_idHelperSvc->mdtIdHelper().multilayer(digcoll_id); // Fill Barrel - Endcap Multilayer Hits if(!isNoisy && adc > 0){ @@ -1849,10 +1675,6 @@ StatusCode MdtRawDataValAlg::fillMDTSummaryHistograms( const Muon::MdtPrepData* StatusCode MdtRawDataValAlg::fillMDTOverviewHistograms( const Muon::MdtPrepData* mdtCollection, bool &isNoiseBurstCandidate ) { StatusCode sc = StatusCode::SUCCESS; Identifier digcoll_id = (mdtCollection)->identify(); - // std::string type="MDT"; - // std::string hardware_name = convertChamberName(m_muonIdHelperTool->mdtIdHelper().stationName(digcoll_id), - // m_muonIdHelperTool->mdtIdHelper().stationEta(digcoll_id), - // m_muonIdHelperTool->mdtIdHelper().stationPhi(digcoll_id),type); std::string hardware_name = getChamberName( mdtCollection ); bool isNoisy = m_masked_tubes->isNoisy( mdtCollection ); @@ -1881,11 +1703,11 @@ StatusCode MdtRawDataValAlg::fillMDTOverviewHistograms( const Muon::MdtPrepData* //Barrel -->Fill MDT Global RZ and YX if( adc>m_ADCCut ) { - if(fabs(mdt_tube_eta)>0. && fabs(mdt_tube_eta)<0.9){m_mdtrzdet[0]->Fill(mdt_tube_z,mdt_tube_perp); m_mdtxydet[0]->Fill(mdt_tube_x,mdt_tube_y);} + if(std::abs(mdt_tube_eta)>0. && std::abs(mdt_tube_eta)<0.9){m_mdtrzdet[0]->Fill(mdt_tube_z,mdt_tube_perp); m_mdtxydet[0]->Fill(mdt_tube_x,mdt_tube_y);} //OverLap -->Fill MDT Global RZ and YX - if(fabs(mdt_tube_eta)>0.9 && fabs(mdt_tube_eta)<1.2){m_mdtrzdet[1]->Fill(mdt_tube_z,mdt_tube_perp); m_mdtxydet[1]->Fill(mdt_tube_x,mdt_tube_y);} + if(std::abs(mdt_tube_eta)>0.9 && std::abs(mdt_tube_eta)<1.2){m_mdtrzdet[1]->Fill(mdt_tube_z,mdt_tube_perp); m_mdtxydet[1]->Fill(mdt_tube_x,mdt_tube_y);} //EndCap -->Fill MDT Global RZ and YX - if(fabs(mdt_tube_eta)>1.2 && fabs(mdt_tube_eta)<2.7){m_mdtrzdet[2]->Fill(mdt_tube_z,mdt_tube_perp); m_mdtxydet[2]->Fill(mdt_tube_x,mdt_tube_y);} + if(std::abs(mdt_tube_eta)>1.2 && std::abs(mdt_tube_eta)<2.7){m_mdtrzdet[2]->Fill(mdt_tube_z,mdt_tube_perp); m_mdtxydet[2]->Fill(mdt_tube_x,mdt_tube_y);} } if(m_overalltdcadcLumi && !isNoisy && adc > 0) m_overalltdcadcLumi->Fill(tdc, adc); @@ -1909,15 +1731,7 @@ StatusCode MdtRawDataValAlg::fillMDTOverviewHistograms( const Muon::MdtPrepData* if(m_overalltdccutLumi && !isNoisy) m_overalltdccutLumi->Fill(tdc); if(!m_overalltdccutLumi) ATH_MSG_DEBUG("overalltdccut not in hist list"); } -/* if (adc>m_ADCCut && HasTrigBARREL()) { - if(m_overalltdccut_RPCtrig) m_overalltdccut_RPCtrig->Fill(tdc); - else ATH_MSG_DEBUG("overalltdccut not in hist list!" ); - } - if (adc>m_ADCCut && HasTrigENDCAP()) { - if(m_overalltdccut_TGCtrig) m_overalltdccut_TGCtrig->Fill(tdc); - else ATH_MSG_DEBUG("overalltdccut not in hist list!" ); - } -*/ + return sc; } @@ -1975,7 +1789,7 @@ StatusCode MdtRawDataValAlg::handleEvent_effCalc(const Trk::SegmentCollection* s Identifier tmpid = rot->identify(); IdentifierHash idHash; MDTChamber* chamber = 0; - m_muonIdHelperTool->mdtIdHelper().get_module_hash( tmpid, idHash ); + m_idHelperSvc->mdtIdHelper().get_module_hash( tmpid, idHash ); sc = getChamber(idHash, chamber); std::string chambername = chamber->getName(); float adc = mrot->prepRawData()->adc(); @@ -2010,26 +1824,21 @@ StatusCode MdtRawDataValAlg::handleEvent_effCalc(const Trk::SegmentCollection* s m_mdthitsperchamber_onSegm_InnerMiddleOuterLumi[ibarrel_endcap]->SetEntries(m_mdthitsperchamber_onSegm_InnerMiddleOuterLumi[ibarrel_endcap]->GetEntries()+1); } } - int mdtMultLayer = m_muonIdHelperTool->mdtIdHelper().multilayer(tmpid); - //chamber->mdtadc_onSegm->Fill(mrot->prepRawData()->adc()); + int mdtMultLayer = m_idHelperSvc->mdtIdHelper().multilayer(tmpid); if(chamber->mdtadc_onSegm_ML1 && mdtMultLayer == 1){ chamber->mdtadc_onSegm_ML1->Fill(adc); - //sumADC_ML1 += mrot->prepRawData()->adc(); - // numHits_ML1++; } if(chamber->mdtadc_onSegm_ML2&& mdtMultLayer == 2){ chamber->mdtadc_onSegm_ML2->Fill(adc); - // sumADC_ML2 += mrot->prepRawData()->adc(); - // numHits_ML2++; } } // This information needs to be stored fully for each segment (for calculations below), so deal with these duplicates later // (otherwise we may not check a traversed ML for a differently pointing overlapping segment, for example) ROTs_chamber.push_back( tmpid ); - ROTs_ML.push_back( m_muonIdHelperTool->mdtIdHelper().multilayer(tmpid) ); - ROTs_L.push_back( m_muonIdHelperTool->mdtIdHelper().tubeLayer(tmpid) ); - ROTs_tube.push_back( m_muonIdHelperTool->mdtIdHelper().tube(tmpid) ); + ROTs_ML.push_back( m_idHelperSvc->mdtIdHelper().multilayer(tmpid) ); + ROTs_L.push_back( m_idHelperSvc->mdtIdHelper().tubeLayer(tmpid) ); + ROTs_tube.push_back( m_idHelperSvc->mdtIdHelper().tube(tmpid) ); ROTs_DR.push_back( mrot->driftRadius() ); ROTs_DRerr.push_back( (mrot->localCovariance())(Trk::driftRadius,Trk::driftRadius) ) ; // always returns value 2.0 ROTs_DT.push_back( mrot->driftTime() ); @@ -2047,8 +1856,6 @@ StatusCode MdtRawDataValAlg::handleEvent_effCalc(const Trk::SegmentCollection* s bool isUnique = true; for(unsigned j=0; j<unique_chambers.size(); j++) { if( getChamberName(ROTs_chamber.at(i)) == getChamberName(unique_chambers.at(j)) ){ - // if( convertChamberName(m_muonIdHelperTool->mdtIdHelper().stationName(ROTs_chamber.at(i)), m_muonIdHelperTool->mdtIdHelper().stationEta(ROTs_chamber.at(i)), m_muonIdHelperTool->mdtIdHelper().stationPhi(ROTs_chamber.at(i)),type) - // == convertChamberName(m_muonIdHelperTool->mdtIdHelper().stationName(unique_chambers.at(j)), m_muonIdHelperTool->mdtIdHelper().stationEta(unique_chambers.at(j)), m_muonIdHelperTool->mdtIdHelper().stationPhi(unique_chambers.at(j)),type) ) { isUnique = false; if( !AinB( ROTs_ML.at(i), unique_chambers_ML.at(j) ) ) unique_chambers_ML.at(j).push_back( ROTs_ML.at(i) ); @@ -2071,10 +1878,9 @@ StatusCode MdtRawDataValAlg::handleEvent_effCalc(const Trk::SegmentCollection* s std::vector<float> traversed_distance; for( unsigned i_chamber=0; i_chamber<unique_chambers.size(); i_chamber++) { Identifier station_id = unique_chambers.at(i_chamber); - if( !m_muonIdHelperTool->mdtIdHelper().is_mdt( station_id ) ) { + if( !m_idHelperSvc->mdtIdHelper().is_mdt( station_id ) ) { ATH_MSG_DEBUG("is_mdt() returned false in segm-based mdt eff calc" ); } - // std::string hardware_name = convertChamberName(m_muonIdHelperTool->mdtIdHelper().stationName(station_id), m_muonIdHelperTool->mdtIdHelper().stationEta(station_id), m_muonIdHelperTool->mdtIdHelper().stationPhi(station_id),type); std::string hardware_name = getChamberName(station_id); // SEGMENT track @@ -2089,20 +1895,20 @@ StatusCode MdtRawDataValAlg::handleEvent_effCalc(const Trk::SegmentCollection* s // Loop over tubes in chamber, find those along segment for(unsigned i_ML=0; i_ML<unique_chambers_ML.at(i_chamber).size(); i_ML++) { int ML = unique_chambers_ML.at(i_chamber).at(i_ML); - Identifier newId = m_muonIdHelperTool->mdtIdHelper().channelID(hardware_name.substr(0,3), m_muonIdHelperTool->mdtIdHelper().stationEta(station_id), m_muonIdHelperTool->mdtIdHelper().stationPhi(station_id), ML, 1, 1); - int tubeMax = m_muonIdHelperTool->mdtIdHelper().tubeMax(newId); - int tubeLayerMax = m_muonIdHelperTool->mdtIdHelper().tubeLayerMax(newId); + Identifier newId = m_idHelperSvc->mdtIdHelper().channelID(hardware_name.substr(0,3), m_idHelperSvc->mdtIdHelper().stationEta(station_id), m_idHelperSvc->mdtIdHelper().stationPhi(station_id), ML, 1, 1); + int tubeMax = m_idHelperSvc->mdtIdHelper().tubeMax(newId); + int tubeLayerMax = m_idHelperSvc->mdtIdHelper().tubeLayerMax(newId); CorrectTubeMax(hardware_name, tubeMax); CorrectLayerMax(hardware_name, tubeLayerMax); - for(int i_tube=m_muonIdHelperTool->mdtIdHelper().tubeMin(newId); i_tube<=tubeMax; i_tube++) { - for(int i_layer=m_muonIdHelperTool->mdtIdHelper().tubeLayerMin(newId); i_layer<=tubeLayerMax; i_layer++) { + for(int i_tube=m_idHelperSvc->mdtIdHelper().tubeMin(newId); i_tube<=tubeMax; i_tube++) { + for(int i_layer=m_idHelperSvc->mdtIdHelper().tubeLayerMin(newId); i_layer<=tubeLayerMax; i_layer++) { const MuonGM::MdtReadoutElement* MdtRoEl = MuonDetMgr->getMdtReadoutElement( newId ); - if(m_BMGpresent && m_muonIdHelperTool->mdtIdHelper().stationName(newId) == m_BMGid ) { + if(m_BMGpresent && m_idHelperSvc->mdtIdHelper().stationName(newId) == m_BMGid ) { std::map<Identifier, std::vector<Identifier> >::iterator myIt = m_DeadChannels.find(MdtRoEl->identify()); if( myIt != m_DeadChannels.end() ){ - Identifier tubeId = m_muonIdHelperTool->mdtIdHelper().channelID(hardware_name.substr(0,3), m_muonIdHelperTool->mdtIdHelper().stationEta(station_id), m_muonIdHelperTool->mdtIdHelper().stationPhi(station_id), ML, i_layer, i_tube ); + Identifier tubeId = m_idHelperSvc->mdtIdHelper().channelID(hardware_name.substr(0,3), m_idHelperSvc->mdtIdHelper().stationEta(station_id), m_idHelperSvc->mdtIdHelper().stationPhi(station_id), ML, i_layer, i_tube ); if( std::find( (myIt->second).begin(), (myIt->second).end(), tubeId) != (myIt->second).end() ) { - ATH_MSG_DEBUG("Skipping tube with identifier " << m_muonIdHelperTool->mdtIdHelper().show_to_string(tubeId) ); + ATH_MSG_DEBUG("Skipping tube with identifier " << m_idHelperSvc->mdtIdHelper().show_to_string(tubeId) ); continue; } } @@ -2129,11 +1935,10 @@ StatusCode MdtRawDataValAlg::handleEvent_effCalc(const Trk::SegmentCollection* s // Here we fill the DRvsDT/DRvsSegD histos, as well is unique hits and traversed tubes to calculate efficiencies if(traversed_tube.size() < 20) { // quality cut here -- 20 traversed tubes is ridiculous and generates low efficiencies (these are due to non-pointing segments) for (unsigned k=0; k<traversed_tube.size(); k++) { - // std::string hardware_name = convertChamberName(m_muonIdHelperTool->mdtIdHelper().stationName(traversed_station_id.at(k)), m_muonIdHelperTool->mdtIdHelper().stationEta(traversed_station_id.at(k)), m_muonIdHelperTool->mdtIdHelper().stationPhi(traversed_station_id.at(k)),type); std::string hardware_name = getChamberName(traversed_station_id.at(k)); // GET HISTS IdentifierHash idHash; - m_muonIdHelperTool->mdtIdHelper().get_module_hash( traversed_station_id.at(k), idHash ); + m_idHelperSvc->mdtIdHelper().get_module_hash( traversed_station_id.at(k), idHash ); MDTChamber* chamber; sc = getChamber( idHash, chamber ); if(!sc.isSuccess()){ @@ -2143,8 +1948,6 @@ StatusCode MdtRawDataValAlg::handleEvent_effCalc(const Trk::SegmentCollection* s bool hit_flag = false; for (unsigned j=0; j<ROTs_tube.size(); j++) { - // if( (convertChamberName(m_muonIdHelperTool->mdtIdHelper().stationName(ROTs_chamber.at(j)), m_muonIdHelperTool->mdtIdHelper().stationEta(ROTs_chamber.at(j)), m_muonIdHelperTool->mdtIdHelper().stationPhi(ROTs_chamber.at(j)),type) == hardware_name) - // && (traversed_tube.at(k)==ROTs_tube.at(j)) && (traversed_L.at(k)==ROTs_L.at(j)) && (traversed_ML.at(k)==ROTs_ML.at(j))) { // found traversed tube with hit used in segment if( (getChamberName(ROTs_chamber.at(j)) == hardware_name) && (traversed_tube.at(k)==ROTs_tube.at(j)) && (traversed_L.at(k)==ROTs_L.at(j)) && (traversed_ML.at(k)==ROTs_ML.at(j))) { // found traversed tube with hit used in segment hit_flag = true; @@ -2154,13 +1957,13 @@ StatusCode MdtRawDataValAlg::handleEvent_effCalc(const Trk::SegmentCollection* s break; } } - Identifier newId = m_muonIdHelperTool->mdtIdHelper().channelID(hardware_name.substr(0,3), m_muonIdHelperTool->mdtIdHelper().stationEta(traversed_station_id.at(k)), m_muonIdHelperTool->mdtIdHelper().stationPhi(traversed_station_id.at(k)), traversed_ML.at(k), 1, 1); - int tubeLayerMax = m_muonIdHelperTool->mdtIdHelper().tubeLayerMax(newId); - m_muonIdHelperTool->mdtIdHelper().get_module_hash( newId, idHash ); + Identifier newId = m_idHelperSvc->mdtIdHelper().channelID(hardware_name.substr(0,3), m_idHelperSvc->mdtIdHelper().stationEta(traversed_station_id.at(k)), m_idHelperSvc->mdtIdHelper().stationPhi(traversed_station_id.at(k)), traversed_ML.at(k), 1, 1); + int tubeLayerMax = m_idHelperSvc->mdtIdHelper().tubeLayerMax(newId); + m_idHelperSvc->mdtIdHelper().get_module_hash( newId, idHash ); CorrectLayerMax(hardware_name, tubeLayerMax); // ChamberTubeNumberCorrection handles the tubeMax problem int mdtlayer = ( (traversed_L.at(k) - 1) + (traversed_ML.at(k) - 1) * tubeLayerMax ); - int ibin = traversed_tube.at(k) + mdtlayer * m_muonIdHelperTool->mdtIdHelper().tubeMax(newId); + int ibin = traversed_tube.at(k) + mdtlayer * m_idHelperSvc->mdtIdHelper().tubeMax(newId); ChamberTubeNumberCorrection(ibin, hardware_name, traversed_tube.at(k), mdtlayer); // Store info for eff calc // (Here we make sure we are removing duplicates from overlapping segments by using sets) @@ -2211,10 +2014,10 @@ void MdtRawDataValAlg::initDeadChannels(const MuonGM::MdtReadoutElement* mydetEl Identifier detElId = mydetEl->identify(); - int name = m_muonIdHelperTool->mdtIdHelper().stationName(detElId); - int eta = m_muonIdHelperTool->mdtIdHelper().stationEta(detElId); - int phi = m_muonIdHelperTool->mdtIdHelper().stationPhi(detElId); - int ml = m_muonIdHelperTool->mdtIdHelper().multilayer(detElId); + int name = m_idHelperSvc->mdtIdHelper().stationName(detElId); + int eta = m_idHelperSvc->mdtIdHelper().stationEta(detElId); + int phi = m_idHelperSvc->mdtIdHelper().stationPhi(detElId); + int ml = m_idHelperSvc->mdtIdHelper().multilayer(detElId); std::vector<Identifier> deadTubes; std::vector<int>::iterator it = tubes.begin(); @@ -2230,7 +2033,7 @@ void MdtRawDataValAlg::initDeadChannels(const MuonGM::MdtReadoutElement* mydetEl ++it; } else { - Identifier deadTubeId = m_muonIdHelperTool->mdtIdHelper().channelID( name, eta, phi, ml, layer, tube ); + Identifier deadTubeId = m_idHelperSvc->mdtIdHelper().channelID( name, eta, phi, ml, layer, tube ); deadTubes.push_back( deadTubeId ); ATH_MSG_VERBOSE("adding dead tube (" << tube << "), layer(" << layer << "), phi(" << phi << "), eta(" << eta << "), name(" << name diff --git a/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/MdtRawDataMonitoring/src/MuonChamberIDSelector.cxx b/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/MdtRawDataMonitoring/src/MuonChamberIDSelector.cxx index 8a897a4648ae26ef4dce5dffe9b6047070744622..088389f7ca86205b16e4069e5d9cf010d3640d7a 100644 --- a/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/MdtRawDataMonitoring/src/MuonChamberIDSelector.cxx +++ b/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/MdtRawDataMonitoring/src/MuonChamberIDSelector.cxx @@ -1,15 +1,8 @@ /* - Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ -////////////////////////////////////////////////////////////////// -// MuonChamberIDSelector.cxx -// Source file for class MuonChamberIDSelector -/////////////////////////////////////////////////////////////////// - #include "MdtRawDataMonitoring/MuonChamberIDSelector.h" - -#include "Identifier/IdentifierHash.h" #include "MuonDQAUtils/MuonChamberNameConverter.h" #include <iomanip> @@ -21,29 +14,13 @@ MuonChamberIDSelector::MuonChamberIDSelector(const std::string &name, ISvcLocato m_rpcchambersId(0) {} -MuonChamberIDSelector::~MuonChamberIDSelector() -{ - ATH_MSG_INFO( " deleting MuonChamberIDSelector " ); -} - // Initialize method: StatusCode MuonChamberIDSelector::initialize() { - StatusCode sc; - // Get the messaging service, print where you are + ATH_CHECK(AthAlgorithm::initialize()); ATH_MSG_DEBUG( "initialize() called" ); - - IToolSvc* toolsvc; - sc=service("ToolSvc",toolsvc); - if( sc.isFailure() ){ - ATH_MSG_WARNING("Could not get tool sevices "); - return( StatusCode::FAILURE ); - } - - // Retrieve MuonIdHelperTool - ATH_CHECK( m_muonIdHelperTool.retrieve() ); - - return sc; + ATH_CHECK(m_idHelperSvc.retrieve()); + return StatusCode::SUCCESS; } StatusCode MuonChamberIDSelector::execute() @@ -56,45 +33,33 @@ StatusCode MuonChamberIDSelector::execute() return StatusCode::SUCCESS; } -StatusCode MuonChamberIDSelector::finalize() -{ - ATH_MSG_DEBUG( "finalize() called" ); - - return StatusCode::SUCCESS; -} - - StatusCode MuonChamberIDSelector::ChamberperformSelection() { - StatusCode sc = StatusCode::SUCCESS ; - - //sc = selectMDT(std::vector<Identifier>& mdtchambersId) ; + StatusCode sc = StatusCode::SUCCESS; sc = selectMDT() ; sc = selectRPC() ; sc = selectTGC() ; sc = selectCSC() ; - return sc ; } -//StatusCode MuonChamberIDSelector::selectMDT(std::vector<Identifier>& mdtchambersId) { StatusCode MuonChamberIDSelector::selectMDT() { StatusCode sc = StatusCode::SUCCESS ; ATH_MSG_DEBUG( "in MDT ChambersSelectorID vector" ); - std::vector<Identifier>::const_iterator idfirst = m_muonIdHelperTool->mdtIdHelper().module_begin(); - std::vector<Identifier>::const_iterator idlast = m_muonIdHelperTool->mdtIdHelper().module_end(); + std::vector<Identifier>::const_iterator idfirst = m_idHelperSvc->mdtIdHelper().module_begin(); + std::vector<Identifier>::const_iterator idlast = m_idHelperSvc->mdtIdHelper().module_end(); - IdContext mdtModuleContext = m_muonIdHelperTool->mdtIdHelper().module_context(); + IdContext mdtModuleContext = m_idHelperSvc->mdtIdHelper().module_context(); Identifier Id; IdentifierHash Idhash; for (std::vector<Identifier>::const_iterator i = idfirst; i != idlast; i++) { Id=*i; - int gethash_code = m_muonIdHelperTool->mdtIdHelper().get_hash(Id, Idhash, &mdtModuleContext); + int gethash_code = m_idHelperSvc->mdtIdHelper().get_hash(Id, Idhash, &mdtModuleContext); m_mdtchambersId->push_back(Id); - std::string extid = m_muonIdHelperTool->mdtIdHelper().show_to_string(Id); + std::string extid = m_idHelperSvc->mdtIdHelper().show_to_string(Id); ATH_MSG_DEBUG( "Adding the chamber Identifier: " << extid ); if (gethash_code == 0) ATH_MSG_DEBUG(" its hash Id is "<< Idhash ); else ATH_MSG_DEBUG(" hash Id NOT computed "<< Idhash ); @@ -109,10 +74,10 @@ StatusCode MuonChamberIDSelector::selectRPC() { StatusCode sc = StatusCode::SUCCESS ; ATH_MSG_DEBUG( "in RPC ChambersSelectorID vector" ); - std::vector<Identifier>::const_iterator idfirst = m_muonIdHelperTool->rpcIdHelper().module_begin(); - std::vector<Identifier>::const_iterator idlast = m_muonIdHelperTool->rpcIdHelper().module_end(); + std::vector<Identifier>::const_iterator idfirst = m_idHelperSvc->rpcIdHelper().module_begin(); + std::vector<Identifier>::const_iterator idlast = m_idHelperSvc->rpcIdHelper().module_end(); - IdContext rpcModuleContext = m_muonIdHelperTool->rpcIdHelper().module_context(); + IdContext rpcModuleContext = m_idHelperSvc->rpcIdHelper().module_context(); Identifier Id; IdentifierHash Idhash; m_rpcchambersId = new std::vector<Identifier>; @@ -120,9 +85,9 @@ StatusCode MuonChamberIDSelector::selectRPC() { for (std::vector<Identifier>::const_iterator i = idfirst; i != idlast; i++) { Id=*i; - int gethash_code = m_muonIdHelperTool->rpcIdHelper().get_hash(Id, Idhash, &rpcModuleContext); + int gethash_code = m_idHelperSvc->rpcIdHelper().get_hash(Id, Idhash, &rpcModuleContext); m_rpcchambersId->push_back(Id); - std::string extid = m_muonIdHelperTool->rpcIdHelper().show_to_string(Id); + std::string extid = m_idHelperSvc->rpcIdHelper().show_to_string(Id); ATH_MSG_DEBUG( "Adding the chamber Identifier: " << extid ); if (gethash_code == 0) ATH_MSG_DEBUG(" its hash Id is "<< Idhash ); else ATH_MSG_DEBUG(" hash Id NOT computed "<< Idhash ); @@ -131,22 +96,3 @@ StatusCode MuonChamberIDSelector::selectRPC() { return sc ; } - -StatusCode MuonChamberIDSelector::selectTGC() { - - StatusCode sc = StatusCode::SUCCESS ; - ATH_MSG_DEBUG( "in TGC ChambersSelectorID vector" ); - - return sc ; - -} - -StatusCode MuonChamberIDSelector::selectCSC() { - - StatusCode sc = StatusCode::SUCCESS ; - ATH_MSG_DEBUG( "in CSC ChambersSelectorID vector" ); - - return sc ; - -} - diff --git a/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/MdtVsRpcRawDataMonitoring/MdtVsRpcRawDataMonitoring/MdtVsRpcRawDataValAlg.h b/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/MdtVsRpcRawDataMonitoring/MdtVsRpcRawDataMonitoring/MdtVsRpcRawDataValAlg.h index f030af303c32dabf26dc459c7ab416a276420117..dee7184c8311a665e42102464a886b1108e39bb9 100755 --- a/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/MdtVsRpcRawDataMonitoring/MdtVsRpcRawDataMonitoring/MdtVsRpcRawDataValAlg.h +++ b/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/MdtVsRpcRawDataMonitoring/MdtVsRpcRawDataMonitoring/MdtVsRpcRawDataValAlg.h @@ -19,26 +19,19 @@ #include <vector> #include <map> -#include "GaudiKernel/Algorithm.h" -#include "GaudiKernel/StatusCode.h" -#include "GaudiKernel/MsgStream.h" -#include "GaudiKernel/ToolHandle.h" +#include "AthenaMonitoring/ManagedMonitorToolBase.h" +#include "GaudiKernel/ServiceHandle.h" -#include "MuonIdHelpers/MuonIdHelperTool.h" +#include "MuonIdHelpers/IMuonIdHelperSvc.h" #include "MuonReadoutGeometry/MuonDetectorManager.h" -#include "MuonReadoutGeometry/RpcReadoutElement.h" -#include "MuonReadoutGeometry/MdtReadoutElement.h" - - -#include "AthenaMonitoring/AthenaMonManager.h" -#include "AthenaMonitoring/ManagedMonitorToolBase.h" #include "MuonDQAUtils/MuonDQAHistMap.h" - -#include "MuonPrepRawData/MuonPrepDataContainer.h" - +#include "MuonPrepRawData/RpcPrepDataContainer.h" +#include "StoreGate/ReadCondHandleKey.h" #include "StoreGate/ReadHandleKey.h" -class TFile; +class TH1; +class TH2; + template <class ConcreteAlgorithm> class AlgFactory; ///////////////////////////////////////////////////////////////////////////// @@ -74,16 +67,13 @@ class MdtVsRpcRawDataValAlg: public ManagedMonitorToolBase "MuonDetectorManager", "Key of input MuonDetectorManager condition data"}; - ToolHandle<Muon::MuonIdHelperTool> m_muonIdHelperTool{this, "idHelper", - "Muon::MuonIdHelperTool/MuonIdHelperTool", "Handle to the MuonIdHelperTool"}; + ServiceHandle<Muon::IMuonIdHelperSvc> m_idHelperSvc {this, "MuonIdHelperSvc", "Muon::MuonIdHelperSvc/MuonIdHelperSvc"}; void bookMDTvsRPCHistograms(std::string m_hardware_name, std::string m_layer_name, int binz, int binminz, int binmaxz, int binx, int binminx, int binmaxx ); void bookMDTvsRPCsectorHistograms(std::string m_sector_name, std::string m_layer_name, float stripzmin, float stripzmax,float wirezmin, float wirezmax ); - MuonDQAHistMap m_stationHists; - bool m_doClusters; std::string m_clusterContainerName; bool m_checkCabling; @@ -93,11 +83,9 @@ class MdtVsRpcRawDataValAlg: public ManagedMonitorToolBase int m_mdtvsrpcreducerpcnbins ; int m_mdtvsrpcreducemdtnbins ; int m_mdtvsrpcreducemdttdcnbins ; - + bool m_doMdtvsRpcESD ; - //Declare Properties - std::string m_chamberName; std::string m_StationSize; SG::ReadHandleKey<Muon::RpcPrepDataContainer> m_key_rpc{this,"RpcPrepDataContainer","RPC_Measurements","RPC PRDs"}; @@ -107,9 +95,7 @@ class MdtVsRpcRawDataValAlg: public ManagedMonitorToolBase int m_lastEvent; int m_cosmicStation; - TH1* m_MdtRpcZdiff ; - TH2* m_MdtNHitsvsRpcNHits ; }; diff --git a/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/MdtVsRpcRawDataMonitoring/src/MdtVsRpcRawDataValAlg.cxx b/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/MdtVsRpcRawDataMonitoring/src/MdtVsRpcRawDataValAlg.cxx index aada0f4ad35d77ad87977cd3f2266497d832a020..76b8d94fe6426acb85be20a5cbf949a6a827251e 100755 --- a/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/MdtVsRpcRawDataMonitoring/src/MdtVsRpcRawDataValAlg.cxx +++ b/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/MdtVsRpcRawDataMonitoring/src/MdtVsRpcRawDataValAlg.cxx @@ -20,9 +20,6 @@ #include "MuonRDO/RpcPadContainer.h" #include "MuonReadoutGeometry/RpcReadoutSet.h" -#include "Identifier/Identifier.h" - - #include "MuonDQAUtils/MuonChamberNameConverter.h" #include "MuonDQAUtils/MuonChambersRange.h" #include "MuonDQAUtils/MuonCosmicSetup.h" @@ -85,38 +82,14 @@ MdtVsRpcRawDataValAlg::~MdtVsRpcRawDataValAlg() } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * -StatusCode MdtVsRpcRawDataValAlg::initialize(){ - +StatusCode MdtVsRpcRawDataValAlg::initialize() { + ATH_CHECK(ManagedMonitorToolBase::initialize()); ATH_MSG_INFO ( "in initializing MdtVsRpcRawDataValAlg" ); - - StatusCode sc; - - // Initialize the IdHelper - StoreGateSvc* detStore = 0; - sc = service("DetectorStore", detStore); - if (sc.isFailure()) { - ATH_MSG_FATAL ( "DetectorStore service not found !" ); - return StatusCode::FAILURE; - } - // MuonDetectorManager from the conditions store ATH_CHECK(m_DetectorManagerKey.initialize()); - - if (sc.isFailure()) { - ATH_MSG_FATAL ( "Cannot get MuonDetectorManager from detector store" ); - return StatusCode::FAILURE; - } - else { - ATH_MSG_DEBUG ( " Found the MuonDetectorManager from detector store. " ); - } - - ATH_CHECK( m_muonIdHelperTool.retrieve() ); - - ManagedMonitorToolBase::initialize().ignore(); // Ignore the checking code; - + ATH_CHECK(m_idHelperSvc.retrieve()); ATH_CHECK(m_key_mdt.initialize()); ATH_CHECK(m_key_rpc.initialize()); - return StatusCode::SUCCESS; } @@ -210,16 +183,16 @@ StatusCode MdtVsRpcRawDataValAlg::fillHistograms() Identifier prd_id = (*rpcPrd)->identify(); - int irpcstationPhi = int(m_muonIdHelperTool->rpcIdHelper().stationPhi (prd_id)) ; - int irpcstationName = int(m_muonIdHelperTool->rpcIdHelper().stationName(prd_id)) ; - int irpcstationEta = int(m_muonIdHelperTool->rpcIdHelper().stationEta (prd_id)) ; - int irpcdoubletR = int(m_muonIdHelperTool->rpcIdHelper().doubletR (prd_id)) ; - int irpcmeasuresPhi = int(m_muonIdHelperTool->rpcIdHelper().measuresPhi(prd_id)) ; + int irpcstationPhi = int(m_idHelperSvc->rpcIdHelper().stationPhi (prd_id)) ; + int irpcstationName = int(m_idHelperSvc->rpcIdHelper().stationName(prd_id)) ; + int irpcstationEta = int(m_idHelperSvc->rpcIdHelper().stationEta (prd_id)) ; + int irpcdoubletR = int(m_idHelperSvc->rpcIdHelper().doubletR (prd_id)) ; + int irpcmeasuresPhi = int(m_idHelperSvc->rpcIdHelper().measuresPhi(prd_id)) ; // only take eta hits if( irpcmeasuresPhi != 0 )continue; - int irpcdoubletPhi = int(m_muonIdHelperTool->rpcIdHelper().doubletPhi(prd_id)) ; - int irpcdoubletZ = int(m_muonIdHelperTool->rpcIdHelper().doubletZ(prd_id)) ; - int irpcstrip = int(m_muonIdHelperTool->rpcIdHelper().strip(prd_id)) ; + int irpcdoubletPhi = int(m_idHelperSvc->rpcIdHelper().doubletPhi(prd_id)) ; + int irpcdoubletZ = int(m_idHelperSvc->rpcIdHelper().doubletZ(prd_id)) ; + int irpcstrip = int(m_idHelperSvc->rpcIdHelper().strip(prd_id)) ; @@ -228,8 +201,8 @@ StatusCode MdtVsRpcRawDataValAlg::fillHistograms() std::string hardware_name=convertChamberName(irpcstationName,irpcstationEta,irpcstationPhi,type) ; if (selectChambersRange(hardware_name, m_chamberName, - m_muonIdHelperTool->rpcIdHelper().stationEta(dig_id), m_StationEta, - m_muonIdHelperTool->rpcIdHelper().stationPhi(dig_id), m_StationPhi, m_StationSize) && chambersCosmicSetup(hardware_name,m_cosmicStation)) { + m_idHelperSvc->rpcIdHelper().stationEta(dig_id), m_StationEta, + m_idHelperSvc->rpcIdHelper().stationPhi(dig_id), m_StationPhi, m_StationSize) && chambersCosmicSetup(hardware_name,m_cosmicStation)) { //define layer int imdt_multi_near = 0; @@ -379,21 +352,21 @@ StatusCode MdtVsRpcRawDataValAlg::fillHistograms() for (Muon::MdtPrepDataCollection::const_iterator mdtCollection=(*containerMdtIt)->begin(); mdtCollection!=(*containerMdtIt)->end(); ++mdtCollection ) { dig_idmdt = (*mdtCollection)->identify(); - int imdt_station = int(m_muonIdHelperTool->mdtIdHelper().stationName (dig_idmdt)); + int imdt_station = int(m_idHelperSvc->mdtIdHelper().stationName (dig_idmdt)); if (imdt_station != irpcstationName) continue; - int imdt_eta = int(m_muonIdHelperTool->mdtIdHelper().stationEta (dig_idmdt)); + int imdt_eta = int(m_idHelperSvc->mdtIdHelper().stationEta (dig_idmdt)); if (imdt_eta != irpcstationEta ) continue; - int imdt_phi = int(m_muonIdHelperTool->mdtIdHelper().stationPhi (dig_idmdt)); + int imdt_phi = int(m_idHelperSvc->mdtIdHelper().stationPhi (dig_idmdt)); if (imdt_phi != irpcstationPhi ) continue; dig_idmdt = (*mdtCollection)->identify(); - int imdt_multi = int(m_muonIdHelperTool->mdtIdHelper().multilayer (dig_idmdt)); + int imdt_multi = int(m_idHelperSvc->mdtIdHelper().multilayer (dig_idmdt)); // only look at near multilayer if(imdt_multi != imdt_multi_near) continue; int imdt_adc = int((*mdtCollection)->adc()); //cut on noise if( imdt_adc<ncutadc )continue; int imdt_tdc = int((*mdtCollection)->tdc()); - int imdt_wire = int(m_muonIdHelperTool->mdtIdHelper().tube (dig_idmdt)); + int imdt_wire = int(m_idHelperSvc->mdtIdHelper().tube (dig_idmdt)); //get mdt information from geomodel to book and fill mdtvsrpc histos with the right min and max range diff --git a/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/MdtVsTgcRawDataMonitoring/MdtVsTgcRawDataMonitoring/MdtVsTgcRawDataValAlg.h b/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/MdtVsTgcRawDataMonitoring/MdtVsTgcRawDataMonitoring/MdtVsTgcRawDataValAlg.h index 39196451e49800baf4dadc3c5f88b0b92907e4a3..b8486bf76531d505f63c424a7a7ec82e792f0145 100644 --- a/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/MdtVsTgcRawDataMonitoring/MdtVsTgcRawDataMonitoring/MdtVsTgcRawDataValAlg.h +++ b/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/MdtVsTgcRawDataMonitoring/MdtVsTgcRawDataMonitoring/MdtVsTgcRawDataValAlg.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ ////////////////////////////////////////////////////////////////////////////////////////////// @@ -15,60 +15,26 @@ #ifndef MdtVsTgcRawDataValAlg_H #define MdtVsTgcRawDataValAlg_H -#include "GaudiKernel/Algorithm.h" -#include "GaudiKernel/StatusCode.h" - -#include "GaudiKernel/MsgStream.h" -#include "GaudiKernel/NTuple.h" -#include "GaudiKernel/ToolHandle.h" - -#include "AthenaMonitoring/AthenaMonManager.h" #include "AthenaMonitoring/ManagedMonitorToolBase.h" -#include "MuonDQAUtils/MuonDQAHistMap.h" +#include "GaudiKernel/ServiceHandle.h" +#include "MuonIdHelpers/IMuonIdHelperSvc.h" +#include "MuonDQAUtils/MuonDQAHistMap.h" #include "MuonReadoutGeometry/MuonDetectorManager.h" #include "MuonReadoutGeometry/TgcReadoutElement.h" - -//#include "TGCcablingInterface/ITGCcablingServerSvc.h" - -#include "MuonSegment/MuonSegment.h" -#include "TrkSegment/SegmentCollection.h" - -#include "TrkTrack/Track.h" -#include "TrkTrack/TrackCollection.h" - -#include "MuonPrepRawData/MuonPrepDataContainer.h" -#include "muonEvent/MuonContainer.h" - #include "MuonTrigCoinData/TgcCoinData.h" #include "MuonTrigCoinData/TgcCoinDataContainer.h" -#include "MuonTrigCoinData/TgcCoinDataCollection.h" - -#include "MuonIdHelpers/MuonIdHelperTool.h" #include "MuonReadoutGeometry/MuonDetectorManager.h" - -#include "MuonDQAUtils/TGCDQAUtils.h" -#include "MuonDQAUtils/MuonDQAFitFunc.h" -//use new mdt segment container #include "xAODMuon/MuonSegmentContainer.h" - #include "StoreGate/ReadHandleKey.h" +#include "MuonPrepRawData/MdtPrepDataContainer.h" #include "SegmTrack.h" -#include "TH1F.h" -#include "TH2F.h" -#include <sstream> -#include <string.h> +#include <string> #include <vector> -#include <map> -#include <fstream> - -class TFile; template <class ConcreteAlgorithm> class AlgFactory; -///////////////////////////////////////////////////////////////////////////// - class MdtVsTgcRawDataValAlg: public ManagedMonitorToolBase { public: @@ -76,7 +42,6 @@ public: MdtVsTgcRawDataValAlg ( const std::string & type, const std::string & name, const IInterface* parent ); virtual ~MdtVsTgcRawDataValAlg(); StatusCode initialize(); - //StatusCode finalize(); virtual StatusCode bookHistogramsRecurrent(); virtual StatusCode fillHistograms(); @@ -101,15 +66,10 @@ public: // MuonDetectorManager from the conditions store SG::ReadCondHandleKey<MuonGM::MuonDetectorManager> m_DetectorManagerKey {this, "DetectorManagerKey", "MuonDetectorManager", - "Key of input MuonDetectorManager condition data"}; - - ToolHandle<Muon::MuonIdHelperTool> m_muonIdHelperTool{this, "idHelper", - "Muon::MuonIdHelperTool/MuonIdHelperTool", "Handle to the MuonIdHelperTool"}; - - // const ITGCcablingSvc* m_cabling; + "Key of input MuonDetectorManager condition data"}; + ServiceHandle<Muon::IMuonIdHelperSvc> m_idHelperSvc {this, "MuonIdHelperSvc", "Muon::MuonIdHelperSvc/MuonIdHelperSvc"}; //Declare Properties - bool m_checkCabling; bool m_tgclv1file; diff --git a/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/MdtVsTgcRawDataMonitoring/src/MdtVsTgcRawDataValAlg.cxx b/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/MdtVsTgcRawDataMonitoring/src/MdtVsTgcRawDataValAlg.cxx index b31f509b3250adb973cb8956f85b2efd6ace042c..ad1588dcc8143618cb3bf2391281dd52cd694145 100644 --- a/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/MdtVsTgcRawDataMonitoring/src/MdtVsTgcRawDataValAlg.cxx +++ b/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/MdtVsTgcRawDataMonitoring/src/MdtVsTgcRawDataValAlg.cxx @@ -10,35 +10,22 @@ // DESCRIPTION: // Subject: correlation btw MDT hits vs TGC RoI -->Offline Muon Data Quality ///////////////////////////////////////////////////////////////////////////////////////////////////////////// - -#include "GaudiKernel/MsgStream.h" -#include "GaudiKernel/ToolHandle.h" - + +#include "MdtVsTgcRawDataMonitoring/MdtVsTgcRawDataValAlg.h" + #include "MuonRDO/TgcRdo.h" #include "MuonRDO/TgcRdoContainer.h" #include "MuonRDO/TgcRdoIdHash.h" - -// MuonDetDesc #include "MuonReadoutGeometry/TgcReadoutParams.h" - #include "MuonDQAUtils/MuonChamberNameConverter.h" #include "MuonDQAUtils/MuonChambersRange.h" #include "MuonDQAUtils/MuonCosmicSetup.h" -#include "MuonDQAUtils/MuonDQAHistMap.h" - #include "MuonRIO_OnTrack/MuonClusterOnTrack.h" - #include "TrkSegment/SegmentCollection.h" - -#include "Identifier/Identifier.h" - #include "MuonCalibIdentifier/MuonFixedId.h" - -#include "MdtVsTgcRawDataMonitoring/MdtVsTgcRawDataValAlg.h" #include "AthenaMonitoring/AthenaMonManager.h" -#include <inttypes.h> - +#include <inttypes.h> #include <sstream> #include <algorithm> #include <fstream> @@ -110,15 +97,11 @@ MdtVsTgcRawDataValAlg::~MdtVsTgcRawDataValAlg(){ StatusCode MdtVsTgcRawDataValAlg::initialize(){ - // init message stream + ATH_CHECK(ManagedMonitorToolBase::initialize()); ATH_MSG_INFO( "in initializing MdtVsTgcRawDataValAlg" ); - // MuonDetectorManager from the conditions store ATH_CHECK(m_DetectorManagerKey.initialize()); - - ATH_CHECK( m_muonIdHelperTool.retrieve() ); - - ManagedMonitorToolBase::initialize().ignore(); // Ignore the checking code; + ATH_CHECK(m_idHelperSvc.retrieve()); //MDT z position //Name MultiLayer TubeLayer z @@ -136,17 +119,14 @@ MdtVsTgcRawDataValAlg::initialize(){ //18 2 3 14030.6 // Retrieve the MuonDetectorManager - const MuonGM::MuonDetectorManager* MuonDetMgrDS; + const MuonGM::MuonDetectorManager* MuonDetMgrDS=nullptr; ATH_CHECK( detStore()->retrieve(MuonDetMgrDS) ); ATH_MSG_DEBUG( " Found the MuonDetectorManager from detector store. " ); - prepareTREarray(MuonDetMgrDS); - ATH_CHECK(m_tgc_PrepDataContainerName.initialize()); ATH_CHECK(m_tgc_CoinContainerName.initialize()); ATH_CHECK(m_mdt_PrepDataContainerName.initialize()); ATH_CHECK(m_mdt_SegmentCollectionName.initialize()); - return StatusCode::SUCCESS; } diff --git a/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/MdtVsTgcRawDataMonitoring/src/MdtVsTgcRawData_TGCEffCheck.cxx b/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/MdtVsTgcRawDataMonitoring/src/MdtVsTgcRawData_TGCEffCheck.cxx index d431d6f1db3c21eed4073b579887ad550f2285bb..103f0bea1f2dfd391ca8b37b598c7bcdb2623924 100644 --- a/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/MdtVsTgcRawDataMonitoring/src/MdtVsTgcRawData_TGCEffCheck.cxx +++ b/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/MdtVsTgcRawDataMonitoring/src/MdtVsTgcRawData_TGCEffCheck.cxx @@ -91,7 +91,7 @@ MdtVsTgcRawDataValAlg::prepareTREarray(const MuonGM::MuonDetectorManager* MuonDe int stationName = TGCStationNames[stationNameIndex]; for(int stationEta=-8; stationEta<=8; stationEta++){// Station Eta int tgcAC(stationEta<0); - int absStationEta = abs(stationEta); + int absStationEta = std::abs(stationEta); for(int stationPhi=0; stationPhi<=48; stationPhi++){// Station Phi // Exclude non-existent "zero" sectors included in the array for ease of use if(stationEta==0){ @@ -104,28 +104,28 @@ MdtVsTgcRawDataValAlg::prepareTREarray(const MuonGM::MuonDetectorManager* MuonDe // Exclude sectors known not to exist if(stationNameIndex==6){ // Inner Forward - if(abs(stationEta)>1)continue; + if(std::abs(stationEta)>1)continue; if(stationPhi>24)continue; } else if(stationNameIndex==7){ // Inner Endcap - if(abs(stationEta)>1)continue; + if(std::abs(stationEta)>1)continue; if(stationPhi>21)continue; } else if((stationNameIndex==0)|| // Midstation Forward (stationNameIndex==2)|| (stationNameIndex==4)){ - if(abs(stationEta)>1)continue; + if(std::abs(stationEta)>1)continue; if(stationPhi>24)continue; } else{ // Midstation Endcap - if(abs(stationEta)>5)continue; + if(std::abs(stationEta)>5)continue; if((stationNameIndex==1)&& - (abs(stationEta)>4))continue; + (std::abs(stationEta)>4))continue; } // Get identifier of TRE at this set of indexes bool *isValid = new bool(true); - Identifier tgc_testId = m_muonIdHelperTool->tgcIdHelper().elementID(stationName, stationEta, stationPhi, true, isValid); + Identifier tgc_testId = m_idHelperSvc->tgcIdHelper().elementID(stationName, stationEta, stationPhi, true, isValid); if(!*isValid){delete isValid; continue;} delete isValid; diff --git a/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/MdtVsTgcRawDataMonitoring/src/MdtVsTgcRawData_correlation.cxx b/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/MdtVsTgcRawDataMonitoring/src/MdtVsTgcRawData_correlation.cxx index 9e4d9a5de7214cdc3945193dfd6dec87a14d0306..36124c806605979ea5be665839053f4b49bf673b 100644 --- a/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/MdtVsTgcRawDataMonitoring/src/MdtVsTgcRawData_correlation.cxx +++ b/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/MdtVsTgcRawDataMonitoring/src/MdtVsTgcRawData_correlation.cxx @@ -11,26 +11,16 @@ // Subject: correlation btw MDT hits vs TGC RoI -->Offline Muon Data Quality //////////////////////////////////////////////////////////////////////////////////// -#include "GaudiKernel/MsgStream.h" +#include "MdtVsTgcRawDataMonitoring/MdtVsTgcRawDataValAlg.h" -// MuonDetDesc #include "MuonReadoutGeometry/TgcReadoutParams.h" - #include "MuonDQAUtils/MuonChamberNameConverter.h" #include "MuonDQAUtils/MuonChambersRange.h" #include "MuonDQAUtils/MuonCosmicSetup.h" #include "MuonDQAUtils/MuonDQAHistMap.h" - -#include "Identifier/Identifier.h" - -//mdt stuff #include "MuonCalibIdentifier/MuonFixedId.h" - -#include "MdtVsTgcRawDataMonitoring/MdtVsTgcRawDataValAlg.h" -#include "AthenaMonitoring/AthenaMonManager.h" - -#include <inttypes.h> +#include <inttypes.h> #include <sstream> #include <algorithm> @@ -83,7 +73,7 @@ MdtVsTgcRawDataValAlg::correlation(const Muon::MdtPrepDataContainer* mdt_hit_con const MuonGM::TgcReadoutElement* pReadoutElementTGC = MuonDetMgr->getTgcReadoutElement(tgcid); const Amg::Vector3D pos = pReadoutElementTGC->channelPos(tgcid); - float tgcEta = abs(pos.eta()); + float tgcEta = std::abs(pos.eta()); float tgcPhi = pos.phi(); if(tgcPhi<0)tgcPhi+=2*M_PI; @@ -122,7 +112,7 @@ MdtVsTgcRawDataValAlg::correlation(const Muon::MdtPrepDataContainer* mdt_hit_con // endcap: increases with R // ============================================================================== - int mdtStationName = int(m_muonIdHelperTool->mdtIdHelper().stationName(mdt_id)) ; + int mdtStationName = int(m_idHelperSvc->mdtIdHelper().stationName(mdt_id)) ; //SN Layer Tube Radial //13:EIL 2x4 x54 x4 @@ -144,8 +134,8 @@ MdtVsTgcRawDataValAlg::correlation(const Muon::MdtPrepDataContainer* mdt_hit_con //only Endcap middle MDT if(mdtStationName!=17 && mdtStationName!=18 )continue; - int mdtStationEta = int(m_muonIdHelperTool->mdtIdHelper().stationEta(mdt_id)) ;//backward:[-6,-1], forward:[1,6], (1 or -1 at lowest R) - int mdtStationPhi = int(m_muonIdHelperTool->mdtIdHelper().stationPhi(mdt_id)) ;//[1:8] + int mdtStationEta = int(m_idHelperSvc->mdtIdHelper().stationEta(mdt_id)) ;//backward:[-6,-1], forward:[1,6], (1 or -1 at lowest R) + int mdtStationPhi = int(m_idHelperSvc->mdtIdHelper().stationPhi(mdt_id)) ;//[1:8] int mdtAC = (mdtStationEta<0);//a:0, c:1 float mdtSector=mdtStationPhi*2.-1.; @@ -161,8 +151,6 @@ MdtVsTgcRawDataValAlg::correlation(const Muon::MdtPrepDataContainer* mdt_hit_con <<" mdtStationPhi "<<mdtStationPhi <<" mdtSectorPhi "<<mdtSectorPhi ); - //if( itgcstationEta!=RoIEta || itgcstationPhi!=RoIPhi48 || end_or_for!=RoIEF || a_or_c!=RoISide )continue; - //loop over MDT PRD Collection Muon::MdtPrepDataCollection::const_iterator collection_it_end=(*containerIt)->end(); @@ -179,10 +167,10 @@ MdtVsTgcRawDataValAlg::correlation(const Muon::MdtPrepDataContainer* mdt_hit_con Identifier mdt_id2 = (*mdtCollection)->identify(); - int mdtMultiLayer = int(m_muonIdHelperTool->mdtIdHelper().multilayer(mdt_id2)); - int mdtTubeLayer = int(m_muonIdHelperTool->mdtIdHelper().tubeLayer(mdt_id2)); - int mdtTube = int(m_muonIdHelperTool->mdtIdHelper().tube(mdt_id2)); - int mdtTubeIdForEM = (abs(mdtStationEta)-1)*64 + mdtTube -1; + int mdtMultiLayer = int(m_idHelperSvc->mdtIdHelper().multilayer(mdt_id2)); + int mdtTubeLayer = int(m_idHelperSvc->mdtIdHelper().tubeLayer(mdt_id2)); + int mdtTube = int(m_idHelperSvc->mdtIdHelper().tube(mdt_id2)); + int mdtTubeIdForEM = (std::abs(mdtStationEta)-1)*64 + mdtTube -1; ATH_MSG_DEBUG("mdtMultiLayer "<<mdtMultiLayer <<" mdtTubeLayer "<<mdtTubeLayer @@ -199,7 +187,7 @@ MdtVsTgcRawDataValAlg::correlation(const Muon::MdtPrepDataContainer* mdt_hit_con const MuonGM::MdtReadoutElement* pReadoutElementMDT = MuonDetMgr->getMdtReadoutElement(mdt_id2); const Amg::Vector3D mdtgPos = pReadoutElementMDT->tubePos(mdt_id2); //global position of the wire - float mdtEta = abs(mdtgPos.eta()); + float mdtEta = std::abs(mdtgPos.eta()); float mdtPhi = mdtgPos.phi(); float mdtr = mdtgPos.perp(); float mdtz = mdtgPos.z(); diff --git a/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/MdtVsTgcRawDataMonitoring/src/MdtVsTgcRawData_maptgchits.cxx b/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/MdtVsTgcRawDataMonitoring/src/MdtVsTgcRawData_maptgchits.cxx index 47716c34e23648724dac30c9a98a41196b9ebecd..7f93ee50b68e3fb16dbe7703d4fa7004c3b2442b 100644 --- a/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/MdtVsTgcRawDataMonitoring/src/MdtVsTgcRawData_maptgchits.cxx +++ b/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/MdtVsTgcRawDataMonitoring/src/MdtVsTgcRawData_maptgchits.cxx @@ -21,7 +21,6 @@ #include "TrkRIO_OnTrack/RIO_OnTrack.h" #include "muonEvent/MuonContainer.h" -//use new MDT segment container #include "xAODMuon/MuonSegmentContainer.h" #include "xAODMuon/MuonSegment.h" @@ -63,10 +62,10 @@ MdtVsTgcRawDataValAlg::maphists(const xAOD::MuonSegmentContainer *newsegment, const Trk::RIO_OnTrack* rio = segm->rioOnTrack(i); if(!rio) continue; Identifier id = rio->identify(); - stationName = int(m_muonIdHelperTool->mdtIdHelper().stationName(id)); + stationName = int(m_idHelperSvc->mdtIdHelper().stationName(id)); // Flag Segments with ROTs in the MDT & Endcap - if(m_muonIdHelperTool->mdtIdHelper().is_mdt(id))isMdt=true; - if(m_muonIdHelperTool->mdtIdHelper().isEndcap(id))isEndcap=true; + if(m_idHelperSvc->mdtIdHelper().is_mdt(id))isMdt=true; + if(m_idHelperSvc->mdtIdHelper().isEndcap(id))isEndcap=true; // If ROT is MDT if((stationName==13)||(stationName==49)){nMdtMeas[0]++;} if((stationName==14)||(stationName==15)){nMdtMeas[1]++;} @@ -94,7 +93,7 @@ MdtVsTgcRawDataValAlg::maphists(const xAOD::MuonSegmentContainer *newsegment, for(int jMDT=0;jMDT<4;jMDT++){// jMDT if(nMdtMeas[jMDT]){// If hits in this Station // Get position variables - float segmGlobalEta = abs(segmGlobalPos.eta()); + float segmGlobalEta = std::abs(segmGlobalPos.eta()); float segmGlobalPhi = segmGlobalPos.phi(); if(segmGlobalPhi<0) segmGlobalPhi+=2*M_PI; // Fill position histogram @@ -123,8 +122,8 @@ MdtVsTgcRawDataValAlg::maphists(const xAOD::MuonSegmentContainer *newsegment, // Get detector variables Identifier tgcid=(*tgc_itc)->identify(); - int tgcStationName = m_muonIdHelperTool->tgcIdHelper().stationName(tgcid); - int gasGap = m_muonIdHelperTool->tgcIdHelper().gasGap(tgcid); + int tgcStationName = m_idHelperSvc->tgcIdHelper().stationName(tgcid); + int gasGap = m_idHelperSvc->tgcIdHelper().gasGap(tgcid); // Get position variables const Amg::Vector3D tgcGlobalPos = tpd->globalPosition(); diff --git a/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/MdtVsTgcRawDataMonitoring/src/functions/MdtVsTgcRawData_MidstationMatching.cxx b/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/MdtVsTgcRawDataMonitoring/src/functions/MdtVsTgcRawData_MidstationMatching.cxx index 91b22b5f85c7d0ff920224bf05052a93515c25c8..e93506c7fa809292d0b47ae559e3b01c8f2d0e52 100644 --- a/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/MdtVsTgcRawDataMonitoring/src/functions/MdtVsTgcRawData_MidstationMatching.cxx +++ b/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/MdtVsTgcRawDataMonitoring/src/functions/MdtVsTgcRawData_MidstationMatching.cxx @@ -103,7 +103,7 @@ MdtVsTgcRawDataValAlg::MidstationOnlyCheck(std::vector<const Muon::MuonSegment*> const Trk::RIO_OnTrack* rio = segm0->rioOnTrack(iROT); if(!rio) continue; Identifier id = rio->identify(); - stationName = int(m_muonIdHelperTool->mdtIdHelper().stationName(id)); + stationName = int(m_idHelperSvc->mdtIdHelper().stationName(id)); if((stationName==17)||(stationName==18))nMdtMeas++;// MDT } @@ -135,16 +135,13 @@ MdtVsTgcRawDataValAlg::MidstationOnlyCheck(std::vector<const Muon::MuonSegment*> // Get position variables //const Trk::GlobalPosition segm1Pos = segm1->globalPosition(); const Amg::Vector3D segm1Pos = segm1->globalPosition(); - - //float segm1PosRho = abs(segm1Pos.perp()); - //float segm1PosEta = abs(segm1Pos.eta()); + float segm1PosPhi = segm1Pos.phi(); float segm1PosThe = segm1Pos.theta(); float segm1PosZ = segm1Pos.z(); if(segm1PosPhi<0)segm1PosPhi+=2*M_PI; if(segm1PosThe>M_PI/2) segm1PosThe=M_PI-segm1PosThe; - //Trk::GlobalDirection segm1PosZunit(segm1Pos/abs(segm1PosZ)); - Amg::Vector3D segm1PosZunit(segm1Pos/abs(segm1PosZ)); + Amg::Vector3D segm1PosZunit(segm1Pos/std::abs(segm1PosZ)); //////////////////////////////////////////////////////////////////////// @@ -156,8 +153,8 @@ MdtVsTgcRawDataValAlg::MidstationOnlyCheck(std::vector<const Muon::MuonSegment*> const Trk::RIO_OnTrack* rio = segm1->rioOnTrack(iROT); if(!rio) continue; Identifier id = rio->identify(); - stationName = int(m_muonIdHelperTool->mdtIdHelper().stationName(id)); - bool isStrip = m_muonIdHelperTool->tgcIdHelper().isStrip(id); + stationName = int(m_idHelperSvc->mdtIdHelper().stationName(id)); + bool isStrip = m_idHelperSvc->tgcIdHelper().isStrip(id); if(((stationName==41)||(stationName==42))&&isStrip)nTGCStrips[0]++;// TGC if(((stationName==43)||(stationName==44))&&isStrip)nTGCStrips[1]++;// TGC @@ -186,29 +183,26 @@ MdtVsTgcRawDataValAlg::MidstationOnlyCheck(std::vector<const Muon::MuonSegment*> if(skipSegm)continue; // Get position variables - //const Trk::GlobalPosition segm2Pos = segm2->globalPosition(); const Amg::Vector3D segm2Pos = segm2->globalPosition(); - float segm2PosRho = abs(segm2Pos.perp()); + float segm2PosRho = std::abs(segm2Pos.perp()); float segm2PosPhi = segm2Pos.phi(); float segm2PosZ = segm2Pos.z(); if(segm2PosPhi<0)segm2PosPhi+=2*M_PI; - //Trk::GlobalDirection segm2PosZunit(segm2Pos/abs(segm2PosZ)); - Amg::Vector3D segm2PosZunit(segm2Pos/abs(segm2PosZ)); + Amg::Vector3D segm2PosZunit(segm2Pos/std::abs(segm2PosZ)); // Apply preliminary phi cut between segm1 and segm2 positions float dPhi_Segm1_Segm2 = segm1PosPhi-segm2PosPhi; if(dPhi_Segm1_Segm2<-M_PI)dPhi_Segm1_Segm2+=2*M_PI; if(dPhi_Segm1_Segm2> M_PI)dPhi_Segm1_Segm2-=2*M_PI; - if(abs(dPhi_Segm1_Segm2)<dPhiCutSegmentMatching){ + if(std::abs(dPhi_Segm1_Segm2)<dPhiCutSegmentMatching){ failedGroupingCut=true; break; } // Extrapolate segm1 position to segm2's Z position - float dZ = abs(segm2PosZ)-abs(segm1PosZ); - //Trk::GlobalPosition extrPos(segm1Pos+(segm1PosZunit*dZ)); + float dZ = std::abs(segm2PosZ)-std::abs(segm1PosZ); Amg::Vector3D extrPos(segm1Pos+(segm1PosZunit*dZ)); - float extrPosRho = abs(extrPos.perp()); + float extrPosRho = std::abs(extrPos.perp()); float extrPosThe = extrPos.theta(); float extrPosPhi = extrPos.phi(); if(extrPosThe>M_PI/2) extrPosThe=M_PI-extrPosThe; @@ -221,8 +215,8 @@ MdtVsTgcRawDataValAlg::MidstationOnlyCheck(std::vector<const Muon::MuonSegment*> if(dPhi_Extr_Segm2> M_PI)dPhi_Extr_Segm2-=2*M_PI; // Cut segments (segm1) which are inside difference cuts - if((abs(dPhi_Extr_Segm2)<dPhiCutSegmentMatching)|| - (abs(dRho_Extr_Segm2)<dRhoCutSegmentMatching)){ + if((std::abs(dPhi_Extr_Segm2)<dPhiCutSegmentMatching)|| + (std::abs(dRho_Extr_Segm2)<dRhoCutSegmentMatching)){ failedGroupingCut=true; break; } @@ -253,7 +247,7 @@ MdtVsTgcRawDataValAlg::MidstationOnlyCheck(std::vector<const Muon::MuonSegment*> // Extrapolate position from nearest Station's Segment to Sector's Z float sectorZ=tre->globalPosition().z(); - float dZ_sector=abs(sectorZ)-abs(segm1PosZ); + float dZ_sector=std::abs(sectorZ)-std::abs(segm1PosZ); //Trk::GlobalPosition sectorExtrapolatedPos = segm1Pos+(segm1PosZunit*dZ_sector); Amg::Vector3D sectorExtrapolatedPos = segm1Pos+(segm1PosZunit*dZ_sector); @@ -325,11 +319,11 @@ MdtVsTgcRawDataValAlg::MidstationOnlyCheck(std::vector<const Muon::MuonSegment*> Identifier tgcid=(*prepitc)->identify(); int tgcAC=(tre->sideA()==false);//isNotAside a:0, c:1 int tgcFE=(tre->forward()==false);//isNotForward f:0, e:1 - int tgcWS=(m_muonIdHelperTool->tgcIdHelper().isStrip(tgcid));//isStrip w=0, s=1 - int stationName = m_muonIdHelperTool->tgcIdHelper().stationName(tgcid); - int stationEta = abs(tre->getStationEta()); + int tgcWS=(m_idHelperSvc->tgcIdHelper().isStrip(tgcid));//isStrip w=0, s=1 + int stationName = m_idHelperSvc->tgcIdHelper().stationName(tgcid); + int stationEta = std::abs(tre->getStationEta()); int stationPhi = tre->getStationPhi(); - int gasGap = m_muonIdHelperTool->tgcIdHelper().gasGap(tgcid); + int gasGap = m_idHelperSvc->tgcIdHelper().gasGap(tgcid); // Cut hits except those from same side Midstation if(tgcAC!=i) continue; @@ -341,20 +335,18 @@ MdtVsTgcRawDataValAlg::MidstationOnlyCheck(std::vector<const Muon::MuonSegment*> if(stationIndex==3)continue; // Get position variables - //const Trk::GlobalPosition prdPos = tpd->globalPosition(); const Amg::Vector3D prdPos = tpd->globalPosition(); - float tgcRho = abs(prdPos.perp()); + float tgcRho = std::abs(prdPos.perp()); float tgcPhi = prdPos.phi(); float tgcZ = prdPos.z(); if(tgcPhi<0)tgcPhi+=2*M_PI; // Extrapolate Segm1 to PRD Z position - float dZ = abs(tgcZ) - abs(segm1PosZ); - //Trk::GlobalPosition tgcExtrapolatedPos = ((segm1Pos)+((segm1PosZunit)*dZ)); + float dZ = std::abs(tgcZ) - std::abs(segm1PosZ); Amg::Vector3D tgcExtrapolatedPos = ((segm1Pos)+((segm1PosZunit)*dZ)); // Get extrapolated variables - float tgcExtrRho = abs(tgcExtrapolatedPos.perp()); + float tgcExtrRho = std::abs(tgcExtrapolatedPos.perp()); float tgcExtrPhi = tgcExtrapolatedPos.phi(); if(tgcExtrPhi<0)tgcExtrPhi+=2*M_PI; @@ -365,7 +357,7 @@ MdtVsTgcRawDataValAlg::MidstationOnlyCheck(std::vector<const Muon::MuonSegment*> if(dPhi> M_PI)dPhi-=2*M_PI; // Pass through loose phi cut to eliminate some noise - if(abs(dPhi)<dPhiCut_Loose){ + if(std::abs(dPhi)<dPhiCut_Loose){ // Fill PRD sagitta histograms if(m_mvt_extrprdsag2[i][stationIndex][tgcFE][tgcWS][0]) m_mvt_extrprdsag2[i][stationIndex][tgcFE][tgcWS][0]->Fill(dRho); if(m_mvt_extrprdsag2[i][stationIndex][tgcFE][tgcWS][2]) m_mvt_extrprdsag2[i][stationIndex][tgcFE][tgcWS][2]->Fill(dPhi); @@ -373,13 +365,12 @@ MdtVsTgcRawDataValAlg::MidstationOnlyCheck(std::vector<const Muon::MuonSegment*> // Do Global check if(canCheckGlobal[stationIndex]){ float dRhoCut = dRhoCutGlobal[tgcWS]*tgcExtrRho; - if(abs(dPhi)<dPhiCutGlobal[tgcWS] && abs(dRho)<dRhoCut){ - // if(layer>=0)hitregistered[layer][tgcWS] = true;// Global hit + if(std::abs(dPhi)<dPhiCutGlobal[tgcWS] && std::abs(dRho)<dRhoCut){ } }// global // Add PRD which matches Segm1 position to vector for further analysis - if(abs(dPhi)<dPhiCutSector[tgcWS] && abs(dRho)<dRhoCutSector[tgcWS]){ + if(std::abs(dPhi)<dPhiCutSector[tgcWS] && std::abs(dRho)<dRhoCutSector[tgcWS]){ tpdVector[tgcWS].push_back(tpd); } // Do Sector Efficiency Check @@ -389,7 +380,7 @@ MdtVsTgcRawDataValAlg::MidstationOnlyCheck(std::vector<const Muon::MuonSegment*> (stationPhi==TGCstation_StationPhi[stationIndex])&& (tgcFE==TGCstation_StationFE[stationIndex])){ // Do check - if(abs(dPhi)<dPhiCutSector[tgcWS] && abs(dRho)<dRhoCutSector[tgcWS]){ + if(std::abs(dPhi)<dPhiCutSector[tgcWS] && std::abs(dRho)<dRhoCutSector[tgcWS]){ if(layer>=0)sectorhitregistered[layer][tgcWS]=true;// Sector hit } } @@ -434,12 +425,12 @@ MdtVsTgcRawDataValAlg::MidstationOnlyCheck(std::vector<const Muon::MuonSegment*> float prd1Phi = prdPos1.phi(); float prd1Z = prdPos1.z(); if(prd1Phi<0)prd1Phi+=2*M_PI; - Amg::Vector3D prd1PosZunit(prdPos1/abs(prd1Z)); + Amg::Vector3D prd1PosZunit(prdPos1/std::abs(prd1Z)); // Get id values Identifier tgcid1=(tpdVector[k].at(iTPD1))->identify(); - int stationName1 = m_muonIdHelperTool->tgcIdHelper().stationName(tgcid1); - int gasGap1 = m_muonIdHelperTool->tgcIdHelper().gasGap(tgcid1); + int stationName1 = m_idHelperSvc->tgcIdHelper().stationName(tgcid1); + int gasGap1 = m_idHelperSvc->tgcIdHelper().gasGap(tgcid1); int layer1 = TGCgetlayer(stationName1,gasGap1); if(layer1>=0)thisTPDlayerMatches[layer1]++; @@ -449,17 +440,17 @@ MdtVsTgcRawDataValAlg::MidstationOnlyCheck(std::vector<const Muon::MuonSegment*> // Get position variables const Amg::Vector3D prdPos2 = tpdVector[k].at(iTPD2)->globalPosition(); - float prd2Rho = abs(prdPos2.perp()); + float prd2Rho = std::abs(prdPos2.perp()); float prd2Phi = prdPos2.phi(); float prd2Z = prdPos2.z(); if(prd2Phi<0)prd2Phi+=2*M_PI; // Extrapolate PRD1 to PRD2 Z position - float dZ = abs(prd2Z)- abs(prd1Z); + float dZ = std::abs(prd2Z)- std::abs(prd1Z); Amg::Vector3D prdExtrPos = ((prdPos1)+((prd1PosZunit)*dZ)); // Get extrapolated variables - float prdExtrRho = abs(prdExtrPos.perp()); + float prdExtrRho = std::abs(prdExtrPos.perp()); float prdExtrPhi = prdExtrPos.phi(); if(prdExtrPhi<0)prdExtrPhi+=2*M_PI; @@ -474,11 +465,11 @@ MdtVsTgcRawDataValAlg::MidstationOnlyCheck(std::vector<const Muon::MuonSegment*> if(m_tgc_prdcompsag[i][k][2]) m_tgc_prdcompsag[i][k][2]->Fill(dPhi); // Do check - if(abs(dPhi)<dPhiCutTPD[k] && abs(dRho)<dRhoCutTPD[k]){ + if(std::abs(dPhi)<dPhiCutTPD[k] && std::abs(dRho)<dRhoCutTPD[k]){ // Get id values Identifier tgcid2=(tpdVector[k].at(iTPD2))->identify(); - int stationName2 = m_muonIdHelperTool->tgcIdHelper().stationName(tgcid2); - int gasGap2 = m_muonIdHelperTool->tgcIdHelper().gasGap(tgcid2); + int stationName2 = m_idHelperSvc->tgcIdHelper().stationName(tgcid2); + int gasGap2 = m_idHelperSvc->tgcIdHelper().gasGap(tgcid2); int layer2 = TGCgetlayer(stationName2,gasGap2); // Add PRD2 to matches for PRD1 diff --git a/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/MdtVsTgcRawDataMonitoring/src/functions/MdtVsTgcRawData_PRDonTrack.cxx b/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/MdtVsTgcRawDataMonitoring/src/functions/MdtVsTgcRawData_PRDonTrack.cxx index 74e912edeff8110b1ce13e97ffd3f0123b011aae..ba7b2c9512e8e8c6f35f715f79ddc2116631e920 100644 --- a/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/MdtVsTgcRawDataMonitoring/src/functions/MdtVsTgcRawData_PRDonTrack.cxx +++ b/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/MdtVsTgcRawDataMonitoring/src/functions/MdtVsTgcRawData_PRDonTrack.cxx @@ -202,16 +202,16 @@ MdtVsTgcRawDataValAlg::CheckTGConTrack(std::vector<SegmTrack> (&matchedSegments) const Muon::MuonClusterOnTrack * rio = mc_list[iROT]; //const Trk::RIO_OnTrack* rio = crot->rioOnTrack(iROT); Identifier id = rio->identify(); - int stationName = int(m_muonIdHelperTool->mdtIdHelper().stationName(id)); + int stationName = int(m_idHelperSvc->mdtIdHelper().stationName(id)); // 41=T1F 42=T1E 43=T2F 44=T2E 45=T3F 46=T3E 47=T4F 48=T4E - if(m_muonIdHelperTool->tgcIdHelper().isStrip(id)){ + if(m_idHelperSvc->tgcIdHelper().isStrip(id)){ if((jMDT==2)&&((stationName==41)||(stationName==42)))nTGCStrips[0]++;// TGC if((jMDT==2)&&((stationName==43)||(stationName==44)))nTGCStrips[1]++;// TGC if((jMDT==2)&&((stationName==45)||(stationName==46)))nTGCStrips[2]++;// TGC if((jMDT==0)&&((stationName==47)||(stationName==48)))nTGCStrips[3]++;// TGC } - ATH_MSG_DEBUG( " check if TGC strip: "<<m_muonIdHelperTool->tgcIdHelper().isStrip(id)<<" StationName: "<<stationName ); + ATH_MSG_DEBUG( " check if TGC strip: "<<m_idHelperSvc->tgcIdHelper().isStrip(id)<<" StationName: "<<stationName ); } } } @@ -257,11 +257,11 @@ MdtVsTgcRawDataValAlg::CheckTGConTrack(std::vector<SegmTrack> (&matchedSegments) Identifier tgcid=(*prepitc)->identify(); int tgcAC=(tre->sideA()==false);//isNotAside a:0, c:1 int tgcFE=(tre->forward()==false);//isNotForward f:0, e:1 - int tgcWS=(m_muonIdHelperTool->tgcIdHelper().isStrip(tgcid));//isStrip w=0, s=1 - int stationName = m_muonIdHelperTool->tgcIdHelper().stationName(tgcid); + int tgcWS=(m_idHelperSvc->tgcIdHelper().isStrip(tgcid));//isStrip w=0, s=1 + int stationName = m_idHelperSvc->tgcIdHelper().stationName(tgcid); int stationEta = std::abs(tre->getStationEta()); int stationPhi = tre->getStationPhi(); - int gasGap = m_muonIdHelperTool->tgcIdHelper().gasGap(tgcid); + int gasGap = m_idHelperSvc->tgcIdHelper().gasGap(tgcid); // Cut hits except those from same side EIFI & Midstation if(tgcAC!=i) continue; diff --git a/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/MdtVsTgcRawDataMonitoring/src/functions/MdtVsTgcRawData_SegmDQ.cxx b/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/MdtVsTgcRawDataMonitoring/src/functions/MdtVsTgcRawData_SegmDQ.cxx index ea9aec81a91e515de5a2911bde73d82e9bae8330..85c281d806a96cb1995ec623411f04165cbd07c4 100644 --- a/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/MdtVsTgcRawDataMonitoring/src/functions/MdtVsTgcRawData_SegmDQ.cxx +++ b/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/MdtVsTgcRawDataMonitoring/src/functions/MdtVsTgcRawData_SegmDQ.cxx @@ -79,8 +79,8 @@ MdtVsTgcRawDataValAlg::DQCheckMDTSegments(std::vector<const Muon::MuonSegment*> continue; } Identifier id = rio->identify(); - stationName = int(m_muonIdHelperTool->mdtIdHelper().stationName(id)); - int isStrip = m_muonIdHelperTool->tgcIdHelper().isStrip(id); + stationName = int(m_idHelperSvc->mdtIdHelper().stationName(id)); + int isStrip = m_idHelperSvc->tgcIdHelper().isStrip(id); if((stationName==41)||(stationName==42))nTgcMeas[isStrip]++;// TGC if((stationName==43)||(stationName==44))nTgcMeas[isStrip]++;// TGC @@ -129,7 +129,7 @@ MdtVsTgcRawDataValAlg::DQCheckMDTSegments(std::vector<const Muon::MuonSegment*> } // Cut Segments with too great a difference between position and direction vectors - if(abs(dPhi_Pos_Dir)>dPhiCutPosDir[jMDT]||abs(dThe_Pos_Dir)>dTheCutPosDir[jMDT]){ + if(std::abs(dPhi_Pos_Dir)>dPhiCutPosDir[jMDT]||std::abs(dThe_Pos_Dir)>dTheCutPosDir[jMDT]){ segmDisqual = true; } diff --git a/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/MdtVsTgcRawDataMonitoring/src/functions/MdtVsTgcRawData_SegmMatching.cxx b/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/MdtVsTgcRawDataMonitoring/src/functions/MdtVsTgcRawData_SegmMatching.cxx index 6a9361f7bf19707ee1a476a3e984fca81acebf83..18e36385f6edb26d66249fe5dd5d080035313428 100644 --- a/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/MdtVsTgcRawDataMonitoring/src/functions/MdtVsTgcRawData_SegmMatching.cxx +++ b/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/MdtVsTgcRawDataMonitoring/src/functions/MdtVsTgcRawData_SegmMatching.cxx @@ -66,16 +66,12 @@ MdtVsTgcRawDataValAlg::MatchMDTSegments(std::vector<const Muon::MuonSegment*> (& if(skipSegm)continue; // Get position variables - //const Trk::GlobalPosition segm1Pos = segm1->globalPosition(); const Amg::Vector3D segm1Pos = segm1->globalPosition(); - // float segm1Rho = abs(segm1Pos.perp()); float segm1PosPhi = segm1Pos.phi(); float segm1PosZ = segm1Pos.z(); if(segm1PosPhi<0)segm1PosPhi+=2*M_PI; - //Trk::GlobalDirection segm1PosZunit(segm1Pos/abs(segm1PosZ)); - //Trk::GlobalDirection segm1Dir = segm1->globalDirection(); - Amg::Vector3D segm1PosZunit(segm1Pos/abs(segm1PosZ)); + Amg::Vector3D segm1PosZunit(segm1Pos/std::abs(segm1PosZ)); Amg::Vector3D segm1Dir = segm1->globalDirection(); float segm1DirThe = segm1Dir.theta(); @@ -109,30 +105,27 @@ MdtVsTgcRawDataValAlg::MatchMDTSegments(std::vector<const Muon::MuonSegment*> (& ////////////////////////////////////////////////////// // Position Cut // Fill position variables - // const Trk::GlobalPosition segm2Pos = segm2->globalPosition(); const Amg::Vector3D segm2Pos = segm2->globalPosition(); - float segm2PosRho = abs(segm2Pos.perp()); + float segm2PosRho = std::abs(segm2Pos.perp()); float segm2PosPhi = segm2Pos.phi(); float segm2PosThe = segm2Pos.theta(); float segm2PosZ = segm2Pos.z(); if(segm2PosThe>M_PI/2) segm2PosThe=M_PI-segm2PosThe; if(segm2PosPhi<0)segm2PosPhi+=2*M_PI; - //Trk::GlobalDirection segm2PosZunit(segm2Pos/abs(segm2PosZ)); - Amg::Vector3D segm2PosZunit(segm2Pos/abs(segm2PosZ)); + Amg::Vector3D segm2PosZunit(segm2Pos/std::abs(segm2PosZ)); // Apply preliminary phi cut between segm1 and segm2 positions float dPhi_Segm1_Segm2 = segm1PosPhi-segm2PosPhi; if(dPhi_Segm1_Segm2<-M_PI)dPhi_Segm1_Segm2+=2*M_PI; if(dPhi_Segm1_Segm2> M_PI)dPhi_Segm1_Segm2-=2*M_PI; - if(abs(dPhi_Segm1_Segm2)>dPhiCutSegmentMatching)continue; + if(std::abs(dPhi_Segm1_Segm2)>dPhiCutSegmentMatching)continue; // Extrapolate segm1 position to segm2's Z position - float dZ = abs(segm2PosZ)-abs(segm1PosZ); - //Trk::GlobalPosition extrPos(segm1Pos+(segm1PosZunit*dZ)); + float dZ = std::abs(segm2PosZ)-std::abs(segm1PosZ); Amg::Vector3D extrPos(segm1Pos+(segm1PosZunit*dZ)); - float extrPosRho = abs(extrPos.perp()); + float extrPosRho = std::abs(extrPos.perp()); float extrPosThe = extrPos.theta(); float extrPosPhi = extrPos.phi(); if(extrPosThe>M_PI/2) extrPosThe=M_PI-extrPosThe; @@ -151,8 +144,8 @@ MdtVsTgcRawDataValAlg::MatchMDTSegments(std::vector<const Muon::MuonSegment*> (& if(m_mdt_segmmatchsag[i][jMDT1][jMDT2][3]) m_mdt_segmmatchsag[i][jMDT1][jMDT2][3]->Fill(dThe_Extr_Segm2); // Cut segments (segm2) which are outside difference cuts - if(abs(dPhi_Extr_Segm2)>dPhiCutSegmentMatching)continue; - if(abs(dRho_Extr_Segm2)>dRhoCutSegmentMatching)continue; + if(std::abs(dPhi_Extr_Segm2)>dPhiCutSegmentMatching)continue; + if(std::abs(dRho_Extr_Segm2)>dRhoCutSegmentMatching)continue; ////////////////////////////////////////////////////// // Direction Cut diff --git a/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/MdtVsTgcRawDataMonitoring/src/functions/MdtVsTgcRawData_SegmSorting.cxx b/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/MdtVsTgcRawDataMonitoring/src/functions/MdtVsTgcRawData_SegmSorting.cxx index 5776b08571bf4fc06a40e5b790ecd344d96891fd..f9a1afb128313c1599ab41f7225bde63f8d82d0b 100644 --- a/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/MdtVsTgcRawDataMonitoring/src/functions/MdtVsTgcRawData_SegmSorting.cxx +++ b/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/MdtVsTgcRawDataMonitoring/src/functions/MdtVsTgcRawData_SegmSorting.cxx @@ -16,12 +16,10 @@ #include "TrkEventPrimitives/TrkEventPrimitivesDict.h" #include "TrkRIO_OnTrack/RIO_OnTrack.h" #include "muonEvent/MuonContainer.h" -//use new MDT segment container #include "xAODMuon/MuonSegmentContainer.h" #include "xAODMuon/MuonSegment.h" #include <inttypes.h> - #include <sstream> #include <algorithm> #include <fstream> @@ -56,10 +54,10 @@ MdtVsTgcRawDataValAlg::SortMDTSegments(const xAOD::MuonSegmentContainer *newsegm Identifier id = rio->identify(); // Identify MDT Endcap Segments - if(m_muonIdHelperTool->mdtIdHelper().is_mdt(id))isMdt=true; - if(m_muonIdHelperTool->mdtIdHelper().isEndcap(id))isEndcap=true; + if(m_idHelperSvc->mdtIdHelper().is_mdt(id))isMdt=true; + if(m_idHelperSvc->mdtIdHelper().isEndcap(id))isEndcap=true; - int stationName = int(m_muonIdHelperTool->mdtIdHelper().stationName(id)); + int stationName = int(m_idHelperSvc->mdtIdHelper().stationName(id)); // Large (L) = odd, greater r, Small (S) = even, lower r // 13=EIL 49=EIS 14=EEL 15=EES 17=EML 18=EMS 20=EOL 21=EOS if((stationName==13)||(stationName==49))nMdtMeas[0]++;// MDT diff --git a/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/RpcRawDataMonitoring/RpcRawDataMonitoring/RpcLv1RawDataEfficiency.h b/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/RpcRawDataMonitoring/RpcRawDataMonitoring/RpcLv1RawDataEfficiency.h index e32daa3183aff8e6250235238ac72de186ff5ee8..95a1d574a3f1030e0d7e2bc967063ae3b8d65859 100644 --- a/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/RpcRawDataMonitoring/RpcRawDataMonitoring/RpcLv1RawDataEfficiency.h +++ b/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/RpcRawDataMonitoring/RpcRawDataMonitoring/RpcLv1RawDataEfficiency.h @@ -15,40 +15,14 @@ #ifndef RpcLv1RawDataEfficiency_H #define RpcLv1RawDataEfficiency_H -#include "GaudiKernel/StatusCode.h" -#include "StoreGate/StoreGateSvc.h" -#include "GaudiKernel/MsgStream.h" -#include "GaudiKernel/NTuple.h" - -#include "AthenaMonitoring/AthenaMonManager.h" #include "AthenaMonitoring/ManagedMonitorToolBase.h" -#include "MuonDQAUtils/MuonDQAHistMap.h" +#include "GaudiKernel/ServiceHandle.h" +#include "MuonIdHelpers/IMuonIdHelperSvc.h" #include "MuonReadoutGeometry/MuonDetectorManager.h" -#include "MuonReadoutGeometry/RpcReadoutElement.h" -#include "MuonReadoutGeometry/MuonReadoutElement.h" -#include "MuonReadoutGeometry/RpcReadoutSet.h" -#include "MuonGeoModel/MYSQL.h" - -#include "muonEvent/MuonContainer.h" -#include "MuonPrepRawData/MuonPrepDataContainer.h" - -#include "AthenaBaseComps/AthAlgorithm.h" - -#include "MuonRDO/RpcFiredChannel.h" -#include "MuonRDO/RpcCoinMatrix.h" -#include "MuonRDO/RpcPad.h" -#include "MuonRDO/RpcPadContainer.h" #include "MuonRDO/RpcSectorLogicContainer.h" - -#include "MuonTrigCoinData/RpcCoinData.h" #include "MuonTrigCoinData/RpcCoinDataContainer.h" -#include "MuonTrigCoinData/RpcCoinDataCollection.h" - -#include "MuonIdHelpers/MuonIdHelperTool.h" - #include "xAODEventInfo/EventInfo.h" - #include "StoreGate/ReadHandleKey.h" // STL includes @@ -57,7 +31,6 @@ #include <vector> #include <map> - // ROOT includes #include <TH2I.h> #include <inttypes.h> @@ -65,7 +38,6 @@ //================================================================================================================================ template <class ConcreteAlgorithm> class AlgFactory; - //================================================================================================================================ class OfflineMuon { public: @@ -169,14 +141,11 @@ class RpcLv1RawDataEfficiency: public ManagedMonitorToolBase { StatusCode readRpcCoinDataContainer(); - // virtual StatusCode GetHistograms(); virtual StatusCode bookHistogramsRecurrent(); virtual StatusCode fillHistograms( ); private: - // Retrieving information and data - ToolHandle<Muon::MuonIdHelperTool> m_muonIdHelperTool{this, "idHelper", - "Muon::MuonIdHelperTool/MuonIdHelperTool", "Handle to the MuonIdHelperTool"}; + ServiceHandle<Muon::IMuonIdHelperSvc> m_idHelperSvc {this, "MuonIdHelperSvc", "Muon::MuonIdHelperSvc/MuonIdHelperSvc"}; // MuonDetectorManager from the conditions store SG::ReadCondHandleKey<MuonGM::MuonDetectorManager> m_DetectorManagerKey {this, "DetectorManagerKey", diff --git a/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/RpcRawDataMonitoring/RpcRawDataMonitoring/RpcRawDataValAlg.h b/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/RpcRawDataMonitoring/RpcRawDataMonitoring/RpcRawDataValAlg.h index ed8224989afe1b1ee7128030c53dbcc1edc1a6be..6cd3cb8a1385921191dabb2e1d41edee06b0117e 100755 --- a/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/RpcRawDataMonitoring/RpcRawDataMonitoring/RpcRawDataValAlg.h +++ b/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/RpcRawDataMonitoring/RpcRawDataMonitoring/RpcRawDataValAlg.h @@ -14,40 +14,26 @@ #ifndef RpcRawDataValAlg_H #define RpcRawDataValAlg_H -#include <sstream> -#include <string.h> -#include <vector> -#include <map> - -#include "AthenaMonitoring/AthenaMonManager.h" #include "AthenaMonitoring/ManagedMonitorToolBase.h" -#include "MuonDQAUtils/MuonDQAHistMap.h" +#include "GaudiKernel/ServiceHandle.h" +#include "MuonIdHelpers/IMuonIdHelperSvc.h" +#include "MuonDQAUtils/MuonDQAHistMap.h" #include "MuonReadoutGeometry/MuonDetectorManager.h" -#include "MuonReadoutGeometry/RpcReadoutElement.h" - -#include "GaudiKernel/Algorithm.h" -#include "GaudiKernel/StatusCode.h" - -#include "GaudiKernel/MsgStream.h" -#include "GaudiKernel/NTuple.h" - -#include "RPCcablingInterface/IRPCcablingServerSvc.h" - -#include "MuonPrepRawData/MuonPrepDataContainer.h" #include "MuonTrigCoinData/RpcCoinDataContainer.h" #include "xAODEventInfo/EventInfo.h" - #include "StoreGate/ReadHandleKey.h" +#include "MuonPrepRawData/RpcPrepDataContainer.h" -#include "MuonIdHelpers/MuonIdHelperTool.h" - +#include <string> +#include <vector> +#include <map> #include <TH2F.h> #include <TH2I.h> #include <TH1I.h> -#include <inttypes.h> +#include <inttypes.h> -#include <sstream> +class IRPCcablingSvc; template <class ConcreteAlgorithm> class AlgFactory; @@ -72,9 +58,6 @@ class RpcRawDataValAlg: public ManagedMonitorToolBase { // Private function to add the clusters to the ntuple StatusCode addClusters(std::string clusterContainerName); - - //ServiceHandle<IRPCConditionsSvc> m_pSummarySvc; - SG::ReadHandleKey<xAOD::EventInfo> m_eventInfo{this,"EventInfo","EventInfo","event info"}; SG::ReadHandleKey<Muon::RpcPrepDataContainer> m_key_rpc{this,"RpcPrepDataContainer","RPC_Measurements","RPC PRDs"}; SG::ReadHandleKey<Muon::RpcCoinDataContainer> m_key_trig{this,"RPCTriggerContainer","RPC_triggerHits","RPC trigger hits"}; @@ -93,7 +76,6 @@ class RpcRawDataValAlg: public ManagedMonitorToolBase { void bookRPCLayerPhivsEtaHistograms(std::string, std::string, int, int, int, int, int, int); void bookRPCLayerPhivsEtaSectorHistograms(std::string, std::string, int, int, int, int, int, int); - /* void bookRPCSummaryHistograms( int, std::vector<std::string>::const_iterator &m_iter ) ; */ void bookRPCSummaryHistograms( int, const std::string & m_quantity ) ; MuonDQAHistMap m_stationHists; @@ -109,8 +91,6 @@ class RpcRawDataValAlg: public ManagedMonitorToolBase { std::vector<std::string> m_layervslayer_name_list ; std::vector<std::string> m_layerPhivsEta_name_list ; std::vector<std::string> m_layerPhivsEtaSector_name_list; - // std::vector<std::string> cm_time_list ; - // std::vector<int> ch16_index_list ; int m_StationNameViewIndex[100][2] ; float m_StationNameSectorSize[100] ; float m_StationPivotSectorSize[100] ; @@ -125,8 +105,7 @@ class RpcRawDataValAlg: public ManagedMonitorToolBase { "MuonDetectorManager", "Key of input MuonDetectorManager condition data"}; - ToolHandle<Muon::MuonIdHelperTool> m_muonIdHelperTool{this, "idHelper", - "Muon::MuonIdHelperTool/MuonIdHelperTool", "Handle to the MuonIdHelperTool"}; + ServiceHandle<Muon::IMuonIdHelperSvc> m_idHelperSvc {this, "MuonIdHelperSvc", "Muon::MuonIdHelperSvc/MuonIdHelperSvc"}; const IRPCcablingSvc* m_cabling; diff --git a/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/RpcRawDataMonitoring/src/RPCMonitorAlgorithm.cxx b/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/RpcRawDataMonitoring/src/RPCMonitorAlgorithm.cxx index be2a1f530685f51b60a1c98c7ea26a2c808dc75a..a650050ed2f64d37bcc7da73aad8bdec76e92464 100644 --- a/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/RpcRawDataMonitoring/src/RPCMonitorAlgorithm.cxx +++ b/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/RpcRawDataMonitoring/src/RPCMonitorAlgorithm.cxx @@ -113,7 +113,7 @@ StatusCode RPCMonitorAlgorithm::fillHistograms(const EventContext& ctx) const xAOD::Muon::Quality quality = m_muonSelectionTool->getQuality(*muon); - if(fabs(pt) < m_minPt || fabs(eta) < m_minEta || fabs(eta) > m_maxEta) { + if(std::abs(pt) < m_minPt || std::abs(eta) < m_minEta || std::abs(eta) > m_maxEta) { continue; } if(!(quality <= m_quality)) { diff --git a/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/RpcRawDataMonitoring/src/RPCStandaloneTracksMon.cxx b/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/RpcRawDataMonitoring/src/RPCStandaloneTracksMon.cxx index aaa6e5c74fccd4ccb743f0dd7c9d1a1b4df1840d..d03d3586dbf59641b935d2b3c0c34feea7ff4ecc 100755 --- a/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/RpcRawDataMonitoring/src/RPCStandaloneTracksMon.cxx +++ b/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/RpcRawDataMonitoring/src/RPCStandaloneTracksMon.cxx @@ -767,7 +767,7 @@ StatusCode RPCStandaloneTracksMon::fillHistograms() if( !metrack ) continue; ATH_MSG_DEBUG("xAOD::Muon::ExtrapolatedMuonSpectrometerTrackParticle found for this muon "); - if( std::sqrt(std::fabs(irpc_clus_posetaII-metrack->eta())*std::fabs(irpc_clus_posetaII-metrack->eta()) + fabs(irpc_clus_posphi-metrack->phi())*fabs(irpc_clus_posphi-metrack->phi())) < m_MuonDeltaRMatching) foundmatch3DwithMuon = true ; + if( std::sqrt(std::abs(irpc_clus_posetaII-metrack->eta())*std::abs(irpc_clus_posetaII-metrack->eta()) + std::abs(irpc_clus_posphi-metrack->phi())*std::abs(irpc_clus_posphi-metrack->phi())) < m_MuonDeltaRMatching) foundmatch3DwithMuon = true ; }}//end muons @@ -960,7 +960,7 @@ StatusCode RPCStandaloneTracksMon::fillHistograms() const xAOD::TrackParticle* metrack = muons->trackParticle( xAOD::Muon::ExtrapolatedMuonSpectrometerTrackParticle ); if( !metrack ) continue; - if( std::fabs(metrack->eta())>1) continue; + if( std::abs(metrack->eta())>1) continue; sc = rpc_triggerefficiency.getHist( m_hMEtracks ,"hMEtracks" ) ; if(sc.isFailure() ) ATH_MSG_WARNING ( "couldn't get " << " hMEtracks " ); if(m_hMEtracks)m_hMEtracks->Fill( metrack->pt() / 1000.); @@ -1011,7 +1011,7 @@ StatusCode RPCStandaloneTracksMon::fillHistograms() if(m_idHelperSvc->rpcIdHelper().measuresPhi(prdcoll_id))continue; - if( std::sqrt( std::fabs(eta_atlas-metrack->eta())*std::fabs(eta_atlas-metrack->eta()) + std::fabs(phi_atlas-metrack->phi())*std::fabs(phi_atlas-metrack->phi()) ) < m_MuonDeltaRMatching) { + if( std::sqrt( std::abs(eta_atlas-metrack->eta())*std::abs(eta_atlas-metrack->eta()) + std::abs(phi_atlas-metrack->phi())*std::abs(phi_atlas-metrack->phi()) ) < m_MuonDeltaRMatching) { //Second coin phi view for( it_container_phi = rpc_coin_container->begin(); it_container_phi != rpc_coin_container->end(); ++it_container_phi ) { for ( Muon::RpcCoinDataCollection::const_iterator it_collection_phi = (*it_container_phi)->begin(); it_collection_phi != (*it_container_phi)->end(); ++it_collection_phi ) { // each collection is a trigger signal @@ -1027,14 +1027,14 @@ StatusCode RPCStandaloneTracksMon::fillHistograms() if(m_idHelperSvc->rpcIdHelper().doubletPhi (prdcoll_id) != m_idHelperSvc->rpcIdHelper().doubletPhi (prdcoll_id_phi)) continue ; if(m_idHelperSvc->rpcIdHelper().gasGap (prdcoll_id) != m_idHelperSvc->rpcIdHelper().gasGap (prdcoll_id_phi)) continue ; - if( std::fabs((*it_collection)->time() - (*it_collection_phi)->time()) > 50. ) continue ; + if( std::abs((*it_collection)->time() - (*it_collection_phi)->time()) > 50. ) continue ; if( (*it_collection)->isLowPtCoin() != (*it_collection_phi)->isLowPtCoin() || (*it_collection)->isHighPtCoin() != (*it_collection_phi)->isHighPtCoin()) continue ; descriptor_Atl = MuonDetMgr->getRpcReadoutElement( prdcoll_id_phi ); eta_atlas = descriptor_Atl->stripPos(prdcoll_id_phi ).eta(); phi_atlas = descriptor_Atl->stripPos(prdcoll_id_phi ).phi(); - if( std::sqrt( std::fabs(eta_atlas-metrack->eta())*std::fabs(eta_atlas-metrack->eta()) + std::fabs(phi_atlas-metrack->phi())*std::fabs(phi_atlas-metrack->phi()) ) < m_MuonDeltaRMatching) { + if( std::sqrt( std::abs(eta_atlas-metrack->eta())*std::abs(eta_atlas-metrack->eta()) + std::abs(phi_atlas-metrack->phi())*std::abs(phi_atlas-metrack->phi()) ) < m_MuonDeltaRMatching) { int minthrview = cointhr ; if(cointhrphi<minthrview)minthrview = cointhrphi; if( (*it_collection)-> isLowPtCoin() && (*it_collection_phi)-> isLowPtCoin()){ @@ -1215,8 +1215,8 @@ StatusCode RPCStandaloneTracksMon::fillHistograms() for (int i_3DII=0;i_3DII!=N_Rpc_Clusters3D;i_3DII++) { if( !(Rpc_Matched_mu.at(i_3DII)) && m_StandAloneMatchedWithTrack )continue; - if( abs(Rpc_Eta_3D.at(i_3DII)-Rpc_Eta_3D.at(i_3DI)) > EtaStationSpan )continue; - if( abs(Rpc_Phi_3D.at(i_3DII)-Rpc_Phi_3D.at(i_3DI)) > DoublePhiSpan )continue; + if( std::abs(Rpc_Eta_3D.at(i_3DII)-Rpc_Eta_3D.at(i_3DI)) > EtaStationSpan )continue; + if( std::abs(Rpc_Phi_3D.at(i_3DII)-Rpc_Phi_3D.at(i_3DI)) > DoublePhiSpan )continue; if(LayerType.at(i_3DII)==ilayertype && ilayertype!=6 )continue; if(Rpc_track[ i_3DII ]>0)continue;//Third no-track assigned LowPt or Pivot or HighPt plane @@ -1398,7 +1398,7 @@ StatusCode RPCStandaloneTracksMon::fillHistograms() if ( ilayertype==6 ) { m_rpcchi2dof -> Fill (chi2dof) ; m_rpcetavsphichi2dof -> Fill (chi2dofphi,chi2dofeta) ; - trms = std::sqrt(std::fabs(t2av - tav*tav)); + trms = std::sqrt(std::abs(t2av - tav*tav)); m_rpcTimeTrackRMS -> Fill (trms) ; for (int i_3D=0;i_3D!=N_Rpc_Clusters3D;i_3D++) { if(Rpc_track[ i_3D ] != N_Rpc_Tracks) continue; @@ -1444,7 +1444,7 @@ StatusCode RPCStandaloneTracksMon::fillHistograms() } - float anglephi = 90-std::atan(std::fabs(xyPhi))*180/M_PI ; //atan between -pi/2 and pi/2 , anglephi from 180 to 0 + float anglephi = 90-std::atan(std::abs(xyPhi))*180/M_PI ; //atan between -pi/2 and pi/2 , anglephi from 180 to 0 if(xyPhi<0) anglephi = 180.-anglephi; float rho = std::sqrt( xyPhi*xyPhi + 1 + zyEta*zyEta); @@ -2221,7 +2221,7 @@ StatusCode RPCStandaloneTracksMon::fillHistograms() Inters3DL = ((rpc->transform(prd_id)).inverse())* Inters3DG ; stripPosCL = ((rpc->transform(prd_id)).inverse())* stripPosC ; - float distance = std::fabs(Inters3DL.x() - stripPosCL.x()); + float distance = std::abs(Inters3DL.x() - stripPosCL.x()); if(distance<MergePointDistance) { @@ -5150,8 +5150,8 @@ StatusCode RPCStandaloneTracksMon::procHistograms( ) if ( RPCLyTrkPrj>0 ) { RPCLyHitOnTr = m_LayerHitOnTrack ->GetBinContent ( ibin + 1 ) ; RPCLyEff = RPCLyHitOnTr / RPCLyTrkPrj ; - RPCLyEff_err = std::sqrt( std::fabs( RPCLyHitOnTr-0.5*0) / RPCLyTrkPrj ) * - std::sqrt( 1. - std::fabs( RPCLyHitOnTr-0.5*0) / RPCLyTrkPrj ) / + RPCLyEff_err = std::sqrt( std::abs( RPCLyHitOnTr-0.5*0) / RPCLyTrkPrj ) * + std::sqrt( 1. - std::abs( RPCLyHitOnTr-0.5*0) / RPCLyTrkPrj ) / std::sqrt( RPCLyTrkPrj ) ; m_LayerEff->SetBinContent ( ibin + 1 , RPCLyEff ) ; @@ -5161,8 +5161,8 @@ StatusCode RPCStandaloneTracksMon::procHistograms( ) if ( RPCLyTrkPrj>0 ) { RPCLyHitOnTr = RPCBA_layerHitOnTrack ->GetBinContent ( ibin + 1 ) ; RPCLyEff = RPCLyHitOnTr / RPCLyTrkPrj ; - RPCLyEff_err = std::sqrt( std::fabs( RPCLyHitOnTr-0.5*0) / RPCLyTrkPrj ) * - std::sqrt( 1. - fabs( RPCLyHitOnTr-0.5*0) / RPCLyTrkPrj ) / + RPCLyEff_err = std::sqrt( std::abs( RPCLyHitOnTr-0.5*0) / RPCLyTrkPrj ) * + std::sqrt( 1. - std::abs( RPCLyHitOnTr-0.5*0) / RPCLyTrkPrj ) / std::sqrt( RPCLyTrkPrj ) ; RPCBA_layerEfficiency->SetBinContent ( ibin + 1 , RPCLyEff ) ; @@ -5172,8 +5172,8 @@ StatusCode RPCStandaloneTracksMon::procHistograms( ) if ( RPCLyTrkPrj>0 ) { RPCLyHitOnTr = RPCBC_layerHitOnTrack ->GetBinContent ( ibin + 1 ) ; RPCLyEff = RPCLyHitOnTr / RPCLyTrkPrj ; - RPCLyEff_err = std::sqrt( std::fabs( RPCLyHitOnTr-0.5*0) / RPCLyTrkPrj ) * - std::sqrt( 1. - fabs( RPCLyHitOnTr-0.5*0) / RPCLyTrkPrj ) / + RPCLyEff_err = std::sqrt( std::abs( RPCLyHitOnTr-0.5*0) / RPCLyTrkPrj ) * + std::sqrt( 1. - std::abs( RPCLyHitOnTr-0.5*0) / RPCLyTrkPrj ) / std::sqrt( RPCLyTrkPrj ) ; RPCBC_layerEfficiency->SetBinContent ( ibin + 1 , RPCLyEff ) ; @@ -5191,8 +5191,8 @@ StatusCode RPCStandaloneTracksMon::procHistograms( ) //hRPCPhiEtaCoinThr0 int RPCOnTr = m_hRPCPhiEtaCoinThr[0] ->GetBinContent ( ibin + 1 ) ; float RPCEff = RPCOnTr / TrkPrj ; - float RPCEff_err = std::sqrt( std::fabs( RPCOnTr-0.5*0) / TrkPrj ) * - std::sqrt( 1. - std::fabs( RPCOnTr-0.5*0) / TrkPrj ) / + float RPCEff_err = std::sqrt( std::abs( RPCOnTr-0.5*0) / TrkPrj ) * + std::sqrt( 1. - std::abs( RPCOnTr-0.5*0) / TrkPrj ) / std::sqrt( TrkPrj ) ; m_hRPCPhiEtaCoinThr_eff[0]->SetBinContent ( ibin + 1 , RPCEff ) ; m_hRPCPhiEtaCoinThr_eff[0]->SetBinError ( ibin + 1 , RPCEff_err ) ; @@ -5200,8 +5200,8 @@ StatusCode RPCStandaloneTracksMon::procHistograms( ) //hRPCPhiEtaCoinThr1 RPCOnTr = m_hRPCPhiEtaCoinThr[1] ->GetBinContent ( ibin + 1 ) ; RPCEff = RPCOnTr / TrkPrj ; - RPCEff_err = std::sqrt( std::fabs( RPCOnTr-0.5*0) / TrkPrj ) * - std::sqrt( 1. - std::fabs( RPCOnTr-0.5*0) / TrkPrj ) / + RPCEff_err = std::sqrt( std::abs( RPCOnTr-0.5*0) / TrkPrj ) * + std::sqrt( 1. - std::abs( RPCOnTr-0.5*0) / TrkPrj ) / std::sqrt( TrkPrj ) ; m_hRPCPhiEtaCoinThr_eff[1]->SetBinContent ( ibin + 1 , RPCEff ) ; m_hRPCPhiEtaCoinThr_eff[1]->SetBinError ( ibin + 1 , RPCEff_err ) ; @@ -5209,8 +5209,8 @@ StatusCode RPCStandaloneTracksMon::procHistograms( ) //hRPCPhiEtaCoinThr2 RPCOnTr = m_hRPCPhiEtaCoinThr[2] ->GetBinContent ( ibin + 1 ) ; RPCEff = RPCOnTr / TrkPrj ; - RPCEff_err = std::sqrt( std::fabs( RPCOnTr-0.5*0) / TrkPrj ) * - std::sqrt( 1. - std::fabs( RPCOnTr-0.5*0) / TrkPrj ) / + RPCEff_err = std::sqrt( std::abs( RPCOnTr-0.5*0) / TrkPrj ) * + std::sqrt( 1. - std::abs( RPCOnTr-0.5*0) / TrkPrj ) / std::sqrt( TrkPrj ) ; m_hRPCPhiEtaCoinThr_eff[2]->SetBinContent ( ibin + 1 , RPCEff ) ; m_hRPCPhiEtaCoinThr_eff[2]->SetBinError ( ibin + 1 , RPCEff_err ) ; @@ -5218,8 +5218,8 @@ StatusCode RPCStandaloneTracksMon::procHistograms( ) //hRPCPhiEtaCoinThr3 RPCOnTr = m_hRPCPhiEtaCoinThr[3] ->GetBinContent ( ibin + 1 ) ; RPCEff = RPCOnTr / TrkPrj ; - RPCEff_err = std::sqrt( std::fabs( RPCOnTr-0.5*0) / TrkPrj ) * - std::sqrt( 1. - std::fabs( RPCOnTr-0.5*0) / TrkPrj ) / + RPCEff_err = std::sqrt( std::abs( RPCOnTr-0.5*0) / TrkPrj ) * + std::sqrt( 1. - std::abs( RPCOnTr-0.5*0) / TrkPrj ) / std::sqrt( TrkPrj ) ; m_hRPCPhiEtaCoinThr_eff[3]->SetBinContent ( ibin + 1 , RPCEff ) ; m_hRPCPhiEtaCoinThr_eff[3]->SetBinError ( ibin + 1 , RPCEff_err ) ; @@ -5227,8 +5227,8 @@ StatusCode RPCStandaloneTracksMon::procHistograms( ) //hRPCPhiEtaCoinThr4 RPCOnTr = m_hRPCPhiEtaCoinThr[4] ->GetBinContent ( ibin + 1 ) ; RPCEff = RPCOnTr / TrkPrj ; - RPCEff_err = std::sqrt( std::fabs( RPCOnTr-0.5*0) / TrkPrj ) * - std::sqrt( 1. - std::fabs( RPCOnTr-0.5*0) / TrkPrj ) / + RPCEff_err = std::sqrt( std::abs( RPCOnTr-0.5*0) / TrkPrj ) * + std::sqrt( 1. - std::abs( RPCOnTr-0.5*0) / TrkPrj ) / std::sqrt( TrkPrj ) ; m_hRPCPhiEtaCoinThr_eff[4]->SetBinContent ( ibin + 1 , RPCEff ) ; m_hRPCPhiEtaCoinThr_eff[4]->SetBinError ( ibin + 1 , RPCEff_err ) ; @@ -5236,16 +5236,16 @@ StatusCode RPCStandaloneTracksMon::procHistograms( ) //hRPCPhiEtaCoinThr5 RPCOnTr = m_hRPCPhiEtaCoinThr[5] ->GetBinContent ( ibin + 1 ) ; RPCEff = RPCOnTr / TrkPrj ; - RPCEff_err = std::sqrt( std::fabs( RPCOnTr-0.5*0) / TrkPrj ) * - std::sqrt( 1. - std::fabs( RPCOnTr-0.5*0) / TrkPrj ) / + RPCEff_err = std::sqrt( std::abs( RPCOnTr-0.5*0) / TrkPrj ) * + std::sqrt( 1. - std::abs( RPCOnTr-0.5*0) / TrkPrj ) / std::sqrt( TrkPrj ) ; m_hRPCPhiEtaCoinThr_eff[5]->SetBinContent ( ibin + 1 , RPCEff ) ; m_hRPCPhiEtaCoinThr_eff[5]->SetBinError ( ibin + 1 , RPCEff_err ) ; //hRPCPadThr0 RPCOnTr = m_hRPCPadThr[0] ->GetBinContent ( ibin + 1 ) ; RPCEff = RPCOnTr / TrkPrj ; - RPCEff_err = std::sqrt( std::fabs( RPCOnTr-0.5*0) / TrkPrj ) * - std::sqrt( 1. - std::fabs( RPCOnTr-0.5*0) / TrkPrj ) / + RPCEff_err = std::sqrt( std::abs( RPCOnTr-0.5*0) / TrkPrj ) * + std::sqrt( 1. - std::abs( RPCOnTr-0.5*0) / TrkPrj ) / std::sqrt( TrkPrj ) ; m_hRPCPadThr_eff[0]->SetBinContent ( ibin + 1 , RPCEff ) ; m_hRPCPadThr_eff[0]->SetBinError ( ibin + 1 , RPCEff_err ) ; @@ -5253,8 +5253,8 @@ StatusCode RPCStandaloneTracksMon::procHistograms( ) //hRPCPadThr1 RPCOnTr = m_hRPCPadThr[1] ->GetBinContent ( ibin + 1 ) ; RPCEff = RPCOnTr / TrkPrj ; - RPCEff_err = std::sqrt( std::fabs( RPCOnTr-0.5*0) / TrkPrj ) * - std::sqrt( 1. - std::fabs( RPCOnTr-0.5*0) / TrkPrj ) / + RPCEff_err = std::sqrt( std::abs( RPCOnTr-0.5*0) / TrkPrj ) * + std::sqrt( 1. - std::abs( RPCOnTr-0.5*0) / TrkPrj ) / std::sqrt( TrkPrj ) ; m_hRPCPadThr_eff[1]->SetBinContent ( ibin + 1 , RPCEff ) ; m_hRPCPadThr_eff[1]->SetBinError ( ibin + 1 , RPCEff_err ) ; @@ -5262,8 +5262,8 @@ StatusCode RPCStandaloneTracksMon::procHistograms( ) //hRPCPadThr2 RPCOnTr = m_hRPCPadThr[2] ->GetBinContent ( ibin + 1 ) ; RPCEff = RPCOnTr / TrkPrj ; - RPCEff_err = std::sqrt( std::fabs( RPCOnTr-0.5*0) / TrkPrj ) * - std::sqrt( 1. - std::fabs( RPCOnTr-0.5*0) / TrkPrj ) / + RPCEff_err = std::sqrt( std::abs( RPCOnTr-0.5*0) / TrkPrj ) * + std::sqrt( 1. - std::abs( RPCOnTr-0.5*0) / TrkPrj ) / std::sqrt( TrkPrj ) ; m_hRPCPadThr_eff[2]->SetBinContent ( ibin + 1 , RPCEff ) ; m_hRPCPadThr_eff[2]->SetBinError ( ibin + 1 , RPCEff_err ) ; @@ -5271,8 +5271,8 @@ StatusCode RPCStandaloneTracksMon::procHistograms( ) //hRPCPadThr3 RPCOnTr = m_hRPCPadThr[3] ->GetBinContent ( ibin + 1 ) ; RPCEff = RPCOnTr / TrkPrj ; - RPCEff_err = std::sqrt( std::fabs( RPCOnTr-0.5*0) / TrkPrj ) * - std::sqrt( 1. - std::fabs( RPCOnTr-0.5*0) / TrkPrj ) / + RPCEff_err = std::sqrt( std::abs( RPCOnTr-0.5*0) / TrkPrj ) * + std::sqrt( 1. - std::abs( RPCOnTr-0.5*0) / TrkPrj ) / std::sqrt( TrkPrj ) ; m_hRPCPadThr_eff[3]->SetBinContent ( ibin + 1 , RPCEff ) ; m_hRPCPadThr_eff[3]->SetBinError ( ibin + 1 , RPCEff_err ) ; @@ -5280,8 +5280,8 @@ StatusCode RPCStandaloneTracksMon::procHistograms( ) //hRPCPadThr4 RPCOnTr = m_hRPCPadThr[4] ->GetBinContent ( ibin + 1 ) ; RPCEff = RPCOnTr / TrkPrj ; - RPCEff_err = std::sqrt( std::fabs( RPCOnTr-0.5*0) / TrkPrj ) * - std::sqrt( 1. - std::fabs( RPCOnTr-0.5*0) / TrkPrj ) / + RPCEff_err = std::sqrt( std::abs( RPCOnTr-0.5*0) / TrkPrj ) * + std::sqrt( 1. - std::abs( RPCOnTr-0.5*0) / TrkPrj ) / std::sqrt( TrkPrj ) ; m_hRPCPadThr_eff[4]->SetBinContent ( ibin + 1 , RPCEff ) ; m_hRPCPadThr_eff[4]->SetBinError ( ibin + 1 , RPCEff_err ) ; @@ -5289,16 +5289,16 @@ StatusCode RPCStandaloneTracksMon::procHistograms( ) //hRPCPadThr5 RPCOnTr = m_hRPCPadThr[5] ->GetBinContent ( ibin + 1 ) ; RPCEff = RPCOnTr / TrkPrj ; - RPCEff_err = std::sqrt( std::fabs( RPCOnTr-0.5*0) / TrkPrj ) * - std::sqrt( 1. - std::fabs( RPCOnTr-0.5*0) / TrkPrj ) / + RPCEff_err = std::sqrt( std::abs( RPCOnTr-0.5*0) / TrkPrj ) * + std::sqrt( 1. - std::abs( RPCOnTr-0.5*0) / TrkPrj ) / std::sqrt( TrkPrj ) ; m_hRPCPadThr_eff[5]->SetBinContent ( ibin + 1 , RPCEff ) ; m_hRPCPadThr_eff[5]->SetBinError ( ibin + 1 , RPCEff_err ) ; //hRPCMuctpiThr0 RPCOnTr = m_hRPCMuctpiThr[0] ->GetBinContent ( ibin + 1 ) ; RPCEff = RPCOnTr / TrkPrj ; - RPCEff_err = std::sqrt( std::fabs( RPCOnTr-0.5*0) / TrkPrj ) * - std::sqrt( 1. - std::fabs( RPCOnTr-0.5*0) / TrkPrj ) / + RPCEff_err = std::sqrt( std::abs( RPCOnTr-0.5*0) / TrkPrj ) * + std::sqrt( 1. - std::abs( RPCOnTr-0.5*0) / TrkPrj ) / std::sqrt( TrkPrj ) ; m_hRPCMuctpiThr_eff[0]->SetBinContent ( ibin + 1 , RPCEff ) ; m_hRPCMuctpiThr_eff[0]->SetBinError ( ibin + 1 , RPCEff_err ) ; @@ -5306,8 +5306,8 @@ StatusCode RPCStandaloneTracksMon::procHistograms( ) //hRPCMuctpiThr1 RPCOnTr = m_hRPCMuctpiThr[1] ->GetBinContent ( ibin + 1 ) ; RPCEff = RPCOnTr / TrkPrj ; - RPCEff_err = std::sqrt( std::fabs( RPCOnTr-0.5*0) / TrkPrj ) * - std::sqrt( 1. - std::fabs( RPCOnTr-0.5*0) / TrkPrj ) / + RPCEff_err = std::sqrt( std::abs( RPCOnTr-0.5*0) / TrkPrj ) * + std::sqrt( 1. - std::abs( RPCOnTr-0.5*0) / TrkPrj ) / std::sqrt( TrkPrj ) ; m_hRPCMuctpiThr_eff[1]->SetBinContent ( ibin + 1 , RPCEff ) ; m_hRPCMuctpiThr_eff[1]->SetBinError ( ibin + 1 , RPCEff_err ) ; @@ -5315,8 +5315,8 @@ StatusCode RPCStandaloneTracksMon::procHistograms( ) //hRPCMuctpiThr2 RPCOnTr = m_hRPCMuctpiThr[2] ->GetBinContent ( ibin + 1 ) ; RPCEff = RPCOnTr / TrkPrj ; - RPCEff_err = std::sqrt( std::fabs( RPCOnTr-0.5*0) / TrkPrj ) * - std::sqrt( 1. - std::fabs( RPCOnTr-0.5*0) / TrkPrj ) / + RPCEff_err = std::sqrt( std::abs( RPCOnTr-0.5*0) / TrkPrj ) * + std::sqrt( 1. - std::abs( RPCOnTr-0.5*0) / TrkPrj ) / std::sqrt( TrkPrj ) ; m_hRPCMuctpiThr_eff[2]->SetBinContent ( ibin + 1 , RPCEff ) ; m_hRPCMuctpiThr_eff[2]->SetBinError ( ibin + 1 , RPCEff_err ) ; @@ -5324,8 +5324,8 @@ StatusCode RPCStandaloneTracksMon::procHistograms( ) //hRPCMuctpiThr3 RPCOnTr = m_hRPCMuctpiThr[3] ->GetBinContent ( ibin + 1 ) ; RPCEff = RPCOnTr / TrkPrj ; - RPCEff_err = std::sqrt( std::fabs( RPCOnTr-0.5*0) / TrkPrj ) * - std::sqrt( 1. - std::fabs( RPCOnTr-0.5*0) / TrkPrj ) / + RPCEff_err = std::sqrt( std::abs( RPCOnTr-0.5*0) / TrkPrj ) * + std::sqrt( 1. - std::abs( RPCOnTr-0.5*0) / TrkPrj ) / std::sqrt( TrkPrj ) ; m_hRPCMuctpiThr_eff[3]->SetBinContent ( ibin + 1 , RPCEff ) ; m_hRPCMuctpiThr_eff[3]->SetBinError ( ibin + 1 , RPCEff_err ) ; @@ -5333,8 +5333,8 @@ StatusCode RPCStandaloneTracksMon::procHistograms( ) //hRPCMuctpiThr4 RPCOnTr = m_hRPCMuctpiThr[4] ->GetBinContent ( ibin + 1 ) ; RPCEff = RPCOnTr / TrkPrj ; - RPCEff_err = std::sqrt( std::fabs( RPCOnTr-0.5*0) / TrkPrj ) * - std::sqrt( 1. - std::fabs( RPCOnTr-0.5*0) / TrkPrj ) / + RPCEff_err = std::sqrt( std::abs( RPCOnTr-0.5*0) / TrkPrj ) * + std::sqrt( 1. - std::abs( RPCOnTr-0.5*0) / TrkPrj ) / std::sqrt( TrkPrj ) ; m_hRPCMuctpiThr_eff[4]->SetBinContent ( ibin + 1 , RPCEff ) ; m_hRPCMuctpiThr_eff[4]->SetBinError ( ibin + 1 , RPCEff_err ) ; @@ -5342,8 +5342,8 @@ StatusCode RPCStandaloneTracksMon::procHistograms( ) //hRPCMuctpiThr5 RPCOnTr = m_hRPCMuctpiThr[5] ->GetBinContent ( ibin + 1 ) ; RPCEff = RPCOnTr / TrkPrj ; - RPCEff_err = std::sqrt( std::fabs( RPCOnTr-0.5*0) / TrkPrj ) * - std::sqrt( 1. - std::fabs( RPCOnTr-0.5*0) / TrkPrj ) / + RPCEff_err = std::sqrt( std::abs( RPCOnTr-0.5*0) / TrkPrj ) * + std::sqrt( 1. - std::abs( RPCOnTr-0.5*0) / TrkPrj ) / std::sqrt( TrkPrj ) ; m_hRPCMuctpiThr_eff[5]->SetBinContent ( ibin + 1 , RPCEff ) ; m_hRPCMuctpiThr_eff[5]->SetBinError ( ibin + 1 , RPCEff_err ) ; @@ -5387,8 +5387,8 @@ StatusCode RPCStandaloneTracksMon::procHistograms( ) PanelVal = 0 ; if ( PanelTrackProj != 0 ) { PanelVal = PanelHitOnTrack/PanelTrackProj ; - PanelVal_err = std::sqrt( std::fabs( PanelHitOnTrack-0.5*0) / PanelTrackProj ) * - std::sqrt( 1. - std::fabs( PanelHitOnTrack-0.5*0) / PanelTrackProj ) / + PanelVal_err = std::sqrt( std::abs( PanelHitOnTrack-0.5*0) / PanelTrackProj ) * + std::sqrt( 1. - std::abs( PanelHitOnTrack-0.5*0) / PanelTrackProj ) / std::sqrt( PanelTrackProj ) ; SummaryEfficiency -> SetBinContent ( pos + shift_pos , PanelVal ) ; SummaryEfficiency -> SetBinError ( pos + shift_pos , PanelVal_err ) ; @@ -5407,8 +5407,8 @@ StatusCode RPCStandaloneTracksMon::procHistograms( ) PanelVal = 0 ; if ( PanelTrackProj != 0 ) { PanelVal = PanelHitOnTrack/PanelTrackProj ; - PanelVal_err = std::sqrt( std::fabs( PanelHitOnTrack-0.5*0) / PanelTrackProj ) * - std::sqrt( 1. - std::fabs( PanelHitOnTrack-0.5*0) / PanelTrackProj ) / + PanelVal_err = std::sqrt( std::abs( PanelHitOnTrack-0.5*0) / PanelTrackProj ) * + std::sqrt( 1. - std::abs( PanelHitOnTrack-0.5*0) / PanelTrackProj ) / std::sqrt( PanelTrackProj ) ; m_SummaryHist[enumSumGapEfficiency+m_SummaryHist_Idx]-> SetBinContent ( pos + shift_pos , PanelVal ) ; m_SummaryHist[enumSumGapEfficiency+m_SummaryHist_Idx]-> SetBinError ( pos + shift_pos , PanelVal_err ) ; @@ -5466,7 +5466,7 @@ StatusCode RPCStandaloneTracksMon::procHistograms( ) PanelVal=PanelVal/PanelVal_entries; PanelVal_square=PanelVal_square/PanelVal_entries; } - PanelVal_err = std::sqrt ( std::fabs(PanelVal_square - PanelVal*PanelVal) ) ; + PanelVal_err = std::sqrt ( std::abs(PanelVal_square - PanelVal*PanelVal) ) ; // rpcAverageCS -> Fill(PanelVal) ; if ( pos>0 ) { m_rpcAverageSide_A[enumAvCS] -> Fill(PanelVal) ; } else { m_rpcAverageSide_C[enumAvCS] -> Fill(PanelVal) ; } @@ -5486,7 +5486,7 @@ StatusCode RPCStandaloneTracksMon::procHistograms( ) PanelVal=PanelVal/PanelVal_entries; PanelVal_square=PanelVal_square/PanelVal_entries; } - PanelVal_err = std::sqrt ( std::fabs(PanelVal_square - PanelVal*PanelVal) ) ; + PanelVal_err = std::sqrt ( std::abs(PanelVal_square - PanelVal*PanelVal) ) ; if ( pos>0 ) { m_rpcAverageSide_A[enumAvRes_CS1] -> Fill(PanelVal) ; } else { m_rpcAverageSide_C[enumAvRes_CS1] -> Fill(PanelVal) ; } SummaryRes_CS1DistriPerSector -> Fill(PanelVal) ; @@ -5507,7 +5507,7 @@ StatusCode RPCStandaloneTracksMon::procHistograms( ) PanelVal=PanelVal/PanelVal_entries; PanelVal_square=PanelVal_square/PanelVal_entries; } - PanelVal_err = std::sqrt ( std::fabs(PanelVal_square - PanelVal*PanelVal) ) ; + PanelVal_err = std::sqrt ( std::abs(PanelVal_square - PanelVal*PanelVal) ) ; if ( pos>0 ) { m_rpcAverageSide_A[enumAvRes_CS2] -> Fill(PanelVal) ; } else { m_rpcAverageSide_C[enumAvRes_CS2] -> Fill(PanelVal) ; } SummaryRes_CS2DistriPerSector -> Fill(PanelVal) ; @@ -5529,7 +5529,7 @@ StatusCode RPCStandaloneTracksMon::procHistograms( ) PanelVal=PanelVal/PanelVal_entries; PanelVal_square=PanelVal_square/PanelVal_entries; } - PanelVal_err = std::sqrt ( std::fabs(PanelVal_square - PanelVal*PanelVal) ) ; + PanelVal_err = std::sqrt ( std::abs(PanelVal_square - PanelVal*PanelVal) ) ; if ( pos>0 ) { m_rpcAverageSide_A[enumAvRes_CSmore2] -> Fill(PanelVal) ; } else { m_rpcAverageSide_C[enumAvRes_CSmore2] -> Fill(PanelVal) ; } SummaryRes_CSmore2DistriPerSector -> Fill(PanelVal) ; @@ -5580,7 +5580,7 @@ StatusCode RPCStandaloneTracksMon::procHistograms( ) PanelVal=PanelVal/PanelVal_entries; PanelVal_square=PanelVal_square/PanelVal_entries; } - PanelVal_err = std::sqrt ( std::fabs(PanelVal_square - PanelVal*PanelVal) ) ; + PanelVal_err = std::sqrt ( std::abs(PanelVal_square - PanelVal*PanelVal) ) ; if ( pos>0 ) { m_rpcAverageSide_A[enumAvTime] -> Fill(PanelVal) ; } else { m_rpcAverageSide_C[enumAvTime] -> Fill(PanelVal) ; } SummaryTimeDistriPerSector -> Fill(PanelVal) ; diff --git a/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/RpcRawDataMonitoring/src/RpcGlobalUtilities.cxx b/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/RpcRawDataMonitoring/src/RpcGlobalUtilities.cxx index 4fe74ba84ddb9368d9db7462617527f576175a96..d4a0498bf27ea77de4cffe0846945486882b5449 100644 --- a/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/RpcRawDataMonitoring/src/RpcGlobalUtilities.cxx +++ b/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/RpcRawDataMonitoring/src/RpcGlobalUtilities.cxx @@ -1,29 +1,17 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ -/*************************************************************************** - global stuff - ----------------------------------------- - ***************************************************************************/ - -//<doc><file> $Id: GlobalUtilities.cxx,v 1.2 2009-02-24 16:47:48 dwright Exp $ -//<version> $Name: not supported by cvs2svn $ - -//<<<<<< INCLUDES >>>>>> - #include <cstdlib> #include <sstream> #include <iostream> #include <cmath> - #include "MuonReadoutGeometry/RpcReadoutSet.h" #include "MuonReadoutGeometry/MuonDetectorManager.h" #include "MuonReadoutGeometry/MuonReadoutElement.h" #include "MuonReadoutGeometry/RpcReadoutElement.h" #include "RpcRawDataMonitoring/RpcGlobalUtilities.h" - namespace RpcGM { @@ -104,7 +92,7 @@ std::vector<int> RpcStripShift(const MuonGM::MuonDetectorManager* muonMgr, cons //Extension feet Pivot if(irpcdoubletR==2)PlaneTipo=1; //BML7 assigned to pivot - if( irpcstationName==2 && ( (abs(irpcstationEta)==7)||(irpcstationPhi==7&&abs(irpcstationEta)==6) ) )PlaneTipo=1; + if( irpcstationName==2 && ( (std::abs(irpcstationEta)==7)||(irpcstationPhi==7&&std::abs(irpcstationEta)==6) ) )PlaneTipo=1; //evaluate strip shift //2=BML,3=BMS,4=BOL,5=BOS,8=BMF,9=BOF,10=BOG,53=BME @@ -143,13 +131,13 @@ std::vector<int> RpcStripShift(const MuonGM::MuonDetectorManager* muonMgr, cons int krpcdoubletR=irpcdoubletR; if(PlaneTipo==0){ - if(krpcstationName==2&&abs(ieta)==7 )continue; - if(krpcstationName==2&&abs(ieta)==6&&irpcstationPhi==7)continue; + if(krpcstationName==2&&std::abs(ieta)==7 )continue; + if(krpcstationName==2&&std::abs(ieta)==6&&irpcstationPhi==7)continue; if(krpcstationName==4||krpcstationName==5||krpcstationName==9||krpcstationName==10)continue; } else if(PlaneTipo==1){ - if(krpcstationName==2&&abs(ieta)==7 ){krpcdoubletR=1;} - else if(krpcstationName==2&&abs(ieta)==6&&irpcstationPhi==7){krpcdoubletR=1;} + if(krpcstationName==2&&std::abs(ieta)==7 ){krpcdoubletR=1;} + else if(krpcstationName==2&&std::abs(ieta)==6&&irpcstationPhi==7){krpcdoubletR=1;} else{ krpcdoubletR=2;} } else if(PlaneTipo==2){ @@ -223,11 +211,11 @@ std::vector<int> RpcStripShift(const MuonGM::MuonDetectorManager* muonMgr, cons else if(irpcstationName==4 ){ShiftStripPhiAtlas = (2*64+80*2) * ( irpcstationPhi -1 ) ;} else{ShiftStripPhiAtlas = (2*64+80*2) * ( irpcstationPhi -1 ) + 2*80 ;} //BML7 assigned to pivot - if( irpcstationName==2 && abs(irpcstationEta)==7){ + if( irpcstationName==2 && std::abs(irpcstationEta)==7){ ShiftStripPhiAtlas = (2*48+64*2) * ( irpcstationPhi -1 ); if(irpcstationPhi==8)ShiftStripPhiAtlas +=4*16; } - if( irpcstationName==2 && irpcstationPhi==7&&abs(irpcstationEta)==6 ){ + if( irpcstationName==2 && irpcstationPhi==7&&std::abs(irpcstationEta)==6 ){ ShiftStripPhiAtlas = (2*48+64*2) * ( irpcstationPhi -1 ) +2*16 ; } } @@ -267,7 +255,7 @@ std::vector<int> RpcStripShift(const MuonGM::MuonDetectorManager* muonMgr, cons PanelIndex = irpcmeasuresPhi + (irpcgasGap-1)*2 + (irpcdoubletPhi-1)*4 + (irpcdoubletZ-1)*8 + (irpcstationName_index)*24 - + ( ( abs(irpcstationEta) ) )*72 ; + + ( ( std::abs(irpcstationEta) ) )*72 ; // exception station name=53, assume irpcstationEta = 0 ; if(irpcstationName ==53) PanelIndex = irpcmeasuresPhi + (irpcgasGap-1)*2 + (irpcdoubletPhi-1)*4 + (irpcdoubletZ-1)*8 + (irpcstationName_index)*24; @@ -275,7 +263,7 @@ std::vector<int> RpcStripShift(const MuonGM::MuonDetectorManager* muonMgr, cons if ( irpcstationName==10 ) { // convention: BOG <-> doubletZ=3 <-> (3-1)*8=16 PanelIndex = irpcmeasuresPhi + (irpcgasGap-1)*2 + (irpcdoubletPhi-1)*4 + 16 + (irpcstationName_index)*24 - + ( ( abs(irpcstationEta) ) )*72 ; + + ( ( std::abs(irpcstationEta) ) )*72 ; } if ( (irpcdoubletR==2) && (irpcstationName==9 || irpcstationName==10) ) { // convention: chambers of RPC upgrade -> eta = eta + 7 @@ -314,13 +302,10 @@ std::vector<int> RpcStripShift(const MuonGM::MuonDetectorManager* muonMgr, cons if (iname>10 && iname!=53) continue; if( iname==6 || iname==7 ) continue; ; - //if((iname==4||iname==5||iname==9||iname==10)&&!(irpcstationName==4||irpcstationName==5||irpcstationName==9||irpcstationName==10))continue; - - //if((iname==2||iname==3||iname==8||iname==53)&&!(irpcstationName==2||irpcstationName==3||irpcstationName==8||irpcstationName==53))continue; - + laststationEta = 8; if(iname==irpcstationName&&iphi==irpcstationPhi){ - laststationEta = abs(irpcstationEta) ; + laststationEta = std::abs(irpcstationEta) ; } for(int ieta = 0; ieta != laststationEta+1; ieta++ ){ @@ -341,8 +326,8 @@ std::vector<int> RpcStripShift(const MuonGM::MuonDetectorManager* muonMgr, cons if(iname==4||iname==5||iname==9||iname==10)continue; } else if(PlaneTipo==1){ - if(irpcstationName==2&&abs(irpcstationEta)==7 )ir=2; - if(irpcstationName==2&&abs(irpcstationEta)==6&&irpcstationPhi==7)ir=2; + if(irpcstationName==2&&std::abs(irpcstationEta)==7 )ir=2; + if(irpcstationName==2&&std::abs(irpcstationEta)==6&&irpcstationPhi==7)ir=2; if(iname==2&&ieta==7 )ir=1; if(iname==2&&ieta==6&&iphi==7)ir=1; } @@ -468,7 +453,7 @@ std::vector<std::string> RpcLayerSectorSideName(const RpcIdHelper& rpcIdHelpe else {layer_name="HighPt";} if(irpcdoubletR==2)layer_name="Pivot"; //BML7 assigned to pivot - if( irpcstationName==2 && ( (abs(irpcstationEta)==7)||(irpcstationPhi==7&&abs(irpcstationEta)==6) ) )layer_name="Pivot"; + if( irpcstationName==2 && ( (std::abs(irpcstationEta)==7)||(irpcstationPhi==7&&std::abs(irpcstationEta)==6) ) )layer_name="Pivot"; if(irpcstationName==3||irpcstationName==5||irpcstationName==8||irpcstationName==9||irpcstationName==10){ HVorROsideleft = "RO side" ; diff --git a/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/RpcRawDataMonitoring/src/RpcLv1RawDataEfficiency.cxx b/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/RpcRawDataMonitoring/src/RpcLv1RawDataEfficiency.cxx index fc52585c8c24808321b56fdd79d0e83ca89dd36b..8f433a0afee9898b5c6f499bcb616aa1ddabf222 100644 --- a/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/RpcRawDataMonitoring/src/RpcLv1RawDataEfficiency.cxx +++ b/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/RpcRawDataMonitoring/src/RpcLv1RawDataEfficiency.cxx @@ -38,6 +38,7 @@ RpcLv1RawDataEfficiency::RpcLv1RawDataEfficiency( const std::string & type, //================================================================================================================================ StatusCode RpcLv1RawDataEfficiency::initialize() { + ATH_CHECK(ManagedMonitorToolBase::initialize()); ATH_MSG_INFO( "In initializing 'RpcLv1RawDataEfficiency'" ); ATH_MSG_INFO( "Package version = "<< PACKAGE_VERSION ); @@ -64,7 +65,7 @@ StatusCode RpcLv1RawDataEfficiency::initialize() m_rpclv1_sectorhits_C[5] = 0 ; m_rpclv1_sectorhits_all[5]= 0 ; - ATH_CHECK( m_muonIdHelperTool.retrieve() ); + ATH_CHECK( m_idHelperSvc.retrieve() ); // MuonDetectorManager from the conditions store ATH_CHECK(m_DetectorManagerKey.initialize()); ATH_MSG_DEBUG( "Found the MuonDetectorManager from detector store." ); @@ -72,10 +73,6 @@ StatusCode RpcLv1RawDataEfficiency::initialize() ATH_CHECK(m_rpcCoinKey.initialize()); ATH_CHECK(m_eventInfo.initialize()); ATH_CHECK(m_sectorLogicContainerKey.initialize(!m_isMC)); - - // Ignore the checking code - ManagedMonitorToolBase::initialize().ignore(); - return StatusCode::SUCCESS; } @@ -111,24 +108,24 @@ StatusCode RpcLv1RawDataEfficiency::readRpcCoinDataContainer() coindata->SetThresholdLowHigh(int((*it_collection)->threshold()), int((*it_collection)->isLowPtCoin()), int((*it_collection)->isHighPtCoin())); prdcoll_id = (*it_collection)->identify(); descriptor_Atl = MuonDetMgr->getRpcReadoutElement( prdcoll_id ); - irpcstationEta = int(m_muonIdHelperTool->rpcIdHelper().stationEta(prdcoll_id)); + irpcstationEta = int(m_idHelperSvc->rpcIdHelper().stationEta(prdcoll_id)); x_atlas = descriptor_Atl->stripPos(prdcoll_id ).x(); y_atlas = descriptor_Atl->stripPos(prdcoll_id ).y(); z_atlas = descriptor_Atl->stripPos(prdcoll_id ).z(); //obtaining phi coordinate: if ( x_atlas > 0 ) { - phi_atlas = atan ( y_atlas / x_atlas ); + phi_atlas = std::atan ( y_atlas / x_atlas ); } else if ( x_atlas == 0 ){ if (y_atlas > 0) phi_atlas = CLHEP::pi/2; else phi_atlas = -CLHEP::pi/2; } else{ - if (y_atlas > 0) phi_atlas = atan ( y_atlas / x_atlas ) + CLHEP::pi ; - else phi_atlas = -CLHEP::pi + atan ( y_atlas / x_atlas ) ; + if (y_atlas > 0) phi_atlas = std::atan ( y_atlas / x_atlas ) + CLHEP::pi ; + else phi_atlas = -CLHEP::pi + std::atan ( y_atlas / x_atlas ) ; } // obtaining pseudorapidity coordinate - if ( z_atlas!=0 ) eta_atlas = -log( abs( tan( 0.5 * atan(sqrt(pow(x_atlas,2.)+pow(y_atlas,2.))/ z_atlas )) ) ); + if ( z_atlas!=0 ) eta_atlas = -std::log( std::abs( std::tan( 0.5 * std::atan(std::hypot(x_atlas, y_atlas)/ z_atlas )) ) ); else eta_atlas = 0; if ( irpcstationEta<0 ) eta_atlas = -eta_atlas; coindata->SetEtaPhi( eta_atlas, phi_atlas ); diff --git a/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/RpcRawDataMonitoring/src/RpcLv1RawDataValAlg.cxx b/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/RpcRawDataMonitoring/src/RpcLv1RawDataValAlg.cxx index 4d89bdfbc1015e1e2cb20f2614467dd795f479e4..f87df481622d2b1c598d6db058cbb88ce193f63c 100755 --- a/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/RpcRawDataMonitoring/src/RpcLv1RawDataValAlg.cxx +++ b/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/RpcRawDataMonitoring/src/RpcLv1RawDataValAlg.cxx @@ -1826,10 +1826,10 @@ void RpcLv1RawDataValAlg::bookRPCCoolHistograms( std::vector<std::string>::const if (kName>10 && kName!=53) continue; for (int iz=0; iz!=3; iz++ ) { int irc = ir ; - if(abs(ieta-8)==7&&ir==1&&kName==2)continue; - if(isec==12&&abs(ieta-8)==6&&ir==1&&kName==2)continue; - if(abs(ieta-8)==7&&ir==2)irc=1; - if(isec==12&&abs(ieta-8)==6&&ir==2)irc=1; + if(std::abs(ieta-8)==7&&ir==1&&kName==2)continue; + if(isec==12&&std::abs(ieta-8)==6&&ir==1&&kName==2)continue; + if(std::abs(ieta-8)==7&&ir==2)irc=1; + if(isec==12&&std::abs(ieta-8)==6&&ir==2)irc=1; const MuonGM::RpcReadoutElement* rpc = MuonDetMgr->getRpcRElement_fromIdFields(kName, ieta-8, istatPhi+1, irc, iz+1, idblPhi+1); if( rpc == NULL ) continue; diff --git a/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/RpcRawDataMonitoring/src/RpcRawDataValAlg.cxx b/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/RpcRawDataMonitoring/src/RpcRawDataValAlg.cxx index 1133f807fe63997cad7f7408c8dcaea7229d512d..6f9360cf2cb52274a5bdde823a1ef1afc7cf95a0 100755 --- a/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/RpcRawDataMonitoring/src/RpcRawDataValAlg.cxx +++ b/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/RpcRawDataMonitoring/src/RpcRawDataValAlg.cxx @@ -108,53 +108,21 @@ RpcRawDataValAlg::~RpcRawDataValAlg() // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * StatusCode RpcRawDataValAlg::initialize(){ - - + ATH_CHECK(ManagedMonitorToolBase::initialize()); ATH_MSG_INFO ( "in initializing RpcRawDataValAlg" ); - ATH_MSG_DEBUG ( "******************" ); ATH_MSG_DEBUG ( "doRpcESD: " << m_doRpcESD ); ATH_MSG_DEBUG ( "RpcFile: "<< m_rpcfile ); - - StatusCode sc; - - // Initialize the IdHelper - StoreGateSvc* detStore = 0; - sc = service("DetectorStore", detStore); - if (sc.isFailure()) { - ATH_MSG_FATAL( "DetectorStore service not found !" ); - return StatusCode::FAILURE; - } - // MuonDetectorManager from the conditions store ATH_CHECK(m_DetectorManagerKey.initialize()); + ATH_CHECK(m_idHelperSvc.retrieve()); - ATH_CHECK( m_muonIdHelperTool.retrieve() ); - // get RPC cablingSvc - const IRPCcablingServerSvc* RpcCabGet = 0; - sc = service("RPCcablingServerSvc", RpcCabGet); - if (sc.isFailure()) { - ATH_MSG_WARNING ( "Could not get RPCcablingServerSvc !" ); - return StatusCode::FAILURE; - } - - sc = RpcCabGet->giveCabling(m_cabling); - if (sc.isFailure()) { - ATH_MSG_WARNING ( "Could not get RPCcablingSvc from the Server !" ); - m_cabling = 0; - return StatusCode::FAILURE; - } else { ATH_MSG_DEBUG ( " Found the RPCcablingSvc. " ); } - /* - sc = m_pSummarySvc.retrieve(); - if (StatusCode::SUCCESS not_eq sc) { - ATH_MSG_WARNING ( "Could not retrieve the summary service" ); - } - */ - - ManagedMonitorToolBase::initialize().ignore(); // Ignore the checking code; + const IRPCcablingServerSvc* RpcCabGet = nullptr; + ATH_CHECK(service("RPCcablingServerSvc", RpcCabGet)); + ATH_CHECK(RpcCabGet->giveCabling(m_cabling)); + ATH_MSG_DEBUG(" Found the RPCcablingSvc. "); - m_rpc_eventstotal=0; // Clear Muon Monitoring Histograms @@ -205,12 +173,11 @@ StatusCode RpcRawDataValAlg::initialize(){ m_rpcCool_StripProfile = 0 ; m_rpcCool_PanelIdHist = 0 ; - m_first = true ; ATH_CHECK(m_eventInfo.initialize()); - ATH_CHECK( m_key_rpc.initialize()); - ATH_CHECK( m_key_trig.initialize()); + ATH_CHECK(m_key_rpc.initialize()); + ATH_CHECK(m_key_trig.initialize()); ATH_CHECK(m_clusterContainerName.initialize(m_doClusters)); return StatusCode::SUCCESS; @@ -592,15 +559,15 @@ StatusCode RpcRawDataValAlg::fillHistograms() { if (m_nPrd<maxPRD) { Identifier prdcoll_id = (*rpcCollection)->identify(); - int irpcstationPhi = int(m_muonIdHelperTool->rpcIdHelper().stationPhi(prdcoll_id)) ; - int irpcstationName = int(m_muonIdHelperTool->rpcIdHelper().stationName(prdcoll_id)) ; - int irpcstationEta = int(m_muonIdHelperTool->rpcIdHelper().stationEta(prdcoll_id)) ; - int irpcdoubletR = int(m_muonIdHelperTool->rpcIdHelper().doubletR(prdcoll_id)) ; - int irpcdoubletZ = int(m_muonIdHelperTool->rpcIdHelper().doubletZ(prdcoll_id)) ; - int irpcdoubletPhi = int(m_muonIdHelperTool->rpcIdHelper().doubletPhi(prdcoll_id)) ; - int irpcgasGap = int(m_muonIdHelperTool->rpcIdHelper().gasGap(prdcoll_id)) ; - int irpcmeasuresPhi = int(m_muonIdHelperTool->rpcIdHelper().measuresPhi(prdcoll_id)) ; - int irpcstrip = int(m_muonIdHelperTool->rpcIdHelper().strip(prdcoll_id)) ; + int irpcstationPhi = int(m_idHelperSvc->rpcIdHelper().stationPhi(prdcoll_id)) ; + int irpcstationName = int(m_idHelperSvc->rpcIdHelper().stationName(prdcoll_id)) ; + int irpcstationEta = int(m_idHelperSvc->rpcIdHelper().stationEta(prdcoll_id)) ; + int irpcdoubletR = int(m_idHelperSvc->rpcIdHelper().doubletR(prdcoll_id)) ; + int irpcdoubletZ = int(m_idHelperSvc->rpcIdHelper().doubletZ(prdcoll_id)) ; + int irpcdoubletPhi = int(m_idHelperSvc->rpcIdHelper().doubletPhi(prdcoll_id)) ; + int irpcgasGap = int(m_idHelperSvc->rpcIdHelper().gasGap(prdcoll_id)) ; + int irpcmeasuresPhi = int(m_idHelperSvc->rpcIdHelper().measuresPhi(prdcoll_id)) ; + int irpcstrip = int(m_idHelperSvc->rpcIdHelper().strip(prdcoll_id)) ; double irpctime = double((*rpcCollection)->time()) ; int irpctriggerInfo = int((*rpcCollection)->triggerInfo ()) ; // double @@ -618,7 +585,7 @@ StatusCode RpcRawDataValAlg::fillHistograms() //get information from geomodel to book and fill rpc histos with the right max strip number - std::vector<int> rpcstripshift = RpcGM::RpcStripShift(MuonDetMgr,m_muonIdHelperTool->rpcIdHelper(), prdcoll_id, irpctriggerInfo) ; + std::vector<int> rpcstripshift = RpcGM::RpcStripShift(MuonDetMgr,m_idHelperSvc->rpcIdHelper(), prdcoll_id, irpctriggerInfo) ; @@ -643,7 +610,7 @@ StatusCode RpcRawDataValAlg::fillHistograms() int shiftstripphiatlas = rpcstripshift[25]; //get name for titles and labels - std::vector<std::string> rpclayersectorsidename = RpcGM::RpcLayerSectorSideName(m_muonIdHelperTool->rpcIdHelper(),prdcoll_id, irpctriggerInfo) ; + std::vector<std::string> rpclayersectorsidename = RpcGM::RpcLayerSectorSideName(m_idHelperSvc->rpcIdHelper(),prdcoll_id, irpctriggerInfo) ; m_layer_name = rpclayersectorsidename[0] ; m_layertodraw1_name = rpclayersectorsidename[1] ; m_layertodraw2_name = rpclayersectorsidename[2] ; @@ -959,22 +926,22 @@ StatusCode RpcRawDataValAlg::fillHistograms() { Identifier prdcoll_id_II = (*rpcCollectionII)->identify(); - int irpcstationPhiII = int(m_muonIdHelperTool->rpcIdHelper().stationPhi(prdcoll_id_II)) ; - int irpcstationNameII = int(m_muonIdHelperTool->rpcIdHelper().stationName(prdcoll_id_II)) ; - int irpcstationEtaII = int(m_muonIdHelperTool->rpcIdHelper().stationEta(prdcoll_id_II)) ; - int irpcdoubletRII = int(m_muonIdHelperTool->rpcIdHelper().doubletR(prdcoll_id_II)) ; - int irpcdoubletZII = int(m_muonIdHelperTool->rpcIdHelper().doubletZ(prdcoll_id_II)) ; - int irpcdoubletPhiII = int(m_muonIdHelperTool->rpcIdHelper().doubletPhi(prdcoll_id_II)) ; - int irpcgasGapII = int(m_muonIdHelperTool->rpcIdHelper().gasGap(prdcoll_id_II)) ; - int irpcmeasuresPhiII = int(m_muonIdHelperTool->rpcIdHelper().measuresPhi(prdcoll_id_II)) ; - int irpcstripII = int(m_muonIdHelperTool->rpcIdHelper().strip(prdcoll_id_II)) ; + int irpcstationPhiII = int(m_idHelperSvc->rpcIdHelper().stationPhi(prdcoll_id_II)) ; + int irpcstationNameII = int(m_idHelperSvc->rpcIdHelper().stationName(prdcoll_id_II)) ; + int irpcstationEtaII = int(m_idHelperSvc->rpcIdHelper().stationEta(prdcoll_id_II)) ; + int irpcdoubletRII = int(m_idHelperSvc->rpcIdHelper().doubletR(prdcoll_id_II)) ; + int irpcdoubletZII = int(m_idHelperSvc->rpcIdHelper().doubletZ(prdcoll_id_II)) ; + int irpcdoubletPhiII = int(m_idHelperSvc->rpcIdHelper().doubletPhi(prdcoll_id_II)) ; + int irpcgasGapII = int(m_idHelperSvc->rpcIdHelper().gasGap(prdcoll_id_II)) ; + int irpcmeasuresPhiII = int(m_idHelperSvc->rpcIdHelper().measuresPhi(prdcoll_id_II)) ; + int irpcstripII = int(m_idHelperSvc->rpcIdHelper().strip(prdcoll_id_II)) ; const MuonGM::RpcReadoutElement* descriptor_Atl_II = MuonDetMgr->getRpcReadoutElement( prdcoll_id_II ); double z_atl_II = descriptor_Atl_II ->stripPos(prdcoll_id_II ).z() ; //get information from geomodel to book and fill rpc histos with the right max strip number - std::vector<int> rpcstripshiftII = RpcGM::RpcStripShift(MuonDetMgr,m_muonIdHelperTool->rpcIdHelper(), prdcoll_id, irpctriggerInfo) ; + std::vector<int> rpcstripshiftII = RpcGM::RpcStripShift(MuonDetMgr,m_idHelperSvc->rpcIdHelper(), prdcoll_id, irpctriggerInfo) ; if(irpcmeasuresPhi==1&&irpcmeasuresPhiII==0){ if(irpcstationPhi==irpcstationPhiII&&irpcstationName==irpcstationNameII&&irpcstationEta==irpcstationEtaII&& @@ -1041,11 +1008,11 @@ StatusCode RpcRawDataValAlg::fillHistograms() } else{ if (y_atlas > 0) { - phi_atlas = atan ( y_atlas / x_atlas ) + CLHEP::pi ; + phi_atlas = std::atan ( y_atlas / x_atlas ) + CLHEP::pi ; } else { - phi_atlas = -CLHEP::pi + atan ( y_atlas / x_atlas ) ; + phi_atlas = -CLHEP::pi + std::atan ( y_atlas / x_atlas ) ; } } @@ -1053,7 +1020,7 @@ StatusCode RpcRawDataValAlg::fillHistograms() // pseudorapidity double eta_atlas = 0; if ( z_atlas!=0 ) { - eta_atlas = -log( abs( tan( 0.5 * atan(sqrt(pow(x_atlas,2.)+pow(y_atlas,2.))/ z_atlas )) )); + eta_atlas = -std::log( std::abs( std::tan( 0.5 * std::atan(std::hypot(x_atlas, y_atlas)/ z_atlas )) )); } else{ eta_atlas = 0 ; @@ -1065,7 +1032,6 @@ StatusCode RpcRawDataValAlg::fillHistograms() m_rpcPhivsEtaAtlasPivot0 ->Fill( stripetaatlas , stripphiatlas -1 ); m_rpcPhivsEtaAtlasPivot0_PhivsZ ->Fill( z_atlas, phi_atlas ) ; // coord cilindriche: 1->phi, 2->z - //m_rpcPhivsEtaAtlasPivot0_PhivsZ ->Fill( phi_atlas, z_atlas ); } if(m_layeronly_name=="Pivot1" ) { m_rpcPhivsEtaAtlasPivot1 ->Fill( stripetaatlas , stripphiatlas -1 ); @@ -1195,37 +1161,30 @@ StatusCode RpcRawDataValAlg::fillHistograms() { if ( m_nTrig < maxPRD ) { Identifier prdcoll_id = (*rpcCoinCollection)->identify(); - int irpcstationPhi = int(m_muonIdHelperTool->rpcIdHelper().stationPhi(prdcoll_id)) ; - int irpcstationName = int(m_muonIdHelperTool->rpcIdHelper().stationName(prdcoll_id)) ; - int irpcstationEta = int(m_muonIdHelperTool->rpcIdHelper().stationEta(prdcoll_id)) ; - int irpcdoubletR = int(m_muonIdHelperTool->rpcIdHelper().doubletR(prdcoll_id)) ; - int irpcdoubletZ = int(m_muonIdHelperTool->rpcIdHelper().doubletZ(prdcoll_id)) ; - int irpcdoubletPhi = int(m_muonIdHelperTool->rpcIdHelper().doubletPhi(prdcoll_id)) ; - int irpcgasGap = int(m_muonIdHelperTool->rpcIdHelper().gasGap(prdcoll_id)) ; - int irpcmeasuresPhi = int(m_muonIdHelperTool->rpcIdHelper().measuresPhi(prdcoll_id)) ; - int irpcstrip = int(m_muonIdHelperTool->rpcIdHelper().strip(prdcoll_id)) ; + int irpcstationPhi = int(m_idHelperSvc->rpcIdHelper().stationPhi(prdcoll_id)) ; + int irpcstationName = int(m_idHelperSvc->rpcIdHelper().stationName(prdcoll_id)) ; + int irpcstationEta = int(m_idHelperSvc->rpcIdHelper().stationEta(prdcoll_id)) ; + int irpcdoubletR = int(m_idHelperSvc->rpcIdHelper().doubletR(prdcoll_id)) ; + int irpcdoubletZ = int(m_idHelperSvc->rpcIdHelper().doubletZ(prdcoll_id)) ; + int irpcdoubletPhi = int(m_idHelperSvc->rpcIdHelper().doubletPhi(prdcoll_id)) ; + int irpcgasGap = int(m_idHelperSvc->rpcIdHelper().gasGap(prdcoll_id)) ; + int irpcmeasuresPhi = int(m_idHelperSvc->rpcIdHelper().measuresPhi(prdcoll_id)) ; + int irpcstrip = int(m_idHelperSvc->rpcIdHelper().strip(prdcoll_id)) ; double irpctime = double((*rpcCoinCollection)->time()) ; - // irpctriggerInfo = int((*rpcCoinCollection)->triggerInfo ()) ; // double int irpctriggerInfo = int ( ((*rpcCoinCollection)->isLowPtCoin())*6 + ((*rpcCoinCollection)->isLowPtInputToHighPtCm())*100 + ((*rpcCoinCollection)->isHighPtCoin())*106 ); int irpcthreshold = int((*rpcCoinCollection)->threshold() ) ; - //std::cout << "irpcthreshold rpcCoinCollection " << irpcthreshold << "\n"; // m_threshold: internal threshold // set in joboptions the correspondence between m_threshold and lvl1 thresholds if ( irpcthreshold == m_lv1Thres_0 ) m_threshold = 0 ; // no threshold assigned if ( irpcthreshold == m_lv1Thres_1 ) m_threshold = 1 ; if ( irpcthreshold == m_lv1Thres_2 ) m_threshold = 2 ; if ( irpcthreshold == m_lv1Thres_3 ) m_threshold = 3 ; - - /*switch (irpcthreshold ) { - case m_lv1Thres_0 : m_threshold = 0 ; break ; - case m_lv1Thres_1 : m_threshold = 1 ; break ; - case m_lv1Thres_2 : m_threshold = 2 ; break ; - } */ + if ( irpcmeasuresPhi==0 ){ if ( irpctriggerInfo==106 ) { m_RPC_Threshold_Eta->Fill( m_threshold+4 ) ; } else if ( irpctriggerInfo==6 ) { m_RPC_Threshold_Eta->Fill( m_threshold ) ; } @@ -1251,7 +1210,7 @@ StatusCode RpcRawDataValAlg::fillHistograms() //get information from geomodel to book and fill rpc histos with the right max strip number - std::vector<int> rpcstripshift = RpcGM::RpcStripShift(MuonDetMgr,m_muonIdHelperTool->rpcIdHelper(), prdcoll_id, irpctriggerInfo) ; + std::vector<int> rpcstripshift = RpcGM::RpcStripShift(MuonDetMgr,m_idHelperSvc->rpcIdHelper(), prdcoll_id, irpctriggerInfo) ; int NphiStrips = rpcstripshift[0] ; int ShiftPhiStrips = rpcstripshift[1] ; int NetaStrips = rpcstripshift[2] ; @@ -1272,7 +1231,7 @@ StatusCode RpcRawDataValAlg::fillHistograms() //get name for titles and labels - std::vector<std::string> rpclayersectorsidename = RpcGM::RpcLayerSectorSideName(m_muonIdHelperTool->rpcIdHelper(),prdcoll_id, irpctriggerInfo) ; + std::vector<std::string> rpclayersectorsidename = RpcGM::RpcLayerSectorSideName(m_idHelperSvc->rpcIdHelper(),prdcoll_id, irpctriggerInfo) ; m_layer_name = rpclayersectorsidename[0] ; m_layertodraw1_name = rpclayersectorsidename[1] ; m_layertodraw2_name = rpclayersectorsidename[2] ; @@ -1323,12 +1282,12 @@ StatusCode RpcRawDataValAlg::fillHistograms() for ( Muon::RpcPrepDataCollection::const_iterator it=(*collPrep)->begin(); it!=(*collPrep)->end(); it++) { Identifier prdConf_id = (*it)->identify(); - int irpcstationPhi_prep = int(m_muonIdHelperTool->rpcIdHelper().stationPhi (prdConf_id )) ; - int irpcstationName_prep = int(m_muonIdHelperTool->rpcIdHelper().stationName(prdConf_id )) ; - int irpcstationEta_prep = int(m_muonIdHelperTool->rpcIdHelper().stationEta (prdConf_id )) ; - int irpcdoubletR_prep = int(m_muonIdHelperTool->rpcIdHelper().doubletR (prdConf_id )) ; - int irpcdoubletPhi_prep = int(m_muonIdHelperTool->rpcIdHelper().doubletPhi (prdConf_id )) ; - int irpcmeasuresPhi_prep = int(m_muonIdHelperTool->rpcIdHelper().measuresPhi(prdConf_id )) ; + int irpcstationPhi_prep = int(m_idHelperSvc->rpcIdHelper().stationPhi (prdConf_id )) ; + int irpcstationName_prep = int(m_idHelperSvc->rpcIdHelper().stationName(prdConf_id )) ; + int irpcstationEta_prep = int(m_idHelperSvc->rpcIdHelper().stationEta (prdConf_id )) ; + int irpcdoubletR_prep = int(m_idHelperSvc->rpcIdHelper().doubletR (prdConf_id )) ; + int irpcdoubletPhi_prep = int(m_idHelperSvc->rpcIdHelper().doubletPhi (prdConf_id )) ; + int irpcmeasuresPhi_prep = int(m_idHelperSvc->rpcIdHelper().measuresPhi(prdConf_id )) ; if ( irpcmeasuresPhi_prep != irpcmeasuresPhi ) continue; if ( irpcstationPhi_prep != irpcstationPhi ) continue; @@ -1336,12 +1295,9 @@ StatusCode RpcRawDataValAlg::fillHistograms() if ( irpcstationName_prep != irpcstationNameC1 && irpcstationName_prep != irpcstationNameC2 ) continue; if ( irpctriggerInfo== 6 && (irpcdoubletR_prep != irpcdoubletR - 1 ) ) continue; if ( irpctriggerInfo==106 && (irpcdoubletR_prep != irpcdoubletR - 1 ) ) continue; - if (abs(irpcstationEta_prep-irpcstationEta)>1) continue; + if (std::abs(irpcstationEta_prep-irpcstationEta)>1) continue; //get information from geomodel to book and fill rpc histos with the right max strip number - - // std::cout << "elementID trig " << irpcstrip << " " << irpcstationName <<" "<< irpcstationEta <<" "<< irpcstationPhi <<" "<< irpcdoubletR << " " << irpctriggerInfo << "\n"; - const MuonGM::RpcReadoutElement* descriptor_Atl_prep = MuonDetMgr->getRpcReadoutElement( prdConf_id ); double x_atl_prep = descriptor_Atl_prep ->stripPos(prdConf_id ).x() ; double y_atl_prep = descriptor_Atl_prep ->stripPos(prdConf_id ).y() ; @@ -1364,7 +1320,6 @@ StatusCode RpcRawDataValAlg::fillHistograms() if(SegVector2D.mag()!=0)ImpactVector2D = ImpactVector2D/ SegVector2D.mag(); - // impactParam = ImpactVector2D.z(); double impactParam = ImpactVector2D.mag() ; if ( irpcmeasuresPhi==0 ) { @@ -1464,8 +1419,6 @@ StatusCode RpcRawDataValAlg::fillHistograms() } else if(irpctriggerInfo==100){ m_rpc2DEtaStationTriggerHits->Fill(irpcstationEta, Settore-1 + 16 ); - // if ( irpcstationEta<0 ) { rpc2DEtaStationTriggerHits_BC ->Fill(irpcstationEta, Settore-1 + 16 );} - // else { rpc2DEtaStationTriggerHits_BA ->Fill(irpcstationEta, Settore-1 + 16 );} } else if(irpctriggerInfo==106){ if(irpcmeasuresPhi==0) {NTrigger_Eta_HighPt ++;} @@ -1571,16 +1524,15 @@ StatusCode RpcRawDataValAlg::fillHistograms() Identifier prdcoll_id_II = (*rpcCoinCollectionII)->identify(); - int irpcstationPhiII = int(m_muonIdHelperTool->rpcIdHelper().stationPhi( prdcoll_id_II)) ; - int irpcstationNameII = int(m_muonIdHelperTool->rpcIdHelper().stationName(prdcoll_id_II)) ; - int irpcstationEtaII = int(m_muonIdHelperTool->rpcIdHelper().stationEta( prdcoll_id_II)) ; - int irpcdoubletRII = int(m_muonIdHelperTool->rpcIdHelper().doubletR( prdcoll_id_II)) ; - int irpcdoubletZII = int(m_muonIdHelperTool->rpcIdHelper().doubletZ( prdcoll_id_II)) ; - int irpcdoubletPhiII = int(m_muonIdHelperTool->rpcIdHelper().doubletPhi( prdcoll_id_II)) ; - int irpcgasGapII = int(m_muonIdHelperTool->rpcIdHelper().gasGap( prdcoll_id_II)) ; - int irpcmeasuresPhiII = int(m_muonIdHelperTool->rpcIdHelper().measuresPhi(prdcoll_id_II)) ; - int irpcstripII = int(m_muonIdHelperTool->rpcIdHelper().strip( prdcoll_id_II)) ; - //irpctriggerInfoII = int((*rpcCoinCollectionII)->triggerInfo() ) ; // double + int irpcstationPhiII = int(m_idHelperSvc->rpcIdHelper().stationPhi( prdcoll_id_II)) ; + int irpcstationNameII = int(m_idHelperSvc->rpcIdHelper().stationName(prdcoll_id_II)) ; + int irpcstationEtaII = int(m_idHelperSvc->rpcIdHelper().stationEta( prdcoll_id_II)) ; + int irpcdoubletRII = int(m_idHelperSvc->rpcIdHelper().doubletR( prdcoll_id_II)) ; + int irpcdoubletZII = int(m_idHelperSvc->rpcIdHelper().doubletZ( prdcoll_id_II)) ; + int irpcdoubletPhiII = int(m_idHelperSvc->rpcIdHelper().doubletPhi( prdcoll_id_II)) ; + int irpcgasGapII = int(m_idHelperSvc->rpcIdHelper().gasGap( prdcoll_id_II)) ; + int irpcmeasuresPhiII = int(m_idHelperSvc->rpcIdHelper().measuresPhi(prdcoll_id_II)) ; + int irpcstripII = int(m_idHelperSvc->rpcIdHelper().strip( prdcoll_id_II)) ; int irpctriggerInfoII = int ( ((*rpcCoinCollection)->isLowPtCoin())*6 + ((*rpcCoinCollection)->isLowPtInputToHighPtCm())*100 + ((*rpcCoinCollection)->isHighPtCoin())*106 ); @@ -1590,14 +1542,13 @@ StatusCode RpcRawDataValAlg::fillHistograms() double z_atl_II = descriptor_Atl_II ->stripPos(prdcoll_id_II ).z() ; //get information from geomodel to book and fill rpc histos with the right max strip number - std::vector<int> rpcstripshiftII = RpcGM::RpcStripShift(MuonDetMgr,m_muonIdHelperTool->rpcIdHelper(), prdcoll_id, irpctriggerInfo) ; + std::vector<int> rpcstripshiftII = RpcGM::RpcStripShift(MuonDetMgr,m_idHelperSvc->rpcIdHelper(), prdcoll_id, irpctriggerInfo) ; if(irpcmeasuresPhi==1&&irpcmeasuresPhiII==0&&irpctriggerInfo==irpctriggerInfoII){ if(irpcstationPhi==irpcstationPhiII&&irpcstationName==irpcstationNameII&&irpcstationEta==irpcstationEtaII&& irpcdoubletR==irpcdoubletRII&&irpcdoubletZ==irpcdoubletZII&&irpcdoubletPhi==irpcdoubletPhiII&&irpcgasGap==irpcgasGapII){ if(m_rpcchamberhist ){ - //if(1 == 0){ bool histo_flag=true; for (std::vector<std::string>::const_iterator iter=m_layerPhivsEta_name_list.begin(); iter!=m_layerPhivsEta_name_list.end(); iter++){ if ( (m_hardware_name+m_layerPhivsEta_name)==*iter){histo_flag=false;} @@ -1656,11 +1607,11 @@ StatusCode RpcRawDataValAlg::fillHistograms() } else{ if (y_atlas > 0) { - phi_atlas = atan ( y_atlas / x_atlas ) + CLHEP::pi ; + phi_atlas = std::atan ( y_atlas / x_atlas ) + CLHEP::pi ; } else { - phi_atlas = -CLHEP::pi + atan ( y_atlas / x_atlas ) ; + phi_atlas = -CLHEP::pi + std::atan ( y_atlas / x_atlas ) ; } } @@ -1668,7 +1619,7 @@ StatusCode RpcRawDataValAlg::fillHistograms() double eta_atlas = 0; // pseudorapidity if ( z_atlas!=0 ) { - eta_atlas = -log( abs( tan( 0.5 * atan(sqrt(pow(x_atlas,2.)+pow(y_atlas,2.))/ z_atlas )) )); + eta_atlas = -std::log( std::abs( std::tan( 0.5 * std::atan(std::hypot(x_atlas, y_atlas)/ z_atlas )) )); } else{ eta_atlas = 0 ; @@ -1833,14 +1784,14 @@ StatusCode RpcRawDataValAlg::fillHistograms() ATH_MSG_DEBUG ( "Adding a new cluster " ); int irpc_clus_size = ((*rpcCollection)->rdoList()).size(); - int irpc_clus_station = m_muonIdHelperTool->rpcIdHelper().stationName(prd_id) ; - int irpc_clus_eta = m_muonIdHelperTool->rpcIdHelper().stationEta(prd_id) ; - int irpc_clus_phi = m_muonIdHelperTool->rpcIdHelper().stationPhi(prd_id) ; - int irpc_clus_doublr = m_muonIdHelperTool->rpcIdHelper().doubletR(prd_id) ; - int irpc_clus_doublz = m_muonIdHelperTool->rpcIdHelper().doubletZ(prd_id) ; - int irpc_clus_doublphi = m_muonIdHelperTool->rpcIdHelper().doubletPhi(prd_id) ; - int irpc_clus_gasgap = m_muonIdHelperTool->rpcIdHelper().gasGap(prd_id) ; - int irpc_clus_measphi = m_muonIdHelperTool->rpcIdHelper().measuresPhi(prd_id) ; + int irpc_clus_station = m_idHelperSvc->rpcIdHelper().stationName(prd_id) ; + int irpc_clus_eta = m_idHelperSvc->rpcIdHelper().stationEta(prd_id) ; + int irpc_clus_phi = m_idHelperSvc->rpcIdHelper().stationPhi(prd_id) ; + int irpc_clus_doublr = m_idHelperSvc->rpcIdHelper().doubletR(prd_id) ; + int irpc_clus_doublz = m_idHelperSvc->rpcIdHelper().doubletZ(prd_id) ; + int irpc_clus_doublphi = m_idHelperSvc->rpcIdHelper().doubletPhi(prd_id) ; + int irpc_clus_gasgap = m_idHelperSvc->rpcIdHelper().gasGap(prd_id) ; + int irpc_clus_measphi = m_idHelperSvc->rpcIdHelper().measuresPhi(prd_id) ; if(irpc_clus_measphi==0){ m_rpcCSEta->Fill( irpc_clus_size); @@ -1867,14 +1818,14 @@ StatusCode RpcRawDataValAlg::fillHistograms() //get information from geomodel to book and fill rpc histos with the right max strip number - std::vector<int> rpcstripshift = RpcGM::RpcStripShift(MuonDetMgr,m_muonIdHelperTool->rpcIdHelper(), prd_id, 0) ; + std::vector<int> rpcstripshift = RpcGM::RpcStripShift(MuonDetMgr,m_idHelperSvc->rpcIdHelper(), prd_id, 0) ; int ShiftStrips = rpcstripshift[ 4] ; int ShiftEtaStripsTot = rpcstripshift[ 8] ; int EtaStripSign = rpcstripshift[10] ; //get name for titles and labels - std::vector<std::string> rpclayersectorsidename = RpcGM::RpcLayerSectorSideName(m_muonIdHelperTool->rpcIdHelper(),prd_id, 0) ; + std::vector<std::string> rpclayersectorsidename = RpcGM::RpcLayerSectorSideName(m_idHelperSvc->rpcIdHelper(),prd_id, 0) ; m_layer_name = rpclayersectorsidename[ 0] ; m_layertodraw1_name = rpclayersectorsidename[ 1] ; @@ -1894,7 +1845,7 @@ StatusCode RpcRawDataValAlg::fillHistograms() float av_strip = 0 ; for(int i=0; i!=irpc_clus_size ; i++){ Identifier id = ((*rpcCollection)->rdoList())[i] ; - int strip = int(m_muonIdHelperTool->rpcIdHelper().strip(id)) ; + int strip = int(m_idHelperSvc->rpcIdHelper().strip(id)) ; strip += ShiftStrips ; av_strip += float(strip) ; } @@ -1914,7 +1865,7 @@ StatusCode RpcRawDataValAlg::fillHistograms() rpcclustersizedislayer->Fill(irpc_clus_size); for(int i=0; i!=irpc_clus_size ; i++){ Identifier id = ((*rpcCollection)->rdoList())[i] ; - int strip = int(m_muonIdHelperTool->rpcIdHelper().strip(id)) ; + int strip = int(m_idHelperSvc->rpcIdHelper().strip(id)) ; strip += ShiftStrips ; if(rpcclustersizelayer)rpcclustersizelayer->Fill( strip, irpc_clus_size ); avstrip += float(strip); @@ -1945,14 +1896,14 @@ StatusCode RpcRawDataValAlg::fillHistograms() Identifier prd_idII = (*rpcCollectionII)->identify(); int irpc_clus_sizeII = ((*rpcCollectionII)->rdoList()).size(); - int irpc_clus_stationII = m_muonIdHelperTool->rpcIdHelper().stationName(prd_idII) ; - int irpc_clus_etaII = m_muonIdHelperTool->rpcIdHelper().stationEta(prd_idII) ; - int irpc_clus_phiII = m_muonIdHelperTool->rpcIdHelper().stationPhi(prd_idII) ; - int irpc_clus_doublrII = m_muonIdHelperTool->rpcIdHelper().doubletR(prd_idII) ; - int irpc_clus_doublzII = m_muonIdHelperTool->rpcIdHelper().doubletZ(prd_idII) ; - int irpc_clus_doublphiII = m_muonIdHelperTool->rpcIdHelper().doubletPhi(prd_idII) ; - int irpc_clus_gasgapII = m_muonIdHelperTool->rpcIdHelper().gasGap(prd_idII) ; - int irpc_clus_measphiII = m_muonIdHelperTool->rpcIdHelper().measuresPhi(prd_idII) ; + int irpc_clus_stationII = m_idHelperSvc->rpcIdHelper().stationName(prd_idII) ; + int irpc_clus_etaII = m_idHelperSvc->rpcIdHelper().stationEta(prd_idII) ; + int irpc_clus_phiII = m_idHelperSvc->rpcIdHelper().stationPhi(prd_idII) ; + int irpc_clus_doublrII = m_idHelperSvc->rpcIdHelper().doubletR(prd_idII) ; + int irpc_clus_doublzII = m_idHelperSvc->rpcIdHelper().doubletZ(prd_idII) ; + int irpc_clus_doublphiII = m_idHelperSvc->rpcIdHelper().doubletPhi(prd_idII) ; + int irpc_clus_gasgapII = m_idHelperSvc->rpcIdHelper().gasGap(prd_idII) ; + int irpc_clus_measphiII = m_idHelperSvc->rpcIdHelper().measuresPhi(prd_idII) ; if(irpc_clus_measphi == irpc_clus_measphiII )continue; if(irpc_clus_station != irpc_clus_stationII )continue; @@ -1966,12 +1917,12 @@ StatusCode RpcRawDataValAlg::fillHistograms() //evaluate average strip float avstripeta = 0 ; float avstripphi = av_strip ; - ShiftEtaStripsTot = RpcGM::RpcStripShift(MuonDetMgr,m_muonIdHelperTool->rpcIdHelper(), prd_idII, 0)[8] ; // angelo 07 oct 2009 - EtaStripSign = RpcGM::RpcStripShift(MuonDetMgr,m_muonIdHelperTool->rpcIdHelper(), prd_idII, 0)[10] ; // angelo 07 oct 2009 + ShiftEtaStripsTot = RpcGM::RpcStripShift(MuonDetMgr,m_idHelperSvc->rpcIdHelper(), prd_idII, 0)[8] ; // angelo 07 oct 2009 + EtaStripSign = RpcGM::RpcStripShift(MuonDetMgr,m_idHelperSvc->rpcIdHelper(), prd_idII, 0)[10] ; // angelo 07 oct 2009 for(int i=0; i!=irpc_clus_sizeII ; i++){ Identifier id = ((*rpcCollectionII)->rdoList())[i] ; - avstripeta += float(m_muonIdHelperTool->rpcIdHelper().strip(id))/irpc_clus_sizeII ; + avstripeta += float(m_idHelperSvc->rpcIdHelper().strip(id))/irpc_clus_sizeII ; } avstripeta += float(ShiftEtaStripsTot) ; @@ -3437,7 +3388,7 @@ StatusCode RpcRawDataValAlg::bookHistogramsRecurrent() if(rpc == NULL )continue; Identifier idr = rpc->identify(); - std::vector<int> rpcstripshift = RpcGM::RpcStripShift(MuonDetMgr,m_muonIdHelperTool->rpcIdHelper(), idr, 0) ; + std::vector<int> rpcstripshift = RpcGM::RpcStripShift(MuonDetMgr,m_idHelperSvc->rpcIdHelper(), idr, 0) ; int rpcpanel_dbindex = rpcstripshift[23]; int PlaneTipo = rpcstripshift[15]; int rpctower_dbindex = rpcstripshift[24]; @@ -4805,10 +4756,10 @@ void RpcRawDataValAlg::bookRPCCoolHistograms( std::vector<std::string>::const_it if(rpc != NULL ){ Identifier idr = rpc->identify(); - std::vector<int> rpcstripshift = RpcGM::RpcStripShift(MuonDetMgr,m_muonIdHelperTool->rpcIdHelper(), idr, 0) ; + std::vector<int> rpcstripshift = RpcGM::RpcStripShift(MuonDetMgr,m_idHelperSvc->rpcIdHelper(), idr, 0) ; NTotStripsSideA = rpcstripshift[6]+rpcstripshift[17]; Identifier idr_c = rpc_c->identify(); - std::vector<int> rpcstripshift_c = RpcGM::RpcStripShift(MuonDetMgr,m_muonIdHelperTool->rpcIdHelper(), idr_c, 0) ; + std::vector<int> rpcstripshift_c = RpcGM::RpcStripShift(MuonDetMgr,m_idHelperSvc->rpcIdHelper(), idr_c, 0) ; NTotStripsSideC = rpcstripshift_c[7]+rpcstripshift_c[18]; } @@ -4839,10 +4790,10 @@ void RpcRawDataValAlg::bookRPCCoolHistograms( std::vector<std::string>::const_it if(kNameF==1)kNameF=53;//BMLE for (int iz=0; iz!=3; iz++ ) { int irc = ir ; - if(abs(ieta-8)==7&&ir==1&&kNameF==2)continue; - if(isec==12&&abs(ieta-8)==6&&ir==1&&kNameF==2)continue; - if(abs(ieta-8)==7&&ir==2&&kNameF==2)irc=1; - if(isec==12&&abs(ieta-8)==6&&ir==2&&kNameF==2)irc=1; + if(std::abs(ieta-8)==7&&ir==1&&kNameF==2)continue; + if(isec==12&&std::abs(ieta-8)==6&&ir==1&&kNameF==2)continue; + if(std::abs(ieta-8)==7&&ir==2&&kNameF==2)irc=1; + if(isec==12&&std::abs(ieta-8)==6&&ir==2&&kNameF==2)irc=1; const MuonGM::RpcReadoutElement* rpc = MuonDetMgr->getRpcRElement_fromIdFields(kNameF, ieta-8, istatPhi+1, irc, iz+1, idblPhi+1); if( rpc == NULL ) continue; @@ -4850,24 +4801,24 @@ void RpcRawDataValAlg::bookRPCCoolHistograms( std::vector<std::string>::const_it if ( iz+1 != rpc->getDoubletZ() ) { continue ; } - Identifier idr = m_muonIdHelperTool->rpcIdHelper().parentID( rpc->identify() ); + Identifier idr = m_idHelperSvc->rpcIdHelper().parentID( rpc->identify() ); rpcElemPhiStrip = int (rpc->NphiStrips() ) ; rpcElemEtaStrip = int (rpc->NetaStrips() ) ; for ( int istripEta=0; istripEta!=rpcElemEtaStrip; istripEta++ ) { - Identifier strip_id = m_muonIdHelperTool->rpcIdHelper().channelID(idr, iz+1, idblPhi+1, ig+1, 0, istripEta+1) ; - Identifier panel_id = m_muonIdHelperTool->rpcIdHelper().panelID( strip_id ) ; + Identifier strip_id = m_idHelperSvc->rpcIdHelper().channelID(idr, iz+1, idblPhi+1, ig+1, 0, istripEta+1) ; + Identifier panel_id = m_idHelperSvc->rpcIdHelper().panelID( strip_id ) ; if( strip_id == 0 ) continue; - coolStripIndex = (RpcGM::RpcStripShift(MuonDetMgr,m_muonIdHelperTool->rpcIdHelper(), strip_id, 0)).at(16); + coolStripIndex = (RpcGM::RpcStripShift(MuonDetMgr,m_idHelperSvc->rpcIdHelper(), strip_id, 0)).at(16); m_rpcCool_PanelIdHist->Fill(coolStripIndex, panel_id.get_identifier32().get_compact()) ; } for ( int istripPhi=0; istripPhi!=rpcElemPhiStrip; istripPhi++ ) { - Identifier strip_id = m_muonIdHelperTool->rpcIdHelper().channelID(idr, iz+1, idblPhi+1, ig+1, 1, istripPhi+1) ; - Identifier panel_id = m_muonIdHelperTool->rpcIdHelper().panelID( strip_id ) ; + Identifier strip_id = m_idHelperSvc->rpcIdHelper().channelID(idr, iz+1, idblPhi+1, ig+1, 1, istripPhi+1) ; + Identifier panel_id = m_idHelperSvc->rpcIdHelper().panelID( strip_id ) ; if( strip_id == 0 ) continue; - coolStripIndex = (RpcGM::RpcStripShift(MuonDetMgr,m_muonIdHelperTool->rpcIdHelper(), strip_id, 0)).at(16); + coolStripIndex = (RpcGM::RpcStripShift(MuonDetMgr,m_idHelperSvc->rpcIdHelper(), strip_id, 0)).at(16); m_rpcCool_PanelIdHist->Fill(coolStripIndex, panel_id.get_identifier32().get_compact() ); } diff --git a/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/TgcRawDataMonitoring/TgcRawDataMonitoring/TgcLv1RawDataValAlg.h b/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/TgcRawDataMonitoring/TgcRawDataMonitoring/TgcLv1RawDataValAlg.h index f2df1fc3b87d9ddb4b8850ff256dad2fd3ab2fd7..edd6650e6afec811cdca9dac7c3428a19e0068f0 100644 --- a/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/TgcRawDataMonitoring/TgcRawDataMonitoring/TgcLv1RawDataValAlg.h +++ b/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/TgcRawDataMonitoring/TgcRawDataMonitoring/TgcLv1RawDataValAlg.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ ////////////////////////////////////////////////////////////////////////////////////////////// @@ -15,51 +15,27 @@ #ifndef TgcLv1RawDataValAlg_H #define TgcLv1RawDataValAlg_H -#include <sstream> -#include <string.h> -#include <vector> -#include <map> - -#include "AthenaMonitoring/AthenaMonManager.h" #include "AthenaMonitoring/ManagedMonitorToolBase.h" -#include "MuonDQAUtils/MuonDQAHistMap.h" - -#include "MuonReadoutGeometry/TgcReadoutElement.h" - -#include "GaudiKernel/Algorithm.h" -#include "GaudiKernel/StatusCode.h" -//#include "StoreGate/DataHandle.h" - -#include "GaudiKernel/MsgStream.h" -#include "GaudiKernel/NTuple.h" - -#include "MuonPrepRawData/MuonPrepDataContainer.h" +#include "GaudiKernel/ServiceHandle.h" +#include "MuonIdHelpers/IMuonIdHelperSvc.h" #include "MuonTrigCoinData/TgcCoinData.h" #include "MuonTrigCoinData/TgcCoinDataContainer.h" -#include "MuonTrigCoinData/TgcCoinDataCollection.h" - -#include "MuonIdHelpers/MuonIdHelperTool.h" - +#include "xAODTrigger/JetRoIContainer.h" #include "xAODMuon/MuonContainer.h" - #include "xAODTrigger/MuonRoIContainer.h" #include "xAODTrigger/EmTauRoIContainer.h" -#include "xAODTrigger/JetRoIContainer.h" -#include "xAODTrigger/JetEtRoI.h" #include "xAODTrigger/EnergySumRoI.h" - #include "TrigSteeringEvent/TrigOperationalInfoCollection.h" - #include "StoreGate/ReadHandleKey.h" - #include "xAODEventInfo/EventInfo.h" +#include <string> +#include <vector> #include "TH1F.h" #include "TH2F.h" #include "TGraphAsymmErrors.h" -class TFile; template <class ConcreteAlgorithm> class AlgFactory; ///////////////////////////////////////////////////////////////////////////// @@ -68,21 +44,15 @@ class TgcLv1RawDataValAlg: public ManagedMonitorToolBase { public: TgcLv1RawDataValAlg ( const std::string & type, const std::string & name, const IInterface* parent ); - virtual ~TgcLv1RawDataValAlg(); + virtual ~TgcLv1RawDataValAlg()=default; StatusCode initialize(); - // StatusCode finalize(); - //virtual StatusCode bookHistograms(); virtual StatusCode bookHistogramsRecurrent(); virtual StatusCode fillHistograms(); virtual StatusCode procHistograms(); private: - - // Tool for TGC Id Helper - ToolHandle<Muon::MuonIdHelperTool> m_muonIdHelperTool{this, "idHelper", - "Muon::MuonIdHelperTool/MuonIdHelperTool", "Handle to the MuonIdHelperTool"}; - + ServiceHandle<Muon::IMuonIdHelperSvc> m_idHelperSvc {this, "MuonIdHelperSvc", "Muon::MuonIdHelperSvc/MuonIdHelperSvc"}; // Event Properties int m_event; int m_lumiblock; diff --git a/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/TgcRawDataMonitoring/TgcRawDataMonitoring/TgcRawDataValAlg.h b/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/TgcRawDataMonitoring/TgcRawDataMonitoring/TgcRawDataValAlg.h index 456915f7f4fa182fe26a3d306c8e372170d1b5dd..d10309fa309288eaf2fdea4fe46ea8ada6995637 100644 --- a/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/TgcRawDataMonitoring/TgcRawDataMonitoring/TgcRawDataValAlg.h +++ b/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/TgcRawDataMonitoring/TgcRawDataMonitoring/TgcRawDataValAlg.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ //////////////////////////////////////////////////////////////////////////////////////////////////////////// @@ -15,42 +15,26 @@ #ifndef TgcRawDataValAlg_H #define TgcRawDataValAlg_H -#include "GaudiKernel/StatusCode.h" -#include "GaudiKernel/AlgTool.h" -#include "GaudiKernel/ToolHandle.h" -#include "GaudiKernel/Algorithm.h" -#include "GaudiKernel/MsgStream.h" -#include "GaudiKernel/NTuple.h" - -#include "AthenaMonitoring/AthenaMonManager.h" #include "AthenaMonitoring/ManagedMonitorToolBase.h" -#include "MuonDQAUtils/MuonDQAHistMap.h" +#include "GaudiKernel/ServiceHandle.h" +#include "MuonIdHelpers/IMuonIdHelperSvc.h" +#include "MuonDQAUtils/MuonDQAHistMap.h" #include "MuonReadoutGeometry/TgcReadoutElement.h" -#include "MuonIdHelpers/MuonIdHelperTool.h" #include "MuonReadoutGeometry/MuonDetectorManager.h" - #include "MuonPrepRawData/MuonPrepDataContainer.h" #include "MuonTrigCoinData/TgcCoinDataContainer.h" - #include "xAODEventInfo/EventInfo.h" - #include "StoreGate/ReadHandleKey.h" #include "TH1.h" #include "TH2.h" #include "TProfile.h" #include "TAxis.h" - -#include <sstream> -#include <string.h> +#include <string> #include <vector> #include <map> - -class TFile; -class Identifier; - // Maximum Collection and Prd static const int maxColl = 1200; static const int maxPrd = 50000; @@ -63,20 +47,16 @@ class TgcRawDataValAlg: public ManagedMonitorToolBase { public: TgcRawDataValAlg ( const std::string & type, const std::string & name, const IInterface* parent ); - virtual ~TgcRawDataValAlg(); + virtual ~TgcRawDataValAlg()=default; StatusCode initialize(); - //virtual StatusCode bookHistograms(); virtual StatusCode bookHistogramsRecurrent(); virtual StatusCode fillHistograms(); virtual StatusCode procHistograms(); private: - - // Tool for TGC Id Helper - ToolHandle<Muon::MuonIdHelperTool> m_muonIdHelperTool{this, "idHelper", - "Muon::MuonIdHelperTool/MuonIdHelperTool", "Handle to the MuonIdHelperTool"}; - + ServiceHandle<Muon::IMuonIdHelperSvc> m_idHelperSvc {this, "MuonIdHelperSvc", "Muon::MuonIdHelperSvc/MuonIdHelperSvc"}; + // event properties int m_event; int m_lumiblock; diff --git a/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/TgcRawDataMonitoring/src/TgcLv1RawDataValAlg.cxx b/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/TgcRawDataMonitoring/src/TgcLv1RawDataValAlg.cxx index 2e31ef2e25f308197fc7f210773c603a7f8a5571..e6f380d37f930f6cb4d19e5dbf4fed7efd9b1f9e 100644 --- a/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/TgcRawDataMonitoring/src/TgcLv1RawDataValAlg.cxx +++ b/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/TgcRawDataMonitoring/src/TgcLv1RawDataValAlg.cxx @@ -12,9 +12,6 @@ // Subject: TGCLV1-->Offline Muon Data Quality/ ///////////////////////////////////////////////////////////////////////////////////////////////////////////// -#include "GaudiKernel/MsgStream.h" -#include "StoreGate/DataHandle.h" - #include "MuonRDO/TgcRdo.h" #include "MuonRDO/TgcRdoContainer.h" #include "MuonRDO/TgcRdoIdHash.h" @@ -163,58 +160,17 @@ TgcLv1RawDataValAlg::TgcLv1RawDataValAlg(const std::string &type, const std::str } - -/////////////////////////////////////////////////////////////////////////// -// TgcLv1RawDataValAlg Destructor -/////////////////////////////////////////////////////////////////////////// -TgcLv1RawDataValAlg::~TgcLv1RawDataValAlg(){ - ATH_MSG_DEBUG( " deleting TgcLv1RawDataValAlg " ); -} - - /////////////////////////////////////////////////////////////////////////// // TgcLv1RawDataValAlg initialize /////////////////////////////////////////////////////////////////////////// StatusCode TgcLv1RawDataValAlg::initialize(){ + ATH_CHECK(ManagedMonitorToolBase::initialize()); ATH_MSG_INFO( "in TgcLv1RawDataValAlg initialize" ); - ATH_CHECK( m_muonIdHelperTool.retrieve() ); - - /* - if ( m_checkCabling ) { - // get Cabling Server Service - const ITGCcablingServerSvc* TgcCabGet = 0; - sc = service("TGCcablingServerSvc", TgcCabGet); - if (sc.isFailure()){ - m_log << MSG::ERROR << " Can't get TGCcablingServerSvc " << endmsg; - return StatusCode::FAILURE; - } - // get Cabling Service - sc = TgcCabGet->giveCabling(m_cabling); - if (sc.isFailure()){ - m_log << MSG::ERROR << " Can't get TGCcablingSvc Server" << endmsg; - return StatusCode::FAILURE; - } - - // check whether TGCcabling is compatible with 1/12 sector or not - int maxRodId,maxSswId, maxSbloc,minChannelId, maxChannelId; - m_cabling->getReadoutIDRanges( maxRodId,maxSswId, maxSbloc,minChannelId, maxChannelId); - if (maxRodId ==12) { - m_log << MSG::INFO << "TGCcabling12Svc OK" << endmsg ; - } else { - m_log << MSG::WARNING << "TGCcablingSvc(octant segmentation) OK" << endmsg ; - } - - } - */ - // Set number of Muon Algorithms to use, 1:muid, 2:muid&staco m_nMuonAlgorithms=1; if(m_environment==AthenaMonManager::online) m_nMuonAlgorithms=1; - - ManagedMonitorToolBase::initialize().ignore();// Ignore the checking code - ATH_CHECK(m_coinCollectionLocation.initialize()); ATH_CHECK(m_coinCollectionLocationPrevious.initialize()); ATH_CHECK(m_coinCollectionLocationNext.initialize()); @@ -225,7 +181,7 @@ TgcLv1RawDataValAlg::initialize(){ ATH_CHECK(m_L1esumRoIName.initialize()); ATH_CHECK(m_eventInfo.initialize()); ATH_CHECK(m_trigOpInfo.initialize(m_useExpressStream)); - + ATH_CHECK(m_idHelperSvc.retrieve()); return StatusCode::SUCCESS; } diff --git a/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/TgcRawDataMonitoring/src/TgcLv1RawDataValAlg_Efficiency.cxx b/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/TgcRawDataMonitoring/src/TgcLv1RawDataValAlg_Efficiency.cxx index e119bdc1c1df9f5fe30a98dd1a6c0fc22e43642b..ca3e3d13d15cfd9bf6509e5562b53f651107a658 100644 --- a/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/TgcRawDataMonitoring/src/TgcLv1RawDataValAlg_Efficiency.cxx +++ b/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/TgcRawDataMonitoring/src/TgcLv1RawDataValAlg_Efficiency.cxx @@ -303,7 +303,7 @@ TgcLv1RawDataValAlg::fillEfficiency(int ms,// 0:Muid 1:Staco // Get Side int ac = (oeta<0); // Set pTs above 50 to 50.1 - if(fabs(opt)>50.) opt = 50.1*oq; + if(std::abs(opt)>50.) opt = 50.1*oq; //ophi = -pi to pi //ophi_mod = -pi/12 to 23*pi/12 @@ -314,7 +314,7 @@ TgcLv1RawDataValAlg::fillEfficiency(int ms,// 0:Muid 1:Staco for(int pt=0;pt<6;pt++){ m_tgclv1turnondenom[ac][pt][pn][ms]->Fill(opt); if(opt> thresetavsphi[pt]){ - m_tgclv1effetavsphidenom[ac][pt][pn][ms]->Fill(fabs(oeta),ophi_mod); + m_tgclv1effetavsphidenom[ac][pt][pn][ms]->Fill(std::abs(oeta),ophi_mod); } if( m_found_express_stream && m_found_nonmuon_express_chain ){ m_tgclv1turnondenom_ES[ac][pt]->Fill(opt); @@ -411,7 +411,7 @@ TgcLv1RawDataValAlg::fillEfficiency(int ms,// 0:Muid 1:Staco for(int pt=0;pt<6;pt++){ if(flag[pt]==true){ if(opt> thresetavsphi[pt]){ - m_tgclv1effetavsphinum[ac][pt][pn][ms][pcn]->Fill(fabs(oeta),ophi_mod); + m_tgclv1effetavsphinum[ac][pt][pn][ms][pcn]->Fill(std::abs(oeta),ophi_mod); } } } diff --git a/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/TgcRawDataMonitoring/src/TgcLv1RawDataValAlg_ReadContainer.cxx b/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/TgcRawDataMonitoring/src/TgcLv1RawDataValAlg_ReadContainer.cxx index 6e95916211fbf187d32ee009e5f394c74d107987..abe1eb3d9a33a888422e1cd25c7c55eddae0280f 100644 --- a/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/TgcRawDataMonitoring/src/TgcLv1RawDataValAlg_ReadContainer.cxx +++ b/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/TgcRawDataMonitoring/src/TgcLv1RawDataValAlg_ReadContainer.cxx @@ -12,29 +12,19 @@ // Subject: TGCLV1-->Offline Muon Data Quality/ ///////////////////////////////////////////////////////////////////////////////////////////////////////////// -#include "GaudiKernel/MsgStream.h" -#include "StoreGate/DataHandle.h" +#include "TgcRawDataMonitoring/TgcLv1RawDataValAlg.h" #include "xAODEventInfo/EventInfo.h" - #include "MuonRDO/TgcRdo.h" #include "MuonRDO/TgcRdoContainer.h" #include "MuonRDO/TgcRdoIdHash.h" - #include "MuonReadoutGeometry/TgcReadoutParams.h" - #include "MuonDQAUtils/MuonChamberNameConverter.h" #include "MuonDQAUtils/MuonChambersRange.h" #include "MuonDQAUtils/MuonCosmicSetup.h" #include "MuonDQAUtils/MuonDQAHistMap.h" - -#include "Identifier/Identifier.h" - -#include "TgcRawDataMonitoring/TgcLv1RawDataValAlg.h" #include "AthenaMonitoring/AthenaMonManager.h" - #include "AnalysisTriggerEvent/LVL1_ROI.h" - #include "TrigSteeringEvent/TrigOperationalInfo.h" /////////////////////////////////////////////////////////////////////////// @@ -139,7 +129,6 @@ TgcLv1RawDataValAlg::readTgcCoinDataContainer(const Muon::TgcCoinDataContainer* int ws = (tcd->isStrip()); //isStrip w:0, s:1 (invalid in case of SL) int phi48 = tcd->phi() -1;//[0:47]MidEnd[0:23]Forward/EIFI if(ef==0) phi48 = phi48*2;//[0:2:46] - //int sector = phi2sector(phi48,ef); int pt = tcd->pt(); Amg::Vector3D gposout = tcd->globalposOut(); double eta, phi; @@ -147,11 +136,11 @@ TgcLv1RawDataValAlg::readTgcCoinDataContainer(const Muon::TgcCoinDataContainer* else { eta = gposout.eta(); phi = gposout.phi(); } const Identifier tcdidout = tcd->channelIdOut(); - int etaout = abs(int(m_muonIdHelperTool->tgcIdHelper().stationEta(tcdidout))); + int etaout = std::abs(int(m_idHelperSvc->tgcIdHelper().stationEta(tcdidout))); if(ef==0) etaout = 0; const Identifier tcdidin = tcd->channelIdIn(); - int etain = abs(int(m_muonIdHelperTool->tgcIdHelper().stationEta(tcdidin))); + int etain = std::abs(int(m_idHelperSvc->tgcIdHelper().stationEta(tcdidin))); if(ef==0) etain = 0; // Fill vectors for different Coincidence Types @@ -274,9 +263,9 @@ TgcLv1RawDataValAlg::readOfflineMuonContainer(std::vector<float>* mu_pt, std::ve float pt = (*it)->pt(); float eta = (*it)->eta(); float phi = (*it)->phi(); - if( fabs(pt) < ptcut || - fabs(eta) < etamin || - fabs(eta) > etamax ) continue; + if( std::abs(pt) < ptcut || + std::abs(eta) < etamin || + std::abs(eta) > etamax ) continue; bool getvalue = true; @@ -309,7 +298,7 @@ TgcLv1RawDataValAlg::readOfflineMuonContainer(std::vector<float>* mu_pt, std::ve trtOLfrac = trtOL/(trtHits + trtOL); bool trt=false; - if( fabs(eta) < 1.9 ){ + if( std::abs(eta) < 1.9 ){ trt= ( ( trtHits > 5 ) && ( trtOLfrac < 0.9 ) ); } else{ @@ -331,8 +320,8 @@ TgcLv1RawDataValAlg::readOfflineMuonContainer(std::vector<float>* mu_pt, std::ve bool overlapped = false; for(unsigned int itr=0; itr<mu_eta->size(); itr++){ - float deta = fabs(mu_eta->at(itr) - eta); - float dphi = fabs(mu_phi->at(itr) - phi); + float deta = std::abs(mu_eta->at(itr) - eta); + float dphi = std::abs(mu_phi->at(itr) - phi); if(dphi > M_PI) dphi = 2*M_PI - dphi; if(sqrt(deta*deta + dphi*dphi) < 0.1){ if(pt > mu_pt->at(itr)){ diff --git a/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/TgcRawDataMonitoring/src/TgcLv1RawDataValAlg_TriggerTiming.cxx b/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/TgcRawDataMonitoring/src/TgcLv1RawDataValAlg_TriggerTiming.cxx index 2fe502e72b9bf1b8c81ed1d3b9f568c60cd48a14..5075045805f73b1ac7bfc8595414405a4713a323 100644 --- a/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/TgcRawDataMonitoring/src/TgcLv1RawDataValAlg_TriggerTiming.cxx +++ b/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/TgcRawDataMonitoring/src/TgcLv1RawDataValAlg_TriggerTiming.cxx @@ -822,7 +822,7 @@ TgcLv1RawDataValAlg::fillTriggerTimingAssociatedWithTrack( int ms,// 0:Muid 1:St float oeta = mu_eta->at(o); float ophi = mu_phi->at(o); float oq = mu_q->at(o); - if( fabs(opt) > 50. ) opt = 50.1 * oq; + if( std::abs(opt) > 50. ) opt = 50.1 * oq; // Get side index int ac = (oeta<0); diff --git a/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/TgcRawDataMonitoring/src/TgcRawDataMonitorAlgorithm.cxx b/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/TgcRawDataMonitoring/src/TgcRawDataMonitorAlgorithm.cxx index f7a762fd54427398a692111a95a9c961d57ea2ec..25366ebc5cd20892f224afb4024fc9125a3a2976 100644 --- a/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/TgcRawDataMonitoring/src/TgcRawDataMonitorAlgorithm.cxx +++ b/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/TgcRawDataMonitoring/src/TgcRawDataMonitorAlgorithm.cxx @@ -3,8 +3,8 @@ */ #include "TgcRawDataMonitorAlgorithm.h" + #include "TObjArray.h" -#include <memory> TgcRawDataMonitorAlgorithm::TgcRawDataMonitorAlgorithm( const std::string& name, ISvcLocator* pSvcLocator ) : AthMonitorAlgorithm(name,pSvcLocator) @@ -12,10 +12,9 @@ TgcRawDataMonitorAlgorithm::TgcRawDataMonitorAlgorithm( const std::string& name, } StatusCode TgcRawDataMonitorAlgorithm::initialize() { - - ATH_CHECK(m_MuonIdHelperTool.retrieve()); + ATH_CHECK(AthMonitorAlgorithm::initialize()); + ATH_CHECK(m_idHelperSvc.retrieve()); ATH_CHECK(m_extrapolator.retrieve()); - ATH_CHECK(m_MuonContainerKey.initialize()); ATH_CHECK(m_MuonRoIContainerKey.initialize()); ATH_CHECK(m_TgcPrepDataContainerKey.initialize()); @@ -49,7 +48,7 @@ StatusCode TgcRawDataMonitorAlgorithm::initialize() { m_trigTagDefs.push_back(def); } - return AthMonitorAlgorithm::initialize(); + return StatusCode::SUCCESS; } StatusCode TgcRawDataMonitorAlgorithm::fillHistograms( const EventContext& ctx ) const { @@ -230,7 +229,7 @@ StatusCode TgcRawDataMonitorAlgorithm::fillHistograms( const EventContext& ctx ) ATH_MSG_ERROR("evtStore() does not contain TgcPrepDataContainer with name "<< m_TgcPrepDataContainerKey); return StatusCode::FAILURE; } - const TgcIdHelper& tgcIdHelper = m_MuonIdHelperTool->tgcIdHelper(); + const TgcIdHelper& tgcIdHelper = m_idHelperSvc->tgcIdHelper(); std::vector<TgcHit> tgcHits; for(auto tgccnt : *tgcPrd){ for(auto data : *tgccnt){ @@ -470,7 +469,7 @@ TgcRawDataMonitorAlgorithm::extrapolateToTGC(const Trk::TrackStateOnSurface* tso } double targetZ = pos.z(); double trackZ = track->position().z(); - if (fabs(trackZ)<fabs(targetZ)-2000. || fabs(trackZ)>fabs(targetZ)+2000.){ + if (std::abs(trackZ)<std::abs(targetZ)-2000. || std::abs(trackZ)>std::abs(targetZ)+2000.){ return 0; } Amg::Transform3D* matrix = new Amg::Transform3D; @@ -485,7 +484,7 @@ TgcRawDataMonitorAlgorithm::extrapolateToTGC(const Trk::TrackStateOnSurface* tso return 0; } distance[0] = trackZ; - distance[1] = fabs(trackZ - targetZ); + distance[1] = std::abs(trackZ - targetZ); const bool boundaryCheck = true; const Trk::Surface* surface = disc; const Trk::TrackParameters* param = m_extrapolator->extrapolate(*track, diff --git a/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/TgcRawDataMonitoring/src/TgcRawDataMonitorAlgorithm.h b/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/TgcRawDataMonitoring/src/TgcRawDataMonitorAlgorithm.h index 24986340082f33a645cc2fcfa21201317ae93074..b22c1e8c6e8a3f2c916c7adae8c4db6eeb58f6f5 100644 --- a/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/TgcRawDataMonitoring/src/TgcRawDataMonitorAlgorithm.h +++ b/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/TgcRawDataMonitoring/src/TgcRawDataMonitorAlgorithm.h @@ -6,15 +6,16 @@ #define TGCRAWDATAMONITORING_TGCRAWDATAMONITORALGORITHM_H #include "AthenaMonitoring/AthMonitorAlgorithm.h" -#include "AthenaMonitoringKernel/Monitored.h" +#include "GaudiKernel/ServiceHandle.h" +#include "GaudiKernel/ToolHandle.h" + +#include "MuonIdHelpers/IMuonIdHelperSvc.h" #include "StoreGate/ReadHandleKey.h" #include "xAODMuon/MuonContainer.h" #include "xAODTrigger/MuonRoIContainer.h" -#include "MuonPrepRawData/MuonPrepDataContainer.h" #include "MuonTrigCoinData/TgcCoinDataContainer.h" -#include "MuonIdHelpers/MuonIdHelperTool.h" -#include "MuonReadoutGeometry/TgcReadoutElement.h" #include "TrkExInterfaces/IExtrapolator.h" +#include "MuonPrepRawData/TgcPrepDataContainer.h" class TgcRawDataMonitorAlgorithm : public AthMonitorAlgorithm { public: @@ -86,7 +87,7 @@ class TgcRawDataMonitorAlgorithm : public AthMonitorAlgorithm { private: - + ServiceHandle<Muon::IMuonIdHelperSvc> m_idHelperSvc {this, "MuonIdHelperSvc", "Muon::MuonIdHelperSvc/MuonIdHelperSvc"}; SG::ReadHandleKey<xAOD::MuonContainer> m_MuonContainerKey{this,"MuonContainerName","Muons","Offline muon track container"}; SG::ReadHandleKey<xAOD::MuonRoIContainer> m_MuonRoIContainerKey{this,"MuonRoIContainerName","LVL1MuonRoIs","L1 muon RoI container"}; @@ -96,8 +97,6 @@ class TgcRawDataMonitorAlgorithm : public AthMonitorAlgorithm { SG::ReadHandleKey<Muon::TgcCoinDataContainer> m_TgcCoinDataContainerNextBCKey{this,"TgcCoinDataContainerNextBCName","TrigT1CoinDataCollectionNextBC","TGC Coin Data Container NextBC"}; SG::ReadHandleKey<Muon::TgcCoinDataContainer> m_TgcCoinDataContainerPrevBCKey{this,"TgcCoinDataContainerPrevBCName","TrigT1CoinDataCollectionPriorBC","TGC Coin Data Container PrevBC"}; - ToolHandle<Muon::MuonIdHelperTool> m_MuonIdHelperTool{this, "MuonIdHelperTool", "Muon::MuonIdHelperTool/MuonIdHelperTool", "Handle to the MuonIdHelperTool"}; - StringProperty m_packageName{this,"PackageName","TgcRawDataMonitor","group name for histograming"}; StringProperty m_trigTagList{this,"TagTrigList","HLT_mu26_ivarmedium_L1MU20","list of triggers to be used for trigger matching"}; BooleanProperty m_TagAndProbe{this,"TagAndProbe",true,"switch to perform tag-and-probe method"}; diff --git a/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/TgcRawDataMonitoring/src/TgcRawDataValAlg.cxx b/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/TgcRawDataMonitoring/src/TgcRawDataValAlg.cxx index 8dec6aa1cc2ac478a568cabe62c38a11eb6bdbbc..e5317518bae0a157c56a63b5f298a4ce702a370a 100644 --- a/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/TgcRawDataMonitoring/src/TgcRawDataValAlg.cxx +++ b/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/TgcRawDataMonitoring/src/TgcRawDataValAlg.cxx @@ -12,13 +12,9 @@ // Subject: TGCLV1-->Offline Muon Data Quality/ ///////////////////////////////////////////////////////////////////////////////////////////////////////////// -#include "GaudiKernel/MsgStream.h" - // GeoModel #include "MuonReadoutGeometry/TgcReadoutParams.h" -#include "Identifier/Identifier.h" - // MuonRDO #include "MuonRDO/TgcRdo.h" #include "MuonRDO/TgcRdoIdHash.h" @@ -29,10 +25,8 @@ #include "MuonDQAUtils/MuonCosmicSetup.h" #include "TgcRawDataMonitoring/TgcRawDataValAlg.h" -#include "AthenaMonitoring/AthenaMonManager.h" #include <inttypes.h> - #include <sstream> #include <math.h> @@ -46,30 +40,17 @@ TgcRawDataValAlg::TgcRawDataValAlg( const std::string & type, const std::string m_numberingVersion=0; } -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * -TgcRawDataValAlg::~TgcRawDataValAlg(){ - ATH_MSG_INFO( " deleting TgcRawDataValAlg " ); -} - // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * StatusCode TgcRawDataValAlg::initialize(){ - ATH_MSG_INFO( "in initializing TgcRawDataValAlg" ); - - ATH_CHECK( ManagedMonitorToolBase::initialize() ); - -// MuonDetectorManager from the conditions store + ATH_CHECK(ManagedMonitorToolBase::initialize()); + ATH_CHECK(m_idHelperSvc.retrieve()); + // MuonDetectorManager from the conditions store ATH_CHECK(m_DetectorManagerKey.initialize()); - - ATH_CHECK( m_muonIdHelperTool.retrieve() ); - //histograms directory names m_generic_path_tgcmonitoring = "Muon/MuonRawDataMonitoring/TGC"; - //tgcchamberId(); - - //offset setOffset(); //set minimum and maximum of channel difference diff --git a/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/TgcRawDataMonitoring/src/TgcRawDataValAlg_Efficiency.cxx b/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/TgcRawDataMonitoring/src/TgcRawDataValAlg_Efficiency.cxx index 88333bd875448c4de84848650b1229c305c09885..13fe8a63402a1578292e1ce8424ffbfad0273f94 100644 --- a/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/TgcRawDataMonitoring/src/TgcRawDataValAlg_Efficiency.cxx +++ b/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/TgcRawDataMonitoring/src/TgcRawDataValAlg_Efficiency.cxx @@ -12,14 +12,8 @@ // Subject: TGCLV1-->Offline Muon Data Quality/ ///////////////////////////////////////////////////////////////////////////////////////////////////////////// -#include "GaudiKernel/MsgStream.h" - -// GeoModel #include "MuonReadoutGeometry/TgcReadoutParams.h" -#include "Identifier/Identifier.h" - -// MuonRDO #include "MuonRDO/TgcRdo.h" #include "MuonRDO/TgcRdoIdHash.h" #include "MuonRDO/TgcRdoContainer.h" @@ -37,7 +31,7 @@ #include <inttypes.h> #include <sstream> -#include <math.h> +#include <cmath> StatusCode TgcRawDataValAlg::bookHistogramsEfficiency(){ @@ -468,7 +462,7 @@ TgcRawDataValAlg::fillEfficiency(){ // If exactly one channel with hit if(m_hitIdVects[CURR][ac][ws][eta][phi48][l].size()==1){ // Fill channel variables - chIds[ws][l] = m_muonIdHelperTool->tgcIdHelper().channel(m_hitIdVects[CURR][ac][ws][eta][phi48][l].at(0)) + m_SLBoffset[ws][ac][eta][l]; + chIds[ws][l] = m_idHelperSvc->tgcIdHelper().channel(m_hitIdVects[CURR][ac][ws][eta][phi48][l].at(0)) + m_SLBoffset[ws][ac][eta][l]; const MuonGM::TgcReadoutElement* pReadoutElementTGC = MuonDetMgr->getTgcReadoutElement(m_hitIdVects[CURR][ac][ws][eta][phi48][l].at(0)); const Amg::Vector3D channelPos = pReadoutElementTGC->channelPos(m_hitIdVects[CURR][ac][ws][eta][phi48][l].at(0)); //global position chEtas[ws][l] = channelPos.eta(); @@ -482,10 +476,10 @@ TgcRawDataValAlg::fillEfficiency(){ // Flag wire edge hits int wsize = m_hitIdVects[CURR][ac][WIRE][eta][phi48][l].size(); for(int hit=0;hit<wsize;hit++){ - int stationName = m_muonIdHelperTool->tgcIdHelper().stationName(m_hitIdVects[CURR][ac][WIRE][eta][phi48][l].at(hit)); - int stationEta = abs(m_muonIdHelperTool->tgcIdHelper().stationEta(m_hitIdVects[CURR][ac][WIRE][eta][phi48][l].at(hit))); - int channel = m_muonIdHelperTool->tgcIdHelper().channel(m_hitIdVects[CURR][ac][WIRE][eta][phi48][l].at(hit)); - int stationPhi = m_muonIdHelperTool->tgcIdHelper().stationPhi(m_hitIdVects[CURR][ac][WIRE][eta][phi48][l].at(hit)); + int stationName = m_idHelperSvc->tgcIdHelper().stationName(m_hitIdVects[CURR][ac][WIRE][eta][phi48][l].at(hit)); + int stationEta = std::abs(m_idHelperSvc->tgcIdHelper().stationEta(m_hitIdVects[CURR][ac][WIRE][eta][phi48][l].at(hit))); + int channel = m_idHelperSvc->tgcIdHelper().channel(m_hitIdVects[CURR][ac][WIRE][eta][phi48][l].at(hit)); + int stationPhi = m_idHelperSvc->tgcIdHelper().stationPhi(m_hitIdVects[CURR][ac][WIRE][eta][phi48][l].at(hit)); // Flag as edge hit if within 3 channels of chamber edge if(channel<=3 || channel>=getNumberOfWires(stationName, l, stationEta, stationPhi)-3){ edgehit[WIRE][l] = true; @@ -495,7 +489,7 @@ TgcRawDataValAlg::fillEfficiency(){ // Flag strip edge hits int ssize = m_hitIdVects[CURR][ac][STRP][eta][phi48][l].size(); for(int hit=0;hit<ssize;hit++){ - int ch = m_muonIdHelperTool->tgcIdHelper().channel(m_hitIdVects[1][ac][1][eta][phi48][l].at(hit)); + int ch = m_idHelperSvc->tgcIdHelper().channel(m_hitIdVects[1][ac][1][eta][phi48][l].at(hit)); // Flag as edge hit if within 3 channels of chamber edge if(ch<= 3 || ch>=30){ edgehit[STRP][l] = true; @@ -557,10 +551,10 @@ TgcRawDataValAlg::fillEfficiency(){ for(int wsLpT=0;wsLpT<2;wsLpT++){ for(int i=0;i<nLpT[wsLpT];i++){ // Flag wire if LpT matches layer 2&3 hits - if((fabs(chEtas[WIRE][refLayer[WIRE]]-LptEta[wsLpT][ac][i]) <deta[WIRE][wsLpT])&& - (fabs(chPhis[WIRE][refLayer[WIRE]]-LptPhi[wsLpT][ac][i]) <dphi[WIRE][wsLpT])&& - (fabs(chEtas[STRP][refLayer[STRP]]-LptEta[wsLpT][ac][i]) <deta[STRP][wsLpT])&& - (fabs(chPhis[STRP][refLayer[STRP]]-LptPhi[wsLpT][ac][i]) <dphi[STRP][wsLpT])){ + if((std::abs(chEtas[WIRE][refLayer[WIRE]]-LptEta[wsLpT][ac][i]) <deta[WIRE][wsLpT])&& + (std::abs(chPhis[WIRE][refLayer[WIRE]]-LptPhi[wsLpT][ac][i]) <dphi[WIRE][wsLpT])&& + (std::abs(chEtas[STRP][refLayer[STRP]]-LptEta[wsLpT][ac][i]) <deta[STRP][wsLpT])&& + (std::abs(chPhis[STRP][refLayer[STRP]]-LptPhi[wsLpT][ac][i]) <dphi[STRP][wsLpT])){ LpTmatch[wsLpT]=true; break; } @@ -640,10 +634,10 @@ TgcRawDataValAlg::fillEfficiency(){ for(int wsEIFI=0;wsEIFI<2;wsEIFI++){ for(int i=0;i<nEIFI[wsEIFI];i++){ // Flag wire if LpT matches layer 2&3 hits - if((fabs(chEtas[WIRE][refLayerEIFI]-EIFIEta[wsEIFI][ac][i]) <deta[WIRE][wsEIFI])&& - (fabs(chPhis[WIRE][refLayerEIFI]-EIFIPhi[wsEIFI][ac][i]) <dphi[WIRE][wsEIFI])&& - (fabs(chEtas[STRP][refLayerEIFI]-EIFIEta[wsEIFI][ac][i]) <deta[STRP][wsEIFI])&& - (fabs(chPhis[STRP][refLayerEIFI]-EIFIPhi[wsEIFI][ac][i]) <dphi[STRP][wsEIFI])){ + if((std::abs(chEtas[WIRE][refLayerEIFI]-EIFIEta[wsEIFI][ac][i]) <deta[WIRE][wsEIFI])&& + (std::abs(chPhis[WIRE][refLayerEIFI]-EIFIPhi[wsEIFI][ac][i]) <dphi[WIRE][wsEIFI])&& + (std::abs(chEtas[STRP][refLayerEIFI]-EIFIEta[wsEIFI][ac][i]) <deta[STRP][wsEIFI])&& + (std::abs(chPhis[STRP][refLayerEIFI]-EIFIPhi[wsEIFI][ac][i]) <dphi[STRP][wsEIFI])){ EIFImatch[wsEIFI]=true; break; } @@ -703,7 +697,7 @@ TgcRawDataValAlg::calculateEfficiency(int ac, int ws, int eta, int phi48, int la else if(layer==8) refLayer = 7; else refLayer = 2; - int referenceChannel = m_muonIdHelperTool->tgcIdHelper().channel(m_hitIdVects[CURR][ac][ws][eta][phi48][refLayer].at(0)); + int referenceChannel = m_idHelperSvc->tgcIdHelper().channel(m_hitIdVects[CURR][ac][ws][eta][phi48][refLayer].at(0)); referenceChannel+=m_SLBoffset[ws][ac][eta][refLayer]; // Loop over Current PRD @@ -711,7 +705,7 @@ TgcRawDataValAlg::calculateEfficiency(int ac, int ws, int eta, int phi48, int la for(std::vector<Identifier>::const_iterator it=m_hitIdVects[CURR][ac][ws][eta][phi48][layer].begin(); it!=itc_end; it++){ - int prdChannel = m_muonIdHelperTool->tgcIdHelper().channel(*it) + m_SLBoffset[ws][ac][eta][layer]; + int prdChannel = m_idHelperSvc->tgcIdHelper().channel(*it) + m_SLBoffset[ws][ac][eta][layer]; int dmin = m_dchmin[layer][refLayer][ws][ac] - dch_extra; int dmax = m_dchmax[layer][refLayer][ws][ac] + dch_extra; if(compareID(prdChannel, referenceChannel, dmin, dmax)){ @@ -730,14 +724,12 @@ TgcRawDataValAlg::calculateEfficiency(int ac, int ws, int eta, int phi48, int la for(std::vector<Identifier>::const_iterator it=m_hitIdVects[PREV][ac][ws][eta][phi48][layer].begin(); it!=itp_end; it++){ - int prdChannel = m_muonIdHelperTool->tgcIdHelper().channel(*it) + m_SLBoffset[ws][ac][eta][layer]; + int prdChannel = m_idHelperSvc->tgcIdHelper().channel(*it) + m_SLBoffset[ws][ac][eta][layer]; int dmin = m_dchmin[layer][refLayer][ws][ac] - dch_extra; int dmax = m_dchmax[layer][refLayer][ws][ac] + dch_extra; if(compareID(prdChannel, referenceChannel, dmin, dmax)){ ATH_MSG_DEBUG("calculate efficiency previous layer"<<layer+1 << " eta" << eta << " phi" << phi48 << " fire" ); - //if(!isEIFI){ m_tgceffmapnumbc[ac][ws][PREV]->Fill(binx, biny); - //} break; } } @@ -747,14 +739,12 @@ TgcRawDataValAlg::calculateEfficiency(int ac, int ws, int eta, int phi48, int la for(std::vector<Identifier>::const_iterator it=m_hitIdVects[NEXT][ac][ws][eta][phi48][layer].begin(); it!=itn_end; it++){ - int prdChannel = m_muonIdHelperTool->tgcIdHelper().channel(*it) + m_SLBoffset[ws][ac][eta][layer]; + int prdChannel = m_idHelperSvc->tgcIdHelper().channel(*it) + m_SLBoffset[ws][ac][eta][layer]; int dmin = m_dchmin[layer][refLayer][ws][ac] - dch_extra; int dmax = m_dchmax[layer][refLayer][ws][ac] + dch_extra; if(compareID(prdChannel, referenceChannel, dmin, dmax)){ ATH_MSG_DEBUG("calculate efficiency next layer"<<layer+1 << " eta" << eta << " phi" << phi48 << " fire" ); - //if(!isEIFI){ m_tgceffmapnumbc[ac][ws][NEXT-1]->Fill(binx, biny); // only prev/next defined, array index should be 1 for NEXT PRD - //} break; } } diff --git a/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/TgcRawDataMonitoring/src/TgcRawDataValAlg_Functions.cxx b/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/TgcRawDataMonitoring/src/TgcRawDataValAlg_Functions.cxx index 2c73fc46b579961881b35cd0906e64a3f78f73a4..a13ff3a709cc60675e09b57762666b131591d03b 100644 --- a/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/TgcRawDataMonitoring/src/TgcRawDataValAlg_Functions.cxx +++ b/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/TgcRawDataMonitoring/src/TgcRawDataValAlg_Functions.cxx @@ -46,43 +46,23 @@ void TgcRawDataValAlg::tgcchamberId(){ ATH_MSG_DEBUG( "in TGC ChambersIDvector" ); - //std::vector<Identifier>::const_iterator idfirst = m_muonIdHelperTool->tgcIdHelper().module_begin(); - std::vector<Identifier>::const_iterator idlast = m_muonIdHelperTool->tgcIdHelper().module_end(); + std::vector<Identifier>::const_iterator idlast = m_idHelperSvc->tgcIdHelper().module_end(); - IdContext tgcModuleContext = m_muonIdHelperTool->tgcIdHelper().module_context(); + IdContext tgcModuleContext = m_idHelperSvc->tgcIdHelper().module_context(); Identifier Id; IdentifierHash Idhash; - for(std::vector<Identifier>::const_iterator i = m_muonIdHelperTool->tgcIdHelper().module_begin(); + for(std::vector<Identifier>::const_iterator i = m_idHelperSvc->tgcIdHelper().module_begin(); i != idlast; i++){ Id=*i; - //int gethash_code = m_muonIdHelperTool->tgcIdHelper().get_hash(Id, Idhash, &tgcModuleContext); - std::string extid = m_muonIdHelperTool->tgcIdHelper().show_to_string(Id); + std::string extid = m_idHelperSvc->tgcIdHelper().show_to_string(Id); - int stationName = int(m_muonIdHelperTool->tgcIdHelper().stationName(Id)); //unsigned integer 41:T1F 42:T1E 43:T2F 44:T2E 45:T3F 46:T3E 47:T4F 48:T4E (T4 means inner small wheel TGCs, EI/FI) - int stationEta = int(m_muonIdHelperTool->tgcIdHelper().stationEta(Id)); //backward:[-5,-1], forward:[1,5], (1 or -1 at lowest R) - int stationPhi = int(m_muonIdHelperTool->tgcIdHelper().stationPhi(Id)); //forward:[1:24], endcap:[1:48], EI:[1:21], FI:[1:24] - //int itgcGasGap = int(m_muonIdHelperTool->tgcIdHelper().gasGap(tgc_id)); //increase with |Z|, doublet:[1:2], triplet:[1:3] + int stationName = int(m_idHelperSvc->tgcIdHelper().stationName(Id)); //unsigned integer 41:T1F 42:T1E 43:T2F 44:T2E 45:T3F 46:T3E 47:T4F 48:T4E (T4 means inner small wheel TGCs, EI/FI) + int stationEta = int(m_idHelperSvc->tgcIdHelper().stationEta(Id)); //backward:[-5,-1], forward:[1,5], (1 or -1 at lowest R) + int stationPhi = int(m_idHelperSvc->tgcIdHelper().stationPhi(Id)); //forward:[1:24], endcap:[1:48], EI:[1:21], FI:[1:24] std::string type = "TGC"; std::string hardware_name=convertChamberName(stationName, stationEta, stationPhi, type) ; - - - //m_log << MSG::DEBUG << "Adding the chamber Identifier: " << extid << endmsg;} - //m_log << MSG::DEBUG << "Adding the chamber Identifier: " << extid <<" "; - /* - m_log << MSG::DEBUG << "Adding the chamber " << hardware_name <<" "; - if (gethash_code == 0) { - if (m_debuglevel) m_log << MSG::DEBUG <<" its Id is "; - if (m_debuglevel) m_log.setf( std::ios::showbase ); - if (m_debuglevel) m_log.setf( std::ios::hex, std::ios::basefield ); - if (m_debuglevel) m_log << Id; - //if (m_debuglevel) m_log.setf( std::ios::dec, std::ios::basefield ); - if (m_debuglevel) m_log << MSG::DEBUG <<" its hash Id is "<< Idhash << endmsg; - }else{ - if (m_debuglevel) m_log << MSG::DEBUG<<" hash Id NOT computed "<< Idhash << endmsg; - } - */ } return; } @@ -260,19 +240,18 @@ TgcRawDataValAlg::getNumberOfWires( const int istationName, const int layer, con //wire number in phi48 int TgcRawDataValAlg::getWireNumberPerPhi48(Identifier id) const{ - int stationName=m_muonIdHelperTool->tgcIdHelper().stationName(id);//41:T1F 42:T1E 43:T2F 44:T2E 45:T3F 46:T3E 47:T3F 48:T4E (T4 means inner small wheel TGCs, EI/FI) + int stationName=m_idHelperSvc->tgcIdHelper().stationName(id);//41:T1F 42:T1E 43:T2F 44:T2E 45:T3F 46:T3E 47:T3F 48:T4E (T4 means inner small wheel TGCs, EI/FI) if(stationName==47||stationName==48){ ATH_MSG_WARNING( "getWireNumberPerPhi48 is not implemented yet for EIFI" ); return -1; } - int GasGap=m_muonIdHelperTool->tgcIdHelper().gasGap(id);//[1-3] - int stationPhi=m_muonIdHelperTool->tgcIdHelper().stationPhi(id);//[1:24], [1:48] - int stationEta=m_muonIdHelperTool->tgcIdHelper().stationEta(id);//[-5:-1][1:5] - //int absstationEta=abs(stationEta);//[1-5] - int channel=m_muonIdHelperTool->tgcIdHelper().channel(id);//channel - int isStrip=m_muonIdHelperTool->tgcIdHelper().isStrip(id);//channel + int GasGap=m_idHelperSvc->tgcIdHelper().gasGap(id);//[1-3] + int stationPhi=m_idHelperSvc->tgcIdHelper().stationPhi(id);//[1:24], [1:48] + int stationEta=m_idHelperSvc->tgcIdHelper().stationEta(id);//[-5:-1][1:5] + int channel=m_idHelperSvc->tgcIdHelper().channel(id);//channel + int isStrip=m_idHelperSvc->tgcIdHelper().isStrip(id);//channel int tgc, gasgap, eta, phi; getEtaPhiBasedNumbering(stationName, GasGap, stationEta, stationPhi, @@ -321,7 +300,7 @@ TgcRawDataValAlg::getSectorBasedNumbering(int StationName, int GasGap, int Stati // etaIndex[0:5], 0 is Forward, [1:5] are Endcap // phiIndex[0:3], Endcap has [0:3] chambers per sector, Forward has [0:1] if(StationName==42||StationName==44||StationName==46){//Endcap - eta=abs(StationEta); + eta=std::abs(StationEta); phi=StationPhi+1;// offset +2, StationPhi is 1-based, phi is 0-based sector=phi/4; phi%=4;// convert to index inside sector (phi[0:3]) @@ -392,7 +371,7 @@ TgcRawDataValAlg::getEtaPhiBasedNumbering(int StationName, int GasGap, int Stati // Eta [0:5] eta=0; if(StationName==42||StationName==44||StationName==46||StationName==48){//Endcap - eta=abs(StationEta); + eta=std::abs(StationEta); }else if(StationName==41||StationName==43||StationName==45||StationName==47){//Forward eta=0; }else{ diff --git a/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/TgcRawDataMonitoring/src/TgcRawDataValAlg_ReadContainer.cxx b/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/TgcRawDataMonitoring/src/TgcRawDataValAlg_ReadContainer.cxx index f77a440eece08e6276b8f11ca30f4db1c944f701..3608553065533466f02d3a3f77dcccafbcc29627 100644 --- a/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/TgcRawDataMonitoring/src/TgcRawDataValAlg_ReadContainer.cxx +++ b/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/TgcRawDataMonitoring/src/TgcRawDataValAlg_ReadContainer.cxx @@ -98,9 +98,9 @@ TgcRawDataValAlg::readTgcPrepDataContainer(const Muon::TgcPrepDataContainer* tgc Identifier chamberID = (*containerIt)->identify(); // Get chamber indexes - int stationName = int(m_muonIdHelperTool->tgcIdHelper().stationName(chamberID));//unsigned integer 41:T1F 42:T1E 43:T2F 44:T2E 45:T3F 46:T3E 47:T4F 48:T4E (T4 means inner small wheel TGCs, EI/FI) - int stationEta = int(m_muonIdHelperTool->tgcIdHelper().stationEta(chamberID)); //backward:[-5,-1], forward:[1,5], (1 or -1 at lowest R) - int stationPhi = int(m_muonIdHelperTool->tgcIdHelper().stationPhi(chamberID)); //forward:[1:24], endcap:[1:48], EI:[1:21], FI:[1:24] + int stationName = int(m_idHelperSvc->tgcIdHelper().stationName(chamberID));//unsigned integer 41:T1F 42:T1E 43:T2F 44:T2E 45:T3F 46:T3E 47:T4F 48:T4E (T4 means inner small wheel TGCs, EI/FI) + int stationEta = int(m_idHelperSvc->tgcIdHelper().stationEta(chamberID)); //backward:[-5,-1], forward:[1,5], (1 or -1 at lowest R) + int stationPhi = int(m_idHelperSvc->tgcIdHelper().stationPhi(chamberID)); //forward:[1:24], endcap:[1:48], EI:[1:21], FI:[1:24] int fe = (stationName==42||stationName==44||stationName==46||stationName==48);// 0:forward, 1:endcap int ac = (stationEta<0); @@ -137,9 +137,9 @@ TgcRawDataValAlg::readTgcPrepDataContainer(const Muon::TgcPrepDataContainer* tgc Identifier elementID = (*collectionIt)->identify(); // Get element indexes - int gasGap = int(m_muonIdHelperTool->tgcIdHelper().gasGap(elementID)); //increase with |Z|, doublet:[1:2], triplet:[1:3] - int channel = int(m_muonIdHelperTool->tgcIdHelper().channel(elementID));//channel in a chamber - int ws = int(m_muonIdHelperTool->tgcIdHelper().isStrip(elementID));//[0:1] + int gasGap = int(m_idHelperSvc->tgcIdHelper().gasGap(elementID)); //increase with |Z|, doublet:[1:2], triplet:[1:3] + int channel = int(m_idHelperSvc->tgcIdHelper().channel(elementID));//channel in a chamber + int ws = int(m_idHelperSvc->tgcIdHelper().isStrip(elementID));//[0:1] // Get indexes for EtaPhi numbering scheme // tgc[0:3] TGC index, gasgap[0:2] GasGap index, @@ -166,7 +166,7 @@ TgcRawDataValAlg::readTgcPrepDataContainer(const Muon::TgcPrepDataContainer* tgc int ssize = m_hitIdVects[pcn][ac][ws][eta][phi48][layer].size(); bool multihit_inchannel=false; for(int hit=0;hit<ssize;hit++){ - int ch=m_muonIdHelperTool->tgcIdHelper().channel(m_hitIdVects[pcn][ac][ws][eta][phi48][layer].at(hit)); + int ch=m_idHelperSvc->tgcIdHelper().channel(m_hitIdVects[pcn][ac][ws][eta][phi48][layer].at(hit)); if(ch == channel){ multihit_inchannel=true; break; diff --git a/MuonSpectrometer/MuonValidation/MuonDQA/MuonTrackMonitoring/python/MuonTrackMonitorAlgorithm.py b/MuonSpectrometer/MuonValidation/MuonDQA/MuonTrackMonitoring/python/MuonTrackMonitorAlgorithm.py index d5076493f3e724b5c025356f18479decb617cde9..8cf79208e68665ff7a45bd2cbfe296cb4be3baeb 100644 --- a/MuonSpectrometer/MuonValidation/MuonDQA/MuonTrackMonitoring/python/MuonTrackMonitorAlgorithm.py +++ b/MuonSpectrometer/MuonValidation/MuonDQA/MuonTrackMonitoring/python/MuonTrackMonitorAlgorithm.py @@ -4,12 +4,18 @@ """ -def MuonTrackConfig(inputFlags): - from AthenaMonitoring import AthMonitorCfgHelper +def MuonTrackConfig(inputFlags, isOld=False): + if isOld: + # Run-2 style configuration + from AthenaMonitoring import AthMonitorCfgHelperOld as AthMonitorCfgHelper + from MuonTrackMonitoring.MuonTrackMonitoringConf import MuonTrackMonitorAlgorithm + else: + from AthenaMonitoring import AthMonitorCfgHelper + from AthenaConfiguration.ComponentFactory import CompFactory + MuonTrackMonitorAlgorithm = CompFactory.MuonTrackMonitorAlgorithm + helper = AthMonitorCfgHelper(inputFlags, "MuonTrackMonitoringConfig") - from AthenaConfiguration.ComponentFactory import CompFactory - MuonTrackMonitorAlgorithm = CompFactory.MuonTrackMonitorAlgorithm muonTrackAlg = helper.addAlgorithm(MuonTrackMonitorAlgorithm, "MuonTrackMonitorAlgorithmAlg") myGroup = helper.addGroup(muonTrackAlg, "MuonTrackMonitorAlgorithm", "MuonPhysics/") diff --git a/MuonSpectrometer/MuonValidation/MuonGeomTest/src/MuonGMCheckCorners.cxx b/MuonSpectrometer/MuonValidation/MuonGeomTest/src/MuonGMCheckCorners.cxx index 49665ac392fae66b5bd92dcb4d09bc9840f7a2c7..5c1bfadcc485153fb6a587201fb637add6d152c2 100644 --- a/MuonSpectrometer/MuonValidation/MuonGeomTest/src/MuonGMCheckCorners.cxx +++ b/MuonSpectrometer/MuonValidation/MuonGeomTest/src/MuonGMCheckCorners.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ /*************************************************************************** @@ -10,20 +10,8 @@ Modified by lkashif to include determination of chamber corner coordinates ***************************************************************************/ -//<<<<<< INCLUDES >>>>>> - -#include "GaudiKernel/MsgStream.h" -#include "StoreGate/StoreGate.h" -#include "StoreGate/StoreGateSvc.h" - #include "MuonGMCheckCorners.h" -#include "MuonIdHelpers/MuonIdHelper.h" -#include "MuonIdHelpers/CscIdHelper.h" -#include "MuonIdHelpers/RpcIdHelper.h" -#include "MuonIdHelpers/MdtIdHelper.h" -#include "MuonIdHelpers/TgcIdHelper.h" - #include "MuonReadoutGeometry/MuonReadoutElement.h" #include "MuonReadoutGeometry/MdtReadoutElement.h" #include "MuonReadoutGeometry/CscReadoutElement.h" @@ -31,23 +19,13 @@ #include "MuonReadoutGeometry/TgcReadoutElement.h" #include "MuonReadoutGeometry/RpcReadoutSet.h" #include "MuonReadoutGeometry/MuonStation.h" - #include "MuonReadoutGeometry/TgcReadoutParams.h" #include "TrkSurfaces/Surface.h" #include <fstream> #include <sstream> -typedef std::istringstream mystream; -//<<<<<< PRIVATE DEFINES >>>>>> -//<<<<<< PRIVATE CONSTANTS >>>>>> -//<<<<<< PRIVATE TYPES >>>>>> -//<<<<<< PRIVATE VARIABLE DEFINITIONS >>>>>> -//<<<<<< PUBLIC VARIABLE DEFINITIONS >>>>>> -//<<<<<< CLASS STRUCTURE INITIALIZATION >>>>>> -//<<<<<< PRIVATE FUNCTION DEFINITIONS >>>>>> -//<<<<<< PUBLIC FUNCTION DEFINITIONS >>>>>> -//<<<<<< MEMBER FUNCTION DEFINITIONS >>>>>> +typedef std::istringstream mystream; MuonGMCheckCorners::MuonGMCheckCorners(const std::string& name, ISvcLocator* pSvcLocator) : AthAlgorithm ( name, pSvcLocator ), @@ -88,791 +66,46 @@ MuonGMCheckCorners::MuonGMCheckCorners(const std::string& name, ISvcLocator* pSv declareProperty("station_index", m_station_index); } -MuonGMCheckCorners::~MuonGMCheckCorners() -{ } - StatusCode MuonGMCheckCorners::initialize() { - StatusCode status = StatusCode::SUCCESS; - - MsgStream ini_log(msgSvc(), name()); - ini_log <<MSG::DEBUG<<" starting up"<<endmsg; + ATH_CHECK(AthAlgorithm::initialize()); + ATH_MSG_DEBUG("MuonGMCheckCorners::initialize()"); // Locate the StoreGateSvc and initialize our local ptr - status = serviceLocator()->service("StoreGateSvc", p_EventStore); - if (!status.isSuccess() || 0 == p_EventStore) { - ini_log << MSG::ERROR << " Could not find StoreGateSvc" << endmsg; - return status; - } - else ini_log << MSG::DEBUG << " StoreGateSvc found" << endmsg; - - // Locate the ActiveStoreSvc and initialize our local ptr - status = serviceLocator()->service("ActiveStoreSvc", p_ActiveStore); - if (!status.isSuccess() || 0 == p_ActiveStore) { - ini_log << MSG::ERROR << " Could not find ActiveStoreSvc" << endmsg; - return status; - } - else ini_log << MSG::DEBUG << " ActiveStoreSvc found" << endmsg; - - - ATH_CHECK(m_idHelperSvc.retrieve()); - - if (status == StatusCode::SUCCESS) { - if (m_check_csc) checkreadoutcscgeo(); - if (m_check_mdt) checkreadoutmdtgeo(); - if (m_check_tgc) checkreadouttgcgeo(); - if (m_check_rpc) checkreadoutrpcgeo(); - if (m_check_rpcrsmap) buildRpcRegionSelectorMap(); - if (m_check_mdtrsmap) buildMdtRegionSelectorMap(); - if (m_check_tgcrsmap) buildTgcRegionSelectorMap(); - if (m_check_parent) checkParentStation(); - } + ATH_CHECK(serviceLocator()->service("StoreGateSvc", p_EventStore)); + ATH_MSG_DEBUG("StoreGateSvc found"); + // Locate the ActiveStoreSvc and initialize our local ptr + ATH_CHECK(serviceLocator()->service("ActiveStoreSvc", p_ActiveStore)); + ATH_MSG_DEBUG("ActiveStoreSvc found"); + + if (m_check_csc) checkreadoutcscgeo(); + if (m_check_mdt) checkreadoutmdtgeo(); + if (m_check_tgc) checkreadouttgcgeo(); + if (m_check_rpc) checkreadoutrpcgeo(); + if (m_check_rpcrsmap) buildRpcRegionSelectorMap(); + if (m_check_mdtrsmap) buildMdtRegionSelectorMap(); + if (m_check_tgcrsmap) buildTgcRegionSelectorMap(); + if (m_check_parent) checkParentStation(); // Access the output file - - if (status == StatusCode::SUCCESS) { NTupleFilePtr file1(ntupleSvc(), "/NTUPLES/FILE1"); NTuplePtr nt(ntupleSvc(), "/NTUPLES/FILE1/10"); if ( !nt ) { // Check if already booked nt = ntupleSvc()->book ("/NTUPLES/FILE1/10", CLID_ColumnWiseTuple, "Coords"); if ( nt ) { - ini_log << MSG::DEBUG << "booked ntuple " << endmsg; - - status = nt->addItem ("ChamberPhi", m_statPhi); - status = nt->addItem ("Multilayer", m_statML); - status = nt->addItem ("Corner", m_MLcorner); - status = nt->addItem ("x", m_x); - status = nt->addItem ("y", m_y); - status = nt->addItem ("z", m_z); + ATH_MSG_DEBUG("booked ntuple"); + ATH_CHECK(nt->addItem ("ChamberPhi", m_statPhi)); + ATH_CHECK(nt->addItem ("Multilayer", m_statML)); + ATH_CHECK(nt->addItem ("Corner", m_MLcorner)); + ATH_CHECK(nt->addItem ("x", m_x)); + ATH_CHECK(nt->addItem ("y", m_y)); + ATH_CHECK(nt->addItem ("z", m_z)); } - } else {ini_log << MSG::INFO <<"Failed to book ntuple"<< endmsg;} + } else { + ATH_MSG_WARNING("Failed to book ntuple"); } - return status; -} - - -StatusCode -MuonGMCheckCorners::execute() -{ - StatusCode status = StatusCode::SUCCESS; - // MsgStream exe_log(msgSvc(), name()); - // // exe_log << MSG::INFO << "m_statPhi" << m_statPhi << endmsg; - // exe_log << MSG::DEBUG << "Executing" << endmsg; - - // std::string gVersion = p_MuonMgr->geometryVersion(); - // std::string fileName = "mdt_current_"+gVersion; - // std::ofstream fout(fileName.c_str()); - // exe_log << MSG::INFO << " ***** Writing file "<< fileName << endmsg; - // fout << setiosflags(std::ios::fixed) << std::setprecision(4)<<std::endl; - - // int n=0; - - // //Array holds [][multilayer][corner][coord] - // double coord[8][256][8][3], l, w, t, wl; - // for (int sname_index = 0; sname_index<MuonDetectorManager::NMdtStatType; ++ sname_index) - - // { - // //int st = sname_index; - // for (int seta_index = 0; seta_index<MuonDetectorManager::NMdtStatEta; ++seta_index) - - // { - // //int zi = seta_index + MuonDetectorManager::NMdtStEtaOffset; - // for (int sphi_index = 0; sphi_index<MuonDetectorManager::NMdtStatPhi; ++sphi_index) - // { - // //int fi = sphi_index + 1; - // for (int dbr_index = 0; dbr_index<MuonDetectorManager::NMdtMultilayer; ++dbr_index) - // { - // const MdtReadoutElement* mdt = p_MuonMgr->getMdtReadoutElement(sname_index, - // seta_index, - // sphi_index, - // dbr_index); - // //std::cerr<<" st_i, zi_i, fi_i, ml_i "<<st<<"/"<<zi<<"/"<<fi<<"/"<<"/"<<dbr_index<<std::endl; - // if (mdt == NULL) continue; - - // //This if block determines what station is being looked at, extracts the chamber dimension and - // //global coordinates of the center from GeoModel, and finds the corner coordinates - - // //Specify the station_index in the jobOption - - // if (sname_index == m_station_index) - // { - // n++; - // fout<<"MLs processed: "<<n-1<<std::endl; - // fout<<" ///////////////////// Found a MdtReadoutElement for indices = " - // <<sname_index<<" "<<seta_index<<" "<< sphi_index<<" " - // <<dbr_index - // <<std::endl; - // Identifier idr = mdt->identify(); - // fout<<" its offline hash Id = "<<mdt->identifyHash()<<std::endl; - // fout<<" its offline Id = "<<p_MdtIdHelper->show_to_string(idr) - // <<" ///////////// belongs to module " - // <<mdt->getTechnologyName()<<"/" - // <<mdt->getStationName()<<std::endl; - // Identifier idp = p_MdtIdHelper->parentID(idr); - // fout<<" parent Id = "<<p_MdtIdHelper->show_to_string(idp)<<std::endl; - // HepGeom::Point3D<double> stc = mdt->parentStationPos(); - // const MuonGM::MuonStation* pms __attribute__((unused)) = mdt->parentMuonStation(); - - // fout<<" Multilayer = "<<mdt->getMultilayer(); - // fout<<" N tube layers = "<<mdt->getNLayers(); - // fout<<" tubes/layer = "<<mdt->getNtubesperlayer()<<std::endl; - - // //Set thickness, width and height of multilayer from GeoModel - // t = mdt->getRsize(); - // w = mdt->getSsize(); - // l = mdt->getZsize(); - - // wl = mdt->getLongSsize(); //width of long side for end-cap chambers - - // fout<<" Thickness = "<<t<<", short width = "<<w<<", long width = "<<wl<<", length = "<<l<<std::endl; - - // HepGeom::Point3D<double> elc = mdt->globalPosition(); - // fout<<" Element centre: "<<elc - // <<" cyl. coords R,phi,Z "<<elc.perp()<<" "<<elc.phi()<<" "<<elc.z()<<std::endl<<std::endl; - - // double s = sin(elc.phi()), c = cos(elc.phi()); - // // double x = elc.x(); - // // fout<<"x = "<<x<<std::endl; - - // //End-cap chambers, trapezoidal - // if (m_station_index > 10 && m_station_index != 23) - // { - // if (elc.z() > 0) - // { - // if (fabs(elc.x())<5 && elc.y()>0) - // { - // coord[0][n-1][0][0] = elc.x() + w/2; - // coord[0][n-1][0][1] = elc.y() - t/2; - // coord[0][n-1][0][2] = elc.z() - l/2; - - // coord[0][n-1][1][0] = coord[0][n-1][0][0] - w; - // coord[0][n-1][1][1] = coord[0][n-1][0][1]; - // coord[0][n-1][1][2] = coord[0][n-1][0][2]; - - // coord[0][n-1][2][0] = coord[0][n-1][1][0]; - // coord[0][n-1][2][1] = coord[0][n-1][1][1]; - // coord[0][n-1][2][2] = coord[0][n-1][1][2] + l; - - // coord[0][n-1][3][0] = coord[0][n-1][2][0] + w; - // coord[0][n-1][3][1] = coord[0][n-1][2][1]; - // coord[0][n-1][3][2] = coord[0][n-1][2][2]; - - // coord[0][n-1][4][0] = elc.x() + wl/2; - // coord[0][n-1][4][1] = elc.y() + t/2; - // coord[0][n-1][4][2] = elc.z() - l/2; - - // coord[0][n-1][5][0] = coord[0][n-1][4][0] - wl; - // coord[0][n-1][5][1] = coord[0][n-1][4][1]; - // coord[0][n-1][5][2] = coord[0][n-1][4][2]; - - // coord[0][n-1][6][0] = coord[0][n-1][5][0]; - // coord[0][n-1][6][1] = coord[0][n-1][5][1]; - // coord[0][n-1][6][2] = coord[0][n-1][5][2] + l; - - // coord[0][n-1][7][0] = coord[0][n-1][6][0] + wl; - // coord[0][n-1][7][1] = coord[0][n-1][6][1]; - // coord[0][n-1][7][2] = coord[0][n-1][6][2]; - // } - - // else if (fabs(elc.x())<5 && elc.y()<0) - // { - // coord[0][n-1][0][0] = elc.x() - w/2; - // coord[0][n-1][0][1] = elc.y() + t/2; - // coord[0][n-1][0][2] = elc.z() - l/2; - - // coord[0][n-1][1][0] = coord[0][n-1][0][0] + w; - // coord[0][n-1][1][1] = coord[0][n-1][0][1]; - // coord[0][n-1][1][2] = coord[0][n-1][0][2]; - - // coord[0][n-1][2][0] = coord[0][n-1][1][0]; - // coord[0][n-1][2][1] = coord[0][n-1][1][1]; - // coord[0][n-1][2][2] = coord[0][n-1][1][2] + l; - - // coord[0][n-1][3][0] = coord[0][n-1][2][0] - w; - // coord[0][n-1][3][1] = coord[0][n-1][2][1]; - // coord[0][n-1][3][2] = coord[0][n-1][2][2]; - - // coord[0][n-1][4][0] = elc.x() - wl/2; - // coord[0][n-1][4][1] = elc.y() - t/2; - // coord[0][n-1][4][2] = elc.z() - l/2; - - // coord[0][n-1][5][0] = coord[0][n-1][4][0] + wl; - // coord[0][n-1][5][1] = coord[0][n-1][4][1]; - // coord[0][n-1][5][2] = coord[0][n-1][4][2]; - - // coord[0][n-1][6][0] = coord[0][n-1][5][0]; - // coord[0][n-1][6][1] = coord[0][n-1][5][1]; - // coord[0][n-1][6][2] = coord[0][n-1][5][2] + l; - - // coord[0][n-1][7][0] = coord[0][n-1][6][0] - wl; - // coord[0][n-1][7][1] = coord[0][n-1][6][1]; - // coord[0][n-1][7][2] = coord[0][n-1][6][2]; - // } - - // else if ((elc.x()>5 && elc.y()>5) || (elc.x()>5 && fabs(elc.y())<5) || (elc.x()<-5 && elc.y()<-5) || - // (elc.x()-5 && fabs(elc.y())<5)) - // { - // coord[0][n-1][0][0] = elc.x() + (t/2)*c - (w/2)*s; - // coord[0][n-1][0][1] = elc.y() - (t/2)*s - (w/2)*c; - // coord[0][n-1][0][2] = elc.z() - (l/2); - - // coord[0][n-1][1][0] = coord[0][n-1][0][0] + w*s; - // coord[0][n-1][1][1] = coord[0][n-1][0][1] + w*c; - // coord[0][n-1][1][2] = coord[0][n-1][0][2]; - - // coord[0][n-1][2][0] = coord[0][n-1][1][0]; - // coord[0][n-1][2][1] = coord[0][n-1][1][1]; - // coord[0][n-1][2][2] = coord[0][n-1][1][2] + l; - - // coord[0][n-1][3][0] = coord[0][n-1][2][0] - w*s; - // coord[0][n-1][3][1] = coord[0][n-1][2][1] - w*c; - // coord[0][n-1][3][2] = coord[0][n-1][2][2]; - - // coord[0][n-1][4][0] = elc.x() - (t/2)*c - (wl/2)*s; - // coord[0][n-1][4][1] = elc.y() + (t/2)*s - (wl/2)*c; - // coord[0][n-1][4][2] = elc.z() - l/2; - - // coord[0][n-1][5][0] = coord[0][n-1][4][0] + wl*s; - // coord[0][n-1][5][1] = coord[0][n-1][4][1] + wl*c; - // coord[0][n-1][5][2] = coord[0][n-1][4][2]; - - // coord[0][n-1][6][0] = coord[0][n-1][5][0]; - // coord[0][n-1][6][1] = coord[0][n-1][5][1]; - // coord[0][n-1][6][2] = coord[0][n-1][5][2] + l; - - // coord[0][n-1][7][0] = coord[0][n-1][6][0] - wl*s; - // coord[0][n-1][7][1] = coord[0][n-1][6][1] - wl*c; - // coord[0][n-1][7][2] = coord[0][n-1][6][2]; - // } - - // else if ((elc.x()<-5 && elc.y()>5) || (elc.x()>5 && elc.y()<-5)) - // { - // coord[0][n-1][0][0] = elc.x() - (t/2)*c - (w/2)*s; - // coord[0][n-1][0][1] = elc.y() + (t/2)*s - (w/2)*c; - // coord[0][n-1][0][2] = elc.z() - (l/2); - - // coord[0][n-1][1][0] = coord[0][n-1][0][0] + w*s; - // coord[0][n-1][1][1] = coord[0][n-1][0][1] + w*c; - // coord[0][n-1][1][2] = coord[0][n-1][0][2]; - - // coord[0][n-1][2][0] = coord[0][n-1][1][0]; - // coord[0][n-1][2][1] = coord[0][n-1][1][1]; - // coord[0][n-1][2][2] = coord[0][n-1][1][2] + l; - - // coord[0][n-1][3][0] = coord[0][n-1][2][0] - w*s; - // coord[0][n-1][3][1] = coord[0][n-1][2][1] - w*c; - // coord[0][n-1][3][2] = coord[0][n-1][2][2]; - - // coord[0][n-1][4][0] = elc.x() + (t/2)*c - (wl/2)*s; - // coord[0][n-1][4][1] = elc.y() - (t/2)*s - (wl/2)*c; - // coord[0][n-1][4][2] = elc.z() - l/2; - - // coord[0][n-1][5][0] = coord[0][n-1][4][0] + wl*s; - // coord[0][n-1][5][1] = coord[0][n-1][4][1] + wl*c; - // coord[0][n-1][5][2] = coord[0][n-1][4][2]; - - // coord[0][n-1][6][0] = coord[0][n-1][5][0]; - // coord[0][n-1][6][1] = coord[0][n-1][5][1]; - // coord[0][n-1][6][2] = coord[0][n-1][5][2] + l; - - // coord[0][n-1][7][0] = coord[0][n-1][6][0] - wl*s; - // coord[0][n-1][7][1] = coord[0][n-1][6][1] - wl*c; - // coord[0][n-1][7][2] = coord[0][n-1][6][2]; - // } - // } //end if over positive z - - // else { - - // if (fabs(elc.x())<5 && elc.y()>0) - // { - // coord[0][n-1][0][0] = elc.x() + w/2; - // coord[0][n-1][0][1] = elc.y() - t/2; - // coord[0][n-1][0][2] = elc.z() + l/2; - - // coord[0][n-1][1][0] = coord[0][n-1][0][0] - w; - // coord[0][n-1][1][1] = coord[0][n-1][0][1]; - // coord[0][n-1][1][2] = coord[0][n-1][0][2]; - - // coord[0][n-1][2][0] = coord[0][n-1][1][0]; - // coord[0][n-1][2][1] = coord[0][n-1][1][1]; - // coord[0][n-1][2][2] = coord[0][n-1][1][2] - l; - - // coord[0][n-1][3][0] = coord[0][n-1][2][0] + w; - // coord[0][n-1][3][1] = coord[0][n-1][2][1]; - // coord[0][n-1][3][2] = coord[0][n-1][2][2]; - - // coord[0][n-1][4][0] = elc.x() + wl/2; - // coord[0][n-1][4][1] = elc.y() + t/2; - // coord[0][n-1][4][2] = elc.z() + l/2; - - // coord[0][n-1][5][0] = coord[0][n-1][4][0] - wl; - // coord[0][n-1][5][1] = coord[0][n-1][4][1]; - // coord[0][n-1][5][2] = coord[0][n-1][4][2]; - - // coord[0][n-1][6][0] = coord[0][n-1][5][0]; - // coord[0][n-1][6][1] = coord[0][n-1][5][1]; - // coord[0][n-1][6][2] = coord[0][n-1][5][2] - l; - - // coord[0][n-1][7][0] = coord[0][n-1][6][0] + wl; - // coord[0][n-1][7][1] = coord[0][n-1][6][1]; - // coord[0][n-1][7][2] = coord[0][n-1][6][2]; - // } - - // else if (fabs(elc.x())<5 && elc.y()<0) - // { - // coord[0][n-1][0][0] = elc.x() - w/2; - // coord[0][n-1][0][1] = elc.y() + t/2; - // coord[0][n-1][0][2] = elc.z() + l/2; - - // coord[0][n-1][1][0] = coord[0][n-1][0][0] + w; - // coord[0][n-1][1][1] = coord[0][n-1][0][1]; - // coord[0][n-1][1][2] = coord[0][n-1][0][2]; - - // coord[0][n-1][2][0] = coord[0][n-1][1][0]; - // coord[0][n-1][2][1] = coord[0][n-1][1][1]; - // coord[0][n-1][2][2] = coord[0][n-1][1][2] - l; - - // coord[0][n-1][3][0] = coord[0][n-1][2][0] - w; - // coord[0][n-1][3][1] = coord[0][n-1][2][1]; - // coord[0][n-1][3][2] = coord[0][n-1][2][2]; - - // coord[0][n-1][4][0] = elc.x() - wl/2; - // coord[0][n-1][4][1] = elc.y() - t/2; - // coord[0][n-1][4][2] = elc.z() + l/2; - - // coord[0][n-1][5][0] = coord[0][n-1][4][0] + wl; - // coord[0][n-1][5][1] = coord[0][n-1][4][1]; - // coord[0][n-1][5][2] = coord[0][n-1][4][2]; - - // coord[0][n-1][6][0] = coord[0][n-1][5][0]; - // coord[0][n-1][6][1] = coord[0][n-1][5][1]; - // coord[0][n-1][6][2] = coord[0][n-1][5][2] - l; - - // coord[0][n-1][7][0] = coord[0][n-1][6][0] - wl; - // coord[0][n-1][7][1] = coord[0][n-1][6][1]; - // coord[0][n-1][7][2] = coord[0][n-1][6][2]; - // } - - // else if ((elc.x()>5 && elc.y()>5) || (elc.x()>5 && fabs(elc.y())<5) || (elc.x()<-5 && elc.y()<-5) || - // (elc.x()-5 && fabs(elc.y())<5)) - // { - // coord[0][n-1][0][0] = elc.x() + (t/2)*c - (w/2)*s; - // coord[0][n-1][0][1] = elc.y() - (t/2)*s - (w/2)*c; - // coord[0][n-1][0][2] = elc.z() + (l/2); - - // coord[0][n-1][1][0] = coord[0][n-1][0][0] + w*s; - // coord[0][n-1][1][1] = coord[0][n-1][0][1] + w*c; - // coord[0][n-1][1][2] = coord[0][n-1][0][2]; - - // coord[0][n-1][2][0] = coord[0][n-1][1][0]; - // coord[0][n-1][2][1] = coord[0][n-1][1][1]; - // coord[0][n-1][2][2] = coord[0][n-1][1][2] - l; - - // coord[0][n-1][3][0] = coord[0][n-1][2][0] - w*s; - // coord[0][n-1][3][1] = coord[0][n-1][2][1] - w*c; - // coord[0][n-1][3][2] = coord[0][n-1][2][2]; - - // coord[0][n-1][4][0] = elc.x() - (t/2)*c - (wl/2)*s; - // coord[0][n-1][4][1] = elc.y() + (t/2)*s - (wl/2)*c; - // coord[0][n-1][4][2] = elc.z() + l/2; - - // coord[0][n-1][5][0] = coord[0][n-1][4][0] + wl*s; - // coord[0][n-1][5][1] = coord[0][n-1][4][1] + wl*c; - // coord[0][n-1][5][2] = coord[0][n-1][4][2]; - - // coord[0][n-1][6][0] = coord[0][n-1][5][0]; - // coord[0][n-1][6][1] = coord[0][n-1][5][1]; - // coord[0][n-1][6][2] = coord[0][n-1][5][2] - l; - - // coord[0][n-1][7][0] = coord[0][n-1][6][0] - wl*s; - // coord[0][n-1][7][1] = coord[0][n-1][6][1] - wl*c; - // coord[0][n-1][7][2] = coord[0][n-1][6][2]; - // } - - // else if ((elc.x()<-5 && elc.y()>5) || (elc.x()>5 && elc.y()<-5)) - // { - // coord[0][n-1][0][0] = elc.x() - (t/2)*c - (w/2)*s; - // coord[0][n-1][0][1] = elc.y() + (t/2)*s - (w/2)*c; - // coord[0][n-1][0][2] = elc.z() + (l/2); - - // coord[0][n-1][1][0] = coord[0][n-1][0][0] + w*s; - // coord[0][n-1][1][1] = coord[0][n-1][0][1] + w*c; - // coord[0][n-1][1][2] = coord[0][n-1][0][2]; - - // coord[0][n-1][2][0] = coord[0][n-1][1][0]; - // coord[0][n-1][2][1] = coord[0][n-1][1][1]; - // coord[0][n-1][2][2] = coord[0][n-1][1][2] - l; - - // coord[0][n-1][3][0] = coord[0][n-1][2][0] - w*s; - // coord[0][n-1][3][1] = coord[0][n-1][2][1] - w*c; - // coord[0][n-1][3][2] = coord[0][n-1][2][2]; - - // coord[0][n-1][4][0] = elc.x() + (t/2)*c - (wl/2)*s; - // coord[0][n-1][4][1] = elc.y() - (t/2)*s - (wl/2)*c; - // coord[0][n-1][4][2] = elc.z() + l/2; - - // coord[0][n-1][5][0] = coord[0][n-1][4][0] + wl*s; - // coord[0][n-1][5][1] = coord[0][n-1][4][1] + wl*c; - // coord[0][n-1][5][2] = coord[0][n-1][4][2]; - - // coord[0][n-1][6][0] = coord[0][n-1][5][0]; - // coord[0][n-1][6][1] = coord[0][n-1][5][1]; - // coord[0][n-1][6][2] = coord[0][n-1][5][2] - l; - - // coord[0][n-1][7][0] = coord[0][n-1][6][0] - wl*s; - // coord[0][n-1][7][1] = coord[0][n-1][6][1] - wl*c; - // coord[0][n-1][7][2] = coord[0][n-1][6][2]; - // } - // } //end if over negative z - - // } //end if over end-cap chambers - - // //Barrel chambers, rectangular - // if (m_station_index < 13 || m_station_index == 23) - // { - // if (elc.z() < 0) - // { - // if (fabs(elc.x())<0.001 && elc.y()>0) - // { - // coord[0][n-1][0][0] = elc.x() - (w/2); - // coord[0][n-1][0][1] = elc.y() + (t/2); - // coord[0][n-1][0][2] = elc.z() + (l/2); - - // coord[0][n-1][1][0] = coord[0][n-1][0][0] + w; - // coord[0][n-1][1][1] = coord[0][n-1][0][1]; - // coord[0][n-1][1][2] = coord[0][n-1][0][2]; - - // coord[0][n-1][2][0] = coord[0][n-1][1][0]; - // coord[0][n-1][2][1] = coord[0][n-1][1][1] - t; - // coord[0][n-1][2][2] = coord[0][n-1][1][2]; - - // coord[0][n-1][3][0] = coord[0][n-1][2][0] - w; - // coord[0][n-1][3][1] = coord[0][n-1][2][1]; - // coord[0][n-1][3][2] = coord[0][n-1][2][2]; - - // coord[0][n-1][4][0] = coord[0][n-1][0][0]; - // coord[0][n-1][4][1] = coord[0][n-1][0][1]; - // coord[0][n-1][4][2] = coord[0][n-1][0][2] - l; - - // coord[0][n-1][5][0] = coord[0][n-1][1][0]; - // coord[0][n-1][5][1] = coord[0][n-1][1][1]; - // coord[0][n-1][5][2] = coord[0][n-1][1][2] - l; - - // coord[0][n-1][6][0] = coord[0][n-1][2][0]; - // coord[0][n-1][6][1] = coord[0][n-1][2][1]; - // coord[0][n-1][6][2] = coord[0][n-1][2][2] - l; - - // coord[0][n-1][7][0] = coord[0][n-1][3][0]; - // coord[0][n-1][7][1] = coord[0][n-1][3][1]; - // coord[0][n-1][7][2] = coord[0][n-1][3][2] - l; - // } - - // else if (fabs(elc.x())<0.001 && elc.y()<0) - // { - // coord[0][n-1][0][0] = elc.x() + w/2; - // coord[0][n-1][0][1] = elc.y() - (t/2); - // coord[0][n-1][0][2] = elc.z() + (l/2); - - // coord[0][n-1][1][0] = coord[0][n-1][0][0] - w; - // coord[0][n-1][1][1] = coord[0][n-1][0][1]; - // coord[0][n-1][1][2] = coord[0][n-1][0][2]; - - // coord[0][n-1][2][0] = coord[0][n-1][1][0]; - // coord[0][n-1][2][1] = coord[0][n-1][1][1] + t; - // coord[0][n-1][2][2] = coord[0][n-1][1][2]; - - // coord[0][n-1][3][0] = coord[0][n-1][2][0] + w; - // coord[0][n-1][3][1] = coord[0][n-1][2][1]; - // coord[0][n-1][3][2] = coord[0][n-1][2][2]; - - // coord[0][n-1][4][0] = coord[0][n-1][0][0]; - // coord[0][n-1][4][1] = coord[0][n-1][0][1]; - // coord[0][n-1][4][2] = coord[0][n-1][0][2] - l; - - // coord[0][n-1][5][0] = coord[0][n-1][1][0]; - // coord[0][n-1][5][1] = coord[0][n-1][1][1]; - // coord[0][n-1][5][2] = coord[0][n-1][1][2] - l; - - // coord[0][n-1][6][0] = coord[0][n-1][2][0]; - // coord[0][n-1][6][1] = coord[0][n-1][2][1]; - // coord[0][n-1][6][2] = coord[0][n-1][2][2] - l; - - // coord[0][n-1][7][0] = coord[0][n-1][3][0]; - // coord[0][n-1][7][1] = coord[0][n-1][3][1]; - // coord[0][n-1][7][2] = coord[0][n-1][3][2] - l; - // } - // else if ((elc.x()>0.001 && elc.y()>=0) || (elc.x()<-0.001 && elc.y()<=0)) - // { - // coord[0][n-1][0][0] = elc.x() + (t/2)*c; - // coord[0][n-1][0][1] = elc.y() - (w/2)*c; - // coord[0][n-1][0][2] = elc.z() + (l/2); - - // coord[0][n-1][1][0] = coord[0][n-1][0][0] - w*s; - // coord[0][n-1][1][1] = coord[0][n-1][0][1] + w*c; - // coord[0][n-1][1][2] = coord[0][n-1][0][2]; - - // coord[0][n-1][2][0] = coord[0][n-1][1][0] - t*c; - // coord[0][n-1][2][1] = coord[0][n-1][1][1] - t*s; - // coord[0][n-1][2][2] = coord[0][n-1][1][2]; - - // coord[0][n-1][3][0] = coord[0][n-1][2][0] + w*s; - // coord[0][n-1][3][1] = coord[0][n-1][2][1] - w*c; - // coord[0][n-1][3][2] = coord[0][n-1][2][2]; - - // coord[0][n-1][4][0] = coord[0][n-1][0][0]; - // coord[0][n-1][4][1] = coord[0][n-1][0][1]; - // coord[0][n-1][4][2] = coord[0][n-1][0][2] - l; - - // coord[0][n-1][5][0] = coord[0][n-1][1][0]; - // coord[0][n-1][5][1] = coord[0][n-1][1][1]; - // coord[0][n-1][5][2] = coord[0][n-1][1][2] - l; - - // coord[0][n-1][6][0] = coord[0][n-1][2][0]; - // coord[0][n-1][6][1] = coord[0][n-1][2][1]; - // coord[0][n-1][6][2] = coord[0][n-1][2][2] - l; - - // coord[0][n-1][7][0] = coord[0][n-1][3][0]; - // coord[0][n-1][7][1] = coord[0][n-1][3][1]; - // coord[0][n-1][7][2] = coord[0][n-1][3][2] - l; - // } - - // else if ((elc.x()<-0.001 && elc.y()>0) || (elc.x()>0.001 && elc.y()<0)) - // { - // coord[0][n-1][0][0] = elc.x() + (t/2)*c; - // coord[0][n-1][0][1] = elc.y() + (w/2)*c; - // coord[0][n-1][0][2] = elc.z() + (l/2); - - // coord[0][n-1][1][0] = coord[0][n-1][0][0] + w*s; - // coord[0][n-1][1][1] = coord[0][n-1][0][1] - w*c; - // coord[0][n-1][1][2] = coord[0][n-1][0][2]; - - // coord[0][n-1][2][0] = coord[0][n-1][1][0] - t*c; - // coord[0][n-1][2][1] = coord[0][n-1][1][1] - t*s; - // coord[0][n-1][2][2] = coord[0][n-1][1][2]; - - // coord[0][n-1][3][0] = coord[0][n-1][2][0] - w*s; - // coord[0][n-1][3][1] = coord[0][n-1][2][1] + w*c; - // coord[0][n-1][3][2] = coord[0][n-1][2][2]; - - // coord[0][n-1][4][0] = coord[0][n-1][0][0]; - // coord[0][n-1][4][1] = coord[0][n-1][0][1]; - // coord[0][n-1][4][2] = coord[0][n-1][0][2] - l; - - // coord[0][n-1][5][0] = coord[0][n-1][1][0]; - // coord[0][n-1][5][1] = coord[0][n-1][1][1]; - // coord[0][n-1][5][2] = coord[0][n-1][1][2] - l; - - // coord[0][n-1][6][0] = coord[0][n-1][2][0]; - // coord[0][n-1][6][1] = coord[0][n-1][2][1]; - // coord[0][n-1][6][2] = coord[0][n-1][2][2] - l; - - // coord[0][n-1][7][0] = coord[0][n-1][3][0]; - // coord[0][n-1][7][1] = coord[0][n-1][3][1]; - // coord[0][n-1][7][2] = coord[0][n-1][3][2] - l; - // } - // } //end if over negative z - - // else { - - // if (fabs(elc.x())<0.001 && elc.y()>0) - // { - // coord[0][n-1][0][0] = elc.x() - (w/2); - // coord[0][n-1][0][1] = elc.y() + (t/2); - // coord[0][n-1][0][2] = elc.z() - (l/2); - - // coord[0][n-1][1][0] = coord[0][n-1][0][0] + w; - // coord[0][n-1][1][1] = coord[0][n-1][0][1]; - // coord[0][n-1][1][2] = coord[0][n-1][0][2]; - - // coord[0][n-1][2][0] = coord[0][n-1][1][0]; - // coord[0][n-1][2][1] = coord[0][n-1][1][1] - t; - // coord[0][n-1][2][2] = coord[0][n-1][1][2]; - - // coord[0][n-1][3][0] = coord[0][n-1][2][0] - w; - // coord[0][n-1][3][1] = coord[0][n-1][2][1]; - // coord[0][n-1][3][2] = coord[0][n-1][2][2]; - - // coord[0][n-1][4][0] = coord[0][n-1][0][0]; - // coord[0][n-1][4][1] = coord[0][n-1][0][1]; - // coord[0][n-1][4][2] = coord[0][n-1][0][2] + l; - - // coord[0][n-1][5][0] = coord[0][n-1][1][0]; - // coord[0][n-1][5][1] = coord[0][n-1][1][1]; - // coord[0][n-1][5][2] = coord[0][n-1][1][2] + l; - - // coord[0][n-1][6][0] = coord[0][n-1][2][0]; - // coord[0][n-1][6][1] = coord[0][n-1][2][1]; - // coord[0][n-1][6][2] = coord[0][n-1][2][2] + l; - - // coord[0][n-1][7][0] = coord[0][n-1][3][0]; - // coord[0][n-1][7][1] = coord[0][n-1][3][1]; - // coord[0][n-1][7][2] = coord[0][n-1][3][2] + l; - // } - - // else if (fabs(elc.x())<0.001 && elc.y()<0) - // { - // coord[0][n-1][0][0] = elc.x() + (w/2); - // coord[0][n-1][0][1] = elc.y() - (t/2); - // coord[0][n-1][0][2] = elc.z() - (l/2); - - // coord[0][n-1][1][0] = coord[0][n-1][0][0] - w; - // coord[0][n-1][1][1] = coord[0][n-1][0][1]; - // coord[0][n-1][1][2] = coord[0][n-1][0][2]; - - // coord[0][n-1][2][0] = coord[0][n-1][1][0]; - // coord[0][n-1][2][1] = coord[0][n-1][1][1] + t; - // coord[0][n-1][2][2] = coord[0][n-1][1][2]; - - // coord[0][n-1][3][0] = coord[0][n-1][2][0] + w; - // coord[0][n-1][3][1] = coord[0][n-1][2][1]; - // coord[0][n-1][3][2] = coord[0][n-1][2][2]; - - // coord[0][n-1][4][0] = coord[0][n-1][0][0]; - // coord[0][n-1][4][1] = coord[0][n-1][0][1]; - // coord[0][n-1][4][2] = coord[0][n-1][0][2] + l; - - // coord[0][n-1][5][0] = coord[0][n-1][1][0]; - // coord[0][n-1][5][1] = coord[0][n-1][1][1]; - // coord[0][n-1][5][2] = coord[0][n-1][1][2] + l; - - // coord[0][n-1][6][0] = coord[0][n-1][2][0]; - // coord[0][n-1][6][1] = coord[0][n-1][2][1]; - // coord[0][n-1][6][2] = coord[0][n-1][2][2] + l; - - // coord[0][n-1][7][0] = coord[0][n-1][3][0]; - // coord[0][n-1][7][1] = coord[0][n-1][3][1]; - // coord[0][n-1][7][2] = coord[0][n-1][3][2] + l; - // } - - // else if ((elc.x()>0.001 && elc.y()>=0) || (elc.x()<-0.001 && elc.y()<=0)) - // { - // coord[0][n-1][0][0] = elc.x() + (t/2)*c; - // coord[0][n-1][0][1] = elc.y() - (w/2)*c; - // coord[0][n-1][0][2] = elc.z() - (l/2); - - // coord[0][n-1][1][0] = coord[0][n-1][0][0] - w*s; - // coord[0][n-1][1][1] = coord[0][n-1][0][1] + w*c; - // coord[0][n-1][1][2] = coord[0][n-1][0][2]; - - // coord[0][n-1][2][0] = coord[0][n-1][1][0] - t*c; - // coord[0][n-1][2][1] = coord[0][n-1][1][1] - t*s; - // coord[0][n-1][2][2] = coord[0][n-1][1][2]; - - // coord[0][n-1][3][0] = coord[0][n-1][2][0] + w*s; - // coord[0][n-1][3][1] = coord[0][n-1][2][1] - w*c; - // coord[0][n-1][3][2] = coord[0][n-1][2][2]; - - // coord[0][n-1][4][0] = coord[0][n-1][0][0]; - // coord[0][n-1][4][1] = coord[0][n-1][0][1]; - // coord[0][n-1][4][2] = coord[0][n-1][0][2] + l; - - // coord[0][n-1][5][0] = coord[0][n-1][1][0]; - // coord[0][n-1][5][1] = coord[0][n-1][1][1]; - // coord[0][n-1][5][2] = coord[0][n-1][1][2] + l; - - // coord[0][n-1][6][0] = coord[0][n-1][2][0]; - // coord[0][n-1][6][1] = coord[0][n-1][2][1]; - // coord[0][n-1][6][2] = coord[0][n-1][2][2] + l; - - // coord[0][n-1][7][0] = coord[0][n-1][3][0]; - // coord[0][n-1][7][1] = coord[0][n-1][3][1]; - // coord[0][n-1][7][2] = coord[0][n-1][3][2] + l; - // } - - // else if ((elc.x()<-0.001 && elc.y()>0) || (elc.x()>0.001 && elc.y()<0)) - // { - // coord[0][n-1][0][0] = elc.x() + (t/2)*c; - // coord[0][n-1][0][1] = elc.y() + (w/2)*c; - // coord[0][n-1][0][2] = elc.z() - (l/2); - - // coord[0][n-1][1][0] = coord[0][n-1][0][0] + w*s; - // coord[0][n-1][1][1] = coord[0][n-1][0][1] - w*c; - // coord[0][n-1][1][2] = coord[0][n-1][0][2]; - - // coord[0][n-1][2][0] = coord[0][n-1][1][0] - t*c; - // coord[0][n-1][2][1] = coord[0][n-1][1][1] - t*s; - // coord[0][n-1][2][2] = coord[0][n-1][1][2]; - - // coord[0][n-1][3][0] = coord[0][n-1][2][0] - w*s; - // coord[0][n-1][3][1] = coord[0][n-1][2][1] + w*c; - // coord[0][n-1][3][2] = coord[0][n-1][2][2]; - - // coord[0][n-1][4][0] = coord[0][n-1][0][0]; - // coord[0][n-1][4][1] = coord[0][n-1][0][1]; - // coord[0][n-1][4][2] = coord[0][n-1][0][2] + l; - - // coord[0][n-1][5][0] = coord[0][n-1][1][0]; - // coord[0][n-1][5][1] = coord[0][n-1][1][1]; - // coord[0][n-1][5][2] = coord[0][n-1][1][2] + l; - - // coord[0][n-1][6][0] = coord[0][n-1][2][0]; - // coord[0][n-1][6][1] = coord[0][n-1][2][1]; - // coord[0][n-1][6][2] = coord[0][n-1][2][2] + l; - - // coord[0][n-1][7][0] = coord[0][n-1][3][0]; - // coord[0][n-1][7][1] = coord[0][n-1][3][1]; - // coord[0][n-1][7][2] = coord[0][n-1][3][2] + l; - // } - - // } //end if over positive z - // } //end if over barrel chambers - - // for (int i = 0; i<8; i++) - // { - // m_statPhi = (long)elc.phi(); - - // if (idr == idp) m_statML = 1; - // else m_statML = 2; - - // m_MLcorner = i+1; - - // m_x = coord[0][n-1][i][0]; - // m_y = coord[0][n-1][i][1]; - // m_z = coord[0][n-1][i][2]; - // //cout<<"accepted coords"<<endl; - // ntupleSvc()->writeRecord("/NTUPLES/FILE1/10"); - // } - - // fout<<"Corner 1: x= "<<coord[0][n-1][0][0]<<", y= "<<coord[0][n-1][0][1]<<", z= "<<coord[0][n-1][0][2]<<std::endl; - // fout<<"Corner 2: x= "<<coord[0][n-1][1][0]<<", y= "<<coord[0][n-1][1][1]<<", z= "<<coord[0][n-1][1][2]<<std::endl; - // fout<<"Corner 3: x= "<<coord[0][n-1][2][0]<<", y= "<<coord[0][n-1][2][1]<<", z= "<<coord[0][n-1][2][2]<<std::endl; - // fout<<"Corner 4: x= "<<coord[0][n-1][3][0]<<", y= "<<coord[0][n-1][3][1]<<", z= "<<coord[0][n-1][3][2]<<std::endl; - // fout<<"Corner 5: x= "<<coord[0][n-1][4][0]<<", y= "<<coord[0][n-1][4][1]<<", z= "<<coord[0][n-1][4][2]<<std::endl; - // fout<<"Corner 6: x= "<<coord[0][n-1][5][0]<<", y= "<<coord[0][n-1][5][1]<<", z= "<<coord[0][n-1][5][2]<<std::endl; - // fout<<"Corner 7: x= "<<coord[0][n-1][6][0]<<", y= "<<coord[0][n-1][6][1]<<", z= "<<coord[0][n-1][6][2]<<std::endl; - // fout<<"Corner 8: x= "<<coord[0][n-1][7][0]<<", y= "<<coord[0][n-1][7][1]<<", z= "<<coord[0][n-1][7][2]<<std::endl<<std::endl; - // } - - // /* Identifier chid; - // for ( int tl=1; tl<=mdt->getNLayers(); tl++) - // { - // //fout<<" A new tube layer "<<tl<<std::endl; - // int tube = 1; - // chid = p_MdtIdHelper->channelID(idp,mdt->getMultilayer(), tl, tube); - // //fout<<p_MdtIdHelper->show_to_string(chid) - // // <<" wire global pos "<<mdt->tubePos(chid); - // fout<<" Tube length is "<<mdt->tubeLength(chid)<<std::endl; - // }*/ - // } - // } - // } - // } - - return status; -} - -StatusCode -MuonGMCheckCorners::finalize() -{ - StatusCode status = StatusCode::SUCCESS; - - - MsgStream fin_log(msgSvc(), name()); - fin_log << MSG::DEBUG << "Finalizing" << endmsg; - - - return status; + return StatusCode::SUCCESS; } void MuonGMCheckCorners::checkreadoutrpcgeo() diff --git a/MuonSpectrometer/MuonValidation/MuonGeomTest/src/MuonGMCheckCorners.h b/MuonSpectrometer/MuonValidation/MuonGeomTest/src/MuonGMCheckCorners.h index 3507a7c2d72125034604d4634966742bb1a3e030..df301cd768c699ff1a6939a7c5a9fa1f9d6fa358 100644 --- a/MuonSpectrometer/MuonValidation/MuonGeomTest/src/MuonGMCheckCorners.h +++ b/MuonSpectrometer/MuonValidation/MuonGeomTest/src/MuonGMCheckCorners.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ /*************************************************************************** @@ -8,51 +8,23 @@ ***************************************************************************/ #ifndef MUONGEOMODEL_MUONGMCHECKCORNERS_H -# define MUONGEOMODEL_MUONGMCHECKCORNERS_H - -//<<<<<< INCLUDES >>>>>> -//<<<<<< PUBLIC DEFINES >>>>>> -//<<<<<< PUBLIC CONSTANTS >>>>>> -//<<<<<< PUBLIC TYPES >>>>>> -//<<<<<< PUBLIC VARIABLES >>>>>> -//<<<<<< PUBLIC FUNCTIONS >>>>>> -//<<<<<< CLASS DECLARATIONS >>>>>> +#define MUONGEOMODEL_MUONGMCHECKCORNERS_H #include "AthenaBaseComps/AthAlgorithm.h" #include "GaudiKernel/NTuple.h" - -#include "GaudiKernel/ServiceHandle.h" -#include "MuonIdHelpers/IMuonIdHelperSvc.h" #include "MuonReadoutGeometry/MuonReadoutElement.h" -#include "MuonIdHelpers/MdtIdHelper.h" -#include "MuonIdHelpers/CscIdHelper.h" -#include "MuonIdHelpers/RpcIdHelper.h" -#include "MuonIdHelpers/TgcIdHelper.h" - -class StoreGateSvc; -class ActiveStoreSvc; using namespace MuonGM; -//namespace MuonGM -// { -// class MuonReadoutElement; -// class MuonDetectorManager; -// } - - -//<<<<<< INLINE PUBLIC FUNCTIONS >>>>>> -//<<<<<< INLINE MEMBER FUNCTIONS >>>>>> class MuonGMCheckCorners: public AthAlgorithm { public: MuonGMCheckCorners(const std::string& name, ISvcLocator* pSvcLocator); - ~MuonGMCheckCorners(); + ~MuonGMCheckCorners()=default; StatusCode initialize(); - StatusCode execute(); - StatusCode finalize(); + StatusCode execute(){return StatusCode::SUCCESS;} private: @@ -82,8 +54,6 @@ class MuonGMCheckCorners: public AthAlgorithm // Pointers to the event StoreGateSvc* p_EventStore; ActiveStoreSvc* p_ActiveStore; - - ServiceHandle<Muon::IMuonIdHelperSvc> m_idHelperSvc {this, "MuonIdHelperSvc", "Muon::MuonIdHelperSvc/MuonIdHelperSvc"}; void checkreadoutcscgeo(); void checkreadoutrpcgeo(); diff --git a/MuonSpectrometer/MuonValidation/MuonRecValidation/MuonTrackPerformance/CMakeLists.txt b/MuonSpectrometer/MuonValidation/MuonRecValidation/MuonTrackPerformance/CMakeLists.txt index cd344f53d157590d7c12d3684ba3a4db861ce9a1..7563469d72a6ff161c660df3eef397391efd6dea 100644 --- a/MuonSpectrometer/MuonValidation/MuonRecValidation/MuonTrackPerformance/CMakeLists.txt +++ b/MuonSpectrometer/MuonValidation/MuonRecValidation/MuonTrackPerformance/CMakeLists.txt @@ -50,7 +50,7 @@ atlas_add_component( MuonTrackPerformance src/*.cxx src/components/*.cxx INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} - LINK_LIBRARIES ${ROOT_LIBRARIES} AtlasHepMCLib AthenaBaseComps xAODEventInfo GaudiKernel MuonIdHelpersLib MuonStationIndexLib MuonSegment MuonRecHelperToolsLib MuonRecToolInterfaces TrkParameters TrkTrack TrkTrackSummary TrkTruthData TrkToolInterfaces StoreGateLib SGtests Identifier EventPrimitives xAODMuon xAODTracking xAODTruth MuonReadoutGeometry MuonClusterizationLib MuonCompetingRIOsOnTrack MuonLayerEvent MuonPrepRawData MuonRIO_OnTrack MuonLayerHough MuonRecValidationNtuples MuonCombinedEvent TrkMeasurementBase TrkPrepRawData TrkExInterfaces ) + LINK_LIBRARIES ${ROOT_LIBRARIES} AtlasHepMCLib AthenaBaseComps xAODEventInfo GaudiKernel MuonIdHelpersLib MuonStationIndexLib MuonSegment MuonRecHelperToolsLib MuonRecToolInterfaces TrkParameters TrkTrack TrkTrackSummary TrkTruthData TrkToolInterfaces StoreGateLib SGtests Identifier EventPrimitives xAODMuon xAODTracking xAODTruth MuonReadoutGeometry MuonClusterizationLib MuonCompetingRIOsOnTrack MuonLayerEvent MuonPrepRawData MuonRIO_OnTrack MuonLayerHough MuonRecValidationNtuples MuonCombinedEvent TrkMeasurementBase TrkPrepRawData TrkExInterfaces TrackRecordLib ) # Install files from the package: atlas_install_headers( MuonTrackPerformance ) diff --git a/PhysicsAnalysis/AnalysisCommon/AnalysisTools/src/AANTupleStream.cxx b/PhysicsAnalysis/AnalysisCommon/AnalysisTools/src/AANTupleStream.cxx index 4375cdd5c952e2d297109d42bcdb0e003b83641a..83cd6cd66ed91c976540faade8a65df11031ad2f 100644 --- a/PhysicsAnalysis/AnalysisCommon/AnalysisTools/src/AANTupleStream.cxx +++ b/PhysicsAnalysis/AnalysisCommon/AnalysisTools/src/AANTupleStream.cxx @@ -344,11 +344,7 @@ StatusCode AANTupleStream::execute() void AANTupleStream::writeAttributeListSpecification() { // go to the root dir of output file -#if ROOT_VERSION_CODE >= ROOT_VERSION(6,4,0) TDirectory::TContext save; -#else - TDirectory::TContext save(0); -#endif gDirectory->cd((m_fileName+":/").c_str()); AttributeListLayout all; @@ -384,11 +380,7 @@ void AANTupleStream::setupTree() } // go to the root dir of output file -#if ROOT_VERSION_CODE >= ROOT_VERSION(6,4,0) TDirectory::TContext save; -#else - TDirectory::TContext save(0); -#endif gDirectory->cd((m_fileName+":/").c_str()); // instantiate TTree diff --git a/PhysicsAnalysis/AnalysisCommon/PMGOverlapRemovalTools/GammaORTools/CMakeLists.txt b/PhysicsAnalysis/AnalysisCommon/PMGOverlapRemovalTools/GammaORTools/CMakeLists.txt new file mode 100644 index 0000000000000000000000000000000000000000..32f32efe0d155db2c1c0ba604a442f248d7d21ad --- /dev/null +++ b/PhysicsAnalysis/AnalysisCommon/PMGOverlapRemovalTools/GammaORTools/CMakeLists.txt @@ -0,0 +1,43 @@ +################################################################################ +# Package: GammaORTools +################################################################################ + +# Declare the package name: +atlas_subdir( GammaORTools ) + +# Extra dependencies, based on the environment: +if( XAOD_STANDALONE ) + set( extra_deps Control/xAODRootAccess ) +else() + set( extra_deps Control/AthenaBaseComps GaudiKernel PhysicsAnalysis/POOLRootAccess) +endif() + +# Declare the package's dependencies: +atlas_depends_on_subdirs( + PUBLIC + Control/AthToolSupport/AsgTools + Event/xAOD/xAODTruth + Event/xAOD/xAODEventInfo + PhysicsAnalysis/Interfaces/PMGAnalysisInterfaces + PRIVATE + ${extra_deps} + ) + + +# Libraries in the package: +atlas_add_library( GammaORToolsLib + GammaORTools/*.h Root/*.cxx + PUBLIC_HEADERS GammaORTools + INCLUDE_DIRS + LINK_LIBRARIES AsgTools xAODTruth xAODEventInfo MCTruthClassifierLib ) + +if( NOT XAOD_STANDALONE ) + atlas_add_component( GammaORTools + src/components/*.cxx + LINK_LIBRARIES AthenaBaseComps GaudiKernel GammaORToolsLib) +endif() + +atlas_add_dictionary( GammaORToolsDict + GammaORTools/GammaORToolsDict.h + GammaORTools/selection.xml + LINK_LIBRARIES GammaORToolsLib ) diff --git a/PhysicsAnalysis/AnalysisCommon/PMGOverlapRemovalTools/GammaORTools/GammaORTools/GammaORToolsDict.h b/PhysicsAnalysis/AnalysisCommon/PMGOverlapRemovalTools/GammaORTools/GammaORTools/GammaORToolsDict.h new file mode 100644 index 0000000000000000000000000000000000000000..27e0f230e955be82b55be5ac3574a640a54fbf60 --- /dev/null +++ b/PhysicsAnalysis/AnalysisCommon/PMGOverlapRemovalTools/GammaORTools/GammaORTools/GammaORToolsDict.h @@ -0,0 +1,6 @@ +#ifndef __GAMMAORTOOLSDICT__ +#define __GAMMAORTOOLSDICT__ +#include "GammaORTools/IVGammaORTool.h" +#include "GammaORTools/VGammaORTool.h" + +#endif diff --git a/PhysicsAnalysis/AnalysisCommon/PMGOverlapRemovalTools/GammaORTools/GammaORTools/IVGammaORTool.h b/PhysicsAnalysis/AnalysisCommon/PMGOverlapRemovalTools/GammaORTools/GammaORTools/IVGammaORTool.h new file mode 100644 index 0000000000000000000000000000000000000000..ad6e65e70836d388afac083f45f8ab0d6dbbbb53 --- /dev/null +++ b/PhysicsAnalysis/AnalysisCommon/PMGOverlapRemovalTools/GammaORTools/GammaORTools/IVGammaORTool.h @@ -0,0 +1,101 @@ +/* + Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration +*/ + +#ifndef GAMMAORTOOLS_IVGAMMAORTOOL_H +#define GAMMAORTOOLS_IVGAMMAORTOOL_H + +#include <vector> +#include <map> + +#include <xAODTruth/TruthParticleContainer.h> +#include <xAODTruth/TruthParticle.h> +#include "AsgTools/IAsgTool.h" + +/****************************************************************************//** +* +* This tool can be used to identify the overlap of a V+jets and V+gamma sample +* or in fact between most V^n+gamma^m and V^n+gamma^(m-1) samples +* (e.g. V+gammagamma vs V+gamma or VV+gamma vs VV). +* It can either decide whether an event is in the overlap region for fixed cuts on photons and lepton +* or be used to extract relevant information from the event so that the overlap removal (OR) can be performed +* at a later stage with a simple 'if' statement. +* +* The OR functions (inOverlap(result), photonPtsOutsideDr(result), or photonPtsOutsideDrs(result)), +* set the result via reference and return a status code. +* Usually the tool will take leptons and photons from the current event but this behavior can be +* overwritten by explicitly setting leptons and photons as additional arguments to the functions. +* +* Further documented at +* https://twiki.cern.ch/twiki/bin/viewauth/AtlasProtected/VGammaORTool +* +*********************************************************************************/ + +class IVGammaORTool: virtual public asg::IAsgTool { +public: + ASG_TOOL_INTERFACE(IVGammaORTool) + + /// Determine whether current event is in overlap region (set via reference). + /// The overlap region is defined by dR_lepton_photon_cut, photon_pT_cut + /// and many more configurable parameters. + /// Note that the function returns a status code. + /// The first agument is the result, the remaining arguments are optional: + /// * If null pointers are given for leptons or photons, they will be taken from the event + /// * One can override this behaviour by manually specifying vectors of lepton/photon + // four vectors (can be used if the full truth record is not available or broken) + /// * If lepton or photon origins are given in addition to the lepton four vectors, + /// particles from irrelevant origins (e.g. decays) are filtered out + /// This can be useful when working with derivations which store the origin but not the + /// full truth record + virtual StatusCode inOverlap(bool& result, + const std::vector<TLorentzVector>* leptons=0, + const std::vector<TLorentzVector>* photons=0, + const std::vector<int>* lepton_origins=0, + const std::vector<int>* photon_origins=0) const =0; + + /// Determine the pTs of photons outside the dR cut that is configured in tool initialization + /// (dR_lepton_photon_cut). Calculates a vector of photon pts, ordered by descending pt. + /// Once these values are calculated they can be stored and used to easily perform OR with arbitrary pT. + /// Note that the function returns a status code. + /// The first agument is the result, the remaining arguments are optional + /// * If null pointers are given for leptons or photons, they will be taken from the event + /// * One can override this behaviour by manually specifying vectors of lepton/photon + // four vectors (can be used if the full truth record is not available or broken) + /// * If lepton or photon origins are given in addition to the lepton four vectors, + /// particles from irrelevant origins (e.g. decays) are filtered out + /// This can be useful when working with derivations which store the origin but not the + /// full truth record + virtual StatusCode photonPtsOutsideDr(std::vector<float>& result, + const std::vector<TLorentzVector>* leptons=0, + const std::vector<TLorentzVector>* photons=0, + const std::vector<int>* lepton_origins=0, + const std::vector<int>* photon_origins=0) const=0; + + /// Determine the pTs of photons outside of several dR cuts that are configured in tool initialization + /// (dR_lepton_photon_cuts). Calculates a mapping between dRs and vector of photon pts (ordered by descending pt). + /// Once these values are calculated they can be stored and used to easily perform OR with arbitrary pT + /// and multiple dR cuts. Note that the function returns a status code. + /// The first agument is the result, the remaining arguments are optional + /// * If null pointers are given for leptons or photons, they will be taken from the event + /// * One can override this behaviour by manually specifying vectors of lepton/photon + // four vectors (can be used if the full truth record is not available or broken) + /// * If lepton or photon origins are given in addition to the lepton four vectors, + /// particles from irrelevant origins (e.g. decays) are filtered out + /// This can be useful when working with derivations which store the origin but not the + /// full truth record + virtual StatusCode photonPtsOutsideDrs(std::map<float, std::vector<float> >& result, + const std::vector<TLorentzVector>* leptons=0, + const std::vector<TLorentzVector>* photons=0, + const std::vector<int>* lepton_origins=0, + const std::vector<int>* photon_origins=0) const=0; + + /// Function determining whether a photon is frixione isolated from truthParticles + /// Parameters as defined in https://arxiv.org/pdf/hep-ph/9801442 + virtual bool frixioneIsolated(const xAOD::TruthParticle& photon, + const xAOD::TruthParticleContainer& truthParticles, + float dR0, float exponent, float epsilon) const=0; +}; + + + +#endif //> !GAMMAORTOOLS_IVGAMMAORTOOL_H diff --git a/PhysicsAnalysis/AnalysisCommon/PMGOverlapRemovalTools/GammaORTools/GammaORTools/VGammaORTool.h b/PhysicsAnalysis/AnalysisCommon/PMGOverlapRemovalTools/GammaORTools/GammaORTools/VGammaORTool.h new file mode 100644 index 0000000000000000000000000000000000000000..4cadb77b1810f156ab513d16f0f5b63d03934d69 --- /dev/null +++ b/PhysicsAnalysis/AnalysisCommon/PMGOverlapRemovalTools/GammaORTools/GammaORTools/VGammaORTool.h @@ -0,0 +1,208 @@ +/* + Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration +*/ + +#ifndef GAMMAORTOOLS_VGAMMAORTOOL_H +#define GAMMAORTOOLS_VGAMMAORTOOL_H + +#include <vector> +#include <map> +#include <string> +#include "boost/current_function.hpp" +#include "MCTruthClassifier/MCTruthClassifier.h" +#include <xAODTruth/TruthParticleContainer.h> +#include <xAODTruth/TruthParticle.h> +#include "AsgTools/AsgTool.h" +#include "AsgTools/AnaToolHandle.h" +#include "GammaORTools/IVGammaORTool.h" + +/****************************************************************************//** +* +* This tool can be used to identify the overlap of a V+jets and V+gamma sample +* or in fact between most V^n+gamma^m and V^n+gamma^(m-1) samples +* (e.g. V+gammagamma vs V+gamma or VV+gamma vs VV). +* It can either decide whether an event is in the overlap region for fixed cuts on photons and lepton +* or be used to extract relevant information from the event so that the overlap removal (OR) can be performed +* at a later stage with a simple 'if' statement. +* +* The OR functions (inOverlap(result), photonPtsOutsideDr(result), or photonPtsOutsideDrs(result)), +* set the result via reference and return a status code. +* Usually the tool will take leptons and photons from the current event but this behavior can be +* overwritten by explicitly setting leptons and photons as additional arguments to the functions. +* +* Further documented at +* https://twiki.cern.ch/twiki/bin/viewauth/AtlasProtected/VGammaORTool +* +*********************************************************************************/ + +class VGammaORTool: public asg::AsgTool, virtual public IVGammaORTool { + ASG_TOOL_CLASS(VGammaORTool, IVGammaORTool) +public: + VGammaORTool(const std::string& name); + virtual ~VGammaORTool() override; + + /// Determine whether current event is in overlap region (set via reference). + /// The overlap region is defined by dR_lepton_photon_cut, photon_pT_cut + /// and many more configurable parameters. + /// Note that the function returns a status code. + /// The first agument is the result, the remaining arguments are optional: + /// * If null pointers are given for leptons or photons, they will be taken from the event + /// * One can override this behaviour by manually specifying vectors of lepton/photon + // four vectors (can be used if the full truth record is not available or broken) + /// * If lepton or photon origins are given in addition to the lepton four vectors, + /// particles from irrelevant origins (e.g. decays) are filtered out + /// This can be useful when working with derivations which store the origin but not the + /// full truth record + virtual StatusCode inOverlap(bool& result, + const std::vector<TLorentzVector>* leptons=0, + const std::vector<TLorentzVector>* photons=0, + const std::vector<int>* lepton_origins=0, + const std::vector<int>* photon_origins=0) const override; + + /// Determine the pTs of photons outside the dR cut that is configured in tool initialization + /// (dR_lepton_photon_cut). Calculates a vector of photon pts, ordered by descending pt. + /// Once these values are calculated they can be stored and used to easily perform OR with arbitrary pT. + /// Note that the function returns a status code. + /// The first agument is the result, the remaining arguments are optional + /// * If null pointers are given for leptons or photons, they will be taken from the event + /// * One can override this behaviour by manually specifying vectors of lepton/photon + // four vectors (can be used if the full truth record is not available or broken) + /// * If lepton or photon origins are given in addition to the lepton four vectors, + /// particles from irrelevant origins (e.g. decays) are filtered out + /// This can be useful when working with derivations which store the origin but not the + /// full truth record + virtual StatusCode photonPtsOutsideDr(std::vector<float>& result, + const std::vector<TLorentzVector>* leptons=0, + const std::vector<TLorentzVector>* photons=0, + const std::vector<int>* lepton_origins=0, + const std::vector<int>* photon_origins=0) const override; + + /// Determine the pTs of photons outside of several dR cuts that are configured in tool initialization + /// (dR_lepton_photon_cuts). Calculates a mapping between dRs and vector of photon pts (ordered by descending pt). + /// Once these values are calculated they can be stored and used to easily perform OR with arbitrary pT + /// and multiple dR cuts. Note that the function returns a status code. + /// The first agument is the result, the remaining arguments are optional + /// * If null pointers are given for leptons or photons, they will be taken from the event + /// * One can override this behaviour by manually specifying vectors of lepton/photon + // four vectors (can be used if the full truth record is not available or broken) + /// * If lepton or photon origins are given in addition to the lepton four vectors, + /// particles from irrelevant origins (e.g. decays) are filtered out + /// This can be useful when working with derivations which store the origin but not the + /// full truth record + virtual StatusCode photonPtsOutsideDrs(std::map<float, std::vector<float> >& result, + const std::vector<TLorentzVector>* leptons=0, + const std::vector<TLorentzVector>* photons=0, + const std::vector<int>* lepton_origins=0, + const std::vector<int>* photon_origins=0) const override; + + /// Function determining whether a photon is frixione isolated from truthParticles + /// Parameters as defined in https://arxiv.org/pdf/hep-ph/9801442 + virtual bool frixioneIsolated(const xAOD::TruthParticle& photon, + const xAOD::TruthParticleContainer& truthParticles, + float dR0, float exponent, float epsilon) const override; + + + /// Get final state (determined by status and barcode) photons (determined by pdg id) from truthParticleContainer + /// A minimum pT cut and isolation is applied according to tool configuration + /// Filter function is applied, only photons from relevant origins are kept + std::vector<TLorentzVector> getPhotonP4s(const xAOD::TruthParticleContainer& truthParticleContainer) const; + + /// Get final state (determined by status and barcode) leptons (determined by pdg id) from truthParticleContainer + /// Filter function is applied, only leptons from relevant origins are kept + std::vector<TLorentzVector> getLeptonP4s(const xAOD::TruthParticleContainer& truthParticleContainer) const; + +private: + + // This function performs the actual algorithm needed for OR, if one of the public functions is called + // It returns a vector of ordered photon pTs for multiple lepton-photon dR cuts + StatusCode photonPtsOutsideDrs(std::map<float, std::vector<float> >& result, + const std::vector<float>& drCuts, + const std::vector<TLorentzVector>* leptons=0, + const std::vector<TLorentzVector>* photons=0, + const std::vector<int>* lepton_origins=0, + const std::vector<int>* photon_origins=0) const; + + // Set the right leptons, get them either from user or the current event + StatusCode setInput(std::vector<TLorentzVector>& leptons_out, + std::vector<TLorentzVector>& photons_out, + const std::vector<TLorentzVector>* lepton_p4s, + const std::vector<TLorentzVector>* photon_p4s, + const std::vector<int>* lepton_origins, + const std::vector<int>* photon_origins) const; + + // Filter out photons whose origin is among the veto origins (typically photons from hadron decays) + std::vector<TLorentzVector> filterPhotonOrigins(const std::vector<TLorentzVector>&, const std::vector<int>&) const; + + // Filter out leptons whose origin is among the veto origins (typically photons from hadron decays) + // Return list containing all leptons from prefered origins (from hard process) first + // As fallback leptons from origins not explictly vetoed (e.g. unkown origins) are added at the end of the list + std::vector<TLorentzVector> filterLeptonOrigins(const std::vector<TLorentzVector>&, const std::vector<int>&) const; + + // Check whether a lepton originates from tau decay + bool isFromTau(const xAOD::TruthParticle& lepton, int nRecursions=0) const; + + // Internal helper function to check wheter photon pTs are compatible with configured overlap cuts + bool checkPhotonPts(const std::vector<float>& photon_pts) const; + + // Implementation of Eq 3.4 in https://arxiv.org/pdf/hep-ph/9801442 + float frixioneFunc(float dR, float dR0, float exponent, float epsilon) const; + + // MCTruthClassifier + asg::AnaToolHandle<MCTruthClassifier> m_truthClassifier; + + // CONFIGURATION ================================================= + + // Maximum barcode considered for final state particles (exclude particles from Geant) + int m_max_barcode; + + // Number of leptons expected in process (e.g. 2 for Z+gamma, 1 for W+gamma, 4 for ZZ+gamma) + // If this is set to a negative number, all possible leptons are considered + // Per default this includes leptons from unkown origins, so it is more robuts to set a positive value + // for m_n_leptons as a upper limit + int m_n_leptons; + // Lepton flavours considered, signed pdgIds (only relevant if leptons are not provided by user) + // If possible, restricting flavors can increase the robustness + std::vector<int> m_lepton_pdgIds; + // Lepton origins preferred when searching prompt leptons + // These origins should be associated with the hard process + // Origin codes are defined here: + // https://svnweb.cern.ch/trac/atlasoff/browser/PhysicsAnalysis/MCTruthClassifier/trunk/MCTruthClassifier/MCTruthClassifierDefs.h + std::vector<int> m_preferred_lepton_origins; + // Lepton origins of leptons never used as prompt + // These should be e.g. hadron origins + std::vector<int> m_lepton_veto_origins; + + // Photon origins vetoed when searching prompt leptons + // These should be photons from hadron/tau decays + // Origin codes are defined here: + // https://svnweb.cern.ch/trac/atlasoff/browser/PhysicsAnalysis/MCTruthClassifier/trunk/MCTruthClassifier/MCTruthClassifierDefs.h + std::vector<int> m_veto_photon_origins; + + // p_T (y) cut(s) used in inOverlap function -- only 1 for Vgamma OR, 2 for Vgammagamma + std::vector<float> m_photon_pT_cuts; + // delta R (l,y) cut for used in inOverlap and photonPtsOutsideDr function + float m_dR_lepton_photon_cut; + // List of dR cuts for which the highest photon pT will be determined by photonPtsOutsideDrs function + std::vector<float> m_dR_lepton_photon_cuts; + + // Require photons to be Frixione isolated (https://arxiv.org/abs/hep-ph/9801442)? + bool m_use_gamma_iso; + // Isolation cone used for Frixione isolation + float m_frixione_dR; + // exponent in Eq 3.4 in https://arxiv.org/pdf/hep-ph/9801442 + float m_frixione_exponent; + // epsilon in Eq 3.4 in https://arxiv.org/pdf/hep-ph/9801442 + float m_frixione_epsilon; + // Which stable particles are *not* considered in isolation? Usually leptons and photons. + std::vector<int> m_abs_pdgids_excluded_from_iso; + + // Minimum photon pT considered in algorithm -- increase speeds up algorithm as less photons need to be classified + float m_min_considered_photon_pT; + + // Name of truth particle collection + std::string m_truthparticle_collection_name; +}; + + + +#endif //> !GAMMAORTOOLS_VGAMMAORTOOL_H diff --git a/PhysicsAnalysis/AnalysisCommon/PMGOverlapRemovalTools/GammaORTools/GammaORTools/selection.xml b/PhysicsAnalysis/AnalysisCommon/PMGOverlapRemovalTools/GammaORTools/GammaORTools/selection.xml new file mode 100644 index 0000000000000000000000000000000000000000..17b9ee6f2ef82fbed9a31fdfeadb83c0e0aee4f5 --- /dev/null +++ b/PhysicsAnalysis/AnalysisCommon/PMGOverlapRemovalTools/GammaORTools/GammaORTools/selection.xml @@ -0,0 +1,4 @@ +<lcgdict> + <class name="IVGammaORTool" /> + <class name="VGammaORTool" /> +<lcgdict> diff --git a/PhysicsAnalysis/AnalysisCommon/PMGOverlapRemovalTools/GammaORTools/Root/VGammaORTool.cxx b/PhysicsAnalysis/AnalysisCommon/PMGOverlapRemovalTools/GammaORTools/Root/VGammaORTool.cxx new file mode 100644 index 0000000000000000000000000000000000000000..9ae7b1e933cf594ef3b1c7e8eba92b3059246a19 --- /dev/null +++ b/PhysicsAnalysis/AnalysisCommon/PMGOverlapRemovalTools/GammaORTools/Root/VGammaORTool.cxx @@ -0,0 +1,410 @@ +/* + Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration +*/ + +#include "GammaORTools/VGammaORTool.h" + +VGammaORTool::VGammaORTool(const std::string& name) + : asg::AsgTool(name), + m_truthClassifier("MCTruthClassifier",this) { + + declareProperty("max_barcode", m_max_barcode = 1e5); + + declareProperty("n_leptons", m_n_leptons = -2); + declareProperty("lepton_pdgIds", m_lepton_pdgIds = {11, -11, 13, -13, 15, -15}); + declareProperty("veto_lepton_origins", m_lepton_veto_origins = {3, 5, 6, 7, 8, 9, 23, 24, 25, 26, 27, 28, 29, 30, 31, + 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42}); + declareProperty("preferred_lepton_origins", m_preferred_lepton_origins = {1, 2, 4, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21}); + + declareProperty("veto_photon_origins", m_veto_photon_origins = {9, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, + 42}); + + declareProperty("photon_pT_cuts", m_photon_pT_cuts = {}); + declareProperty("dR_lepton_photon_cut", m_dR_lepton_photon_cut = 0.1); + declareProperty("dR_lepton_photon_cuts", m_dR_lepton_photon_cuts = {0.0, 0.05, 0.075, 0.1, 0.125, 0.15, 0.2}); + + declareProperty("use_gamma_iso", m_use_gamma_iso = false); + declareProperty("frixione_dR", m_frixione_dR = 0.1); + declareProperty("frixione_exponent", m_frixione_exponent = 2); + declareProperty("frixione_epsilon", m_frixione_epsilon = 0.1); + declareProperty("abs_pdgids_excluded_from_iso", m_abs_pdgids_excluded_from_iso = {11, 12, 13, 14, 15, 16, 22}); + declareProperty("min_considered_photon_pT", m_min_considered_photon_pT = 3.e3); + + declareProperty("truthparticle_collection_name", m_truthparticle_collection_name = "TruthParticles"); + + for (int origin : m_preferred_lepton_origins) { + if (std::find(m_lepton_veto_origins.begin(), m_lepton_veto_origins.end(), origin) != m_lepton_veto_origins.end()) { + ATH_MSG_ERROR(origin << " in both lepton origin and lepton veto origin, this is not correct."); + break; + } + } + // pT cuts are sorted in descending order + std::sort(m_photon_pT_cuts.begin(), m_photon_pT_cuts.end(), std::greater<float>()); +} + +VGammaORTool::~VGammaORTool() { +} + + +//============================================================================ +// PUBLIC IN OVERLAP FUNCTION +// See header for description +StatusCode VGammaORTool::inOverlap(bool& result, + const std::vector<TLorentzVector>* leptons, + const std::vector<TLorentzVector>* photons, + const std::vector<int>* lepton_origins, + const std::vector<int>* photon_origins) const { + std::vector<float> photon_pts; + ANA_CHECK(photonPtsOutsideDr(photon_pts,leptons,photons,lepton_origins,photon_origins)); + result = checkPhotonPts(photon_pts); + return StatusCode::SUCCESS; +} + +//============================================================================ +// PUBLIC PTS OUTSIDE DR FUNCTION +// See header for description +StatusCode VGammaORTool::photonPtsOutsideDr(std::vector<float>& result, + const std::vector<TLorentzVector>* leptons, + const std::vector<TLorentzVector>* photons, + const std::vector<int>* lepton_origins, + const std::vector<int>* photon_origins) const { + std::map<float, std::vector<float> > photon_pt_map; + ANA_CHECK(photonPtsOutsideDrs(photon_pt_map,std::vector<float>(1, m_dR_lepton_photon_cut),leptons,photons,lepton_origins,photon_origins)); + result = photon_pt_map[m_dR_lepton_photon_cut]; + return StatusCode::SUCCESS; +} + +//============================================================================ +// PUBLIC PTS OUTSIDE DR*S* FUNCTION +// See header for description +StatusCode VGammaORTool::photonPtsOutsideDrs(std::map<float, std::vector<float> >& result, + const std::vector<TLorentzVector>* leptons, + const std::vector<TLorentzVector>* photons, + const std::vector<int>* lepton_origins, + const std::vector<int>* photon_origins) const { + ANA_CHECK(photonPtsOutsideDrs(result,m_dR_lepton_photon_cuts,leptons,photons,lepton_origins,photon_origins)); + return StatusCode::SUCCESS; +} + + +//============================================================================ +// PRIVATE PTS OUTSIDE DRS FUNCTION +// This function exectutes the OR algorithm if one of the public funtions is called +StatusCode VGammaORTool::photonPtsOutsideDrs(std::map<float, std::vector<float> >& result, + const std::vector<float>& drCuts, + const std::vector<TLorentzVector>* leptons, + const std::vector<TLorentzVector>* photons, + const std::vector<int>* lepton_origins, + const std::vector<int>* photon_origins) const { + + std::vector<TLorentzVector> good_leptons; + std::vector<TLorentzVector> good_photons; + ANA_CHECK(setInput(good_leptons,good_photons,leptons,photons,lepton_origins,photon_origins)); + + // the actual OR algorithm is here, pts of photon outside dRs are determined first + for (const auto& drCut : drCuts) { + result[drCut] = std::vector<float>(); + for (const auto& photon : good_photons) { + bool tooCloseToLepton = false; + for (uint i_lep = 0; i_lep < good_leptons.size() && (m_n_leptons<0 || int(i_lep) < m_n_leptons); i_lep++) { + const float dr = photon.DeltaR(good_leptons[i_lep]); + if (dr < drCut) { + tooCloseToLepton = true; + break; + } + } + if (!tooCloseToLepton) { + result[drCut].push_back(photon.Pt()); + } + } + // photon pts are sorted and returned + sort(result[drCut].begin(), result[drCut].end(), std::greater<float>()); + } + + return StatusCode::SUCCESS; +} + +//============================================================================ +// find the right leptons, get them either from user or the current event +StatusCode VGammaORTool::setInput(std::vector<TLorentzVector>& leptons_out, + std::vector<TLorentzVector>& photons_out, + const std::vector<TLorentzVector>* lepton_p4s, + const std::vector<TLorentzVector>* photon_p4s, + const std::vector<int>* lepton_origins, + const std::vector<int>* photon_origins) const { + + // truth particles are retrieved from event if not given by user + const xAOD::TruthParticleContainer* truthParticles = nullptr; + if(lepton_p4s==0 || photon_p4s==0){ + ANA_CHECK( evtStore()->retrieve(truthParticles, m_truthparticle_collection_name) ); + } + + // relevant photons and leptons identified + if(lepton_p4s==0){ + leptons_out = getLeptonP4s(*truthParticles); + } + else{ + if(lepton_origins!=0){ + leptons_out = filterLeptonOrigins(*lepton_p4s,*lepton_origins); + } + else{ + leptons_out = *lepton_p4s; + } + } + if(photon_p4s==0){ + photons_out = getPhotonP4s(*truthParticles); + } + else{ + if(photon_origins!=0){ + photons_out = filterPhotonOrigins(*photon_p4s,*photon_origins); + } + else{ + photons_out = *photon_p4s; + } + } + + ATH_MSG_DEBUG(BOOST_CURRENT_FUNCTION << ": Found " << photons_out.size() << " photons."); + ATH_MSG_DEBUG(BOOST_CURRENT_FUNCTION << ": Found " << leptons_out.size() << " leptons."); + + if (m_n_leptons >=0 && int(leptons_out.size()) < m_n_leptons) { + ATH_MSG_WARNING( + BOOST_CURRENT_FUNCTION << ": Found " << leptons_out.size() << " leptons but expected " << m_n_leptons << "."); + } + + return StatusCode::SUCCESS; +} + + +//============================================================================ +// Functions to filter out particles from wrong origins +std::vector<TLorentzVector> VGammaORTool::filterPhotonOrigins(const std::vector<TLorentzVector>& photon_candidates, + const std::vector<int>& photon_origins) const { + // this should only happen if the user gives the wrong input + if (photon_candidates.size() != photon_origins.size()) { + ATH_MSG_ERROR( + BOOST_CURRENT_FUNCTION << ": size of photon candidates (" << photon_candidates.size() << ") different from number of photon origins (" << photon_origins.size() << + ")."); + } + // filter out vetoed photons + std::vector<TLorentzVector> photon_p4s; + for (uint i = 0; i < photon_candidates.size(); i++) { + const TLorentzVector p4 = photon_candidates[i]; + const int p_origin = photon_origins[i]; + const bool vetoed = + std::find(m_veto_photon_origins.begin(), m_veto_photon_origins.end(), p_origin) != m_veto_photon_origins.end(); + if (!vetoed) { + photon_p4s.push_back(p4); + } + } + return photon_p4s; +} + +std::vector<TLorentzVector> VGammaORTool::filterLeptonOrigins(const std::vector<TLorentzVector>& lepton_candidates, + const std::vector<int>& lepton_origins) const { + // this should only happen if the user gives the wrong input + if (lepton_candidates.size() != lepton_origins.size()) { + ATH_MSG_ERROR( + BOOST_CURRENT_FUNCTION << ": size of lepton candidates (" << lepton_candidates.size() << ") different from number of lepton origins (" << lepton_origins.size() << + ")."); + } + std::vector<TLorentzVector> lepton_p4s; + std::vector<TLorentzVector> leptons_not_vetoed_p4s; + // find both good photons and photons that are just not vetoed (lower quality, used as fall back) + for (uint i = 0; i < lepton_candidates.size(); i++) { + const TLorentzVector p4 = lepton_candidates[i]; + const int p_origin = lepton_origins[i]; + const bool use = std::find(m_preferred_lepton_origins.begin(), m_preferred_lepton_origins.end(), p_origin) != m_preferred_lepton_origins.end(); + if (use) { + lepton_p4s.push_back(p4); + if (m_n_leptons>=0 && int(lepton_p4s.size()) >= m_n_leptons) { + // as soon as enough leptons are found, return them + // this is why the order of lepton candidates matters + // if this tool identifies the leptons, taus will be before mu/el and otherwise leptons are ordered by pT + // in most cases the origin should unambiguosly identify the lepton anyway + return lepton_p4s; + } + } else { + bool vetoed = + std::find(m_lepton_veto_origins.begin(), m_lepton_veto_origins.end(), p_origin) != m_lepton_veto_origins.end(); + if (!vetoed) { + leptons_not_vetoed_p4s.push_back(p4); + } + } + } + // if not enough good leptons were found (or no expected number of leptons was set), + // the result is filled with leptons that were merely not vetoed + for (const auto& l : leptons_not_vetoed_p4s) { + lepton_p4s.push_back(l); + if (m_n_leptons>=0 && int(lepton_p4s.size()) >= m_n_leptons) { + return lepton_p4s; + } + } + return lepton_p4s; +} + +//============================================================================ +// Get the right leptons and photons from the event +std::vector<TLorentzVector> VGammaORTool::getLeptonP4s(const xAOD::TruthParticleContainer& truthParticles) const { + std::vector<const xAOD::TruthParticle*> tau_candidates; + std::vector<const xAOD::TruthParticle*> elmu_candidates; + for (const auto& p : truthParticles) { + // ignore all particles with geant barcodes + if (p->barcode() > m_max_barcode) { + continue; + } + // ignore all particles with the wrong pdgid + if (std::find(m_lepton_pdgIds.begin(), m_lepton_pdgIds.end(), p->pdgId()) == m_lepton_pdgIds.end()) { + continue; + } + // handle taus: use tau instances before decay into non-tau + if (std::abs(p->pdgId()) == 15) { + bool childIsTau = false; + bool hasChildren = false; + // make sure tau has no tau children, i.e. is tau before decay + for (uint i = 0; i < p->nChildren(); i++) { + if (p->child(i) == nullptr) continue; + if (p->child(i)->barcode() == p->barcode()) continue; + hasChildren = true; + if (p->child(i)->pdgId() == p->pdgId()) { + childIsTau = true; + break; + } + } + if (hasChildren && !childIsTau) { + tau_candidates.push_back(p); + } + } + // electron and muons: use all status 1 not from tau + else if (p->status() == 1 && !isFromTau(*p)) { + elmu_candidates.push_back(p); + } + } + // sort leptons by pT + sort(tau_candidates.begin(), tau_candidates.end(), + [](const xAOD::TruthParticle*& p1, const xAOD::TruthParticle*& p2) { + return p1->pt() > p2->pt(); + }); + sort(elmu_candidates.begin(), elmu_candidates.end(), + [](const xAOD::TruthParticle*& p1, const xAOD::TruthParticle*& p2) { + return p1->pt() > p2->pt(); + }); + // put taus before other leptons in a vector + std::vector<const xAOD::TruthParticle*> lepton_candidates(tau_candidates); + lepton_candidates.insert(lepton_candidates.end(), elmu_candidates.begin(), elmu_candidates.end()); + // determine lepton origins + std::vector<TLorentzVector> lepton_p4s; + std::vector<int> lepton_origins; + for (const auto& p : lepton_candidates) { + auto res = const_cast<asg::AnaToolHandle<MCTruthClassifier>*>(&m_truthClassifier)->get()->particleTruthClassifier(p); + lepton_origins.push_back(res.second); + lepton_p4s.push_back(p->p4()); + } + // filter out bad origins + return filterLeptonOrigins(lepton_p4s, lepton_origins); +} + +std::vector<TLorentzVector> VGammaORTool::getPhotonP4s(const xAOD::TruthParticleContainer& truthParticles) const { + std::vector<TLorentzVector> photon_p4s; + std::vector<int> photon_origins; + for (const auto& p : truthParticles) { + // consider only final state photons, not from geant, above a lower pt cut + if (p->status() != 1 || p->barcode() > m_max_barcode || p->pdgId() != 22 || p->pt() < m_min_considered_photon_pT) { + continue; + } + // require photons to be isolated if use_gamma_iso is true + if (m_use_gamma_iso && + !frixioneIsolated(*p, truthParticles, m_frixione_dR, m_frixione_exponent, m_frixione_epsilon)) { + continue; + } + // determine photon origin + auto res = const_cast<asg::AnaToolHandle<MCTruthClassifier>*>(&m_truthClassifier)->get()->particleTruthClassifier(p); + photon_origins.push_back(res.second); + photon_p4s.push_back(p->p4()); + } + // filter out bad photons + return filterPhotonOrigins(photon_p4s, photon_origins); +} + +bool VGammaORTool::isFromTau(const xAOD::TruthParticle& lepton, int nRecursions) const{ + // avoid being stuck in some weird particle family tree + if(nRecursions>20){ + return false; + } + for(uint i=0; i<lepton.nParents(); i++){ + const xAOD::TruthParticle* parent=lepton.parent(i); + if(abs(parent->pdgId())==15){ + return true; + } + if(parent->pdgId()==lepton.pdgId()){ + return isFromTau(lepton, nRecursions+1); + } + } + return false; + +} + +bool VGammaORTool::checkPhotonPts(const std::vector<float>& photon_pts) const{ + if(m_photon_pT_cuts.size()==0){ + ATH_MSG_ERROR("photon_pT_cuts needs to be a non-empty list, when inOverlap is called, set as property or in constructor."); + return false; + } + if(m_photon_pT_cuts.size()>photon_pts.size()){ + return false; + } + for(uint i=0; i<m_photon_pT_cuts.size();i++){ + if(photon_pts[i]<m_photon_pT_cuts[i]){ + return false; + } + } + return true; +} +//============================================================================ +// Functions related to photon isolation +bool VGammaORTool::frixioneIsolated(const xAOD::TruthParticle& photon, + const xAOD::TruthParticleContainer& truthParticles, float dR0, float exponent, + float epsilon) const { + // all photons are isolated if dR is negative + if (dR0 <= 0.) { + return true; + } + // create map between hadron-photon dr and hadron pt + std::map<float, float> dr_to_pt; + for (const auto& p : truthParticles) { + // consider status 1 not from geant + if (p->status() != 1 || p->barcode() > m_max_barcode) { + continue; + } + // ignore what typically is leptons and photons + if (std::find(m_abs_pdgids_excluded_from_iso.begin(), m_abs_pdgids_excluded_from_iso.end(), + std::abs(p->pdgId())) != m_abs_pdgids_excluded_from_iso.end()) { + continue; + } + const float dRgamma = photon.p4().DeltaR(p->p4()); + // consider only photons withon isolation cone dR0 + if (dRgamma < dR0) { + // should two hadrons have the same dr they are added up + if (dr_to_pt.count(dRgamma) > 0) { + dr_to_pt[dRgamma] += p->pt(); + } + dr_to_pt[dRgamma] = p->pt(); + } + } + // use map to determine whether photon is Frixione isolated + // map is sorted from low to high dr + float sumPt = 0.; + for (const auto& pair : dr_to_pt) { + sumPt += pair.second; + const float dRgamma = pair.first; + // if for any dRgamma the sum of pt of hadrons with a distrance of <=dRgamma to photon + // does not fulfill the Frixione condition, the photon is not isolated + if (sumPt > photon.pt() * frixioneFunc(dRgamma, dR0, exponent, epsilon)) { + return false; + } + } + // otherwise the photon is isolated + return true; +} + +float VGammaORTool::frixioneFunc(float dR, float dR0, float exponent, float epsilon) const { + return epsilon * TMath::Power((1 - TMath::Cos(dR)) / (1 - TMath::Cos(dR0)), exponent); +} diff --git a/PhysicsAnalysis/AnalysisCommon/PMGOverlapRemovalTools/GammaORTools/src/components/GammaORTools_load.cxx b/PhysicsAnalysis/AnalysisCommon/PMGOverlapRemovalTools/GammaORTools/src/components/GammaORTools_load.cxx new file mode 100644 index 0000000000000000000000000000000000000000..486992631719a8632a25a8688b78bb8e3fba32c6 --- /dev/null +++ b/PhysicsAnalysis/AnalysisCommon/PMGOverlapRemovalTools/GammaORTools/src/components/GammaORTools_load.cxx @@ -0,0 +1,5 @@ +#include "GammaORTools/VGammaORTool.h" + +DECLARE_COMPONENT( VGammaORTool ) + + diff --git a/PhysicsAnalysis/AthenaROOTAccess/src/DVCollectionProxy.cxx b/PhysicsAnalysis/AthenaROOTAccess/src/DVCollectionProxy.cxx index 93df24a19ff1af653058e3d5e4e0fd021eed46c6..32bde20c1a98283b21b9d0a7e2d6d63cc7267ece 100755 --- a/PhysicsAnalysis/AthenaROOTAccess/src/DVCollectionProxy.cxx +++ b/PhysicsAnalysis/AthenaROOTAccess/src/DVCollectionProxy.cxx @@ -270,17 +270,10 @@ public: return 0; } /// Not implemented for AthenaROOTAccess. -#if ROOT_VERSION_CODE >= ROOT_VERSION(5,34,6) static void* collect(void* /*from*/, void* /*to*/) { ::Fatal("DVCollectionProxy", "collect not implemented"); return 0; } -#else - static void* collect(void* /*env*/) { - ::Fatal("DVCollectionProxy", "collect not implemented"); - return 0; - } -#endif }; @@ -313,11 +306,7 @@ DVCollectionProxy::DVCollectionProxy (const char* elttype, fNext.call = DVCollectionFuncs::next; fFirst.call = DVCollectionFuncs::first; fClear.call = DVCollectionFuncs::clear; -#if ROOT_VERSION_CODE >= ROOT_VERSION(5,34,6) fCollect = DVCollectionFuncs::collect; -#else - fCollect.call = DVCollectionFuncs::collect; -#endif fCreateEnv.call = DVCollectionFuncs::create_env; fResize = DVCollectionFuncs::resize; fConstruct = DVCollectionFuncs::construct; diff --git a/PhysicsAnalysis/AthenaROOTAccess/src/TBranchAlias.cxx b/PhysicsAnalysis/AthenaROOTAccess/src/TBranchAlias.cxx index eea42bf1ec5b1acf45903b5afac025bf1a157949..f6873beaf1168bd17be584572934de3cb503eb29 100644 --- a/PhysicsAnalysis/AthenaROOTAccess/src/TBranchAlias.cxx +++ b/PhysicsAnalysis/AthenaROOTAccess/src/TBranchAlias.cxx @@ -27,11 +27,6 @@ #include "TLeafObject.h" -#if ! (ROOT_VERSION_CODE >= ROOT_VERSION(6,1,0) || (ROOT_VERSION_CODE>=ROOT_VERSION(5,34,22) && ROOT_VERSION_CODE<ROOT_VERSION(6,0,0))) -R__EXTERN TTree* gTree; -#endif - - namespace AthenaROOTAccess { @@ -184,11 +179,6 @@ TBranchAlias* TBranchAlias::addToTree (TTreeTrans* tree, const char* targ_branchname, const char* aux_branchname /*= ""*/) { -#if ! (ROOT_VERSION_CODE >= ROOT_VERSION(6,1,0) || (ROOT_VERSION_CODE>=ROOT_VERSION(5,34,22) && ROOT_VERSION_CODE<ROOT_VERSION(6,0,0))) - // Needed by the Root code... - gTree = tree; -#endif - // May be needed by constructors. TTreeTrans::Push save_tree (tree); diff --git a/PhysicsAnalysis/AthenaROOTAccess/src/TBranchTPConvert.cxx b/PhysicsAnalysis/AthenaROOTAccess/src/TBranchTPConvert.cxx index 4ff02d180020ef1dbfbaa8fadc17ac98379b68f2..b64b3348c8fd500202586841713cc116a61d0e88 100755 --- a/PhysicsAnalysis/AthenaROOTAccess/src/TBranchTPConvert.cxx +++ b/PhysicsAnalysis/AthenaROOTAccess/src/TBranchTPConvert.cxx @@ -35,11 +35,6 @@ #include <stdexcept> -#if ! (ROOT_VERSION_CODE >= ROOT_VERSION(6,1,0) || (ROOT_VERSION_CODE>=ROOT_VERSION(5,34,22) && ROOT_VERSION_CODE<ROOT_VERSION(6,0,0))) -R__EXTERN TTree* gTree; -#endif - - namespace { // Helper to increment/decrement a value with exception protection. struct Inc @@ -322,11 +317,6 @@ TBranchTPConvert::addToTree (TTreeTrans* tree, clsname = cl->GetName(); } -#if ! (ROOT_VERSION_CODE >= ROOT_VERSION(6,1,0) || (ROOT_VERSION_CODE>=ROOT_VERSION(5,34,22) && ROOT_VERSION_CODE<ROOT_VERSION(6,0,0))) - // Required for creating a new TBranch. - gTree = tree; -#endif - // May be needed by constructors. TTreeTrans::Push save_tree (tree); diff --git a/PhysicsAnalysis/D3PDMaker/D3PDMakerReader/src/CodeGenerator_v2_constants.h b/PhysicsAnalysis/D3PDMaker/D3PDMakerReader/src/CodeGenerator_v2_constants.h index f55e63be244b864754acfd0269fdaddf4c7273b6..1b2e3b14a3a94c84b88d60bfe2917bd7e830f4ff 100644 --- a/PhysicsAnalysis/D3PDMaker/D3PDMakerReader/src/CodeGenerator_v2_constants.h +++ b/PhysicsAnalysis/D3PDMaker/D3PDMakerReader/src/CodeGenerator_v2_constants.h @@ -1949,13 +1949,8 @@ static const char* D3PDPERFSTATS_HEADER = " const char *filename, ::Bool_t isStart );\n" " virtual void FileOpenEvent( ::TFile *file, const char *filename, ::Double_t start );\n" " virtual void FileReadEvent( ::TFile *file, ::Int_t len, ::Double_t start );\n" - "#if ROOT_VERSION_CODE < ROOT_VERSION( 5, 99, 0 )\n" - " virtual void FileUnzipEvent( ::TFile *file, ::Long64_t pos, ::Double_t start, ::Int_t complen,\n" - " ::Int_t objlen );\n" - "#else\n" " virtual void UnzipEvent( ::TObject* tree, ::Long64_t pos, ::Double_t start,\n" " ::Int_t complen, ::Int_t objlen );\n" - "#endif // ROOT 6\n" " virtual void RateEvent( ::Double_t proctime, ::Double_t deltatime,\n" " ::Long64_t eventsprocessed, ::Long64_t bytesRead );\n" " virtual void SetBytesRead( ::Long64_t num );\n" @@ -2161,31 +2156,10 @@ static const char* D3PDPERFSTATS_CXX = " }\n\n" " return;\n" " }\n\n" - "#if ROOT_VERSION_CODE < ROOT_VERSION( 5, 99, 0 )\n" - " void D3PDPerfStats::FileUnzipEvent( ::TFile* file, ::Long64_t pos, ::Double_t start,\n" - " ::Int_t complen, ::Int_t objlen ) {\n\n" - " // Do the calculation without delay:\n" - " const ::Double_t tnow = TTimeStamp();\n" - " const ::Double_t dtime = tnow - start;\n\n" - " // Do nothing if we're not running:\n" - " if( ( ! fRunning ) || ( file != fFile ) ) return;\n\n" - " // Just accumulate the zipping time statistics:\n" - " fStats.SetUnzipTime( fStats.GetUnzipTime() + dtime );\n\n" - " // This function was only added in a 5.28 patch...\n" - "#if ROOT_VERSION_CODE > ROOT_VERSION( 5, 28, 0 )\n" - " // Forward the call if possible:\n" - " if( fOtherPerfStats ) {\n" - " fOtherPerfStats->FileUnzipEvent( file, pos, start, complen, objlen );\n" - " }\n" - "#endif // ROOT_VERSION...\n\n" - " return;\n" - " }\n" - "#else\n" " void D3PDPerfStats::UnzipEvent( ::TObject*, ::Long64_t, ::Double_t, ::Int_t,\n" " ::Int_t ) {\n\n" " return;\n" " }\n" - "#endif // ROOT 6\n\n" " void D3PDPerfStats::RateEvent( ::Double_t proctime, ::Double_t deltatime,\n" " ::Long64_t eventsprocessed, ::Long64_t bytesRead ) {\n\n" " // Forward the call if possible:\n" diff --git a/PhysicsAnalysis/D3PDMaker/EventCommonD3PDMaker/CMakeLists.txt b/PhysicsAnalysis/D3PDMaker/EventCommonD3PDMaker/CMakeLists.txt index 8603b9517d1eaeae7b75ce35d9da5374dd304acc..42bc81ee00102fbfb5372b0c9f0ac0331d0628b8 100644 --- a/PhysicsAnalysis/D3PDMaker/EventCommonD3PDMaker/CMakeLists.txt +++ b/PhysicsAnalysis/D3PDMaker/EventCommonD3PDMaker/CMakeLists.txt @@ -19,7 +19,6 @@ atlas_depends_on_subdirs( PRIVATE Event/xAOD/xAODBase Event/xAOD/xAODEventInfo GaudiKernel - LumiBlock/LumiBlockComps PhysicsAnalysis/AnalysisCommon/ParticleEvent PhysicsAnalysis/D3PDMaker/D3PDMakerInterfaces PhysicsAnalysis/D3PDMaker/D3PDMakerUtils @@ -35,7 +34,7 @@ atlas_add_component( EventCommonD3PDMaker src/*.cxx src/components/*.cxx INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} ${Boost_INCLUDE_DIRS} ${CLHEP_INCLUDE_DIRS} - LINK_LIBRARIES ${ROOT_LIBRARIES} ${Boost_LIBRARIES} ${CLHEP_LIBRARIES} AthenaBaseComps AthenaKernel Navigation AthenaPoolUtilities IOVDbDataModel EventBookkeeperMetaData EventKernel FourMomUtils NavFourMom xAODBase xAODEventInfo GaudiKernel LumiBlockCompsLib ParticleEvent D3PDMakerUtils JetEvent ) + LINK_LIBRARIES ${ROOT_LIBRARIES} ${Boost_LIBRARIES} ${CLHEP_LIBRARIES} AthenaBaseComps AthenaKernel Navigation AthenaPoolUtilities IOVDbDataModel EventBookkeeperMetaData EventKernel FourMomUtils NavFourMom xAODBase xAODEventInfo GaudiKernel ParticleEvent D3PDMakerUtils JetEvent ) # Install files from the package: atlas_install_python_modules( python/*.py ) diff --git a/PhysicsAnalysis/D3PDMaker/EventCommonD3PDMaker/src/LBMetadataTool.cxx b/PhysicsAnalysis/D3PDMaker/EventCommonD3PDMaker/src/LBMetadataTool.cxx index ff126eb7d5fae3c5d553694b09888dd5d500cc6d..b7baa88f3f64589b6c3f95fb6e0aae6512a755ed 100644 --- a/PhysicsAnalysis/D3PDMaker/EventCommonD3PDMaker/src/LBMetadataTool.cxx +++ b/PhysicsAnalysis/D3PDMaker/EventCommonD3PDMaker/src/LBMetadataTool.cxx @@ -14,10 +14,9 @@ #include "LBMetadataTool.h" -#include "LumiBlockComps/ILumiBlockMetaDataTool.h" #include "D3PDMakerInterfaces/ID3PD.h" #include "AthenaKernel/errorcheck.h" - +#include "TString.h" namespace D3PD { @@ -31,11 +30,8 @@ namespace D3PD { LBMetadataTool::LBMetadataTool (const std::string& type, const std::string& name, const IInterface* parent) - : AthAlgTool (type, name, parent), - m_lumitool ("LumiBlockMetaDataTool") + : AthAlgTool (type, name, parent) { - declareProperty ("LumiBlockMetaDataTool", m_lumitool, - "The lumi metadata tool."); declareProperty ("Metakey", m_metakey = "Lumi", "Key for output metadata."); } @@ -46,7 +42,6 @@ LBMetadataTool::LBMetadataTool (const std::string& type, */ StatusCode LBMetadataTool::initialize() { - CHECK( m_lumitool.retrieve() ); return AthAlgTool::initialize(); } @@ -73,7 +68,8 @@ LBMetadataTool::queryInterface( const InterfaceID& riid, void** ppvIf ) */ StatusCode LBMetadataTool::writeMetadata (ID3PD* d3pd) { - TString xml = m_lumitool->getUniqueGRLString(); + TString xml; + ATH_MSG_WARNING( "Luminosity metadata not added correctly to the D3PD!" ); CHECK( d3pd->addMetadata (m_metakey, &xml) ); return StatusCode::SUCCESS; } diff --git a/PhysicsAnalysis/D3PDMaker/EventCommonD3PDMaker/src/LBMetadataTool.h b/PhysicsAnalysis/D3PDMaker/EventCommonD3PDMaker/src/LBMetadataTool.h index daeccb39f4ecb7e3468d7268c6158d2b40c2a718..64c3d750f8db1bf8787247f153ba8453e2df5a85 100644 --- a/PhysicsAnalysis/D3PDMaker/EventCommonD3PDMaker/src/LBMetadataTool.h +++ b/PhysicsAnalysis/D3PDMaker/EventCommonD3PDMaker/src/LBMetadataTool.h @@ -19,7 +19,6 @@ #include "D3PDMakerInterfaces/IMetadataTool.h" #include "AthenaBaseComps/AthAlgTool.h" #include "GaudiKernel/ToolHandle.h" -#include "LumiBlockComps/ILumiBlockMetaDataTool.h" namespace D3PD { @@ -60,9 +59,6 @@ public: private: - /// Property: Lumi metadata tool. - ToolHandle<ILumiBlockMetaDataTool> m_lumitool; - /// Key for output metadata. std::string m_metakey; }; diff --git a/PhysicsAnalysis/DerivationFramework/DerivationFrameworkFlavourTag/CMakeLists.txt b/PhysicsAnalysis/DerivationFramework/DerivationFrameworkFlavourTag/CMakeLists.txt new file mode 100644 index 0000000000000000000000000000000000000000..72ae124b92368db0d0384de810eef456b5ff090f --- /dev/null +++ b/PhysicsAnalysis/DerivationFramework/DerivationFrameworkFlavourTag/CMakeLists.txt @@ -0,0 +1,49 @@ +################################################################################ +# Package: DerivationFrameworkFlavourTag +################################################################################ + +# Declare the package name: +atlas_subdir( DerivationFrameworkFlavourTag ) + + +# Declare the package's dependencies: +atlas_depends_on_subdirs( PUBLIC + GaudiKernel + PRIVATE + Control/AthenaBaseComps + Control/AthenaKernel + Event/xAOD/xAODCore + Event/xAOD/xAODJet + Event/xAOD/xAODPFlow + Event/xAOD/xAODTracking + Event/xAOD/xAODTrigger + Event/xAOD/xAODTruth + Event/xAOD/xAODCaloEvent + PhysicsAnalysis/DerivationFramework/DerivationFrameworkInterfaces + PhysicsAnalysis/JetTagging/JetTagPerformanceCalibration/xAODBTaggingEfficiency + PhysicsAnalysis/JetTagging/FlavorTagDiscriminants + Reconstruction/Jet/JetInterface + Reconstruction/Jet/JetCalibTools + Tracking/TrkVertexFitter/TrkVertexFitterInterfaces + Tracking/TrkExtrapolation/TrkExInterfaces + ) + +# Component(s) in the package: +atlas_add_component( DerivationFrameworkFlavourTag + src/*.cxx + src/components/*.cxx + LINK_LIBRARIES GaudiKernel AthenaBaseComps xAODCore xAODJet xAODPFlow + xAODTracking xAODTrigger xAODTruth JetInterface TrkExInterfaces FlavorTagDiscriminants + JetCalibToolsLib) + + +# Install files from the package: +atlas_install_python_modules( python/*.py ) +atlas_install_joboptions( share/*.py ) + +# add the test utility +atlas_add_executable( test_btagging util/test-btagging.cxx ) +atlas_add_executable( test_jet_links util/test-jet-links.cxx ) +target_link_libraries(test_btagging xAODCore xAODJet xAODRootAccess) +target_link_libraries(test_jet_links xAODCore xAODJet xAODRootAccess) + diff --git a/PhysicsAnalysis/DerivationFramework/DerivationFrameworkFlavourTag/python/AntiKtVR30Rmax4Rmin02TrackGhostTagJetsCPContent.py b/PhysicsAnalysis/DerivationFramework/DerivationFrameworkFlavourTag/python/AntiKtVR30Rmax4Rmin02TrackGhostTagJetsCPContent.py new file mode 100644 index 0000000000000000000000000000000000000000..c78a63b8935fae73f45dce72ddc2a1c26c17092c --- /dev/null +++ b/PhysicsAnalysis/DerivationFramework/DerivationFrameworkFlavourTag/python/AntiKtVR30Rmax4Rmin02TrackGhostTagJetsCPContent.py @@ -0,0 +1,8 @@ +# Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration + +from JetFlavorGhostLabels import getJetFlavorGhostLabels + +AntiKtVR30Rmax4Rmin02TrackGhostTagJetsCPContent = [ +"AntiKtVR30Rmax4Rmin02TrackGhostTagJets", +"AntiKtVR30Rmax4Rmin02TrackGhostTagJetsAux.pt.eta.phi.m.HadronConeExclExtendedTruthLabelID.HadronConeExclTruthLabelID." + getJetFlavorGhostLabels(), +] diff --git a/PhysicsAnalysis/DerivationFramework/DerivationFrameworkFlavourTag/python/AntiKtVR30Rmax4Rmin02TrackJetsCPContent.py b/PhysicsAnalysis/DerivationFramework/DerivationFrameworkFlavourTag/python/AntiKtVR30Rmax4Rmin02TrackJetsCPContent.py new file mode 100644 index 0000000000000000000000000000000000000000..0dc0a6129aa1294224d25d622e50837481694870 --- /dev/null +++ b/PhysicsAnalysis/DerivationFramework/DerivationFrameworkFlavourTag/python/AntiKtVR30Rmax4Rmin02TrackJetsCPContent.py @@ -0,0 +1,8 @@ +# Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration + +from JetFlavorGhostLabels import getJetFlavorGhostLabels + +AntiKtVR30Rmax4Rmin02TrackJetsCPContent = [ +"AntiKtVR30Rmax4Rmin02TrackJets_BTagging201810", +"AntiKtVR30Rmax4Rmin02TrackJets_BTagging201810Aux.pt.eta.phi.m.HadronConeExclExtendedTruthLabelID.HadronConeExclTruthLabelID.", +] diff --git a/PhysicsAnalysis/DerivationFramework/DerivationFrameworkFlavourTag/python/AntiKtVR30Rmax4Rmin02TrackJets_BTagging201810CPContent.py b/PhysicsAnalysis/DerivationFramework/DerivationFrameworkFlavourTag/python/AntiKtVR30Rmax4Rmin02TrackJets_BTagging201810CPContent.py new file mode 100644 index 0000000000000000000000000000000000000000..fb91da66a56b7c400ec1b608246aea1fd45a28a9 --- /dev/null +++ b/PhysicsAnalysis/DerivationFramework/DerivationFrameworkFlavourTag/python/AntiKtVR30Rmax4Rmin02TrackJets_BTagging201810CPContent.py @@ -0,0 +1,6 @@ +# Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration + +AntiKtVR30Rmax4Rmin02TrackJets_BTagging201810CPContent = [ +"AntiKtVR30Rmax4Rmin02TrackJets_BTagging201810", +"AntiKtVR30Rmax4Rmin02TrackJets_BTagging201810Aux.pt.eta.phi.m.HadronConeExclExtendedTruthLabelID.HadronConeExclTruthLabelID.", +] diff --git a/PhysicsAnalysis/DerivationFramework/DerivationFrameworkFlavourTag/python/AntiKtVR30Rmax4Rmin02TrackJets_BTagging201810GhostTagCPContent.py b/PhysicsAnalysis/DerivationFramework/DerivationFrameworkFlavourTag/python/AntiKtVR30Rmax4Rmin02TrackJets_BTagging201810GhostTagCPContent.py new file mode 100644 index 0000000000000000000000000000000000000000..8b8e1aea2e16130906eab00b4f6a5c24b328f936 --- /dev/null +++ b/PhysicsAnalysis/DerivationFramework/DerivationFrameworkFlavourTag/python/AntiKtVR30Rmax4Rmin02TrackJets_BTagging201810GhostTagCPContent.py @@ -0,0 +1,6 @@ +# Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration + +AntiKtVR30Rmax4Rmin02TrackJets_BTagging201810GhostTagCPContent = [ +"AntiKtVR30Rmax4Rmin02TrackJets_BTagging201810GhostTag", +"AntiKtVR30Rmax4Rmin02TrackJets_BTagging201810GhostTagAux.pt.eta.phi.m.HadronConeExclExtendedTruthLabelID.HadronConeExclTruthLabelID.", +] diff --git a/PhysicsAnalysis/DerivationFramework/DerivationFrameworkFlavourTag/python/AntiKtVR30Rmax4Rmin02TrackJets_BTagging201903CPContent.py b/PhysicsAnalysis/DerivationFramework/DerivationFrameworkFlavourTag/python/AntiKtVR30Rmax4Rmin02TrackJets_BTagging201903CPContent.py new file mode 100644 index 0000000000000000000000000000000000000000..be8d1a03f44b81b394b14a7df3d4a5c080e20c4f --- /dev/null +++ b/PhysicsAnalysis/DerivationFramework/DerivationFrameworkFlavourTag/python/AntiKtVR30Rmax4Rmin02TrackJets_BTagging201903CPContent.py @@ -0,0 +1,8 @@ +# Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration + +from JetFlavorGhostLabels import getJetFlavorGhostLabels + +AntiKtVR30Rmax4Rmin02TrackJets_BTagging201903CPContent = [ +"AntiKtVR30Rmax4Rmin02TrackJets_BTagging201903", +"AntiKtVR30Rmax4Rmin02TrackJets_BTagging201903Aux.pt.eta.phi.m.HadronConeExclExtendedTruthLabelID.HadronConeExclTruthLabelID.", +] diff --git a/PhysicsAnalysis/DerivationFramework/DerivationFrameworkFlavourTag/python/BJetTriggerContent.py b/PhysicsAnalysis/DerivationFramework/DerivationFrameworkFlavourTag/python/BJetTriggerContent.py new file mode 100644 index 0000000000000000000000000000000000000000..e483b7c3ada99c597a3b1b0522a1abf72d923230 --- /dev/null +++ b/PhysicsAnalysis/DerivationFramework/DerivationFrameworkFlavourTag/python/BJetTriggerContent.py @@ -0,0 +1,20 @@ +# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + +BJetTriggerContent = [ + "HLT_xAOD__BTaggingContainer_HLTBjetFex", + "HLT_xAOD__BTaggingContainer_HLTBjetFexAux.", + "HLT_xAOD__JetContainer_EFJet", + "HLT_xAOD__JetContainer_EFJetAux.", + "HLT_xAOD__JetContainer_GSCJet", + "HLT_xAOD__JetContainer_GSCJetAux.", + "HLT_xAOD__JetContainer_SplitJet", + "HLT_xAOD__JetContainer_SplitJetAux.", + "HLT_xAOD__JetContainer_a4tcemsubjesFS", + "HLT_xAOD__JetContainer_a4tcemsubjesFSAux.", + "HLT_xAOD__VertexContainer_EFHistoPrmVtx", + "HLT_xAOD__VertexContainer_EFHistoPrmVtxAux.", + "HLT_xAOD__VertexContainer_xPrimVx", + "HLT_xAOD__VertexContainer_xPrimVxAux.", + "LVL1JetRoIs", + "LVL1JetRoIsAux." + ] diff --git a/PhysicsAnalysis/DerivationFramework/DerivationFrameworkFlavourTag/python/BTaggingContent.py b/PhysicsAnalysis/DerivationFramework/DerivationFrameworkFlavourTag/python/BTaggingContent.py new file mode 100644 index 0000000000000000000000000000000000000000..c014f5d0a3c5fd0e34820041542266f3d5866867 --- /dev/null +++ b/PhysicsAnalysis/DerivationFramework/DerivationFrameworkFlavourTag/python/BTaggingContent.py @@ -0,0 +1,191 @@ +# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + +# from +# https://stackoverflow.com/questions/3663450/python-remove-substring-only-at-the-end-of-string +def rchop(thestring, ending): + if thestring.endswith(ending): + return thestring[:-len(ending)] + + return thestring + + +JetStandardAux = \ + [ "pt" + , "eta" + , "btagging" + , "btaggingLink" + , "HadronConeExclTruthLabelID" + , "HadronConeExclExtendedTruthLabelID" + , "ConeExclBHadronsFinal" + , "ConeExclCHadronsFinal" + ] + +BTaggingStandardAux = \ + [ "MV2c10_discriminant" + , "MV2rmu_discriminant" + , "MV2r_discriminant" + , "MV2c100_discriminant" + , "MV2cl100_discriminant" + , "DL1_pu" + , "DL1_pc" + , "DL1_pb" + , "DL1r_pu" + , "DL1r_pc" + , "DL1r_pb" + , "DL1rmu_pu" + , "DL1rmu_pc" + , "DL1rmu_pb" + , "DL1mu_pu" + , "DL1mu_pc" + , "DL1mu_pb" + ] + +# These are the inputs to DL1rmu + SMT +BTaggingHighLevelAux = [ + "softMuon_dR", + "softMuon_pTrel", + "softMuon_scatteringNeighbourSignificance", + "softMuon_momentumBalanceSignificance", + "softMuon_qOverPratio", + "softMuon_ip3dD0", + "softMuon_ip3dD0Significance", + "softMuon_ip3dZ0", + "softMuon_ip3dZ0Significance", + "JetFitter_mass", + "JetFitter_isDefaults", + "JetFitter_energyFraction", + "JetFitter_significance3d", + "JetFitter_nVTX", + "JetFitter_nSingleTracks", + "JetFitter_nTracksAtVtx", + "JetFitter_N2Tpair", + "JetFitter_deltaR", + "SV1_NGTinSvx", + "SV1_masssvx", + "SV1_isDefaults", + "SV1_N2Tpair", + "SV1_efracsvx", + "SV1_deltaR", + "SV1_Lxy", + "SV1_L3d", + "SV1_significance3d", + "IP2D_bu", + "IP2D_isDefaults", + "IP2D_bc", + "IP2D_cu", + "IP3D_bu", + "IP3D_isDefaults", + "IP3D_bc", + "IP3D_cu", + "JetFitterSecondaryVertex_nTracks", + "JetFitterSecondaryVertex_isDefaults", + "JetFitterSecondaryVertex_mass", + "JetFitterSecondaryVertex_energy", + "JetFitterSecondaryVertex_energyFraction", + "JetFitterSecondaryVertex_displacement3d", + "JetFitterSecondaryVertex_displacement2d", + "JetFitterSecondaryVertex_maximumTrackRelativeEta", + "JetFitterSecondaryVertex_minimumTrackRelativeEta", + "JetFitterSecondaryVertex_averageTrackRelativeEta", + "maximumTrackRelativeEta", + "minimumTrackRelativeEta", + "averageTrackRelativeEta", + "rnnip_pb", + "rnnip_pc", + "rnnip_pu", + "softMuon_pb", + "softMuon_pc", + "softMuon_pu", + "softMuon_isDefaults", +] + +BTaggingXbbAux = [ + 'JetFitter_N2Tpair','JetFitter_dRFlightDir','JetFitter_deltaeta', + 'JetFitter_deltaphi', 'JetFitter_energyFraction', 'JetFitter_mass', + 'JetFitter_massUncorr', 'JetFitter_nSingleTracks', + 'JetFitter_nTracksAtVtx', + 'JetFitter_nVTX', 'JetFitter_significance3d', + 'SV1_L3d','SV1_Lxy','SV1_N2Tpair','SV1_NGTinSvx','SV1_deltaR', + 'SV1_dstToMatLay', 'SV1_efracsvx', 'SV1_masssvx', 'SV1_significance3d', + 'rnnip_pb','rnnip_pc','rnnip_ptau','rnnip_pu' +] + +JetGhostLabelAux = [ + "GhostBHadronsFinalCount", + "GhostCHadronsFinalCount", + "GhostTausFinalCount", +] + +BTaggingExtendedAux = [ + "BTagTrackToJetAssociator", +] + +JetExtendedAux = [ + "GhostBHadronsFinalCount", + "GhostBHadronsFinalPt", + "GhostCHadronsFinalCount", + "GhostCHadronsFinalPt", + "GhostTausFinalCount", + "GhostTausFinalPt", + "GhostTrack", +] + +def BTaggingExpertContent(jetcol): + + btaggingtmp = "BTagging_" + jetcol.split('Jets')[0] + if 'BTagging' in jetcol: + stamp = jetcol.split('BTagging')[1] + btaggingtmp += '_'+stamp + + # deal with name mismatch between PV0TrackJets and BTagging_Track + btagging = btaggingtmp.replace("PV0Track", "Track") + + jetAllAux = JetStandardAux + JetExtendedAux + jetcontent = [ ".".join( [ jetcol + "Aux" ] + jetAllAux ) ] + + # add aux variables + btaggingAllAux = (BTaggingHighLevelAux + + BTaggingStandardAux + + BTaggingExtendedAux) + btagcontent = [ ".".join( [ btagging + "Aux" ] + btaggingAllAux ) ] + + return [jetcol] + jetcontent + [ btagging ] + btagcontent + + +def BTaggingStandardContent(jetcol): + + btaggingtmp = "BTagging_" + jetcol.split('Jets')[0] + if 'BTagging' in jetcol: + stamp = jetcol.split('BTagging')[1] + btaggingtmp += '_'+stamp + # deal with name mismatch between PV0TrackJets and BTagging_Track + btagging = btaggingtmp.replace("PV0Track", "Track") + + jetcontent = \ + [ jetcol ] \ + + [ ".".join( [ jetcol + "Aux" ] + JetStandardAux ) ] + + btagcontent = \ + [ btagging ] \ + + [ ".".join( [ btagging + "Aux" ] + BTaggingStandardAux ) ] + return jetcontent + btagcontent + + +def BTaggingXbbContent(jetcol): + + btaggingtmp = "BTagging_" + jetcol.split('Jets')[0] + if 'BTagging' in jetcol: + stamp = jetcol.split('BTagging')[1] + btaggingtmp += '_'+stamp + + # deal with name mismatch between PV0TrackJets and BTagging_Track + btagging = btaggingtmp.replace("PV0Track", "Track") + + jetAllAux = JetStandardAux + JetGhostLabelAux + jetcontent = [ ".".join( [ jetcol + "Aux" ] + jetAllAux ) ] + + # add aux variables + btaggingAllAux = BTaggingHighLevelAux + BTaggingStandardAux + btagcontent = [ ".".join( [ btagging + "Aux" ] + btaggingAllAux ) ] + + return [jetcol] + jetcontent + [ btagging ] + btagcontent diff --git a/PhysicsAnalysis/DerivationFramework/DerivationFrameworkFlavourTag/python/FlavourTagAllVariables.py b/PhysicsAnalysis/DerivationFramework/DerivationFrameworkFlavourTag/python/FlavourTagAllVariables.py new file mode 100644 index 0000000000000000000000000000000000000000..2fa1b1c86d977a2630cdf4ebd01fd314054f4e62 --- /dev/null +++ b/PhysicsAnalysis/DerivationFramework/DerivationFrameworkFlavourTag/python/FlavourTagAllVariables.py @@ -0,0 +1,15 @@ +# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + +# helpers for AllVariables appended to content of FTAG derivations + +## ---------------------------------------------------------------------------- +## b-jet triggers: vertices for performance studies +FTAllVars_bjetTriggerVtx=[ "HLT_xAOD__BTagVertexContainer_BjetVertexFex", + "HLT_xAOD__VertexContainer_BjetSecondaryVertexFex", + "HLT_xAOD__VertexContainer_PrimVertexFTKRaw", + "HLT_xAOD__VertexContainer_PrimVertexFTK", + "HLT_xAOD__VertexContainer_PrimVertexFTKRefit", + "HLT_xAOD__VertexContainer_xPrimVx", + "HLT_xAOD__VertexContainer_EFHistoPrmVtx", + "HLT_xAOD__VertexContainer_SecondaryVertex" ] +## ---------------------------------------------------------------------------- diff --git a/PhysicsAnalysis/DerivationFramework/DerivationFrameworkFlavourTag/python/FlavourTagCommon.py b/PhysicsAnalysis/DerivationFramework/DerivationFrameworkFlavourTag/python/FlavourTagCommon.py new file mode 100644 index 0000000000000000000000000000000000000000..e414bbb58f867ff19ff4e2365f9598f2bd67b271 --- /dev/null +++ b/PhysicsAnalysis/DerivationFramework/DerivationFrameworkFlavourTag/python/FlavourTagCommon.py @@ -0,0 +1,287 @@ +# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + +#******************************************************************** + +# FlavourTagCommon.py + +# Schedules all tools needed for FlavourTag analyses and writes the + +# results into SG. These may then be accessed along the train + +#******************************************************************** + +import AthenaCommon.Constants as Lvl +from AthenaCommon import Logging +ftaglog = Logging.logging.getLogger('FlavourTagCommon') + + +from DerivationFrameworkCore.DerivationFrameworkMaster import * +from BTagging.BTaggingFlags import BTaggingFlags +from AthenaCommon.GlobalFlags import globalflags + +DoneJetCollections=set([]) + +###################################################################### +DontReduceInfoRun = False + +def DontReduceInfo(Rel20=True): + + global DontReduceInfoRun + if (DontReduceInfoRun): + return + DontReduceInfoRun = True + + if globalflags.DataSource()!='geant4': + return + + + from DerivationFrameworkInDet.DerivationFrameworkInDetConf import DerivationFramework__TrackParametersForTruthParticles + + TTPName = "TruthParticle" + + if Rel20: + TTPName = "TruthParticles" + + TruthDecor = DerivationFramework__TrackParametersForTruthParticles( name = "TruthTPDecor", + OutputLevel = Lvl.INFO, + DecorationPrefix ="", + TruthParticleContainerName=TTPName) + + + global ToolSvc + if globalflags.DataSource()!='data': + ToolSvc +=TruthDecor + augmentationTools = [TruthDecor] + if globalflags.DataSource()=='data': + augmentationTools = [] + + from DerivationFrameworkCore.DerivationFrameworkCoreConf import DerivationFramework__CommonAugmentation + + global DerivationFrameworkJob + DerivationFrameworkJob += CfgMgr.DerivationFramework__CommonAugmentation("MyDFTSOS_KERN", + AugmentationTools = augmentationTools, + OutputLevel = Lvl.INFO ) +###################################################################### +#ReTag JetCollections +SAJetBTaggerAlgs={} +BTaggingFlags.CalibrationChannelAliases += [ "AntiKt4TopoEM->AntiKt4EMTopo" ] +BTaggingFlags.Jets=[] +from BTagging.BTaggingConfiguration import getConfiguration +ConfInst=getConfiguration() + + +def ReTag(Taggers, JetCollections = ['AntiKt4EMTopoJets' ], Sequencer=None, DoFullRetag=True): + JetCollectionList = [] + AuthorSubString = [] + + btag = "BTagging_" + suffix_name = "" + tmpSVname = "SecVtx" + tmpJFVxname = "JFVtx" + SA = 'standalone_' + + from ParticleJetTools.ParticleJetToolsConf import JetAssocConstAlg + from BTagging.BTaggingConfiguration import defaultTrackAssoc, defaultMuonAssoc + assocalg = \ + JetAssocConstAlg( + "BTaggingRetagAssocAlg", + JetCollections=JetCollections, + Associators=[defaultTrackAssoc, defaultMuonAssoc] + ) + + Sequencer += assocalg + + for JetCollection in JetCollections: + name = JetCollection.replace('ZTrack', 'Track').replace('PV0Track', 'Track') + author= btag+name[:-4]+suffix_name + algname = SA + author.lower() + + + if algname in SAJetBTaggerAlgs: + ftaglog.info("Tagger {} already exists. Add to {}".format(algname,Sequencer)) + Sequencer += SAJetBTaggerAlgs[algname] + + else: + JetCollectionList.append((JetCollection,name)) + BTaggingFlags.Jets.append(name[:-4]) + AuthorSubString.append(author) + + global ConfInst + ######################## WARNING ######################################## + # from BTagging.BTaggingConfiguration import doNotCheckForTaggerObstacles + ConfInst.doNotCheckForTaggerObstacles() + ####BTaggingFlags.PrimaryVertexCollectionName = "PrimaryVertices" + ######################################################################### + #from BTagging.BTaggingConfiguration import setupJetBTaggerTool, getJetCollectionTool + from BTagging.BTaggingConf import Analysis__StandAloneJetBTaggerAlg as StandAloneJetBTaggerAlg + #BTaggingFlags.OutputLevel=VERBOSE + NotInJetToolManager = [] # For jet collections + if DoFullRetag: + retagMode = "" + else: + retagMode="Retag" + for i, jet in enumerate(JetCollectionList): + try: + btagger = ConfInst.setupJetBTaggerTool(ToolSvc, JetCollection=jet[1][:-4], AddToToolSvc=True, + Verbose=True, + #Verbose=BTaggingFlags.OutputLevel < 3, + options={"name" : AuthorSubString[i].lower(), + "BTagName" : AuthorSubString[i], + "BTagJFVtxName": tmpJFVxname, + "BTagSVName" : tmpSVname, + }, +# TaggerList = ['SV1Flip','JetFitterNNFlip','IP2DNeg','IP3DNeg','MV2c100Flip'] + SetupScheme = retagMode, + TaggerList = Taggers + ) + SAbtagger = StandAloneJetBTaggerAlg(name=SA + AuthorSubString[i].lower(), + JetBTaggerTool=btagger, + JetCollectionName = jet[0], + outputCollectionSuffix = suffix_name, + DuplicatePFlow = BTaggingFlags.Do2019Retraining + ) + if Sequencer is None: + global DerivationFrameworkJob + Sequencer=DerivationFrameworkJob + Sequencer += SAbtagger + SAJetBTaggerAlgs[SA + AuthorSubString[i].lower()] = SAbtagger + ftaglog.info("Create {} in {}".format(SAbtagger,Sequencer)) + # print SAbtagger + #global DerivationFrameworkJob + #DerivationFrameworkJob += SAbtagger + except AttributeError as error: + print '#BTAG# --> ' + str(error) + print '#BTAG# --> ' + jet[1] + print '#BTAG# --> ' + AuthorSubString[i] + NotInJetToolManager.append(AuthorSubString[i]) + + if len(NotInJetToolManager) > 0: + AuthorSubString = list(set(AuthorSubString) - set(NotInJetToolManager)) + + # Both standard and aux container must be listed explicitly. + # For release 19, the container version must be explicit. + #BaseName = "xAOD::BTaggingContainer_v1#" + #BaseAuxName = "xAOD::BTaggingAuxContainer_v1#" + + #AOD list + #BTaggingFlags.btaggingAODList += [ BaseName + author for author in AuthorSubString] + #BTaggingFlags.btaggingAODList += [ BaseAuxName + author + 'Aux.' for author in AuthorSubString] + #BTaggingFlags.btaggingAODList += [ BaseName + author + 'AOD' for author in AuthorSubString] + #BTaggingFlags.btaggingAODList += [ BaseAuxName + author + 'AODAux.' for author in AuthorSubString] + + #ESD list + #BTaggingFlags.btaggingESDList += [ BaseName + author for author in AuthorSubString] + #BTaggingFlags.btaggingESDList += [ BaseAuxName + author + 'Aux.' for author in AuthorSubString] + + #AOD list SeCVert + #BaseNameSecVtx = "xAOD::VertexContainer_v1#" + #BaseAuxNameSecVtx = "xAOD::VertexAuxContainer_v1#" + #BTaggingFlags.btaggingAODList += [ BaseNameSecVtx + author + tmpSVname for author in AuthorSubString] + #BTaggingFlags.btaggingAODList += [ BaseAuxNameSecVtx + author + tmpSVname + 'Aux.-vxTrackAtVertex' for author in AuthorSubString] + + #ESD list + #BTaggingFlags.btaggingESDList += [ BaseNameSecVtx + author + tmpSVname for author in AuthorSubString] + #BTaggingFlags.btaggingESDList += [ BaseAuxNameSecVtx + author + tmpSVname + 'Aux.-vxTrackAtVertex' for author in AuthorSubString] + + #AOD list JFSeCVert + #BaseNameJFSecVtx = "xAOD::BTagVertexContainer_v1#" + #BaseAuxNameJFSecVtx = "xAOD::BTagVertexAuxContainer_v1#" + #BTaggingFlags.btaggingAODList += [ BaseNameJFSecVtx + author + tmpJFVxname for author in AuthorSubString] + #BTaggingFlags.btaggingAODList += [ BaseAuxNameJFSecVtx + author + tmpJFVxname + 'Aux.' for author in AuthorSubString] + #ESD list + #BTaggingFlags.btaggingESDList += [ BaseNameJFSecVtx + author + tmpJFVxname for author in AuthorSubString] + #BTaggingFlags.btaggingESDList += [ BaseAuxNameJFSecVtx + author + tmpJFVxname + 'Aux.' for author in AuthorSubString] + + + + + +###################################################################### + +def FlavorTagInit(DoReduceInfo = False, + DoMSV = False, + Rel20 = True, + DoRetag = True, + scheduleFlipped = False, + myTaggers = [], + JetCollections = ['AntiKt4EMTopoJets' ], #['AntiKt4PV0TrackJets', 'AntiKt4LCTopoJets' ] + DoFullRetag=True, + Sequencer=None): + + # ==================================================================== + # MAIN SWITCHESr + # ==================================================================== + #ReduceInfo =False ##write minimal amount of info on the output file + #DoMSV =False ##include variables for MSV tagger + #Rel20 =True ##switch between rel19 and rel20 + #(only option that will work on original DC14 xAOD) + #doRetag =True ## perform retagging + #adjust configurations + + if DoRetag==False: + DoReduceInfo=True + + + #if the user has defined a list of desired taggers use that one, otherwise use only the active taggers + if len( myTaggers ) >0: + Taggers = myTaggers + else: + from BTagging.BTaggingFlags import BTaggingFlags + if scheduleFlipped: + Taggers = BTaggingFlags.ExpertTaggers + else: + Taggers = BTaggingFlags.StandardTaggers + + + ##### VD: THIS IS ALSO NOT NEEDED????? + ##write minimal amount of info on the output file + #if DoReduceInfo==False: + # DontReduceInfo(Rel20) + #ReTag JetCollections + if DoRetag: + ReTag(Taggers, JetCollections, Sequencer, DoFullRetag) + + +###################################################################### + +def applyBTagging(jetalg,algname,sequence): + btagWPlist = [ 'FixedCutBEff_60', 'FixedCutBEff_70', 'FixedCutBEff_77', 'FixedCutBEff_85' ] + btagAlglist = [ 'MV2c10', 'MV2r', 'MV2rmu', 'DL1', 'DL1r', 'DL1rmu'] + + btagtooldict = {} + from AthenaCommon.AppMgr import ToolSvc + for btagWP in btagWPlist: + for btagAlg in btagAlglist: + btagtoolname = 'DFBtagSel'+btagWP+'_'+btagAlg+'_'+jetalg + ftaglog.info("Add B-tag WP {} of the {} algorithm for {}".format(btagWP,btagAlg,jetalg)) + btagtool = None + if hasattr(ToolSvc,btagtoolname): + btagtool = getattr(ToolSvc,btagtoolname) + else: + btagtool = CfgMgr.BTaggingSelectionTool(btagtoolname) + ToolSvc += btagtool + btagtool.TaggerName = btagAlg + # In the absence of properly defined FlatBEff WP we alias them on the flat cut ones + btagtool.OperatingPoint = btagWP + btagtool.JetAuthor = jetalg+"Jets" + btagtool.MinPt = 0 + if '_BTagging' in jetalg: + btagtool.JetAuthor = jetalg.replace('_BTagging','Jets_BTagging') + btagtool.ErrorOnTagWeightFailure = False #avoid an error when the jets tagweight cannot be retrived, and only print a warning + btagtool.FlvTagCutDefinitionsFileName = "xAODBTaggingEfficiency/13TeV/2019-21-13TeV-MC16-CDI-2019-10-07_v1.root" + btagKey = btagWP+'_'+btagAlg + btagtooldict[btagKey] = btagtool + + from DerivationFrameworkJetEtMiss.ExtendedJetCommon import * + applyBTaggingAugmentation(jetalg,algname,sequence,btagtooldict) + +def applyBTagging_xAODColl(jetalg='AntiKt4EMTopo',sequence=DerivationFrameworkJob): + if BTaggingFlags.Do2019Retraining: + supportedJets = ['AntiKt4EMTopo_BTagging201810', 'AntiKt4EMPFlow_BTagging201810'] + else: + supportedJets = ['AntiKt4EMTopo', 'AntiKt4EMPFlow'] + if not jetalg in supportedJets: + ftaglog.warning('B-tagging requested for unsupported jet collection {}!'.format(jetalg)) + return + else: + applyBTagging(jetalg,'JetCommonKernel_{0}'.format(jetalg),sequence) diff --git a/PhysicsAnalysis/DerivationFramework/DerivationFrameworkFlavourTag/python/FlavourTagExtraVariables.py b/PhysicsAnalysis/DerivationFramework/DerivationFrameworkFlavourTag/python/FlavourTagExtraVariables.py new file mode 100644 index 0000000000000000000000000000000000000000..4c378750d66d695736124bdb43885c2440168638 --- /dev/null +++ b/PhysicsAnalysis/DerivationFramework/DerivationFrameworkFlavourTag/python/FlavourTagExtraVariables.py @@ -0,0 +1,20 @@ +# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + +# helpers for ExtraVariables appended to content of FTAG derivations + +## ---------------------------------------------------------------------------- +## b-jet triggers: +## tracks: keep variables as used for the tracking CP group smart-list: +FTExtraVars_bjetTriggerTracks=[] +from DerivationFrameworkInDet.InDetTrackParticlesCPContent import InDetTrackParticlesCPContent as FTExtraVars_InDetTrackParticlesCPContent +FT_IDTPstring="InDetTrackParticlesAux" +for FT_IDTPitem in FTExtraVars_InDetTrackParticlesCPContent: + if (FT_IDTPstring == FT_IDTPitem.split(".")[0]): + # tracking used to do primary + FTExtraVars_bjetTriggerTracks.append(FT_IDTPitem.replace(FT_IDTPstring,"HLT_xAOD__TrackParticleContainer_InDetTrigTrackingxAODCnv_BjetPrmVtx_FTF")) + # tracking used to seed the precision + FTExtraVars_bjetTriggerTracks.append(FT_IDTPitem.replace(FT_IDTPstring,"HLT_xAOD__TrackParticleContainer_InDetTrigTrackingxAODCnv_Bjet_FTF")) + # tracking to do the actual b-tagging + FTExtraVars_bjetTriggerTracks.append(FT_IDTPitem.replace(FT_IDTPstring,"HLT_xAOD__TrackParticleContainer_InDetTrigTrackingxAODCnv_Bjet_IDTrig")) + +## ---------------------------------------------------------------------------- diff --git a/PhysicsAnalysis/DerivationFramework/DerivationFrameworkFlavourTag/python/HbbCommon.py b/PhysicsAnalysis/DerivationFramework/DerivationFrameworkFlavourTag/python/HbbCommon.py new file mode 100644 index 0000000000000000000000000000000000000000..62eca674c0e74e1166de8a62672a661c3e5879e6 --- /dev/null +++ b/PhysicsAnalysis/DerivationFramework/DerivationFrameworkFlavourTag/python/HbbCommon.py @@ -0,0 +1,668 @@ +# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration + + +# import Common Algs +from DerivationFrameworkJetEtMiss.JetCommon import DFJetAlgs + +# I wish we didn't need this +from BTagging.BTaggingConfiguration import getConfiguration +ConfInst=getConfiguration() + +from GaudiKernel.Configurable import WARNING + +# Import star stuff (it was like that when I got here) +from DerivationFrameworkJetEtMiss.JetCommon import * +from DerivationFrameworkJetEtMiss.ExtendedJetCommon import * +from JetRec.JetRecConf import JetAlgorithm + +#=================================================================== +# ExKt/CoM Subjets +#=================================================================== + +# make exkt subjet finding tool +def buildExclusiveSubjets(ToolSvc, JetCollectionName, subjet_mode, nsubjet, doGhostAssoc, doTrackSubJet, ExGhostLabels=["GhostBHadronsFinal", "GhostCHadronsFinal", "GhostTrack"], min_subjet_pt_mev = 0): + # + # a full list of ExGhostLabels = ["GhostBHadronsFinal", "GhostBHadronsInitial", "GhostBQuarksFinal", "GhostCHadronsFinal", "GhostCHadronsInitial", + # "GhostCQuarksFinal", "GhostHBosons", "GhostPartons", "GhostTQuarksFinal", "GhostTausFinal", "GhostTruth", "GhostTrack"] + # + + from JetRec.JetRecStandard import jtm + + subjetlabel = "Ex%s%iSubJets" % (subjet_mode, nsubjet) + doCoM = False + algj = "Kt" + if subjet_mode == "CoM" : + doCoM = True + # + #supported algorithms: Reconstruction/Jet/JetSubStructureUtils/Root/SubjetFinder.cxx + #algorithms:"ee_kt" or "EEKt" for EE_Kt + # "cambridge" or "CamKt" for Cambridge + # "FastJetPlugin" for EECambridge plugin + algj = "ee_kt" + + talabel = "" + if doGhostAssoc: + talabel = "GA" + subjetlabel = "Ex%s%i%sSubJets" % (subjet_mode, nsubjet, talabel) + + # removing truth labels if runining on data + if globalflags.DataSource()=='data': ExGhostLabels = ["GhostTrack"] + + SubjetContainerName = "%sEx%s%i%sSubJets" % (JetCollectionName.replace("Jets", ""), subjet_mode, nsubjet, talabel) + ExKtbbTagToolName = str( "Ex%s%sbbTagTool%i_%s" % (subjet_mode, talabel, nsubjet, JetCollectionName) ) + + if hasattr(jtm, ExKtbbTagToolName): + ExKtbbTagToolInstance = jtm[ ExKtbbTagToolName ] + print " ExKtbbTagTool ", ExKtbbTagToolName, "is alredy in jtm.tools" + else: + print " building ExKtbbTagTool ", ExKtbbTagToolName + + from JetSubStructureMomentTools.JetSubStructureMomentToolsConf import SubjetFinderTool + from JetSubStructureMomentTools.JetSubStructureMomentToolsConf import SubjetRecorderTool + + subjetrecorder = SubjetRecorderTool("subjetrecorder_%s%i%s_%s" % (subjet_mode, nsubjet, talabel, JetCollectionName)) + ToolSvc += subjetrecorder + subjetrecorder.SubjetLabel = subjetlabel + subjetrecorder.SubjetContainerName = SubjetContainerName + + if not hasattr(ToolSvc, "ExKtTrackSelectorLoose"): + from InDetTrackSelectionTool.InDetTrackSelectionToolConf import InDet__InDetTrackSelectionTool + ToolSvc += InDet__InDetTrackSelectionTool("ExKtTrackSelectorLoose", + CutLevel = "Loose", + ) + + from JetTagTools.JetTagToolsConf import Analysis__ExKtbbTagTool + ExKtbbTagToolInstance = Analysis__ExKtbbTagTool( + name = ExKtbbTagToolName, + JetAlgorithm = algj, + JetRadius = 10.0, + PtMin = min_subjet_pt_mev, + ExclusiveNJets = nsubjet, + doTrack = doTrackSubJet, + InputJetContainerName = JetCollectionName, + SubjetContainerName = SubjetContainerName, + SubjetRecorder = subjetrecorder, + SubjetLabel = subjetlabel, + SubjetAlgorithm_BTAG = "AntiKt", + SubjetRadius_BTAG = 0.4, + TrackSelectionTool = ToolSvc.ExKtTrackSelectorLoose, + PrimaryVtxContainerName = "PrimaryVertices", + SubjetBoostConstituent = doCoM, + GhostLabels = ",".join(ExGhostLabels) + ) + jtm.add( ExKtbbTagToolInstance ) + ToolSvc += ExKtbbTagToolInstance + + return (ExKtbbTagToolInstance, SubjetContainerName) + +#=================================================================== +# Build ExKt or CoM Subjets, default is ExKt +#=================================================================== +def addExKtCoM(sequence, ToolSvc, JetCollectionExCoM, nSubjets, doTrackSubJet, doGhostAssoc=False, ExGhostLabels=["GhostBHadronsFinal","GhostCHadronsFinal","GhostTrack"], min_subjet_pt_mev = 0, subjetAlgName = "Kt"): + if(subjetAlgName != "Kt" and subjetAlgName != "CoM"): + print "WARNING: Subjet type must be Kt or CoM. Using Kt as default!" + subjetAlgName = "Kt" + from JetRec.JetRecStandard import jtm + ExCoMJetCollection__SubJet = [] + + (ExCoMbbTagToolInstance, SubjetContainerName) = buildExclusiveSubjets(ToolSvc, JetCollectionExCoM, subjetAlgName, nSubjets, doGhostAssoc, doTrackSubJet, ExGhostLabels, min_subjet_pt_mev) + + ExCoMJetCollection__SubJet += [SubjetContainerName] + + + excomELresetName = "ELreset_subjet_%s" % (SubjetContainerName.replace("Jets", "")) + excomELresetNameLJet = "ELreset_Large_%sjet_%s" % (SubjetContainerName.replace("Jets", ""),JetCollectionExCoM.replace("Jets", "")) + excomAlgName = "jfind_%s" % (SubjetContainerName) + excomJetRecToolName = "%s" % (SubjetContainerName) + excomBTagName = "BTagging_%s" % (SubjetContainerName.replace("Jets", "")) + + if excomAlgName in DFJetAlgs: + print " Algorithm Ex%s "%subjetAlgName, excomAlgName, "already built before sequence ", sequence + + if hasattr(sequence, excomAlgName): + print " sequence Ex%s "%subjetAlgName, sequence, "already has an instance of algorithm", excomAlgName + else: + print " Add algorithm Ex%s "%subjetAlgName, excomAlgName, "to sequence", sequence + sequence += DFJetAlgs[excomAlgName] + sequence += CfgMgr.xAODMaker__ElementLinkResetAlg(excomELresetName, SGKeys=[SubjetContainerName+"Aux."]) + sequence += DFJetAlgs[excomAlgName+"_btag"] + sequence += CfgMgr.xAODMaker__ElementLinkResetAlg(excomELresetNameLJet, SGKeys=[JetCollectionExCoM+"Aux."]) + else: + print " Algorithm Ex%s "%subjetAlgName, excomAlgName, " to be built sequence ", sequence + if hasattr(jtm, excomJetRecToolName): + print " Ex%sJetRecTool "%subjetAlgName, excomJetRecToolName, " already built sequence ", sequence + jetrec = jtm [ excomJetRecToolName ] + else: + print " Ex%s tool "%subjetAlgName, excomJetRecToolName, " to be built sequence ", sequence + from JetRec.JetRecConf import JetRecTool + jetrec = JetRecTool( + name = excomJetRecToolName, + OutputContainer = JetCollectionExCoM, + InputContainer = JetCollectionExCoM, + JetModifiers = [ExCoMbbTagToolInstance], + ) + jtm.add( jetrec ) + ToolSvc += jetrec + + excomJetRecBTagToolName = str( "%s_sub"%excomJetRecToolName ) + if hasattr(jtm, excomJetRecBTagToolName): + print " Ex%sJetRecBTagTool "%subjetAlgName, excomJetRecBTagToolName, " already built sequence ", sequence + jetrec_btagging = jtm [ excomJetRecBTagToolName ] + else: + print " Ex%sJetRecBTagTool "%subjetAlgName, excomJetRecBTagToolName, " to be built sequence ", sequence + + #make the btagging tool for excom jets + from BTagging.BTaggingFlags import BTaggingFlags + btag_excom = ConfInst.setupJetBTaggerTool(ToolSvc, JetCollection=excomJetRecToolName.replace("Jets", ""), AddToToolSvc=True, Verbose=True, + options={"name" : excomBTagName.lower(), + "BTagName" : excomBTagName, + "BTagJFVtxName": "JFVtx", + "BTagSVName" : "SecVtx", + }, + SetupScheme = "", + TaggerList = BTaggingFlags.StandardTaggers, + TrackAssociatorName="GhostTrack" if doGhostAssoc else "MatchedTracks" + ) + # running association + b-tagging on subjets now + from BTagging.BTaggingConfiguration import comTrackAssoc, comMuonAssoc, defaultTrackAssoc, defaultMuonAssoc + mods = [defaultTrackAssoc, defaultMuonAssoc, btag_excom] + if(subjetAlgName=="CoM"): mods = [comTrackAssoc, comMuonAssoc, btag_excom] + if globalflags.DataSource()!='data': + mods.append(jtm.jetdrlabeler) + + jetrec_btagging = JetRecTool( name = excomJetRecBTagToolName, + InputContainer = SubjetContainerName, + OutputContainer = SubjetContainerName, + JetModifiers = mods) + jtm.add( jetrec_btagging ) + ToolSvc += jetrec_btagging + + jetalg_excom = JetAlgorithm( + name = excomAlgName, + Tools = [jetrec], + ) + sequence += jetalg_excom + DFJetAlgs[excomAlgName] = jetalg_excom + + # Reset EL for ExCoM subjets after all of them are built + # Otherwise crashing for CoM during TrackToJetAssociation due to failure of finding the large-R parent jet. + sequence += CfgMgr.xAODMaker__ElementLinkResetAlg(excomELresetName, SGKeys=[SubjetContainerName+"Aux."]) + + jetalg_excom_btag = JetAlgorithm( + name = excomAlgName+"_btag", + Tools = [jetrec_btagging], + ) + sequence += jetalg_excom_btag + DFJetAlgs[excomAlgName+"_btag"] = jetalg_excom_btag + sequence += CfgMgr.xAODMaker__ElementLinkResetAlg(excomELresetNameLJet, SGKeys=[JetCollectionExCoM+"Aux."]) + + return ExCoMJetCollection__SubJet + +################################################################## +# Associate the VR track jets to existing large-R jet collections +# +# For any groomed jet collections, the association will be done to +# the parent jet collection (so for the +# AntiKt10LCTopoTrimmedPtFrac5SmallR20Jets collection the +# association will be done to the AntiKt10LCTopoJets collection). +# +# If no jet collection is supplied, the association is done to +# AntiKt10LCTopoJets +################################################################## +def addVRJets(sequence, largeRColls = None, do_ghost=False, logger=None, doFlipTagger=False, training='201810', *pos_opts, **opts): + from AthenaCommon import Logging + + if logger is None: + logger = Logging.logging.getLogger('VRLogger') + + # define constants here, since we don't want every derivaiton + # deciding for themselves what a VR jet is. If we do want this + # flexibility, this code will need some rewriting to ensure that + # there are no issues with train safety. + if opts or pos_opts: + logger.warning('Options specified for VR jets, they will be ignored') + + if largeRColls is None: + largeRColls = [ + "AntiKt10LCTopoTrimmedPtFrac5SmallR20Jets" + ] + + VRName, ghostLab = buildVRJets(sequence, do_ghost, logger, doFlipTagger, training) + toAssociate = { + ghostLab : ghostLab.lower() + } + + ungroomedNames = [] + for collection in largeRColls: + ungroomedName, getters = linkVRJetsToLargeRJets(sequence, collection, toAssociate) + ungroomedNames.append(ungroomedName) + + return ungroomedNames + +def buildVRJets(sequence, do_ghost, logger = None, doFlipTagger=False, training='201810'): + + from AthenaCommon import Logging + + if logger is None: + logger = Logging.logging.getLogger('VRLogger') + + supported_trainings = ['201810', '201903'] + # Check allowed trainings + # Is there a better way to do this with a central DB? + if training not in ['201810', '201903']: + logger.warning("WARNING: Using an unsupported training tag! This is UNDEFINED and will probably break. Please choose a training tag from") + logger.warning(supported_trainings) + + from JetRec.JetRecStandard import jtm + + # Making Chris Happy: all VR track-jet b-tagging should have the training campaign label + trainingTag = '_BTagging%s' % (training) + + VRJetName="AntiKtVR30Rmax4Rmin02Track%s" % (trainingTag) + VRGhostLabel="GhostVR30Rmax4Rmin02TrackJet%s" % (trainingTag) + VRJetAlg="AntiKt" + VRJetRadius=0.4 + VRJetInputs='pv0track' + VRJetOptions = dict( + ghostArea = 0 , ptmin = 4000, + variableRMinRadius = 0.02, variableRMassScale = 30000, + calibOpt = "none") + + # Change some options if we have do_ghost set to true. Hopefully + # this will be the only VR collection in the future. + if do_ghost: + ghost_suffix = "GhostTag" + VRJetName += ghost_suffix + VRGhostLabel += ghost_suffix + + #========================================================== + # Build VR jets + #========================================================== + + from DerivationFrameworkJetEtMiss.ExtendedJetCommon import nameJetsFromAlg + VRJetRecToolName = nameJetsFromAlg(VRJetName) + VRJetAlgName = "jfind_%s" % (VRJetRecToolName) + VRJetBTagName = "BTagging_%s" % (VRJetName.replace('BTagging','')) + + logger.info("VR Btag name: %s" % VRJetBTagName) + logger.info("VR jet name: %s" % VRJetRecToolName) + + from AthenaCommon.AppMgr import ToolSvc + + #make the btagging tool for VR jets + from BTagging.BTaggingFlags import BTaggingFlags + BTaggingFlags.CalibrationChannelAliases += ["AntiKtVR30Rmax4Rmin02Track->AntiKtVR30Rmax4Rmin02Track,AntiKt4EMTopo"] + BTaggingFlags.CalibrationChannelAliases += ["%s->AntiKtVR30Rmax4Rmin02Track,AntiKt4EMTopo" % (VRJetName)] + btag_vrjets = ConfInst.setupJetBTaggerTool( + ToolSvc, JetCollection=VRJetRecToolName, AddToToolSvc=True, Verbose=True, + options={"name" : VRJetBTagName.lower(), + "BTagName" : VRJetBTagName, + "BTagJFVtxName": "JFVtx", + "BTagSVName" : "SecVtx", + }, + SetupScheme = "", + TaggerList = BTaggingFlags.ExpertTaggers if doFlipTagger else BTaggingFlags.StandardTaggers, + TrackAssociatorName="GhostTrack" if do_ghost else "MatchedTracks", + ) + + from BTagging.BTaggingConfiguration import defaultTrackAssoc, defaultMuonAssoc + + # Slice the array - this forces a copy so that if we modify it we don't also + # change the array in jtm. + pseudoJetGetters = jtm.gettersMap[VRJetInputs][:] + + # We want to include ghost associated tracks in the pv0 tracks so that + # we can use the looser ghost association criteria for b-tagging. + if VRJetInputs == "pv0track": + pseudoJetGetters.append(jtm["gtrackget"]) + + if VRJetAlgName in DFJetAlgs: + logger.info("Algorithm %s already built before" % VRJetAlgName) + + if hasattr(sequence, VRJetAlgName): + logger.info("Sequence %s already has an instance of algorithm %s" % (sequence, VRJetAlgName)) + else: + logger.info("Add algorithm %s to sequence %s" % (VRJetAlgName, sequence)) + sequence += DFJetAlgs[VRJetAlgName] + else: + logger.info("Create algorithm %s" % VRJetAlgName) + + if hasattr(jtm, VRJetRecToolName): + logger.info("JetRecTool %s is alredy in jtm.tools in sequence %s" % (VRJetRecToolName, sequence)) + else: + logger.info("Create JetRecTool %s" % VRJetRecToolName) + #can only run trackjetdrlabeler with truth labels, so MC only + + mods = [defaultTrackAssoc, defaultMuonAssoc, btag_vrjets] + + if globalflags.DataSource()!='data': + mods.append(jtm.trackjetdrlabeler) + + jtm.addJetFinder( + VRJetRecToolName, + VRJetAlg, + VRJetRadius, + pseudoJetGetters, + modifiersin=mods, + ivtxin=0, + **VRJetOptions) + + from JetRec.JetRecConf import JetAlgorithm + jetalg_smallvr30_track = JetAlgorithm(VRJetAlgName, Tools = [ jtm[VRJetRecToolName] ]) + sequence += jetalg_smallvr30_track + DFJetAlgs[VRJetAlgName] = jetalg_smallvr30_track + + #========================================================== + # Build PseudoJet Getter + #========================================================== + + pjgettername = VRGhostLabel.lower() + from DerivationFrameworkJetEtMiss.ExtendedJetCommon import nameJetsFromAlg + + if hasattr(jtm, pjgettername): + logger.info("Found %s in jtm in sequence %s" % (pjgettername, sequence)) + else: + logger.info("Add %s to jtm in sequence %s" % (pjgettername, sequence)) + + inputContainerName = jetFlags.containerNamePrefix() + nameJetsFromAlg(VRJetName) + + + from JetRec.JetRecConf import PseudoJetGetter + jtm += PseudoJetGetter( + pjgettername, # give a unique name + InputContainer = inputContainerName, # SG key + Label = VRGhostLabel, # this is the name you'll use to retrieve ghost associated VR track jets + OutputContainer = "PseudoJet" + VRGhostLabel, + SkipNegativeEnergy = True, + GhostScale = 1.e-20, # this makes the PseudoJet Ghosts, and thus the reco flow will treat them as such + ) + return VRJetName, VRGhostLabel + +################################################################## +# Build variable-R calorimeter jets +################################################################## +def addVRCaloJets(sequence,outputlist,dotruth=True,writeUngroomed=False): + if DerivationFrameworkIsMonteCarlo and dotruth: + addTrimmedJets('AntiKt', 1.0, 'Truth', rclus=0.2, ptfrac=0.05, variableRMassScale=600000, variableRMinRadius=0.2, mods="truth_groomed", + algseq=sequence, outputGroup=outputlist, writeUngroomed=writeUngroomed) + addTrimmedJets('AntiKt', 1.0, 'PV0Track', rclus=0.2, ptfrac=0.05, variableRMassScale=600000, variableRMinRadius=0.2, mods="groomed", + algseq=sequence, outputGroup=outputlist, writeUngroomed=writeUngroomed) + addTrimmedJets('AntiKt', 1.0, 'LCTopo', rclus=0.2, ptfrac=0.05, variableRMassScale=600000, variableRMinRadius=0.2, mods="lctopo_groomed", + algseq=sequence, outputGroup=outputlist, writeUngroomed=writeUngroomed) + +################################################################### +## Utils: get jetRectoTool +################################################################### +def getJetRecTool(collection, getParent=True): + """Get the JetRecTool for a given collection from the jtm. If getParent is + set then if that tool has an InputContainer property set then try and + retrieve the JetRecTool for that parent, continue going until there is no + InputContainer property. Will raise a KeyError if no JetRecTool can be + found at any stage. + """ + from JetRec.JetRecStandardToolManager import jtm + try: + jetRecTool = jtm[collection] + except KeyError as e: + raise KeyError("JetRecTool {0} not present in jtm".format(collection) ) + if getParent and hasattr(jetRecTool, "InputContainer") and jetRecTool.InputContainer: + jetRecTool = getJetRecTool(jetRecTool.InputContainer, True) + return jetRecTool + +################################################################### +## Utils: link jets (copied over from Jon Burr in EXOT27Utils) +################################################################### +def linkVRJetsToLargeRJets( + sequence, collection, getters): + """Re-run jet finding for a jet collection using a new list of + PseudoJetGetters. These PseudoJetGetters should already have been loaded + into jtm. + collection should be the name of the jet collection, which should already + have been sequenced, so it's jet rec tool will exist in jtm. + getters should be a map of PseudoJetGetters, each key being the name of the + (non ghost) collection, with the value being the name of the + PseudoJetGetter in jtm. + Returns the name of the ungroomed collection that is the parent of + 'collection' (this will be the same as 'collection' if this isn't groomed) + *and* the list of ghost labels (these are the element link names). + """ + from JetRec.JetRecStandardToolManager import jtm + import DerivationFrameworkJetEtMiss.JetCommon as JetCommon + from DerivationFrameworkJetEtMiss.ExtendedJetCommon import nameJetsFromAlg + logger = Logging.logging.getLogger('HbbTaggerLog') + # First, retrieve the original JetRecTool - this is the one that made the + # *ungroomed* jets, not the groomed ones. Ghost association is done to + # ungroomed objects + originalJetRecTool = getJetRecTool(collection, getParent = True) + originalUngroomedName = originalJetRecTool.name() + ungroomedJetAlg = originalUngroomedName + if ungroomedJetAlg.endswith("Jets"): + ungroomedJetAlg = ungroomedJetAlg[:-4] + originalFinder = jtm[originalJetRecTool.JetFinder.getName()] + originalGetters = [jtm[g.getName()] for g in originalJetRecTool.PseudoJetGetters] + newGetters = [jtm[g] for g in getters.values()] + + # Next, prepare the names of the new objects we'll need from jtm + + comb_name = "_".join(getters.keys() ) + LargeRJetFindingAlg = "jfind_{0}_{1}".format(collection, comb_name).lower() + LargeRJetPrefix = "{0}_{1}".format(collection, comb_name) + LargeRJets = nameJetsFromAlg(LargeRJetPrefix) + LinkTransferAlg = "LinkTransfer_{0}_{1}".format(collection, comb_name) + + # Check to see if this large R jet collection is already known to JetCommon + if LargeRJetFindingAlg in JetCommon.DFJetAlgs: + logger.info("Found {0} in DFJetAlgs".format(LargeRJetFindingAlg) ) + # Is it in our sequence? + if hasattr(sequence, LargeRJetFindingAlg): + logger.info("Algorithm already exists in the input sequence. Will not " + "add again") + else: + logger.info("Adding algorithm into the sequence {0}".format(sequence) ) + sequence += JetCommon.DFJetAlgs[LargeRJetFindingAlg] + else: + # Check to see if the corresponding JetRecTool already exists + if hasattr(jtm, LargeRJets): + logger.info("JetRecTool {0} already exists in jtm".format(LargeRJets) ) + else: + logger.info("Create a new JetRecTool {0}".format(LargeRJets) ) + JetCommon.OutputJets.setdefault("CustomJets", []).append(LargeRJets) + originalModifiers = [jtm[m.getName()] for m in originalJetRecTool.JetModifiers] + jtm.addJetFinder( + output = LargeRJets, + alg = originalFinder.JetAlgorithm, + radius = originalFinder.JetRadius, + gettersin = originalGetters + newGetters, + modifiersin = originalModifiers, + ghostArea = 0, + ptmin = originalFinder.PtMin, + variableRMinRadius = originalFinder.VariableRMinRadius, + variableRMassScale = originalFinder.VariableRMassScale, + calibOpt = "none") + # Note that we don't need ptminFilter as this was included in the original + # list of JetModifiers + logger.info( + "Creating new jet algorithm {0} and adding it to sequence {1}".format( + LargeRJetFindingAlg, sequence) ) + theJetAlg = JetAlgorithm(LargeRJetFindingAlg, Tools = [jtm[LargeRJets] ]) + sequence += theJetAlg + JetCommon.DFJetAlgs[LargeRJetFindingAlg] = theJetAlg + + # Everything so far has been to create the links on a copy of the ungroomed + # collection. Now we need to copy those links over to the original ungroomed + # collection. + from DerivationFrameworkJetEtMiss.ExtendedJetCommon import getJetExternalAssocTool, applyJetAugmentation + assocTool = getJetExternalAssocTool( + ungroomedJetAlg, + LargeRJetPrefix, + MomentPrefix = '', + ListOfOldLinkNames=[g.Label for g in newGetters] + ) + applyJetAugmentation( + ungroomedJetAlg, LinkTransferAlg, sequence, assocTool) + + return originalUngroomedName, [g.Label for g in newGetters] + + + +#=================================================================== +# Utils: Copy Jets +#=================================================================== +def addCopyJet(FTAG5Seq, ToolSvc, InputJetCollectionName, OutputJetCollectionName, **options): + doShallowCopy = options.pop("ShallowCopy", False) + + from JetRec.JetRecConf import JetRecTool + jetrec = JetRecTool( + name = "JetRecTool_CopyJet_%s_%s" % (InputJetCollectionName, OutputJetCollectionName), + OutputContainer = OutputJetCollectionName, + InputContainer = InputJetCollectionName, + + ShallowCopy = doShallowCopy, + **options + ) + + ToolSvc += jetrec + FTAG5Seq += JetAlgorithm( + name = "JetAlgorithm_CopyJet_%s_%s" % (InputJetCollectionName, OutputJetCollectionName), + Tools = [jetrec], + ) + + return OutputJetCollectionName + + +#======================================================================== +# Hbb Tagger +#======================================================================== +def get_unique_name(strings): + clean_strings = [] + for string in strings: + chars = [] + for char in string: + chars += char if (char.isalpha() or char.isdigit()) else '_' + clean_strings.append(''.join(chars)) + return '_'.join(clean_strings) + +def addHbbTagger( + sequence, ToolSvc, logger=None, + output_level=WARNING, + jet_collection="AntiKt10LCTopoTrimmedPtFrac5SmallR20", + nn_file_name="BoostedJetTaggers/HbbTagger/Summer2018/Apr13HbbNetwork.json", + nn_config_file="BoostedJetTaggers/HbbTaggerDNN/PreliminaryConfigNovember2017.json"): + if logger is None: + logger = Logging.logging.getLogger('HbbTaggerLog') + + fat_calibrator_name = get_unique_name(["HbbCalibrator", jet_collection]) + is_data = not DerivationFrameworkIsMonteCarlo + if not hasattr(ToolSvc, fat_calibrator_name): + fatCalib = CfgMgr.JetCalibrationTool( + fat_calibrator_name, + OutputLevel=output_level, + JetCollection=jet_collection, + ConfigFile="JES_MC16recommendation_FatJet_JMS_comb_19Jan2018.config", + CalibSequence="EtaJES_JMS", + CalibArea="00-04-81", + IsData=is_data) + ToolSvc += fatCalib + logger.info('set up {}'.format(fatCalib)) + else: + logger.info('took {} from tool svc'.format(fat_calibrator_name)) + fatCalib = getattr(ToolSvc, fat_calibrator_name) + + # short name for naming tools + nn_short_file = nn_file_name.split('/')[-1].split('.')[0] + + hbb_tagger_name = get_unique_name(["HbbTagger",nn_short_file]) + if not hasattr(ToolSvc, hbb_tagger_name): + hbbTagger = CfgMgr.HbbTaggerDNN( + hbb_tagger_name, + OutputLevel=output_level, + neuralNetworkFile=nn_file_name, + configurationFile=nn_config_file) + ToolSvc += hbbTagger + logger.info('set up {}'.format(hbbTagger)) + else: + logger.info('took {} from tool svc'.format(hbb_tagger_name)) + hbbTagger = getattr(ToolSvc, hbb_tagger_name) + + tagger_alg_name = get_unique_name( + ["HbbTaggerAlg",jet_collection, nn_short_file]) + if not hasattr(sequence, tagger_alg_name): + if tagger_alg_name in DFJetAlgs: + sequence += DFJetAlgs[tagger_alg_name] + logger.info('took {} from jet algs'.format(tagger_alg_name)) + else: + tagger_alg = CfgMgr.HbbTaggingAlgorithm( + tagger_alg_name, + OutputLevel=output_level, + jetCollectionName=(jet_collection + "Jets"), + minPt=250e3, + maxEta=2.0, + tagger=hbbTagger, + calibrationTool=fatCalib) + DFJetAlgs[tagger_alg_name] = tagger_alg + sequence += tagger_alg + logger.info('set up {}'.format(tagger_alg)) + else: + logger.info('{} already scheduled for {}'.format( + tagger_alg_name, jet_collection)) + +def addRecommendedXbbTaggers(sequence, ToolSvc, logger=None): + addHbbTagger(sequence, ToolSvc, logger) + addHbbTagger( + sequence, ToolSvc, + nn_file_name="BoostedJetTaggers/HbbTagger/Summer2018/MulticlassNetwork.json", + nn_config_file="BoostedJetTaggers/HbbTaggerDNN/MulticlassConfigJune2018.json") + +xbbTaggerExtraVariables = [ + "AntiKt10LCTopoTrimmedPtFrac5SmallR20Jets.HbbScore", + "AntiKt10LCTopoTrimmedPtFrac5SmallR20Jets.XbbScoreHiggs.XbbScoreTop.XbbScoreQCD"] + +#==================================================================== +# Large-R RC jets w/ ExKt 2 & 3 subjets +#=================================================================== +def addExKtDoubleTaggerRCJets(sequence, ToolSvc):#, ExKtJetCollection__FatJetConfigs, ExKtJetCollection__FatJet, ExKtJetCollection__SubJet):#, jetToolName, algoName): + DFisMC = (globalflags.DataSource()=='geant4') + jetToolName = "DFReclustertingTool" + algoName = "DFJetReclusteringAlgo" + + ExKtJetCollection__FatJet = "AntiKt8EMPFlowJets" + ExKtJetCollection__SubJet = [] + + if jetToolName not in DFJetAlgs: + ToolSvc += CfgMgr.JetReclusteringTool(jetToolName,InputJetContainer="AntiKt4EMPFlowJets", OutputJetContainer="AntiKt8EMPFlowJets") + getattr(ToolSvc,jetToolName).ReclusterRadius = 0.8 + getattr(ToolSvc,jetToolName).InputJetPtMin = 20 + getattr(ToolSvc,jetToolName).RCJetPtMin = 1 + getattr(ToolSvc,jetToolName).TrimPtFrac = 0 + getattr(ToolSvc,jetToolName).DoArea = False + getattr(ToolSvc,jetToolName).GhostTracksInputContainer = "InDetTrackParticles" + getattr(ToolSvc,jetToolName).GhostTracksVertexAssociationName = "JetTrackVtxAssoc" + if(DFisMC): + getattr(ToolSvc,jetToolName).GhostTruthBHadronsInputContainer = "BHadronsFinal" + getattr(ToolSvc,jetToolName).GhostTruthCHadronsInputContainer = "CHadronsFinal" + + sequence += CfgMgr.AthJetReclusteringAlgo(algoName, JetReclusteringTool = getattr(ToolSvc,jetToolName)) + DFJetAlgs[jetToolName] = getattr(ToolSvc,jetToolName) + + # build subjets + GhostLabels = ["GhostTrack"] + if(DFisMC): + GhostLabels += ["GhostBHadronsFinal"] + GhostLabels += ["GhostCHadronsFinal"] + # N=2 subjets + ExKtJetCollection__SubJet += addExKtCoM(sequence, ToolSvc, ExKtJetCollection__FatJet, nSubjets=2, doTrackSubJet=True, ExGhostLabels=GhostLabels, min_subjet_pt_mev=1) + # N=3 subjets + ExKtJetCollection__SubJet += addExKtCoM(sequence, ToolSvc, ExKtJetCollection__FatJet, nSubjets=3, doTrackSubJet=True, ExGhostLabels=GhostLabels, min_subjet_pt_mev=1) + #Ghosttracks + # N=2 subjets + ExKtJetCollection__SubJet += addExKtCoM(sequence, ToolSvc, ExKtJetCollection__FatJet, nSubjets=2, doTrackSubJet=True, doGhostAssoc=True, ExGhostLabels=GhostLabels, min_subjet_pt_mev=1) + # N=3 subjets + ExKtJetCollection__SubJet += addExKtCoM(sequence, ToolSvc, ExKtJetCollection__FatJet, nSubjets=3, doTrackSubJet=True, doGhostAssoc=True, ExGhostLabels=GhostLabels, min_subjet_pt_mev=1) + + sequence += CfgMgr.xAODMaker__ElementLinkResetAlg("ELReset_AfterSubjetBuild", SGKeys=[name+"Aux." for name in ExKtJetCollection__SubJet]) + + from BTagging.BTaggingFlags import BTaggingFlags + BTaggingFlags.CalibrationChannelAliases += [ jetname[:-4].replace("PV0", "")+"->AntiKt4EMTopo" for jetname in ExKtJetCollection__FatJet ] + BTaggingFlags.CalibrationChannelAliases += [ jetname[:-4].replace("PV0", "")+"->AntiKt4EMTopo" for jetname in ExKtJetCollection__SubJet ] + + sequence += CfgMgr.xAODMaker__ElementLinkResetAlg("ELReset_AfterBtag", SGKeys=[name+"Aux." for name in ExKtJetCollection__SubJet]) diff --git a/PhysicsAnalysis/DerivationFramework/DerivationFrameworkFlavourTag/python/JetFlavorGhostLabels.py b/PhysicsAnalysis/DerivationFramework/DerivationFrameworkFlavourTag/python/JetFlavorGhostLabels.py new file mode 100644 index 0000000000000000000000000000000000000000..5539eb4dc406f1b46b9b196eaad9b426b1ea1f00 --- /dev/null +++ b/PhysicsAnalysis/DerivationFramework/DerivationFrameworkFlavourTag/python/JetFlavorGhostLabels.py @@ -0,0 +1,14 @@ +# Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration + +_flavors = [ + 'BHadronsFinal', + 'CHadronsFinal', +] + +def getJetFlavorGhostLabels(flavors=_flavors): + labels = [ + 'Ghost' + gp + 'Count' for gp in _flavors + ] + [ + 'Ghost' + gp + 'Pt' for gp in _flavors + ] + return '.'.join(labels) diff --git a/PhysicsAnalysis/DerivationFramework/DerivationFrameworkFlavourTag/python/SoftBtagCommon.py b/PhysicsAnalysis/DerivationFramework/DerivationFrameworkFlavourTag/python/SoftBtagCommon.py new file mode 100644 index 0000000000000000000000000000000000000000..91f7b6f471cfba4e7941d34a447c9d1df0cb375a --- /dev/null +++ b/PhysicsAnalysis/DerivationFramework/DerivationFrameworkFlavourTag/python/SoftBtagCommon.py @@ -0,0 +1,63 @@ +# Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration + +#******************************************************************** + +# SoftBtagCommon.py + +#******************************************************************** + +import AthenaCommon.Constants as Lvl +from AthenaCommon import Logging +ftaglog = Logging.logging.getLogger('SoftBtagCommon') + +from DerivationFrameworkCore.DerivationFrameworkMaster import * +from AthenaCommon.GlobalFlags import globalflags + +def applySoftBtagging(algname,sequence): + + from VrtSecInclusive.SoftBtagTrackSelector import SoftBtagTrackSelector + SoftBtagTrackSelector = SoftBtagTrackSelector() + SoftBtagTrackSelector.Jetcontainer = "AntiKt4EMTopoJets" + SoftBtagTrackSelector.InputTrackContainer = "InDetTrackParticles" + SoftBtagTrackSelector.OutputTrackContainer = "SoftBtagSeedTrackParticles" + + sequence += SoftBtagTrackSelector + from AthenaCommon.AppMgr import ToolSvc + + from VrtSecInclusive.VrtSecInclusive import VrtSecInclusive + VrtSecInclusive_SoftB = VrtSecInclusive("VrtSecInclusive_SoftB") + + sequence += VrtSecInclusive_SoftB + + # set options for vertexing + VrtSecInclusive_SoftB.TrackLocation = "SoftBtagSeedTrackParticles" + VrtSecInclusive_SoftB.SecondaryVerticesContainerName = "SoftBtagCandidateVertices" + VrtSecInclusive_SoftB.TruthParticleFilter = "Bhadron" + VrtSecInclusive_SoftB.DoTwoTrSoftBtag = True + VrtSecInclusive_SoftB.TwoTrVrtAngleCut = 0.7 + VrtSecInclusive_SoftB.twoTrVrtMinDistFromPV = 0.2 + VrtSecInclusive_SoftB.PassThroughTrackSelection = True + VrtSecInclusive_SoftB.ImpactWrtBL = False + VrtSecInclusive_SoftB.doPVcompatibilityCut = False + VrtSecInclusive_SoftB.RemoveFake2TrkVrt = True + VrtSecInclusive_SoftB.doReassembleVertices = False + VrtSecInclusive_SoftB.doMergeByShuffling = False + VrtSecInclusive_SoftB.doMergeFinalVerticesDistance = False + VrtSecInclusive_SoftB.doAssociateNonSelectedTracks = False + VrtSecInclusive_SoftB.doFinalImproveChi2 = False + VrtSecInclusive_SoftB.DoTruth = False + VrtSecInclusive_SoftB.SelVrtChi2Cut = 5. + VrtSecInclusive_SoftB.SelTrkMaxCutoff = 30 + VrtSecInclusive_SoftB.twoTrkVtxFormingD0Cut = 0. + + from TrkVKalVrtFitter.TrkVKalVrtFitterConf import Trk__TrkVKalVrtFitter + InclusiveVxFitterTool = Trk__TrkVKalVrtFitter(name = "InclusiveVxFitter", + Extrapolator = ToolSvc.AtlasExtrapolator, + IterationNumber = 30, + AtlasMagFieldSvc = "AtlasFieldSvc" + ) + ToolSvc += InclusiveVxFitterTool; + + VrtSecInclusive_SoftB.VertexFitterTool=InclusiveVxFitterTool + VrtSecInclusive_SoftB.Extrapolator = ToolSvc.AtlasExtrapolator + diff --git a/PhysicsAnalysis/DerivationFramework/DerivationFrameworkFlavourTag/python/__init__.py b/PhysicsAnalysis/DerivationFramework/DerivationFrameworkFlavourTag/python/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..74583d364ec2ca794156596c7254d9b234a940c6 --- /dev/null +++ b/PhysicsAnalysis/DerivationFramework/DerivationFrameworkFlavourTag/python/__init__.py @@ -0,0 +1,2 @@ +# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + diff --git a/PhysicsAnalysis/DerivationFramework/DerivationFrameworkFlavourTag/share/FTAG1.py b/PhysicsAnalysis/DerivationFramework/DerivationFrameworkFlavourTag/share/FTAG1.py new file mode 100644 index 0000000000000000000000000000000000000000..1028dcd1e13746e823e06747f790a0e2973296c6 --- /dev/null +++ b/PhysicsAnalysis/DerivationFramework/DerivationFrameworkFlavourTag/share/FTAG1.py @@ -0,0 +1,476 @@ +#==================================================================== +# FTAG1.py +# It requires the reductionConf flag FTAG1 in Reco_tf.py +#==================================================================== + +# Set up common services and job object. +# This should appear in ALL derivation job options +from DerivationFrameworkCore.DerivationFrameworkMaster import * +from DerivationFrameworkInDet.InDetCommon import * +from DerivationFrameworkJetEtMiss.JetCommon import * +from DerivationFrameworkJetEtMiss.ExtendedJetCommon import * +from DerivationFrameworkJetEtMiss.ExtendedJetCommon import replaceAODReducedJets +from DerivationFrameworkEGamma.EGammaCommon import * +from DerivationFrameworkMuons.MuonsCommon import * +from DerivationFrameworkFlavourTag.HbbCommon import * +from DerivationFrameworkFlavourTag.FlavourTagCommon import FlavorTagInit +from DerivationFrameworkFlavourTag.SoftBtagCommon import applySoftBtagging +from DerivationFrameworkCore.ThinningHelper import ThinningHelper +from DerivationFrameworkCore.DerivationFrameworkCoreConf import DerivationFramework__DerivationKernel +from DerivationFrameworkCore.SlimmingHelper import SlimmingHelper + +from DstarVertexing.DstarVertexingConf import DstarVertexing +from TrkVertexFitterUtils.TrkVertexFitterUtilsConf import Trk__TrackToVertexIPEstimator +from DerivationFrameworkTools.DerivationFrameworkToolsConf import DerivationFramework__TriggerSkimmingTool +from DerivationFrameworkJetEtMiss.AntiKt4EMTopoJetsCPContent import AntiKt4EMTopoJetsCPContent +from DerivationFrameworkInDet.DerivationFrameworkInDetConf import DerivationFramework__TrackToVertexWrapper +from DerivationFrameworkFlavourTag.FlavourTagAllVariables import FTAllVars_bjetTriggerVtx +from DerivationFrameworkFlavourTag.FlavourTagExtraVariables import FTExtraVars_bjetTriggerTracks +from DerivationFrameworkFlavourTag.FlavourTagExtraVariables import FTExtraVars_bjetTriggerTracks + +#==================================================================== +# Create Private Sequence +#==================================================================== + +FTAG1Seq = CfgMgr.AthSequencer("FTAG1Sequence") + +#==================================================================== +# SKIMMING TOOLS +# (SKIMMING = REMOVING WHOLE EVENTS THAT FAIL CRITERIA) +# Create skimming tool, and create + add kernel to sequence +#==================================================================== + +# triggers used for skimming: +triggers_jX = ["HLT_j[0-9]*"] +triggers_bperf = ["HLT_j[1-9][0-9]*_b.*perf.*"] +triggersSkim = triggers_jX + triggers_bperf + +FTAG1TriggerSkimmingTool = DerivationFramework__TriggerSkimmingTool(name = "FTAG1TriggerSkimmingTool", + TriggerListOR = triggersSkim) +ToolSvc += FTAG1TriggerSkimmingTool +print FTAG1TriggerSkimmingTool + +FTAG1Seq += CfgMgr.DerivationFramework__DerivationKernel("FTAG1SkimKernel", + SkimmingTools = [FTAG1TriggerSkimmingTool], + ) + +#==================================================================== +# TRUTH SETUP +#==================================================================== +if globalflags.DataSource()!='data': + from DerivationFrameworkMCTruth.MCTruthCommon import addStandardTruthContents, addHFAndDownstreamParticles + addStandardTruthContents() + addHFAndDownstreamParticles() + +#==================================================================== +# AUGMENTATION TOOLS +# ( AUGMENTATION = adding information to the output DxAOD that is not found in the input file ) +# Create DStar vertexing tool, and create + add kernel to sequence +#==================================================================== + +#add D0 augmentation +FTAG1DstarAug="D0VxAug" +FTAG1DstarVertexing = DstarVertexing( name = "FTAG1DstarVertexing", + OutputLevel = INFO, + D0VertexOutputName= FTAG1DstarAug, + InputJetsColletion = "AntiKt4EMTopoJets", + JetPtCut = 20) + +ToolSvc += FTAG1DstarVertexing +print "using DstarVertexing package to add D0 vertex information" +print FTAG1DstarVertexing + +FTAG1Seq += CfgMgr.DerivationFramework__DerivationKernel("FTAG1AugmentKernel", + AugmentationTools = [FTAG1DstarVertexing] + ) + +#make IPE tool for BTagTrackAugmenter +FTAG1IPETool = Trk__TrackToVertexIPEstimator(name = "FTAG1IPETool") +ToolSvc += FTAG1IPETool +print FTAG1IPETool + +#==================================================================== +# Basic Jet Collections +#==================================================================== + +#put custom jet names here +OutputJets["FTAG1"] = ["AntiKtVR30Rmax4Rmin02TrackJets_BTagging201810", + "AntiKtVR30Rmax4Rmin02TrackJets_BTagging201810GhostTag", + "AntiKtVR30Rmax4Rmin02TrackJets_BTagging201903", + "AntiKt10LCTopoTrimmedPtFrac5SmallR20ExKt2SubJets", + "AntiKt10LCTopoTrimmedPtFrac5SmallR20ExKt3SubJets", + "AntiKt10LCTopoTrimmedPtFrac5SmallR20ExCoM2SubJets", + "AntiKt4EMTopoJets", + "AntiKt4EMPFlowJets" + ] + + +reducedJetList = ["AntiKt2PV0TrackJets", + "AntiKt4PV0TrackJets", + "AntiKt10LCTopoJets", + "AntiKt4TruthJets"] + +extendedFlag = 1 # --- = 0 for Standard Taggers & =1 for ExpertTaggers + +replaceAODReducedJets(reducedJetList,FTAG1Seq,"FTAG1", extendedFlag) + +addDefaultTrimmedJets(FTAG1Seq,"FTAG1",dotruth=True) +# +# Adding ExKt and ExCoM sub-jets for each trimmed large-R jet +# +ExKtJetCollection__FatJet = "AntiKt10LCTopoTrimmedPtFrac5SmallR20Jets" +ExKtJetCollection__SubJet = addExKtCoM(FTAG1Seq, ToolSvc, ExKtJetCollection__FatJet, nSubjets=2, doTrackSubJet=False) +ExKtJetCollection__SubJet3 = addExKtCoM(FTAG1Seq, ToolSvc, ExKtJetCollection__FatJet, nSubjets=3, doTrackSubJet=False) +ExCoMJetCollection__SubJet = addExKtCoM(FTAG1Seq, ToolSvc, ExKtJetCollection__FatJet, nSubjets=2, doTrackSubJet=False, subjetAlgName = "CoM") + + +BTaggingFlags.CalibrationChannelAliases += ["AntiKt10LCTopoTrimmedPtFrac5SmallR20ExKt2Sub->AntiKt4LCTopo,AntiKt4TopoEM,AntiKt4EMTopo", + "AntiKt10LCTopoTrimmedPtFrac5SmallR20ExKt3Sub->AntiKt4LCTopo,AntiKt4TopoEM,AntiKt4EMTopo", + "AntiKt10LCTopoTrimmedPtFrac5SmallR20ExCoM2Sub->AntiKt4LCTopo,AntiKt4TopoEM,AntiKt4EMTopo"] + +#============================================================================== +# Soft Tagging +#============================================================================== +from DerivationFrameworkFlavourTag.DerivationFrameworkFlavourTagConf import BTagVertexAugmenter +from InDetVKalVxInJetTool.InDetVKalVxInJetFinder import InDetVKalVxInJetFinder + +FTAG1Seq += BTagVertexAugmenter("BTagVertexAugmenter") + + +# used by Loose and Medium +SoftBJetSVFinderTool = InDetVKalVxInJetFinder("SoftBJetSVFinder") +ToolSvc += SoftBJetSVFinderTool +SoftBJetSVFinderTool.ConeForTag = 0.75 + +softTagAlgLoose = CfgMgr.SoftBVrt__SoftBVrtClusterTool( "SoftBVrtClusterToolLoose", + OutputLevel=INFO, #DEBUG + ) + +softTagAlgLoose.SVFinderName = 'SoftBJetSVFinder' +softTagAlgLoose.TrackJetCollectionName = 'AntiKt4PV0TrackJets' +softTagAlgLoose.TrackSelectionTool.CutLevel = "LoosePrimary" +softTagAlgLoose.OperatingPoint = 'Loose' + +FTAG1Seq += softTagAlgLoose + +softTagAlgMedium = CfgMgr.SoftBVrt__SoftBVrtClusterTool( "SoftBVrtClusterToolMedium", + OutputLevel=INFO, #DEBUG + ) + +softTagAlgMedium.SVFinderName = 'SoftBJetSVFinder' +softTagAlgMedium.TrackJetCollectionName = 'AntiKt4PV0TrackJets' +softTagAlgMedium.TrackSelectionTool.CutLevel = "LoosePrimary" +softTagAlgMedium.OperatingPoint = 'Medium' + +FTAG1Seq += softTagAlgMedium + +# used by Tight +SoftBJetSVFinderToolTight = InDetVKalVxInJetFinder("SoftBJetSVFinderTight") +ToolSvc += SoftBJetSVFinderToolTight +SoftBJetSVFinderTool.ConeForTag = 0.6 + +softTagAlgTight = CfgMgr.SoftBVrt__SoftBVrtClusterTool( "SoftBVrtClusterToolTight", + OutputLevel=INFO, #DEBUG + ) + +softTagAlgTight.SVFinderName = 'SoftBJetSVFinderTight' +softTagAlgTight.TrackJetCollectionName = 'AntiKt4PV0TrackJets' +softTagAlgTight.TrackSelectionTool.CutLevel = "LoosePrimary" +softTagAlgTight.OperatingPoint = 'Tight' + +FTAG1Seq += softTagAlgTight + +applySoftBtagging("softBtag", FTAG1Seq ) # SV tagger in VrtSecInclusive + +#=================================================================== +# Add Large-R RC jets w/ ExKt 2 & 3 subjets +#=================================================================== + +addExKtDoubleTaggerRCJets(FTAG1Seq, ToolSvc) + +#=================================================================== +# Variable Radius (VR) Jets +#=================================================================== + +# Create variable-R trackjets and dress AntiKt10LCTopo with ghost VR-trkjet +addVRJets(FTAG1Seq) +addVRJets(FTAG1Seq, do_ghost=True) +addVRJets(FTAG1Seq, training='201903') #new trackjet training! +# Also add Hbb Tagger(s) +addHbbTagger(FTAG1Seq, ToolSvc) +addHbbTagger( + FTAG1Seq, ToolSvc, + nn_file_name="BoostedJetTaggers/HbbTagger/Summer2018/MulticlassNetwork.json", + nn_config_file="BoostedJetTaggers/HbbTaggerDNN/MulticlassConfigJune2018.json") + +# alias for VR +BTaggingFlags.CalibrationChannelAliases += ["AntiKtVR30Rmax4Rmin02Track->AntiKtVR30Rmax4Rmin02Track,AntiKt4EMTopo", + "AntiKtVR30Rmax4Rmin02TrackGhostTag->AntiKtVR30Rmax4Rmin02TrackGhostTag,AntiKt4EMTopo"] + +#=================================================================== +# Tag custom or pre-built jet collections +#=================================================================== + +FlavorTagInit(scheduleFlipped = True, JetCollections = ['AntiKt4EMTopoJets', 'AntiKt4EMPFlowJets'],Sequencer = FTAG1Seq) + +#==================================================================== +# Add sequence (with all kernels needed) to DerivationFrameworkJob +#==================================================================== + +DerivationFrameworkJob += FTAG1Seq + +#==================================================================== +# SET UP STREAM +#==================================================================== + +# The base name (DAOD_FTAG1 here) must match the string in +streamName = derivationFlags.WriteDAOD_FTAG1Stream.StreamName +fileName = buildFileName( derivationFlags.WriteDAOD_FTAG1Stream ) +FTAG1Stream = MSMgr.NewPoolRootStream( streamName, fileName ) +# Only events that pass the filters listed below are written out. +# Name must match that of the kernel above +# AcceptAlgs = logical OR of filters +# RequireAlgs = logical AND of filters +FTAG1Stream.AcceptAlgs(["FTAG1SkimKernel"]) +FTAG1SlimmingHelper = SlimmingHelper("FTAG1SlimmingHelper") + +# nb: BTagging_AntiKt4EMTopo smart collection includes both AntiKt4EMTopoJets and BTagging_AntiKt4EMTopo +# container variables. Thus BTagging_AntiKt4EMTopo is needed in SmartCollections as well as AllVariables +FTAG1SlimmingHelper.SmartCollections = ["Electrons","Muons", + "PrimaryVertices", + "InDetTrackParticles", + "MET_Reference_AntiKt4EMTopo", + "MET_Reference_AntiKt4EMPFlow", + "AntiKt4EMTopoJets", + "AntiKt4EMPFlowJets", + "AntiKt8EMPFlowJets", + "AntiKt8EMPFlowExKt2SubJets", + "AntiKt8EMPFlowExKt3SubJets", + "BTagging_AntiKt8EMPFlowExKt2Sub", + "BTagging_AntiKt8EMPFlowExKt3Sub", + "AntiKt8EMPFlowExKt2GASubJets", + "AntiKt8EMPFlowExKt3GASubJets", + "BTagging_AntiKt8EMPFlowExKt2GASub", + "BTagging_AntiKt8EMPFlowExKt3GASub", + ] + +FTAG1SlimmingHelper.AllVariables = ["AntiKt4EMTopoJets", "AntiKt4EMPFlowJets", + "BTagging_AntiKtVR30Rmax4Rmin02Track_2018GhostTag", + "BTagging_AntiKtVR30Rmax4Rmin02Track_201810", + "BTagging_AntiKtVR30Rmax4Rmin02Track_201810JFVtx", + "BTagging_AntiKtVR30Rmax4Rmin02Track_201903", + "BTagging_AntiKtVR30Rmax4Rmin02Track_201903JFVtx", + "BTagging_AntiKt10LCTopoTrimmedPtFrac5SmallR20ExKt2Sub", + "BTagging_AntiKt10LCTopoTrimmedPtFrac5SmallR20ExKt2SubJFVtx", + "BTagging_AntiKt10LCTopoTrimmedPtFrac5SmallR20ExKt3Sub", + "BTagging_AntiKt10LCTopoTrimmedPtFrac5SmallR20ExKt3SubJFVtx", + "BTagging_AntiKt10LCTopoTrimmedPtFrac5SmallR20ExCoM2Sub", + "BTagging_AntiKt10LCTopoTrimmedPtFrac5SmallR20ExCoM2SubJFVtx", + "BTagging_AntiKt2Track", + "BTagging_AntiKt2TrackJFVtx", + "TruthEvents", + "MET_Truth", + "MET_TruthRegions", + "TruthParticles", + "TruthHFWithDecayParticles", + "TruthHFWithDecayVertices", + "TruthVertices", + "CaloCalTopoClusters", + "HLT_xAOD__BTaggingContainer_HLTBjetFex", + "HLT_xAOD__BTagVertexContainer_BjetVertexFex", + "HLT_xAOD__VertexContainer_BjetSecondaryVertexFex", + "HLT_xAOD__VertexContainer_PrimVertexFTKRaw", + "HLT_xAOD__VertexContainer_PrimVertexFTK", + "HLT_xAOD__VertexContainer_PrimVertexFTKRefit", + "HLT_xAOD__VertexContainer_xPrimVx", + "HLT_xAOD__VertexContainer_EFHistoPrmVtx", + "HLT_xAOD__VertexContainer_SecondaryVertex", + "HLT_xAOD__JetContainer_FarawayJet", + "HLT_xAOD__TrackParticleContainer_InDetTrigTrackingxAODCnv_Bjet_IDTrig", + ] + +for FT1_bjetTriggerVtx in FTAllVars_bjetTriggerVtx: + FTAG1SlimmingHelper.AllVariables.append(FT1_bjetTriggerVtx) + +FTAG1SlimmingHelper.ExtraVariables += [AntiKt4EMTopoJetsCPContent[1].replace("AntiKt4EMTopoJetsAux","AntiKt10LCTopoJets"), + "InDetTrackParticles.truthMatchProbability.x.y.z.vx.vy.vz", + "InDetTrackParticles.numberOfInnermostPixelLayerSplitHits.numberOfNextToInnermostPixelLayerSplitHits.numberOfNextToInnermostPixelLayerSharedHits", + "InDetTrackParticles.numberOfPixelSplitHits.numberOfInnermostPixelLayerSharedHits.numberOfContribPixelLayers.hitPattern.radiusOfFirstHit", + "InDetTrackParticles.is_selected.is_associated.is_svtrk_final.pt_wrtSV.eta_wrtSV.phi_wrtSV.d0_wrtSV.z0_wrtSV.errP_wrtSV.errd0_wrtSV.errz0_wrtSV.chi2_toSV", + "InDetTrackParticles.btagIp_d0.btagIp_z0SinTheta.btagIp_d0Uncertainty.btagIp_z0SinThetaUncertainty.btagIp_trackDisplacement.btagIp_trackMomentum", + "PrimaryVertices.neutralWeights.numberDoF.sumPt2.chiSquared.covariance.trackWeights", + "CombinedMuonTrackParticles.vx.vy.vz", + "ExtrapolatedMuonTrackParticles.vx.vy.vz", + "MSOnlyExtrapolatedMuonTrackParticles.vx.vy.vz", + "MuonSpectrometerTrackParticles.vx.vy.vz", + "AntiKt10LCTopoJets.ConeExclBHadronsFinal", + "AntiKt10LCTopoJets.GhostAntiKt2TrackJet.GhostAntiKt2TrackJetPt.GhostAntiKt2TrackJetCount", + "AntiKt10LCTopoJets.GhostVR30Rmax4Rmin02TrackJet_BTagging201810.GhostVR30Rmax4Rmin02TrackJet_BTagging201810Pt.GhostVR30Rmax4Rmin02TrackJet_BTagging201810Count", + "AntiKt10LCTopoJets.GhostVR30Rmax4Rmin02TrackJet_BTagging201903.GhostVR30Rmax4Rmin02TrackJet_BTagging201903Pt.GhostVR30Rmax4Rmin02TrackJet_BTagging201903Count", + "AntiKt10LCTopoJets.GhostVR30Rmax4Rmin02TrackJet_BTagging201810GhostTag.GhostVR30Rmax4Rmin02TrackJet_BTagging201810GhostTagPt.GhostVR30Rmax4Rmin02TrackJet_BTagging201810GhostTagCount", + "BTagging_AntiKt2TrackSecVtx.-vxTrackAtVertex", + "BTagging_AntiKt4EMTopo_201810SecVtx.-vxTrackAtVertex", + "BTagging_AntiKt4EMPFlow_201810SecVtx.-vxTrackAtVertex", + #"BTagging_AntiKtVR30Rmax4Rmin02Track_201810SecVtx.-vxTrackAtVertex", + "BTagging_AntiKt4EMPFlow_201903SecVtx.-vxTrackAtVertex", + "BTagging_AntiKtVR30Rmax4Rmin02Track_201810SecVtx.-vxTrackAtVertex", + "BTagging_AntiKtVR30Rmax4Rmin02Track_201903SecVtx.-vxTrackAtVertex", + "BTagging_AntiKtVR30Rmax4Rmin02Track_201810GhostTagSecVtx.-vxTrackAtVertex", + "BTagging_AntiKt10LCTopoTrimmedPtFrac5SmallR20ExKt2SubSecVtx.-vxTrackAtVertex", + "BTagging_AntiKt10LCTopoTrimmedPtFrac5SmallR20ExKt3SubSecVtx.-vxTrackAtVertex", + "BTagging_AntiKt10LCTopoTrimmedPtFrac5SmallR20ExCoM2SubSecVtx.-vxTrackAtVertex", + #"InDetTrackParticles.FTAG1_unbiased_d0.FTAG1_unbiased_z0.FTAG1_unbiased_d0Sigma.FTAG1_unbiased_z0Sigma", + "CaloCalTopoClusters.calM.calE.calEta.calPhi", + "PrimaryVertices.x.y.trackParticleLinks.vertexType.neutralParticleLinks", + "HLT_xAOD__TrackParticleContainer_InDetTrigTrackingxAODCnv_BjetPrmVtx_FTF.vz", + "HLT_xAOD__TrackParticleContainer_InDetTrigTrackingxAODCnv_Bjet_FTF.vz", + "HLT_xAOD__TrackParticleContainer_InDetTrigTrackingxAODCnv_Bjet_IDTrig.vz", + FTAG1DstarAug+".-vxTrackAtVertex"] + +for FT1_bjetTriggerTracks in FTExtraVars_bjetTriggerTracks: + FTAG1SlimmingHelper.ExtraVariables.append(FT1_bjetTriggerTracks) + +FTAG1SlimmingHelper.SmartCollections += ["AntiKt4EMTopoJets_BTagging201810", + "AntiKt4EMPFlowJets_BTagging201810", + "AntiKt4EMPFlowJets_BTagging201903"] + +FTAG1SlimmingHelper.AllVariables += ["BTagging_AntiKt4EMPFlow_201810", + "BTagging_AntiKt4EMPFlow_201903", + "BTagging_AntiKt4EMPFlow_201810JFVtx", + "BTagging_AntiKt4EMPFlow_201903JFVtx", + "BTagging_AntiKt4EMTopo_201810", + "BTagging_AntiKt4EMTopo_201810JFVtx", + "AntiKt4EMTopoJets_BTagging201810", + "AntiKt4EMPFlowJets_BTagging201810", + "AntiKt4EMPFlowJets_BTagging201903", + "AntiKtVR30Rmax4Rmin02TrackJets_BTagging201810", + "AntiKtVR30Rmax4Rmin02TrackJets_BTagging201903"] +FTAG1SlimmingHelper.ExtraVariables += ["BTagging_AntiKt4EMTopo_201810SecVtx.-vxTrackAtVertex"] + + +#---------------------------------------------------------------------- +# Add needed dictionary stuff +FTAG1SlimmingHelper.AppendToDictionary = { + "TruthHFWithDecayParticles" : "xAOD::TruthParticleContainer", + "TruthHFWithDecayParticlesAux" : "xAOD::TruthParticleAuxContainer", + "TruthHFWithDecayVertices" : "xAOD::TruthVertexContainer", + "TruthHFWithDecayVerticesAux" : "xAOD::TruthVertexAuxContainer", + FTAG1DstarAug : "xAOD::VertexContainer", + FTAG1DstarAug+"Aux" : "xAOD::VertexAuxContainer", + "AntiKtVR30Rmax4Rmin02Track_BTagging201810GhostTag" : "xAOD::JetContainer" , + "AntiKtVR30Rmax4Rmin02Track_BTagging201810GhostTagAux" : "xAOD::JetAuxContainer" , + "BTagging_AntiKt4EMTopo_201810JFVtx" : "xAOD::BTagVertexContainer", + "BTagging_AntiKt4EMTopo_201810JFVtxAux" : "xAOD::BTagVertexAuxContainer", + "BTagging_AntiKt4EMPFlow" : "xAOD::BTaggingContainer", + "BTagging_AntiKt4EMPFlowAux" : "xAOD::BTaggingAuxContainer", + "BTagging_AntiKt4EMPFlowJFVtx" : "xAOD::BTagVertexContainer", + "BTagging_AntiKt4EMPFlowJFVtxAux" : "xAOD::BTagVertexAuxContainer", + "BTagging_AntiKt4EMPFlow_201810JFVtx" : "xAOD::BTagVertexContainer", + "BTagging_AntiKt4EMPFlow_201810JFVtxAux" : "xAOD::BTagVertexAuxContainer", + "BTagging_AntiKt4EMPFlow_201903JFVtx" : "xAOD::BTagVertexContainer", + "BTagging_AntiKt4EMPFlow_201903JFVtxAux" : "xAOD::BTagVertexAuxContainer", + "BTagging_AntiKt4EMTopo_201810SecVtx" : "xAOD::VertexContainer", + "BTagging_AntiKt4EMTopo_201810SecVtxAux" : "xAOD::VertexAuxContainer", + "BTagging_AntiKt4EMPFlow_201810SecVtx" : "xAOD::VertexContainer", + "BTagging_AntiKt4EMPFlow_201810SecVtxAux" : "xAOD::VertexAuxContainer", + "BTagging_AntiKt4EMPFlow_201903SecVtx" : "xAOD::VertexContainer", + "BTagging_AntiKt4EMPFlow_201903SecVtxAux" : "xAOD::VertexAuxContainer", + "BTagging_AntiKtVR30Rmax4Rmin02Track_201810" : "xAOD::BTaggingContainer" , + "BTagging_AntiKtVR30Rmax4Rmin02Track_201810Aux" : "xAOD::BTaggingAuxContainer", + "BTagging_AntiKtVR30Rmax4Rmin02Track_201810JFVtx" : "xAOD::BTagVertexContainer" , + "BTagging_AntiKtVR30Rmax4Rmin02Track_201810JFVtxAux" : "xAOD::BTagVertexAuxContainer", + "BTagging_AntiKtVR30Rmax4Rmin02Track_201810SecVtx" : "xAOD::VertexContainer" , + "BTagging_AntiKtVR30Rmax4Rmin02Track_201810SecVtxAux" : "xAOD::VertexAuxContainer", + "BTagging_AntiKtVR30Rmax4Rmin02Track_201903" : "xAOD::BTaggingContainer" , + "BTagging_AntiKtVR30Rmax4Rmin02Track_201903Aux" : "xAOD::BTaggingAuxContainer", + "BTagging_AntiKtVR30Rmax4Rmin02Track_201903JFVtx" : "xAOD::BTagVertexContainer" , + "BTagging_AntiKtVR30Rmax4Rmin02Track_201903JFVtxAux" : "xAOD::BTagVertexAuxContainer", + "BTagging_AntiKtVR30Rmax4Rmin02Track_201903SecVtx" : "xAOD::VertexContainer" , + "BTagging_AntiKtVR30Rmax4Rmin02Track_201903SecVtxAux" : "xAOD::VertexAuxContainer", + "BTagging_AntiKtVR30Rmax4Rmin02Track_201810GhostTag" : "xAOD::BTaggingContainer" , + "BTagging_AntiKtVR30Rmax4Rmin02Track_201810GhostTagAux" : "xAOD::BTaggingAuxContainer", + "BTagging_AntiKtVR30Rmax4Rmin02Track_201810GhostTagJFVtx" : "xAOD::BTagVertexContainer" , + "BTagging_AntiKtVR30Rmax4Rmin02Track_201810GhostTagJFVtxAux" : "xAOD::BTagVertexAuxContainer", + "BTagging_AntiKtVR30Rmax4Rmin02Track_201810GhostTagSecVtx" : "xAOD::VertexContainer" , + "BTagging_AntiKtVR30Rmax4Rmin02Track_201810GhostTagSecVtxAux" : "xAOD::VertexAuxContainer", + "BTagging_AntiKt2Track" : "xAOD::BTaggingContainer" , + "BTagging_AntiKt2TrackAux" : "xAOD::BTaggingAuxContainer", + "BTagging_AntiKt2TrackJFVtx" : "xAOD::BTagVertexContainer" , + "BTagging_AntiKt2TrackJFVtxAux" : "xAOD::BTagVertexAuxContainer", + "BTagging_AntiKt2TrackSecVtx" : "xAOD::VertexContainer" , + "BTagging_AntiKt2TrackSecVtxAux" : "xAOD::VertexAuxContainer", + "AntiKt10LCTopoTrimmedPtFrac5SmallR20ExKt2SubJets" : "xAOD::JetContainer" , + "AntiKt10LCTopoTrimmedPtFrac5SmallR20ExKt2SubJetsAux" : "xAOD::JetAuxContainer" , + "BTagging_AntiKt10LCTopoTrimmedPtFrac5SmallR20ExKt2Sub" : "xAOD::BTaggingContainer" , + "BTagging_AntiKt10LCTopoTrimmedPtFrac5SmallR20ExKt2SubAux" : "xAOD::BTaggingAuxContainer", + "BTagging_AntiKt10LCTopoTrimmedPtFrac5SmallR20ExKt2SubJFVtx" : "xAOD::BTagVertexContainer" , + "BTagging_AntiKt10LCTopoTrimmedPtFrac5SmallR20ExKt2SubJFVtxAux" : "xAOD::BTagVertexAuxContainer", + "BTagging_AntiKt10LCTopoTrimmedPtFrac5SmallR20ExKt2SubSecVtx" : "xAOD::VertexContainer" , + "BTagging_AntiKt10LCTopoTrimmedPtFrac5SmallR20ExKt2SubSecVtxAux" : "xAOD::VertexAuxContainer", + "AntiKt10LCTopoTrimmedPtFrac5SmallR20ExKt3SubJets" : "xAOD::JetContainer" , + "AntiKt10LCTopoTrimmedPtFrac5SmallR20ExKt3SubJetsAux" : "xAOD::JetAuxContainer" , + "BTagging_AntiKt10LCTopoTrimmedPtFrac5SmallR20ExKt3Sub" : "xAOD::BTaggingContainer" , + "BTagging_AntiKt10LCTopoTrimmedPtFrac5SmallR20ExKt3SubAux" : "xAOD::BTaggingAuxContainer", + "BTagging_AntiKt10LCTopoTrimmedPtFrac5SmallR20ExKt3SubJFVtx" : "xAOD::BTagVertexContainer" , + "BTagging_AntiKt10LCTopoTrimmedPtFrac5SmallR20ExKt3SubJFVtxAux" : "xAOD::BTagVertexAuxContainer", + "BTagging_AntiKt10LCTopoTrimmedPtFrac5SmallR20ExKt3SubSecVtx" : "xAOD::VertexContainer" , + "BTagging_AntiKt10LCTopoTrimmedPtFrac5SmallR20ExKt3SubSecVtxAux" : "xAOD::VertexAuxContainer", + "AntiKt10LCTopoTrimmedPtFrac5SmallR20ExCoM2SubJets" : "xAOD::JetContainer" , + "AntiKt10LCTopoTrimmedPtFrac5SmallR20ExCoM2SubJetsAux" : "xAOD::JetAuxContainer" , + "BTagging_AntiKt10LCTopoTrimmedPtFrac5SmallR20ExCoM2Sub" : "xAOD::BTaggingContainer" , + "BTagging_AntiKt10LCTopoTrimmedPtFrac5SmallR20ExCoM2SubAux" : "xAOD::BTaggingAuxContainer", + "BTagging_AntiKt10LCTopoTrimmedPtFrac5SmallR20ExCoM2SubJFVtx" : "xAOD::BTagVertexContainer" , + "BTagging_AntiKt10LCTopoTrimmedPtFrac5SmallR20ExCoM2SubJFVtxAux" : "xAOD::BTagVertexAuxContainer", + "BTagging_AntiKt10LCTopoTrimmedPtFrac5SmallR20ExCoM2SubSecVtx" : "xAOD::VertexContainer" , + "BTagging_AntiKt10LCTopoTrimmedPtFrac5SmallR20ExCoM2SubSecVtxAux" : "xAOD::VertexAuxContainer", + "AntiKt8EMPFlowJets" : "xAOD::JetContainer" , + "AntiKt8EMPFlowJetsAux" : "xAOD::JetAuxContainer" , + "AntiKt8EMPFlowExKt2SubJets" : "xAOD::JetContainer" , + "AntiKt8EMPFlowExKt2SubJetsAux" : "xAOD::JetAuxContainer" , + "BTagging_AntiKt8EMPFlowExKt2Sub" : "xAOD::BTaggingContainer" , + "BTagging_AntiKt8EMPFlowExKt2SubAux" : "xAOD::BTaggingAuxContainer", + "AntiKt8EMPFlowExKt3SubJets" : "xAOD::JetContainer" , + "AntiKt8EMPFlowExKt3SubJetsAux" : "xAOD::JetAuxContainer" , + "BTagging_AntiKt8EMPFlowExKt3Sub" : "xAOD::BTaggingContainer" , + "BTagging_AntiKt8EMPFlowExKt3SubAux" : "xAOD::BTaggingAuxContainer", + "AntiKt8EMPFlowExKt2GASubJets" : "xAOD::JetContainer" , + "AntiKt8EMPFlowExKt2GASubJetsAux" : "xAOD::JetAuxContainer" , + "BTagging_AntiKt8EMPFlowExKt2GASub" : "xAOD::BTaggingContainer" , + "BTagging_AntiKt8EMPFlowExKt2GASubAux" : "xAOD::BTaggingAuxContainer", + "AntiKt8EMPFlowExKt3GASubJets" : "xAOD::JetContainer" , + "AntiKt8EMPFlowExKt3GASubJetsAux" : "xAOD::JetAuxContainer" , + "BTagging_AntiKt8EMPFlowExKt3GASub" : "xAOD::BTaggingContainer" , + "BTagging_AntiKt8EMPFlowExKt3GASubAux" : "xAOD::BTaggingAuxContainer" + } +#---------------------------------------------------------------------- +# Add soft b-tagging containers +excludedVertexAuxData = "-vxTrackAtVertex.-MvfFitInfo.-isInitialized.-VTAV" + +StaticContent = [] +StaticContent += ["xAOD::VertexContainer#SoftBVrtClusterTool_Tight_Vertices"] +StaticContent += ["xAOD::VertexAuxContainer#SoftBVrtClusterTool_Tight_VerticesAux." + excludedVertexAuxData] +StaticContent += ["xAOD::VertexContainer#SoftBVrtClusterTool_Medium_Vertices"] +StaticContent += ["xAOD::VertexAuxContainer#SoftBVrtClusterTool_Medium_VerticesAux." + excludedVertexAuxData] +StaticContent += ["xAOD::VertexContainer#SoftBVrtClusterTool_Loose_Vertices"] +StaticContent += ["xAOD::VertexAuxContainer#SoftBVrtClusterTool_Loose_VerticesAux." + excludedVertexAuxData] +StaticContent += ["xAOD::VertexContainer#VrtSecInclusive_SoftBtagCandidateVertices"] +StaticContent += ["xAOD::VertexAuxContainer#VrtSecInclusive_SoftBtagCandidateVerticesAux."] + +FTAG1SlimmingHelper.StaticContent = StaticContent +#---------------------------------------------------------------------- + +addJetOutputs(FTAG1SlimmingHelper,["FTAG1"]) + +FTAG1SlimmingHelper.IncludeMuonTriggerContent = False +FTAG1SlimmingHelper.IncludeEGammaTriggerContent = False +FTAG1SlimmingHelper.IncludeJetTriggerContent = True +FTAG1SlimmingHelper.IncludeEtMissTriggerContent = False +FTAG1SlimmingHelper.IncludeBJetTriggerContent = True +#---------------------------------------------------------------------- + +#FTAG1 TrigNav Thinning +FTAG1ThinningHelper = ThinningHelper( "FTAG1ThinningHelper" ) +FTAG1ThinningHelper.TriggerChains = 'HLT_j[0-9]*|HLT_j[1-9][0-9]*_b.*perf.*' +FTAG1ThinningHelper.AppendToStream( FTAG1Stream ) + +FTAG1SlimmingHelper.AppendContentToStream(FTAG1Stream) diff --git a/PhysicsAnalysis/DerivationFramework/DerivationFrameworkFlavourTag/share/FTAG2.py b/PhysicsAnalysis/DerivationFramework/DerivationFrameworkFlavourTag/share/FTAG2.py new file mode 100644 index 0000000000000000000000000000000000000000..589e9db5a97ddd34a0a9eaa9246af6367b37eecc --- /dev/null +++ b/PhysicsAnalysis/DerivationFramework/DerivationFrameworkFlavourTag/share/FTAG2.py @@ -0,0 +1,359 @@ +#==================================================================== +# FTAG2.py +# It requires the reductionConf flag FTAG2 in Reco_tf.py +#==================================================================== + +# Set up common services and job object. +# This should appear in ALL derivation job options +from DerivationFrameworkCore.DerivationFrameworkMaster import * +from DerivationFrameworkInDet.InDetCommon import * +from DerivationFrameworkJetEtMiss.JetCommon import * +from DerivationFrameworkJetEtMiss.ExtendedJetCommon import * +from DerivationFrameworkJetEtMiss.ExtendedJetCommon import replaceAODReducedJets +from DerivationFrameworkEGamma.EGammaCommon import * +from DerivationFrameworkMuons.MuonsCommon import * +from DerivationFrameworkCore.ThinningHelper import ThinningHelper +from DerivationFrameworkExotics.JetDefinitions import * +from JetRec.JetRecStandard import jtm +from TrkVertexFitterUtils.TrkVertexFitterUtilsConf import Trk__TrackToVertexIPEstimator +from DerivationFrameworkCore.SlimmingHelper import SlimmingHelper +from DerivationFrameworkCore.DerivationFrameworkCoreConf import DerivationFramework__DerivationKernel +from DerivationFrameworkCore.LHE3WeightMetadata import * +from DerivationFrameworkTools.DerivationFrameworkToolsConf import DerivationFramework__xAODStringSkimmingTool +from DerivationFrameworkFlavourTag.HbbCommon import * +from DerivationFrameworkFlavourTag.FlavourTagCommon import * +from DerivationFrameworkFlavourTag.SoftBtagCommon import applySoftBtagging +from DerivationFrameworkFlavourTag.FlavourTagAllVariables import FTAllVars_bjetTriggerVtx +from DerivationFrameworkInDet.DerivationFrameworkInDetConf import DerivationFramework__TrackToVertexWrapper +from DerivationFrameworkJetEtMiss.AntiKt4EMTopoJetsCPContent import AntiKt4EMTopoJetsCPContent + +#==================================================================== +# Create Private Sequence +#==================================================================== + +FTAG2Seq = CfgMgr.AthSequencer("FTAG2Sequence"); + +#==================================================================== +# SKIMMING TOOLS +# (SKIMMING = REMOVING WHOLE EVENTS THAT FAIL CRITERIA) +# Create skimming tool, and create + add kernel to sequence +#==================================================================== +FTAG2StringSkimmingTool = DerivationFramework__xAODStringSkimmingTool(name = "FTAG2StringSkimmingTool", + expression = 'count( (Muons.pt > 18*GeV) && (0 == Muons.muonType || 1 == Muons.muonType || 4 == Muons.muonType) ) + count(( Electrons.pt > 18*GeV) && ((Electrons.Loose) || (Electrons.DFCommonElectronsLHLoose))) >= 2 ') + +ToolSvc += FTAG2StringSkimmingTool +print FTAG2StringSkimmingTool + +FTAG2Seq += CfgMgr.DerivationFramework__DerivationKernel("FTAG2SkimKernel", + SkimmingTools = [FTAG2StringSkimmingTool], + ) + +#==================================================================== +# TRUTH SETUP +#==================================================================== +if globalflags.DataSource()!='data': + from DerivationFrameworkMCTruth.MCTruthCommon import addStandardTruthContents, addHFAndDownstreamParticles + addStandardTruthContents() + addHFAndDownstreamParticles() + +#==================================================================== +# AUGMENTATION TOOLS +# ( AUGMENTATION = adding information to the output DxAOD that is not found in the input file ) +# Create IPE tool, then create augmenter and add to sequence +#==================================================================== + +#make IPE tool for BTagTrackAugmenter +FTAG2IPETool = Trk__TrackToVertexIPEstimator(name = "FTAG2IPETool") +ToolSvc += FTAG2IPETool +print FTAG2IPETool + +#augment jets with track info +FTAG2Seq += CfgMgr.BTagVertexAugmenter() + +#Add unbiased track parameters to track particles +#FTAG2TrackToVertexWrapper= DerivationFramework__TrackToVertexWrapper(name = "FTAG2TrackToVertexWrapper", +# TrackToVertexIPEstimator = FTAG2IPETool, +# DecorationPrefix = "FTAG2", +# ContainerName = "InDetTrackParticles") +#ToolSvc += FTAG2TrackToVertexWrapper +#print FTAG2TrackToVertexWrapper + +#==================================================================== +# Basic Jet Collections +#==================================================================== + +#put custom jet names here +OutputJets["FTAG2"] = ["AntiKt4EMTopoJets", + "AntiKtVR30Rmax4Rmin02TrackJets_BTagging201810", + "AntiKt4EMPFlowJets"] + + +reducedJetList = ["AntiKt2PV0TrackJets", + "AntiKt4PV0TrackJets", + "AntiKt10LCTopoJets", + "AntiKt4TruthJets"] + +extendedFlag = 1 # --- = 0 for Standard Taggers & =1 for ExpertTaggers +replaceAODReducedJets(reducedJetList,FTAG2Seq,"FTAG2", extendedFlag) + +addDefaultTrimmedJets(FTAG2Seq,"FTAG2",dotruth=True) + +#=================================================================== +# Add Large-R RC jets w/ ExKt 2 & 3 subjets +#=================================================================== + +addExKtDoubleTaggerRCJets(FTAG2Seq, ToolSvc) + +#=================================================================== +# Variable Radius (VR) Jets +#=================================================================== + +# Create variable-R trackjets and dress AntiKt10LCTopo with ghost VR-trkjet +addVRJets(FTAG2Seq, doFlipTagger=True) +addVRJets(FTAG2Seq, doFlipTagger=True, training='201903') +addVRJets(FTAG2Seq, do_ghost=True, doFlipTagger=True) + +# Also add Hbb Tagger +addHbbTagger(FTAG2Seq, ToolSvc) + +# alias for VR +BTaggingFlags.CalibrationChannelAliases += ["AntiKtVR30Rmax4Rmin02Track->AntiKtVR30Rmax4Rmin02Track,AntiKt4EMTopo"] + +#============================================================================== +# Soft Tagging +#============================================================================== +from InDetVKalVxInJetTool.InDetVKalVxInJetFinder import InDetVKalVxInJetFinder + +# used by Loose and Medium +SoftBJetSVFinderTool = InDetVKalVxInJetFinder("SoftBJetSVFinder") +ToolSvc += SoftBJetSVFinderTool +SoftBJetSVFinderTool.ConeForTag = 0.75 + +softTagAlgLoose = CfgMgr.SoftBVrt__SoftBVrtClusterTool( "SoftBVrtClusterToolLoose", + OutputLevel=INFO, #DEBUG + ) + +softTagAlgLoose.SVFinderName = 'SoftBJetSVFinder' +softTagAlgLoose.TrackJetCollectionName = 'AntiKt4PV0TrackJets' +softTagAlgLoose.TrackSelectionTool.CutLevel = "LoosePrimary" +softTagAlgLoose.OperatingPoint = 'Loose' + +FTAG2Seq += softTagAlgLoose + +softTagAlgMedium = CfgMgr.SoftBVrt__SoftBVrtClusterTool( "SoftBVrtClusterToolMedium", + OutputLevel=INFO, #DEBUG + ) + +softTagAlgMedium.SVFinderName = 'SoftBJetSVFinder' +softTagAlgMedium.TrackJetCollectionName = 'AntiKt4PV0TrackJets' +softTagAlgMedium.TrackSelectionTool.CutLevel = "LoosePrimary" +softTagAlgMedium.OperatingPoint = 'Medium' + +FTAG2Seq += softTagAlgMedium + +# used by Tight +SoftBJetSVFinderToolTight = InDetVKalVxInJetFinder("SoftBJetSVFinderTight") +ToolSvc += SoftBJetSVFinderToolTight +SoftBJetSVFinderTool.ConeForTag = 0.6 + +softTagAlgTight = CfgMgr.SoftBVrt__SoftBVrtClusterTool( "SoftBVrtClusterToolTight", + OutputLevel=INFO, #DEBUG + ) + +softTagAlgTight.SVFinderName = 'SoftBJetSVFinderTight' +softTagAlgTight.TrackJetCollectionName = 'AntiKt4PV0TrackJets' +softTagAlgTight.TrackSelectionTool.CutLevel = "LoosePrimary" +softTagAlgTight.OperatingPoint = 'Tight' + +FTAG2Seq += softTagAlgTight + +applySoftBtagging("softBtag", FTAG2Seq ) # SV tagger in VrtSecInclusive + +#=================================================================== +# Tag custom or pre-built jet collections +#=================================================================== + +FlavorTagInit(scheduleFlipped = True, JetCollections = ['AntiKt4EMPFlowJets','AntiKt4EMTopoJets'], Sequencer = FTAG2Seq) + + +#==================================================================== +# Add sequence (with all kernels needed) to DerivationFrameworkJob +#==================================================================== + +DerivationFrameworkJob += FTAG2Seq + +#==================================================================== +# SET UP STREAM +#==================================================================== + +# The base name (DAOD_FTAG2 here) must match the string in +streamName = derivationFlags.WriteDAOD_FTAG2Stream.StreamName +fileName = buildFileName( derivationFlags.WriteDAOD_FTAG2Stream ) +FTAG2Stream = MSMgr.NewPoolRootStream( streamName, fileName ) +# Only events that pass the filters listed below are written out. +# Name must match that of the kernel above +# AcceptAlgs = logical OR of filters +# RequireAlgs = logical AND of filters +FTAG2Stream.AcceptAlgs(["FTAG2SkimKernel"]) + +FTAG2SlimmingHelper = SlimmingHelper("FTAG2SlimmingHelper") + +# nb: BTagging_AntiKt4EMTopo smart collection includes both AntiKt4EMTopoJets and BTagging_AntiKt4EMTopo +# container variables. Thus BTagging_AntiKt4EMTopo is needed in SmartCollections as well as AllVariables +FTAG2SlimmingHelper.SmartCollections = ["Electrons","Muons", + "AntiKt4EMTopoJets", + "MET_Reference_AntiKt4EMTopo", + "AntiKt4EMPFlowJets", + "MET_Reference_AntiKt4EMPFlow", + "AntiKt8EMPFlowJets", + "AntiKt8EMPFlowExKt2SubJets", + "AntiKt8EMPFlowExKt3SubJets", + "BTagging_AntiKt8EMPFlowExKt2Sub", + "BTagging_AntiKt8EMPFlowExKt3Sub", + "BTagging_AntiKtVR30Rmax4Rmin02Track_201810GhostTag_expert", + ] + +FTAG2SlimmingHelper.AllVariables = ["AntiKt4EMTopoJets", + "BTagging_AntiKtVR30Rmax4Rmin02Track_201810", + "BTagging_AntiKtVR30Rmax4Rmin02Track_2018JFVtx", + "BTagging_AntiKt4EMPFlow_201810", + "BTagging_AntiKt4EMPFlow_201903", + "BTagging_AntiKt4EMPFlowJFVtx", + "BTagging_AntiKt4EMPFlow_201810JFVtx", + "BTagging_AntiKt4EMPFlow_201903JFVtx", + "BTagging_AntiKt2Track", + "BTagging_AntiKt2TrackJFVtx", + "PrimaryVertices", + "TruthEvents", + "TruthParticles", + "TruthVertices", + "TruthHFWithDecayParticles", + "TruthHFWithDecayVertices", + "MET_Truth", + "MET_TruthRegions"] + +for FT2_bjetTriggerVtx in FTAllVars_bjetTriggerVtx: + FTAG2SlimmingHelper.AllVariables.append(FT2_bjetTriggerVtx) + +FTAG2SlimmingHelper.ExtraVariables += [AntiKt4EMTopoJetsCPContent[1].replace("AntiKt4EMTopoJetsAux","AntiKt10LCTopoJets"), + #"InDetTrackParticles.truthMatchProbability.x.y.z.vx.vy.vz", + #"InDetTrackParticles.numberOfContribPixelLayers.numberOfTRTHits.numberOfInnermostPixelLayerSharedHits.numberOfNextToInnermostPixelLayerSharedHits", + #"InDetTrackParticles.numberOfPixelSplitHits.numberOfInnermostPixelLayerSplitHits.numberOfNextToInnermostPixelLayerSplitHits", + #"InDetTrackParticles.hitPattern.radiusOfFirstHit", + #"InDetTrackParticles.FTAG2_unbiased_d0.FTAG2_unbiased_z0.FTAG2_unbiased_d0Sigma.FTAG2_unbiased_z0Sigma", + #"CombinedMuonTrackParticles.vx.vy.vz", + #"ExtrapolatedMuonTrackParticles.vx.vy.vz", + #"MSOnlyExtrapolatedMuonTrackParticles.vx.vy.vz", + #"MuonSpectrometerTrackParticles.vx.vy.vz", + #"InDetForwardTrackParticles.phi.qOverP.theta", + "BTagging_AntiKt4EMPFlow_201810SecVtx.-vxTrackAtVertex", + "BTagging_AntiKt4EMPFlow_201903SecVtx.-vxTrackAtVertex", + "BTagging_AntiKt2TrackSecVtx.-vxTrackAtVertex", + "BTagging_AntiKtVR30Rmax4Rmin02Track_201810SecVtx.-vxTrackAtVertex", + "BTagging_AntiKt4EMPFlow.MV1_discriminant.MV1c_discriminant.SV1_pb.SV1_pu.IP3D_pb.IP3D_pu.MV2c10_discriminant", + "AntiKt10LCTopoJets.GhostVR30Rmax4Rmin02TrackJet.GhostVR30Rmax4Rmin02TrackJetPt.GhostVR30Rmax4Rmin02TrackJetCount", + "AntiKt4EMPFlowJets.EMFrac.HECFrac.LArQuality.HECQuality.FracSamplingMax.NegativeE.AverageLArQF.FracSamplingMaxIndex.HadronConeExclTruthLabelID.GhostTrack", + "AntiKt4EMPFlowJets.Jvt.JvtRpt.JvtJvfcorr", + "AntiKt4EMPFlowJets.NumTrkPt1000.NumTrkPt500.SumPtTrkPt500.SumPtTrkPt1000", + "InDetTrackParticles.btagIp_d0.btagIp_z0SinTheta.btagIp_d0Uncertainty.btagIp_z0SinThetaUncertainty.btagIp_trackDisplacement.btagIp_trackMomentum", + "InDetTrackParticles.is_selected.is_associated.is_svtrk_final.pt_wrtSV.eta_wrtSV.phi_wrtSV.d0_wrtSV.z0_wrtSV.errP_wrtSV.errd0_wrtSV.errz0_wrtSV.chi2_toSV", + ] + +FTAG2SlimmingHelper.SmartCollections += ["AntiKt4EMTopoJets_BTagging201810", + "AntiKt4EMPFlowJets_BTagging201810", + "AntiKt4EMPFlowJets_BTagging201903", + "AntiKtVR30Rmax4Rmin02TrackJets_BTagging201810", + "AntiKtVR30Rmax4Rmin02TrackJets_BTagging201903"] +FTAG2SlimmingHelper.AllVariables += ["BTagging_AntiKt4EMPFlow_201810", + "BTagging_AntiKt4EMPFlow_201903", + "BTagging_AntiKt4EMTopo_201810", + "BTagging_AntiKtVR30Rmax4Rmin02Track_201810", + "BTagging_AntiKtVR30Rmax4Rmin02Track_201903", + "AntiKt4EMTopoJets_BTagging201810", + "AntiKt4EMPFlowJets_BTagging201810", + "AntiKt4EMPFlowJets_BTagging201903"] + +#---------------------------------------------------------------------- +# Add needed dictionary stuff +FTAG2SlimmingHelper.AppendToDictionary = { + "TruthHFWithDecayParticles" : "xAOD::TruthParticleContainer", + "TruthHFWithDecayParticlesAux" : "xAOD::TruthParticleAuxContainer", + "TruthHFWithDecayVertices" : "xAOD::TruthVertexContainer", + "TruthHFWithDecayVerticesAux" : "xAOD::TruthVertexAuxContainer", + "BTagging_AntiKt4EMPFlow" : "xAOD::BTaggingContainer", + "BTagging_AntiKt4EMPFlowAux" : "xAOD::BTaggingAuxContainer", + "BTagging_AntiKt4EMPFlowJFVtx" : "xAOD::BTagVertexContainer", + "BTagging_AntiKt4EMPFlowJFVtxAux" : "xAOD::BTagVertexAuxContainer", + "BTagging_AntiKt4EMPFlow_201810JFVtx" : "xAOD::BTagVertexContainer", + "BTagging_AntiKt4EMPFlow_201810JFVtxAux" : "xAOD::BTagVertexAuxContainer", + "BTagging_AntiKt4EMPFlow_201903JFVtx" : "xAOD::BTagVertexContainer", + "BTagging_AntiKt4EMPFlow_201903JFVtxAux" : "xAOD::BTagVertexAuxContainer", + "BTagging_AntiKt4EMPFlow_201810SecVtx" : "xAOD::VertexContainer" , + "BTagging_AntiKt4EMPFlow_201810SecVtxAux" : "xAOD::VertexAuxContainer", + "BTagging_AntiKt4EMPFlow_201903SecVtx" : "xAOD::VertexContainer" , + "BTagging_AntiKt4EMPFlow_201903SecVtxAux" : "xAOD::VertexAuxContainer", + "AntiKtVR30Rmax4Rmin02Track_201903" : "xAOD::JetContainer" , + "AntiKtVR30Rmax4Rmin02Track_201903Aux" : "xAOD::JetAuxContainer" , + "BTagging_AntiKtVR30Rmax4Rmin02Track_201903" : "xAOD::BTaggingContainer" , + "BTagging_AntiKtVR30Rmax4Rmin02Track_201903Aux" : "xAOD::BTaggingAuxContainer", + "BTagging_AntiKtVR30Rmax4Rmin02Track_201903JFVtx" : "xAOD::BTagVertexContainer" , + "BTagging_AntiKtVR30Rmax4Rmin02Track_201903JFVtxAux" : "xAOD::BTagVertexAuxContainer", + "BTagging_AntiKtVR30Rmax4Rmin02Track_201903SecVtx" : "xAOD::VertexContainer" , + "BTagging_AntiKtVR30Rmax4Rmin02Track_201903SecVtxAux" : "xAOD::VertexAuxContainer", + "AntiKtVR30Rmax4Rmin02Track_201810" : "xAOD::JetContainer" , + "AntiKtVR30Rmax4Rmin02Track_201810Aux" : "xAOD::JetAuxContainer" , + "BTagging_AntiKtVR30Rmax4Rmin02Track_201810" : "xAOD::BTaggingContainer" , + "BTagging_AntiKtVR30Rmax4Rmin02Track_201810Aux" : "xAOD::BTaggingAuxContainer", + "BTagging_AntiKtVR30Rmax4Rmin02Track_201810JFVtx" : "xAOD::BTagVertexContainer" , + "BTagging_AntiKtVR30Rmax4Rmin02Track_201810JFVtxAux" : "xAOD::BTagVertexAuxContainer", + "BTagging_AntiKtVR30Rmax4Rmin02Track_201810SecVtx" : "xAOD::VertexContainer" , + "BTagging_AntiKtVR30Rmax4Rmin02Track_201810SecVtxAux" : "xAOD::VertexAuxContainer", + "BTagging_AntiKt2Track" : "xAOD::BTaggingContainer" , + "BTagging_AntiKt2TrackAux" : "xAOD::BTaggingAuxContainer", + "BTagging_AntiKt2TrackJFVtx" : "xAOD::BTagVertexContainer" , + "BTagging_AntiKt2TrackJFVtxAux" : "xAOD::BTagVertexAuxContainer", + "BTagging_AntiKt2TrackSecVtx" : "xAOD::VertexContainer" , + "BTagging_AntiKt2TrackSecVtxAux" : "xAOD::VertexAuxContainer", + "AntiKt8EMPFlowJets" : "xAOD::JetContainer" , + "AntiKt8EMPFlowJetsAux" : "xAOD::JetAuxContainer" , + "AntiKt8EMPFlowExKt2SubJets" : "xAOD::JetContainer" , + "AntiKt8EMPFlowExKt2SubJetsAux" : "xAOD::JetAuxContainer" , + "BTagging_AntiKt8EMPFlowExKt2Sub" : "xAOD::BTaggingContainer" , + "BTagging_AntiKt8EMPFlowExKt2SubAux" : "xAOD::BTaggingAuxContainer", + "AntiKt8EMPFlowExKt3SubJets" : "xAOD::JetContainer" , + "AntiKt8EMPFlowExKt3SubJetsAux" : "xAOD::JetAuxContainer" , + "BTagging_AntiKt8EMPFlowExKt3Sub" : "xAOD::BTaggingContainer" , + "BTagging_AntiKt8EMPFlowExKt3SubAux" : "xAOD::BTaggingAuxContainer" +} + +#---------------------------------------------------------------------- +# Add soft b-tagging containers +excludedVertexAuxData = "-vxTrackAtVertex.-MvfFitInfo.-isInitialized.-VTAV" + +StaticContent = [] +StaticContent += ["xAOD::VertexContainer#SoftBVrtClusterTool_Tight_Vertices"] +StaticContent += ["xAOD::VertexAuxContainer#SoftBVrtClusterTool_Tight_VerticesAux." + excludedVertexAuxData] +StaticContent += ["xAOD::VertexContainer#SoftBVrtClusterTool_Medium_Vertices"] +StaticContent += ["xAOD::VertexAuxContainer#SoftBVrtClusterTool_Medium_VerticesAux." + excludedVertexAuxData] +StaticContent += ["xAOD::VertexContainer#SoftBVrtClusterTool_Loose_Vertices"] +StaticContent += ["xAOD::VertexAuxContainer#SoftBVrtClusterTool_Loose_VerticesAux." + excludedVertexAuxData] +StaticContent += ["xAOD::VertexContainer#VrtSecInclusive_SoftBtagCandidateVertices"] +StaticContent += ["xAOD::VertexAuxContainer#VrtSecInclusive_SoftBtagCandidateVerticesAux."] + +FTAG2SlimmingHelper.StaticContent = StaticContent +#---------------------------------------------------------------------- + +addJetOutputs(FTAG2SlimmingHelper,["FTAG2"]) + +FTAG2SlimmingHelper.IncludeMuonTriggerContent = True +FTAG2SlimmingHelper.IncludeEGammaTriggerContent = True +FTAG2SlimmingHelper.IncludeJetTriggerContent = True +FTAG2SlimmingHelper.IncludeEtMissTriggerContent = True +FTAG2SlimmingHelper.IncludeBJetTriggerContent = True + +#FTAG2 TrigNav Thinning +FTAG2ThinningHelper = ThinningHelper( "FTAG2ThinningHelper" ) +FTAG2ThinningHelper.TriggerChains = 'HLT_.*b.*perf.*|HLT_mu.*|HLT_e.*' +FTAG2ThinningHelper.AppendToStream( FTAG2Stream ) + +FTAG2SlimmingHelper.AppendContentToStream(FTAG2Stream) diff --git a/PhysicsAnalysis/DerivationFramework/DerivationFrameworkFlavourTag/share/FTAG3.py b/PhysicsAnalysis/DerivationFramework/DerivationFrameworkFlavourTag/share/FTAG3.py new file mode 100644 index 0000000000000000000000000000000000000000..0503c50e15af1447ab802c1fab7a301c37840c9a --- /dev/null +++ b/PhysicsAnalysis/DerivationFramework/DerivationFrameworkFlavourTag/share/FTAG3.py @@ -0,0 +1,223 @@ +#==================================================================== +# FTAG3.py +# It requires the reductionConf flag FTAG3 in Reco_tf.py +#==================================================================== + +# Set up common services and job object. +# This should appear in ALL derivation job options +from DerivationFrameworkCore.DerivationFrameworkMaster import * +from DerivationFrameworkInDet.InDetCommon import * +from DerivationFrameworkJetEtMiss.JetCommon import * +#from DerivationFrameworkJetEtMiss.ExtendedJetCommon import * +from DerivationFrameworkJetEtMiss.ExtendedJetCommon import replaceAODReducedJets,addDefaultTrimmedJets +from DerivationFrameworkEGamma.EGammaCommon import * +from DerivationFrameworkMuons.MuonsCommon import * +from DerivationFrameworkFlavourTag.FlavourTagCommon import FlavorTagInit +from DerivationFrameworkCore.ThinningHelper import ThinningHelper + +from DerivationFrameworkTools.DerivationFrameworkToolsConf import DerivationFramework__TriggerSkimmingTool,DerivationFramework__xAODStringSkimmingTool +from DerivationFrameworkCore.DerivationFrameworkCoreConf import DerivationFramework__DerivationKernel +from DerivationFrameworkCore.SlimmingHelper import SlimmingHelper + +#==================================================================== +# Create Private Sequence +#==================================================================== + +FTAG3Seq = CfgMgr.AthSequencer("FTAG3Sequence"); + +#==================================================================== +# SKIMMING TOOLS +# (SKIMMING = REMOVING WHOLE EVENTS THAT FAIL CRITERIA) +# Create skimming tool, and create + add kernel to sequence +#==================================================================== +triggers = [] +#2016 mu-jet triggers without online b-tagging information +triggers.append("HLT_mu4_j15_dr05") +triggers.append("HLT_mu4_j25_dr05") +triggers.append("HLT_mu4_j35_dr05") +triggers.append("HLT_mu4_j55_dr05") +triggers.append("HLT_mu6_j85_dr05") +triggers.append("HLT_mu6_j110_dr05") +triggers.append("HLT_mu6_j150_dr05") +triggers.append("HLT_mu6_j175_dr05") +#2016 menu mu-jet triggers with online b-tagging information +triggers.append("HLT_mu4_j15_bperf_split_dr05_dz02") +triggers.append("HLT_mu4_j25_bperf_split_dr05_dz02") +triggers.append("HLT_mu4_j35_bperf_split_dr05_dz02") +triggers.append("HLT_mu4_j55_bperf_split_dr05_dz02") +triggers.append("HLT_mu6_j85_bperf_split_dr05_dz02") +triggers.append("HLT_mu6_j110_bperf_split_dr05_dz02") +triggers.append("HLT_mu6_j150_bperf_split_dr05_dz02") +triggers.append("HLT_mu6_j175_bperf_split_dr05_dz02") +#2018 additional mu-jet triggers +triggers.append("HLT_mu4_j15_boffperf_split_dr05_dz02") +triggers.append("HLT_mu4_j15_gsc35_boffperf_split_dr05_dz02") +triggers.append("HLT_mu4_j25_boffperf_split_dr05_dz02") +triggers.append("HLT_mu4_j35_boffperf_split_dr05_dz02") +triggers.append("HLT_mu4_j35_gsc55_boffperf_split_dr05_dz02") +triggers.append("HLT_mu6_j60_gsc110_boffperf_split_dr05_dz02") +triggers.append("HLT_mu6_j60_gsc85_boffperf_split_dr05_dz02") +triggers.append("HLT_mu6_j110_gsc150_boffperf_split_dr05_dz02") +triggers.append("HLT_mu6_j110_gsc150_bperf_split_dr05_dz02") +triggers.append("HLT_mu6_j150_gsc175_boffperf_split_dr05_dz02") +triggers.append("HLT_mu6_j175_gsc260_boffperf_split_dr05_dz02") + +if globalflags.DataSource()=='data': + # muon-in-jet triggers are buggy in MC, so only apply them in data + FTAG3TriggerSkimmingTool = DerivationFramework__TriggerSkimmingTool(name = "FTAG3TriggerSkimmingTool", + TriggerListOR = triggers ) + ToolSvc += FTAG3TriggerSkimmingTool + print FTAG3TriggerSkimmingTool + FTAG3Seq += CfgMgr.DerivationFramework__DerivationKernel("FTAG3SkimKernel", + SkimmingTools = [FTAG3TriggerSkimmingTool] ) + +if globalflags.DataSource()!='data': + # since we aren't using a trigger skim, apply a muon pT cut to avoid gigantic dijet samples + FTAG3StringSkimmingTool = DerivationFramework__xAODStringSkimmingTool(name = "FTAG3StringSkimmingTool", + expression = 'count( (Muons.pt > 4*GeV) && (Muons.DFCommonGoodMuon) ) >= 1') + ToolSvc += FTAG3StringSkimmingTool + print FTAG3StringSkimmingTool + FTAG3Seq += CfgMgr.DerivationFramework__DerivationKernel("FTAG3SkimKernel", + SkimmingTools = [FTAG3StringSkimmingTool] ) + +#==================================================================== +# TRUTH SETUP +#==================================================================== +if globalflags.DataSource()!='data': + from DerivationFrameworkMCTruth.MCTruthCommon import addStandardTruthContents, addHFAndDownstreamParticles + addStandardTruthContents() + addHFAndDownstreamParticles() + +#==================================================================== +# Basic Jet Collections +#==================================================================== + +OutputJets["FTAG3"] = ["AntiKt4EMTopoJets"] + +reducedJetList = ["AntiKt2PV0TrackJets", + "AntiKt4PV0TrackJets", + "AntiKt10TruthWZJets", + "AntiKt4TruthJets"] + +extendedFlag = 0 # --- = 0 for Standard Taggers & =1 for ExpertTaggers +replaceAODReducedJets(reducedJetList,FTAG3Seq,"FTAG3", extendedFlag) + +addDefaultTrimmedJets(FTAG3Seq,"FTAG3",dotruth=True) + +#=================================================================== +# Tag custom or pre-built jet collections +#=================================================================== + +FlavorTagInit(JetCollections = ['AntiKt4EMTopoJets'],Sequencer = FTAG3Seq) + +#==================================================================== +# Add sequence (with all kernels needed) to DerivationFrameworkJob +#==================================================================== + +DerivationFrameworkJob += FTAG3Seq + +#==================================================================== +# SET UP STREAM +#==================================================================== + +# The base name (DAOD_FTAG3 here) must match the string in +streamName = derivationFlags.WriteDAOD_FTAG3Stream.StreamName +fileName = buildFileName( derivationFlags.WriteDAOD_FTAG3Stream ) +FTAG3Stream = MSMgr.NewPoolRootStream( streamName, fileName ) +FTAG3Stream.AcceptAlgs(["FTAG3SkimKernel"]) + +FTAG3SlimmingHelper = SlimmingHelper("FTAG3SlimmingHelper") + +# nb: BTagging_AntiKt4EMTopo smart collection includes both AntiKt4EMTopoJets and BTagging_AntiKt4EMTopo +# container variables. Thus BTagging_AntiKt4EMTopo is needed in SmartCollections as well as AllVariables +FTAG3SlimmingHelper.SmartCollections = ["Electrons","Muons", + "InDetTrackParticles", + "PrimaryVertices", + "AntiKt4EMTopoJets", + "AntiKt4EMPFlowJets", + "MET_Reference_AntiKt4EMTopo",] + +FTAG3SlimmingHelper.AllVariables = ["AntiKt10TruthWZJets", + "BTagging_AntiKt2Track", + "BTagging_AntiKt2TrackJFVtx", + "BTagging_AntiKt10TruthWZ", + "BTagging_AntiKt10TruthWZJFVtx", + "TruthEvents", + "TruthVertices", + "TruthParticles", + "TruthHFWithDecayParticles", + "TruthHFWithDecayVertices", + "TruthMuons", + "MuonTruthParticles", + "MET_Truth", + "MET_TruthRegions", + "HLT_xAOD__TrackParticleContainer_MuonEFInfo_CombTrackParticles", + "HLT_xAOD__TrackParticleContainer_MuonEFInfo_CombTrackParticles_FullScan", + "HLT_xAOD__MuonContainer_MuonEFInfo" + ] + +FTAG3SlimmingHelper.ExtraVariables += ["BTagging_AntiKt2TrackSecVtx.-vxTrackAtVertex", + "BTagging_AntiKt10TruthSecVtx.-vxTrackAtVertex"] + + +if BTaggingFlags.Do2019Retraining: + FTAG3SlimmingHelper.SmartCollections += \ + ["AntiKt4EMTopoJets_BTagging201810"] + + FTAG3SlimmingHelper.AllVariables += \ + ["BTagging_AntiKt4EMTopo_201810", + "AntiKt4EMTopoJets_BTagging201810"] + FTAG3SlimmingHelper.ExtraVariables += ["BTagging_AntiKt4EMTopo_201810SecVtx.-vxTrackAtVertex"] +else: + FTAG3SlimmingHelper.SmartCollections += \ + ["AntiKt4EMTopoJets"] + FTAG3SlimmingHelper.AllVariables += \ + ["BTagging_AntiKt4EMTopo", + "AntiKt4EMTopoJets"] + FTAG3SlimmingHelper.ExtraVariables += ["BTagging_AntiKt4EMTopoSecVtx.-vxTrackAtVertex"] + + +#---------------------------------------------------------------------- +# Add needed dictionary stuff +FTAG3SlimmingHelper.AppendToDictionary = { + "TruthHFWithDecayParticles" : "xAOD::TruthParticleContainer", + "TruthHFWithDecayParticlesAux" : "xAOD::TruthParticleAuxContainer", + "TruthHFWithDecayVertices" : "xAOD::TruthVertexContainer", + "TruthHFWithDecayVerticesAux" : "xAOD::TruthVertexAuxContainer", + "TruthVertices" : "xAOD::TruthVertexContainer", + "TruthVerticesAux" : "xAOD::TruthVertexAuxContainer", + "TruthParticles" : "xAOD::TruthParticleContainer", + "TruthParticlesAux" : "xAOD::TruthParticleAuxContainer", + "TruthMuons" : "xAOD::TruthParticleContainer", + "TruthMuonsAux" : "xAOD::TruthParticleAuxContainer", + "BTagging_AntiKt4EMTopo_201810SecVtx" : "xAOD::VertexContainer", + "BTagging_AntiKt4EMTopo_201810SecVtxAux" : "xAOD::VertexAuxContainer", + "BTagging_AntiKt2Track" : "xAOD::BTaggingContainer" , + "BTagging_AntiKt2TrackAux" : "xAOD::BTaggingAuxContainer", + "BTagging_AntiKt2TrackJFVtx" : "xAOD::BTagVertexContainer" , + "BTagging_AntiKt2TrackJFVtxAux" : "xAOD::BTagVertexAuxContainer", + "BTagging_AntiKt2TrackSecVtx" : "xAOD::VertexContainer" , + "BTagging_AntiKt2TrackSecVtxAux" : "xAOD::VertexAuxContainer", + "BTagging_AntiKt10TruthWZ" : "xAOD::BTaggingContainer" , + "BTagging_AntiKt10TruthWZAux" : "xAOD::BTaggingAuxContainer" , + "BTagging_AntiKt10TruthWZJFVtx" : "xAOD::BTagVertexContainer" , + "BTagging_AntiKt10TruthWZJFVtxAux" : "xAOD::BTagVertexAuxContainer" , + "BTagging_AntiKt10TruthWZSecVtx" : "xAOD::VertexContainer" , + "BTagging_AntiKt10TruthWZSecVtxAux" : "xAOD::VertexAuxContainer" , +} +#---------------------------------------------------------------------- +addJetOutputs(FTAG3SlimmingHelper,["FTAG3"]) + +FTAG3SlimmingHelper.IncludeMuonTriggerContent = True +FTAG3SlimmingHelper.IncludeEGammaTriggerContent = False +FTAG3SlimmingHelper.IncludeJetTriggerContent = True +FTAG3SlimmingHelper.IncludeEtMissTriggerContent = False +FTAG3SlimmingHelper.IncludeBJetTriggerContent = True + +#FTAG3 TrigNav Thinning +FTAG3ThinningHelper = ThinningHelper( "FTAG3ThinningHelper" ) +FTAG3ThinningHelper.TriggerChains = 'HLT_mu*_j.*_dr05|HLT_mu*_j.*_bperf_split_dr05_dz02|HLT_mu*_j.*_boffperf_split_dr05_dz02|HLT_mu*_j.*_gsc.*_dr05_dz02' +FTAG3ThinningHelper.AppendToStream( FTAG3Stream ) + +FTAG3SlimmingHelper.AppendContentToStream(FTAG3Stream) + diff --git a/PhysicsAnalysis/DerivationFramework/DerivationFrameworkFlavourTag/share/FTAG4.py b/PhysicsAnalysis/DerivationFramework/DerivationFrameworkFlavourTag/share/FTAG4.py new file mode 100644 index 0000000000000000000000000000000000000000..d5968b587979409c1e4a357536d90277db7159ee --- /dev/null +++ b/PhysicsAnalysis/DerivationFramework/DerivationFrameworkFlavourTag/share/FTAG4.py @@ -0,0 +1,347 @@ +#==================================================================== +# FTAG4.py : for single lepton analyses +# It requires the reductionConf flag FTAG4 in Reco_tf.py +#==================================================================== +# Set up common services and job object. +# This should appear in ALL derivation job options +from DerivationFrameworkCore.DerivationFrameworkMaster import * +from DerivationFrameworkInDet.InDetCommon import * +from DerivationFrameworkJetEtMiss.JetCommon import * +from DerivationFrameworkJetEtMiss.ExtendedJetCommon import * +from DerivationFrameworkJetEtMiss.ExtendedJetCommon import replaceAODReducedJets +from DerivationFrameworkEGamma.EGammaCommon import * +from DerivationFrameworkMuons.MuonsCommon import * +from DerivationFrameworkFlavourTag.FlavourTagCommon import FlavorTagInit +from DerivationFrameworkFlavourTag.HbbCommon import addVRJets, addExKtCoM, addHbbTagger +from DerivationFrameworkFlavourTag.SoftBtagCommon import applySoftBtagging +from DerivationFrameworkCore.ThinningHelper import ThinningHelper + +from DerivationFrameworkCore.LHE3WeightMetadata import * +from DerivationFrameworkTools.DerivationFrameworkToolsConf import DerivationFramework__xAODStringSkimmingTool +from DerivationFrameworkTools.DerivationFrameworkToolsConf import DerivationFramework__TriggerSkimmingTool +from DerivationFrameworkJetEtMiss.AntiKt4EMTopoJetsCPContent import AntiKt4EMTopoJetsCPContent +from DerivationFrameworkCore.DerivationFrameworkCoreConf import DerivationFramework__DerivationKernel +from DerivationFrameworkCore.SlimmingHelper import SlimmingHelper + +#==================================================================== +# Create Private Sequence +#==================================================================== + +FTAG4Seq = CfgMgr.AthSequencer("FTAG4Sequence") + +#==================================================================== +# SKIMMING TOOLS +# (SKIMMING = REMOVING WHOLE EVENTS THAT FAIL CRITERIA) +# Create skimming tool, and create + add kernel to sequence +#==================================================================== + +# offline lepton skimming : require at least one lepton +# pt-thresholds were evaluated for lowest single lepton triggers with pt-thresholds of 26 GeV +# 0 == Muons.muonType correspond to Combined muons. DFCommonGoodMuon cuts on type are quality dependent +# we assume that mu-channel events will be requested to have combined muon offline. +# wo type cut, there is a relatively large (+~30%) leakage of mostly CaloTagged (muonType=3) muons +offlineElec = "(Electrons.pt > 24*GeV) && (Electrons.Medium || Electrons.DFCommonElectronsLHMedium)" +offlineMuon = "(Muons.pt > 24*GeV) && (Muons.DFCommonGoodMuon) && (0 == Muons.muonType)" +offlineExpression = "( (count("+offlineElec+") >= 1) || (count("+offlineMuon+") >= 1) )" +print 'FTAG4: offline skimming expression : \n', offlineExpression + +FTAG4StringSkimmingTool = DerivationFramework__xAODStringSkimmingTool(name = "FTAG4StringSkimmingTool", + expression = offlineExpression) +ToolSvc += FTAG4StringSkimmingTool +print FTAG4StringSkimmingTool + +# triggers used for skimming: +# single lepton triggers: we want to include lowest un-prescaled +# we do not hard-code the exact triggers, as these vary with luminosity +# we however assume that the lowest un-prescaled triggers will have +# thresholds of 20 GeV <= pt < 1 TeV +triggers_e = [ "HLT_e[2-9][0-9]_.*", # WARNING: for triggers with 10<=pt<20 GeV, change to HLT_e[1-0][0-9]_.* ! + "HLT_e[1-9][0-9][0-9]_.*" ] +triggers_mu = [ "HLT_mu[2-9][0-9]_.*", # WARNING: for triggers with 10<=pt<20 GeV, change to HLT_mu[1-0][0-9]_.* ! + "HLT_mu[1-9][0-9][0-9]_.*" ] +triggersSkim = triggers_e + triggers_mu + +FTAG4TriggerSkimmingTool = DerivationFramework__TriggerSkimmingTool(name = "FTAG4TriggerSkimmingTool", + TriggerListOR = triggersSkim) +ToolSvc += FTAG4TriggerSkimmingTool +print FTAG4TriggerSkimmingTool + +FTAG4Seq += CfgMgr.DerivationFramework__DerivationKernel("FTAG4SkimKernel", + SkimmingTools = [FTAG4StringSkimmingTool,FTAG4TriggerSkimmingTool]) + +#==================================================================== +# TRUTH SETUP +#==================================================================== +if globalflags.DataSource()!='data': + from DerivationFrameworkMCTruth.MCTruthCommon import addStandardTruthContents, addHFAndDownstreamParticles + addStandardTruthContents() + addHFAndDownstreamParticles() + +#==================================================================== +# Basic Jet Collections +#==================================================================== + +OutputJets["FTAG4"] = ["AntiKt4EMTopoJets", + "AntiKtVR30Rmax4Rmin02TrackJets_BTagging201810", + "AntiKt10LCTopoTrimmedPtFrac5SmallR20ExCoM2SubJets", + "AntiKt4EMPFlowJets"] + +reducedJetList = ["AntiKt2PV0TrackJets", + "AntiKt4PV0TrackJets", + "AntiKt4TruthJets"] + +extendedFlag = 1 # --- = 0 for Standard Taggers & =1 for ExpertTaggers +replaceAODReducedJets(reducedJetList,FTAG4Seq,"FTAG4", extendedFlag) + +addDefaultTrimmedJets(FTAG4Seq,"FTAG4",dotruth=True) +# +# Adding ExCoM sub-jets for each trimmed large-R jet +# +ExCoMJetCollection__FatJet = "AntiKt10LCTopoTrimmedPtFrac5SmallR20Jets" +ExCoMJetCollection__SubJet = addExKtCoM(FTAG4Seq, ToolSvc, ExCoMJetCollection__FatJet, 2, False, subjetAlgName="CoM") + +BTaggingFlags.CalibrationChannelAliases += ["AntiKt10LCTopoTrimmedPtFrac5SmallR20ExCoM2Sub->AntiKt4LCTopo,AntiKt4TopoEM,AntiKt4EMTopo"] + +#============================================================================== +# Soft Tagging +#============================================================================== +from InDetVKalVxInJetTool.InDetVKalVxInJetFinder import InDetVKalVxInJetFinder + +FTAG4Seq += CfgMgr.BTagVertexAugmenter() + +# used by Loose and Medium +SoftBJetSVFinderTool = InDetVKalVxInJetFinder("SoftBJetSVFinder") +ToolSvc += SoftBJetSVFinderTool +SoftBJetSVFinderTool.ConeForTag = 0.75 + +softTagAlgLoose = CfgMgr.SoftBVrt__SoftBVrtClusterTool( "SoftBVrtClusterToolLoose", + OutputLevel=INFO, #DEBUG + ) + +softTagAlgLoose.SVFinderName = 'SoftBJetSVFinder' +softTagAlgLoose.TrackJetCollectionName = 'AntiKt4PV0TrackJets' +softTagAlgLoose.TrackSelectionTool.CutLevel = "LoosePrimary" +softTagAlgLoose.OperatingPoint = 'Loose' + +FTAG4Seq += softTagAlgLoose + +softTagAlgMedium = CfgMgr.SoftBVrt__SoftBVrtClusterTool( "SoftBVrtClusterToolMedium", + OutputLevel=INFO, #DEBUG + ) + +softTagAlgMedium.SVFinderName = 'SoftBJetSVFinder' +softTagAlgMedium.TrackJetCollectionName = 'AntiKt4PV0TrackJets' +softTagAlgMedium.TrackSelectionTool.CutLevel = "LoosePrimary" +softTagAlgMedium.OperatingPoint = 'Medium' + +FTAG4Seq += softTagAlgMedium + +# used by Tight +SoftBJetSVFinderToolTight = InDetVKalVxInJetFinder("SoftBJetSVFinderTight") +ToolSvc += SoftBJetSVFinderToolTight +SoftBJetSVFinderTool.ConeForTag = 0.6 + +softTagAlgTight = CfgMgr.SoftBVrt__SoftBVrtClusterTool( "SoftBVrtClusterToolTight", + OutputLevel=INFO, #DEBUG + ) + +softTagAlgTight.SVFinderName = 'SoftBJetSVFinderTight' +softTagAlgTight.TrackJetCollectionName = 'AntiKt4PV0TrackJets' +softTagAlgTight.TrackSelectionTool.CutLevel = "LoosePrimary" +softTagAlgTight.OperatingPoint = 'Tight' + +FTAG4Seq += softTagAlgTight + +applySoftBtagging("softBtag", FTAG4Seq ) # SV tagger in VrtSecInclusive + +#=================================================================== +# Variable Radius (VR) Jets +#=================================================================== + +# Create variable-R trackjets and dress AntiKt10LCTopo with ghost VR-trkjet +addVRJets(FTAG4Seq, doFlipTagger=True) +addVRJets(FTAG4Seq, doFlipTagger=True, training='201903') +addHbbTagger( + FTAG4Seq, ToolSvc, + nn_file_name="BoostedJetTaggers/HbbTagger/Summer2018/MulticlassNetwork.json", + nn_config_file="BoostedJetTaggers/HbbTaggerDNN/MulticlassConfigJune2018.json") + +# alias for VR +BTaggingFlags.CalibrationChannelAliases += ["AntiKtVR30Rmax4Rmin02Track->AntiKtVR30Rmax4Rmin02Track,AntiKt4EMTopo"] + +#=================================================================== +# Tag custom or pre-built jet collections +#=================================================================== + +FlavorTagInit(scheduleFlipped = True, JetCollections = ['AntiKt4EMPFlowJets', 'AntiKt4EMTopoJets'],Sequencer = FTAG4Seq) + +#==================================================================== +# Add sequence (with all kernels needed) to DerivationFrameworkJob +#==================================================================== + +DerivationFrameworkJob += FTAG4Seq + +#==================================================================== +# SET UP STREAM +#==================================================================== +# The base name (DAOD_FTAG4 here) must match the string in +streamName = derivationFlags.WriteDAOD_FTAG4Stream.StreamName +fileName = buildFileName( derivationFlags.WriteDAOD_FTAG4Stream ) +FTAG4Stream = MSMgr.NewPoolRootStream( streamName, fileName ) +# Only events that pass the filters listed below are written out. +# Name must match that of the kernel above +# AcceptAlgs = logical OR of filters +# RequireAlgs = logical AND of filters +FTAG4Stream.AcceptAlgs(["FTAG4SkimKernel"]) + +FTAG4SlimmingHelper = SlimmingHelper("FTAG4SlimmingHelper") + +# nb: BTagging_AntiKt4EMTopo smart collection includes both AntiKt4EMTopoJets and BTagging_AntiKt4EMTopo +# container variables. Thus BTagging_AntiKt4EMTopo is needed in SmartCollections as well as AllVariables +FTAG4SlimmingHelper.SmartCollections = ["Electrons","Muons", + "InDetTrackParticles", + "AntiKt4EMTopoJets", + "AntiKt4EMPFlowJets", + "MET_Reference_AntiKt4EMPFlow", + "MET_Reference_AntiKt4EMTopo"] + +FTAG4SlimmingHelper.AllVariables = [ + "BTagging_AntiKtVR30Rmax4Rmin02Track_201810", + "BTagging_AntiKtVR30Rmax4Rmin02Track_201810JFVtx", + "BTagging_AntiKtVR30Rmax4Rmin02Track_201903", + "BTagging_AntiKtVR30Rmax4Rmin02Track_201903JFVtx", + "BTagging_AntiKt10LCTopoTrimmedPtFrac5SmallR20ExCoM2Sub", + "BTagging_AntiKt10LCTopoTrimmedPtFrac5SmallR20ExCoM2SubJFVtx", + "BTagging_AntiKt2Track", + "BTagging_AntiKt2TrackJFVtx", + "TruthVertices", + "TruthEvents", + "TruthHFWithDecayParticles", + "TruthHFWithDecayVertices", + "MET_Truth", + "MET_TruthRegions", + "TruthParticles", + ] + +FTAG4SlimmingHelper.ExtraVariables += [AntiKt4EMTopoJetsCPContent[1].replace("AntiKt4EMTopoJetsAux","AntiKt10LCTopoJets"), + "InDetTrackParticles.truthMatchProbability.x.y.z.vx.vy.vz", + "InDetTrackParticles.numberOfInnermostPixelLayerSplitHits.numberOfNextToInnermostPixelLayerSplitHits.numberOfNextToInnermostPixelLayerSharedHits", + "InDetTrackParticles.numberOfPixelSplitHits.numberOfInnermostPixelLayerSharedHits.numberOfContribPixelLayers.hitPattern.radiusOfFirstHit", + "InDetTrackParticles.is_selected.is_associated.is_svtrk_final.pt_wrtSV.eta_wrtSV.phi_wrtSV.d0_wrtSV.z0_wrtSV.errP_wrtSV.errd0_wrtSV.errz0_wrtSV.chi2_toSV", + "PrimaryVertices.x.y.z.neutralWeights.numberDoF.sumPt2.chiSquared.covariance.trackWeights", + "CombinedMuonTrackParticles.vx.vy.vz", + "ExtrapolatedMuonTrackParticles.vx.vy.vz", + "MSOnlyExtrapolatedMuonTrackParticles.vx.vy.vz", + "MuonSpectrometerTrackParticles.vx.vy.vz", + "BTagging_AntiKtVR30Rmax4Rmin02Track_201810SecVtx.-vxTrackAtVertex", + "BTagging_AntiKt10LCTopoTrimmedPtFrac5SmallR20ExCoM2SubSecVtx.-vxTrackAtVertex", + "BTagging_AntiKt2TrackSecVtx.-vxTrackAtVertex"] + +FTAG4SlimmingHelper.SmartCollections += \ + ["AntiKt4EMTopoJets_BTagging201810", + "AntiKt4EMPFlowJets_BTagging201810", + "AntiKt4EMPFlowJets_BTagging201903", + "BTagging_AntiKt4EMTopo_201810", + "AntiKtVR30Rmax4Rmin02TrackJets_BTagging201810", + "AntiKtVR30Rmax4Rmin02TrackJets_BTagging201903"] + +FTAG4SlimmingHelper.AllVariables += \ + ["BTagging_AntiKt4EMTopo_201810", + "BTagging_AntiKt4EMPFlow_201810", + "BTagging_AntiKt4EMPFlow_201903", + "BTagging_AntiKt4EMTopo_201810JFVtx", + "BTagging_AntiKt4EMPFlow_201810JFVtx", + "BTagging_AntiKt4EMPFlow_201903JFVtx", + "BTagging_AntiKtVR30Rmax4Rmin02Track_201903", + "BTagging_AntiKtVR30Rmax4Rmin02Track_201810", + "AntiKt4EMTopoJets_BTagging201810", + "AntiKt4EMPFlowJets_BTagging201810", + "AntiKt4EMPFlowJets_BTagging201903"] + +FTAG4SlimmingHelper.ExtraVariables += ["BTagging_AntiKt4EMTopo_201810SecVtx.-vxTrackAtVertex", + "BTagging_AntiKt4EMPFlow_201810SecVtx.-vxTrackAtVertex", + "BTagging_AntiKt4EMPFlow_201903SecVtx.-vxTrackAtVertex", + "AntiKt4EMPFlowJets_BTagging201810.EMFrac.HECFrac.LArQuality.HECQuality.FracSamplingMax.NegativeE.AverageLArQF.FracSamplingMaxIndex.HadronConeExclTruthLabelID.GhostTrack", + "AntiKt4EMPFlowJets_BTagging201810.Jvt.JvtRpt.JvtJvfcorr", + "AntiKt4EMPFlowJets_BTagging201810.NumTrkPt1000.NumTrkPt500.SumPtTrkPt500.SumPtTrkPt1000", + "AntiKt4EMPFlowJets_BTagging201903.EMFrac.HECFrac.LArQuality.HECQuality.FracSamplingMax.NegativeE.AverageLArQF.FracSamplingMaxIndex.HadronConeExclTruthLabelID.GhostTrack", + "AntiKt4EMPFlowJets_BTagging201903.Jvt.JvtRpt.JvtJvfcorr", + "AntiKt4EMPFlowJets_BTagging201903.NumTrkPt1000.NumTrkPt500.SumPtTrkPt500.SumPtTrkPt1000"] + +#---------------------------------------------------------------------- +# Add needed dictionary stuff +FTAG4SlimmingHelper.AppendToDictionary = { + "TruthHFWithDecayParticles" : "xAOD::TruthParticleContainer", + "TruthHFWithDecayParticlesAux" : "xAOD::TruthParticleAuxContainer", + "TruthHFWithDecayVertices" : "xAOD::TruthVertexContainer", + "TruthHFWithDecayVerticesAux" : "xAOD::TruthVertexAuxContainer", + "BTagging_AntiKt2Track" : "xAOD::BTaggingContainer" , + "BTagging_AntiKt2TrackAux" : "xAOD::BTaggingAuxContainer", + "BTagging_AntiKt2TrackJFVtx" : "xAOD::BTagVertexContainer" , + "BTagging_AntiKt2TrackJFVtxAux" : "xAOD::BTagVertexAuxContainer", + "BTagging_AntiKt2TrackSecVtx" : "xAOD::VertexContainer" , + "BTagging_AntiKt2TrackSecVtxAux" : "xAOD::VertexAuxContainer", + "AntiKtVR30Rmax4Rmin02Track" : "xAOD::JetContainer" , + "AntiKtVR30Rmax4Rmin02TrackAux" : "xAOD::JetAuxContainer" , + "BTagging_AntiKt4EMPFlow" : "xAOD::BTaggingContainer", + "BTagging_AntiKt4EMPFlowAux" : "xAOD::BTaggingAuxContainer", + "BTagging_AntiKt4EMPFlowJFVtx" : "xAOD::BTagVertexContainer", + "BTagging_AntiKt4EMPFlowJFVtxAux" : "xAOD::BTagVertexAuxContainer", + "BTagging_AntiKt4EMTopo_201810JFVtx" : "xAOD::BTagVertexContainer", + "BTagging_AntiKt4EMTopo_201810JFVtxAux" : "xAOD::BTagVertexAuxContainer", + "BTagging_AntiKt4EMPFlow_201810JFVtx" : "xAOD::BTagVertexContainer", + "BTagging_AntiKt4EMPFlow_201810JFVtxAux" : "xAOD::BTagVertexAuxContainer", + "BTagging_AntiKt4EMPFlow_201903JFVtx" : "xAOD::BTagVertexContainer", + "BTagging_AntiKt4EMPFlow_201903JFVtxAux" : "xAOD::BTagVertexAuxContainer", + "BTagging_AntiKt4EMTopo_201810SecVtx" : "xAOD::VertexContainer", + "BTagging_AntiKt4EMTopo_201810SecVtxAux" : "xAOD::VertexAuxContainer", + "BTagging_AntiKt4EMPFlow_201810SecVtx" : "xAOD::VertexContainer", + "BTagging_AntiKt4EMPFlow_201810SecVtxAux" : "xAOD::VertexAuxContainer", + "BTagging_AntiKt4EMPFlow_201903SecVtx" : "xAOD::VertexContainer", + "BTagging_AntiKt4EMPFlow_201903SecVtxAux" : "xAOD::VertexAuxContainer", + "BTagging_AntiKtVR30Rmax4Rmin02Track_201810" : "xAOD::BTaggingContainer" , + "BTagging_AntiKtVR30Rmax4Rmin02Track_201810Aux" : "xAOD::BTaggingAuxContainer", + "BTagging_AntiKtVR30Rmax4Rmin02Track_201810JFVtx" : "xAOD::BTagVertexContainer" , + "BTagging_AntiKtVR30Rmax4Rmin02Track_201810JFVtxAux" : "xAOD::BTagVertexAuxContainer", + "BTagging_AntiKtVR30Rmax4Rmin02Track_201810SecVtx" : "xAOD::VertexContainer" , + "BTagging_AntiKtVR30Rmax4Rmin02Track_201810SecVtxAux" : "xAOD::VertexAuxContainer", + "AntiKt10LCTopoTrimmedPtFrac5SmallR20ExCoM2SubJets" : "xAOD::JetContainer" , + "AntiKt10LCTopoTrimmedPtFrac5SmallR20ExCoM2SubJetsAux" : "xAOD::JetAuxContainer" , + "BTagging_AntiKt10LCTopoTrimmedPtFrac5SmallR20ExCoM2Sub" : "xAOD::BTaggingContainer" , + "BTagging_AntiKt10LCTopoTrimmedPtFrac5SmallR20ExCoM2SubAux" : "xAOD::BTaggingAuxContainer", + "BTagging_AntiKt10LCTopoTrimmedPtFrac5SmallR20ExCoM2SubJFVtx" : "xAOD::BTagVertexContainer" , + "BTagging_AntiKt10LCTopoTrimmedPtFrac5SmallR20ExCoM2SubJFVtxAux" : "xAOD::BTagVertexAuxContainer", + "BTagging_AntiKt10LCTopoTrimmedPtFrac5SmallR20ExCoM2SubSecVtx" : "xAOD::VertexContainer" , + "BTagging_AntiKt10LCTopoTrimmedPtFrac5SmallR20ExCoM2SubSecVtxAux" : "xAOD::VertexAuxContainer", +} +#---------------------------------------------------------------------- +# Add soft b-tagging containers +excludedVertexAuxData = "-vxTrackAtVertex.-MvfFitInfo.-isInitialized.-VTAV" + +StaticContent = [] +StaticContent += ["xAOD::VertexContainer#SoftBVrtClusterTool_Tight_Vertices"] +StaticContent += ["xAOD::VertexAuxContainer#SoftBVrtClusterTool_Tight_VerticesAux." + excludedVertexAuxData] +StaticContent += ["xAOD::VertexContainer#SoftBVrtClusterTool_Medium_Vertices"] +StaticContent += ["xAOD::VertexAuxContainer#SoftBVrtClusterTool_Medium_VerticesAux." + excludedVertexAuxData] +StaticContent += ["xAOD::VertexContainer#SoftBVrtClusterTool_Loose_Vertices"] +StaticContent += ["xAOD::VertexAuxContainer#SoftBVrtClusterTool_Loose_VerticesAux." + excludedVertexAuxData] +StaticContent += ["xAOD::VertexContainer#VrtSecInclusive_SoftBtagCandidateVertices"] +StaticContent += ["xAOD::VertexAuxContainer#VrtSecInclusive_SoftBtagCandidateVerticesAux."] + +FTAG4SlimmingHelper.StaticContent = StaticContent +#---------------------------------------------------------------------- + +addJetOutputs(FTAG4SlimmingHelper,["FTAG4"]) + +FTAG4SlimmingHelper.IncludeMuonTriggerContent = True +FTAG4SlimmingHelper.IncludeEGammaTriggerContent = True +FTAG4SlimmingHelper.IncludeJetTriggerContent = True +FTAG4SlimmingHelper.IncludeEtMissTriggerContent = False +FTAG4SlimmingHelper.IncludeBJetTriggerContent = True + +#FTAG4 TrigNav Thinning +FTAG4ThinningHelper = ThinningHelper( "FTAG4ThinningHelper" ) +FTAG4ThinningHelper.TriggerChains = 'HLT_e[2-9][0-9]_.*|HLT_e[1-9][0-9][0-9]_.*|HLT_mu[2-9][0-9]_.*|HLT_mu[1-9][0-9][0-9]_.*|HLT_mu[2-9][0-9]' +FTAG4ThinningHelper.AppendToStream( FTAG4Stream ) + +FTAG4SlimmingHelper.AppendContentToStream(FTAG4Stream) diff --git a/PhysicsAnalysis/DerivationFramework/DerivationFrameworkFlavourTag/share/FTAG5.py b/PhysicsAnalysis/DerivationFramework/DerivationFrameworkFlavourTag/share/FTAG5.py new file mode 100644 index 0000000000000000000000000000000000000000..0f392bebc44fc581a7f09f1f038b3a625ebf443c --- /dev/null +++ b/PhysicsAnalysis/DerivationFramework/DerivationFrameworkFlavourTag/share/FTAG5.py @@ -0,0 +1,383 @@ +#==================================================================== +# FTAG5.py +# It requires the reductionConf flag FTAG5 in Reco_tf.py +#==================================================================== + +# Set up common services and job object. + +# Framework core +from DerivationFrameworkCore.DerivationFrameworkMaster import ( + DerivationFrameworkJob, buildFileName) +from DerivationFrameworkCore.ThinningHelper import ( + ThinningHelper) +from DerivationFrameworkCore.SlimmingHelper import SlimmingHelper +from DerivationFrameworkCore.DerivationFrameworkCoreConf import ( + DerivationFramework__DerivationKernel) + +from DerivationFrameworkTools.DerivationFrameworkToolsConf import ( + DerivationFramework__xAODStringSkimmingTool) + +# JetEtMiss +from DerivationFrameworkJetEtMiss.JetCommon import ( + OutputJets, addJetOutputs) +from DerivationFrameworkJetEtMiss.ExtendedJetCommon import ( + addDefaultTrimmedJets, addTCCTrimmedJets, replaceAODReducedJets, addConstModJets) +from JetRec.JetRecStandard import jtm +from TrackCaloClusterRecTools.TrackCaloClusterConfig import runTCCReconstruction + +# tracking +from TrkVertexFitterUtils.TrkVertexFitterUtilsConf import ( + Trk__TrackToVertexIPEstimator) + +# flavor tagging +from DerivationFrameworkFlavourTag.HbbCommon import ( + addVRJets, addExKtCoM, addRecommendedXbbTaggers, xbbTaggerExtraVariables) +from DerivationFrameworkFlavourTag import BTaggingContent as bvars +from DerivationFrameworkMCTruth.MCTruthCommon import ( + addTruth3ContentToSlimmerTool) +from DerivationFrameworkJetEtMiss.JSSVariables import JSSHighLevelVariables +from BTagging.BTaggingConf import Analysis__BTagNNAlg as BTagNNAlg + +from FlavorTagDiscriminants.discriminants import complex_jet_discriminants + +# logging +from AthenaCommon import Logging +ftag5_log = Logging.logging.getLogger('FTAG5LOG') +def log_setup(algo): + ftag5_log.info('set up {}'.format(algo)) + +#==================================================================== +# SET UP STREAM +#==================================================================== + +# The base name (DAOD_FTAG5 here) must match the string in +streamName = derivationFlags.WriteDAOD_FTAG5Stream.StreamName +fileName = buildFileName( derivationFlags.WriteDAOD_FTAG5Stream ) +FTAG5Stream = MSMgr.NewPoolRootStream( streamName, fileName ) +# Only events that pass the filters listed below are written out. +# Name must match that of the kernel above +# AcceptAlgs = logical OR of filters +# RequireAlgs = logical AND of filters +FTAG5Stream.AcceptAlgs(["FTAG5Kernel"]) + + +#==================================================================== +# SKIMMING TOOLS +#==================================================================== +skim_expr = 'count(AntiKt10LCTopoTrimmedPtFrac5SmallR20Jets.pt > 250 * GeV && (abs(AntiKt10LCTopoTrimmedPtFrac5SmallR20Jets.eta) < 2.0)) > 0' + +FTAG5StringSkimmingTool = DerivationFramework__xAODStringSkimmingTool( + name = "FTAG5StringSkimmingTool", + expression = skim_expr) + +ToolSvc += FTAG5StringSkimmingTool +log_setup(FTAG5StringSkimmingTool) + +#===================================================================== +# Thinning tools +#===================================================================== + +FTAG5ThinningHelper = ThinningHelper( "FTAG5ThinningHelper" ) +FTAG5ThinningHelper.TriggerChains = '' +FTAG5ThinningHelper.AppendToStream( FTAG5Stream ) + +from DerivationFrameworkFlavourTag.DerivationFrameworkFlavourTagConf import ( + DerivationFramework__HbbTrackThinner as HbbThinner ) + +# Run HbbThinner on large-R jet collections +FTAG5HbbThinningTools = [] +for collection in ["AntiKt10LCTopoTrimmedPtFrac5SmallR20Jets", "AntiKt10TrackCaloClusterTrimmedPtFrac5SmallR20Jets"]: + FTAG5HbbThinningTools.append(HbbThinner( + name = "FTAG5HbbThinningTool_%s"%collection, + thinningService = FTAG5ThinningHelper.ThinningSvc(), + jetCollectionName = collection, + largeJetPtCut = 200e3, + largeJetEtaCut = 2.1, + smallJetPtCut = 7e3, + nLeadingSubjets = 100, # save all the subjets in the jet + addSubjetGhosts = True, + addConstituents = True, + addConeAssociated = True)) + + ToolSvc += FTAG5HbbThinningTools[-1] + log_setup(FTAG5HbbThinningTools[-1]) + +# Tracks and CaloClusters associated with TCCs +from DerivationFrameworkInDet.DerivationFrameworkInDetConf import DerivationFramework__TCCTrackParticleThinning +FTAG5TCCThinningTool = DerivationFramework__TCCTrackParticleThinning(name = "FTAG5TCCThinningTool", + ThinningService = FTAG5ThinningHelper.ThinningSvc(), + JetKey = "AntiKt10TrackCaloClusterJets", + TCCKey = "TrackCaloClustersCombinedAndNeutral", + InDetTrackParticlesKey = "InDetTrackParticles", + CaloCalTopoClustersKey = "CaloCalTopoClusters", + ThinOriginCorrectedClusters = True, + OriginCaloCalTopoClustersKey = "LCOriginTopoClusters") +ToolSvc += FTAG5TCCThinningTool +log_setup(FTAG5TCCThinningTool) + + + +#==================================================================== +# AUGMENTATION TOOLS +# ( AUGMENTATION = adding information to the output DxAOD that is not found in the input file ) +#==================================================================== + +#make IPE tool for TrackToVertexWrapper +FTAG5IPETool = Trk__TrackToVertexIPEstimator(name = "FTAG5IPETool") +ToolSvc += FTAG5IPETool +log_setup(FTAG5IPETool) + +#==================================================================== +# CREATE PRIVATE SEQUENCE +#==================================================================== + +FTAG5Seq = CfgMgr.AthSequencer("FTAG5Sequence"); +DerivationFrameworkJob += FTAG5Seq + +#==================================================================== +# Basic Jet Collections +#==================================================================== + +#put custom jet names here +FTAG5BTaggedJets = [ + "AntiKt2PV0TrackJets", + "AntiKtVR30Rmax4Rmin02TrackJets_BTagging201810", + "AntiKtVR30Rmax4Rmin02TrackJets_BTagging201903", + "AntiKtVR30Rmax4Rmin02TrackJets_BTagging201810GhostTag", + "AntiKtVR30Rmax4Rmin02TrackJets_BTagging201903", + "AntiKt10LCTopoTrimmedPtFrac5SmallR20ExKt2SubJets", + "AntiKt10LCTopoTrimmedPtFrac5SmallR20ExKt3SubJets", + "AntiKt10LCTopoTrimmedPtFrac5SmallR20ExKt2GASubJets", + "AntiKt10LCTopoTrimmedPtFrac5SmallR20ExKt3GASubJets", + "AntiKt10LCTopoTrimmedPtFrac5SmallR20ExCoM2SubJets"] +OutputJets["FTAG5"] = FTAG5BTaggedJets[:] + +# running TCC reconstruction +import AthenaCommon.AtlasUnixStandardJob +include("RecExCond/AllDet_detDescr.py") +runTCCReconstruction(FTAG5Seq, ToolSvc, "LCOriginTopoClusters", "InDetTrackParticles",outputTCCName="TrackCaloClustersCombinedAndNeutral") + +# I don't understand why we need some of these. We don't use +# AntiKt4PV0TrackJets in the output, but without them we get a crash +reducedJetList = ["AntiKt2PV0TrackJets", + "AntiKt4PV0TrackJets", # <- Crashes without this, + "AntiKt10LCTopoJets", # <- while building this collection + "AntiKt10TrackCaloClusterJets", + "AntiKt4TruthJets", + "AntiKt10TruthJets"] + +extendedFlag = 0 # --- = 0 for Standard Taggers & =1 for ExpertTaggers +replaceAODReducedJets(reducedJetList,FTAG5Seq,"FTAG5", extendedFlag) + +#=================================================================== +# Add trimmed large-R jets +#=================================================================== +addDefaultTrimmedJets(FTAG5Seq,"FTAG5",dotruth=True) +addTCCTrimmedJets(FTAG5Seq,"FTAG5") + +# These are the jet collections considered below for adding links to track-jets, smart slimming lists and extra JSS variables +fatJetCollections = [ + "AntiKt10LCTopoTrimmedPtFrac5SmallR20Jets", + "AntiKt10TrackCaloClusterTrimmedPtFrac5SmallR20Jets", +] + +#==================================================================== +# TRUTH in excess of TRUTH3 +#==================================================================== +if globalflags.DataSource()!='data': + + from DerivationFrameworkMCTruth.MCTruthCommon import ( + addStandardTruthContents, + addHFAndDownstreamParticles, + addWbosonsAndDownstreamParticles, + addBosonsAndDownstreamParticles, + addTopQuarkAndDownstreamParticles, + ) + addStandardTruthContents() + addHFAndDownstreamParticles() + addWbosonsAndDownstreamParticles() + addBosonsAndDownstreamParticles() # H/W/Z bosons + addTopQuarkAndDownstreamParticles() # top + +#=================================================================== +# Variable Radius (VR) Jets +#=================================================================== + +# alias for VR +BTaggingFlags.CalibrationChannelAliases += ["AntiKtVR30Rmax4Rmin02Track->AntiKtVR30Rmax4Rmin02Track,AntiKt4EMTopo", + "AntiKtVR30Rmax4Rmin02TrackGhostTag->AntiKtVR30Rmax4Rmin02TrackGhostTag,AntiKt4EMTopo",] + +addVRJets( + sequence=FTAG5Seq, + largeRColls=fatJetCollections, + do_ghost=False, + logger=ftag5_log) + +addVRJets( + sequence=FTAG5Seq, + largeRColls=fatJetCollections, + do_ghost=True, + logger=ftag5_log) + +addVRJets( + sequence=FTAG5Seq, + largeRColls=fatJetCollections, + do_ghost=False, + training='201903', + logger=ftag5_log) + +# Add new DL1 and RNN +newtag_collections = [ + 'AntiKtVR30Rmax4Rmin02TrackJets_BTagging201810', + 'AntiKtVR30Rmax4Rmin02TrackJets_BTagging201903', + 'AntiKtVR30Rmax4Rmin02TrackJets_BTagging201810GhostTag' +] +rnn_remap = {'rnnip_p' + x: 'rnnipT_p' + x for x in 'bcu'} +FTAG5Seq += BTagNNAlg( + "BTagRNNForTrackJets", + nnPath='BTagging/201903/rnnip/antiktvr30rmax4rmin02track/network.json', + jetCollections=newtag_collections, + variableRemapping=rnn_remap) +dl1_remap = {'DL1r_p' + x: 'DL1Tr_p' + x for x in 'bcu'} +dl1_remap.update(rnn_remap) +FTAG5Seq += BTagNNAlg( + "BTagDL1rForTrackJets", + nnPath='BTagging/201903/dl1r/antiktvr30rmax4rmin02track/network.json', + jetCollections=newtag_collections, + variableRemapping=dl1_remap) + + +#=================================================================== +# ExKt subjets for each trimmed large-R jet +#=================================================================== +ExKtJetCollection__FatJet = "AntiKt10LCTopoTrimmedPtFrac5SmallR20Jets" + +addExKtCoM(FTAG5Seq, ToolSvc, ExKtJetCollection__FatJet, 2, doGhostAssoc=True, doTrackSubJet=False) +addExKtCoM(FTAG5Seq, ToolSvc, ExKtJetCollection__FatJet, 3, doGhostAssoc=True, doTrackSubJet=False) + +addExKtCoM(FTAG5Seq, ToolSvc, ExKtJetCollection__FatJet, 2, doTrackSubJet=False) +addExKtCoM(FTAG5Seq, ToolSvc, ExKtJetCollection__FatJet, 3, doTrackSubJet=False) + +addExKtCoM(FTAG5Seq, ToolSvc, ExKtJetCollection__FatJet, 2, doTrackSubJet=False, subjetAlgName = "CoM") + +BTaggingFlags.CalibrationChannelAliases += ["AntiKt10LCTopoTrimmedPtFrac5SmallR20ExKt2Sub->AntiKt4LCTopo,AntiKt4TopoEM,AntiKt4EMTopo", + "AntiKt10LCTopoTrimmedPtFrac5SmallR20ExKt3Sub->AntiKt4LCTopo,AntiKt4TopoEM,AntiKt4EMTopo", + "AntiKt10LCTopoTrimmedPtFrac5SmallR20ExKt2GASub->AntiKt4LCTopo,AntiKt4TopoEM,AntiKt4EMTopo", + "AntiKt10LCTopoTrimmedPtFrac5SmallR20ExKt3GASub->AntiKt4LCTopo,AntiKt4TopoEM,AntiKt4EMTopo", + "AntiKt10LCTopoTrimmedPtFrac5SmallR20ExCoM2Sub->AntiKt4LCTopo,AntiKt4TopoEM,AntiKt4EMTopo"] + +#================================================================== +# Augment tracks and jets with additional information +#================================================================== + +FTAG5Seq += CfgMgr.BTagVertexAugmenter() + +#================================================================ +# Add Hbb tagger +#================================================================ + +addRecommendedXbbTaggers(FTAG5Seq, ToolSvc, ftag5_log) + +#==================================================================== +# CREATE THE DERIVATION KERNEL ALGORITHM AND PASS THE ABOVE TOOLS +#==================================================================== + +FTAG5Seq += CfgMgr.DerivationFramework__DerivationKernel( + "FTAG5Kernel", + SkimmingTools = [FTAG5StringSkimmingTool], + ThinningTools = [FTAG5TCCThinningTool]+FTAG5HbbThinningTools, + AugmentationTools = [] +) + + +#==================================================================== +# Add slimming tools +#==================================================================== + +FTAG5SlimmingHelper = SlimmingHelper("FTAG5SlimmingHelper") + +FTAG5SlimmingHelper.SmartCollections = [ + "Muons", + "InDetTrackParticles", + "BTagging_AntiKtVR30Rmax4Rmin02Track_201903", + "BTagging_AntiKtVR30Rmax4Rmin02Track_201810_expert", + "BTagging_AntiKtVR30Rmax4Rmin02Track_201810GhostTag_expert", + "BTagging_AntiKt10LCTopoTrimmedPtFrac5SmallR20ExKt2Sub_expert", + "BTagging_AntiKt10LCTopoTrimmedPtFrac5SmallR20ExKt3Sub_expert", + "BTagging_AntiKt10LCTopoTrimmedPtFrac5SmallR20ExKt2GASub_expert", + "BTagging_AntiKt10LCTopoTrimmedPtFrac5SmallR20ExKt3GASub_expert", + "BTagging_AntiKt10LCTopoTrimmedPtFrac5SmallR20ExCoM2Sub_expert"] +FTAG5SlimmingHelper.SmartCollections += fatJetCollections + +for fatJetCollection in fatJetCollections: + jssVariables = ['.'.join([fatJetCollection] + JSSHighLevelVariables) ] + FTAG5SlimmingHelper.ExtraVariables += jssVariables + +FTAG5SlimmingHelper.ExtraVariables += [ + "InDetTrackParticles.truthMatchProbability.x.y.z.vx.vy.vz", + "InDetTrackParticles.numberOfContribPixelLayers.numberOfTRTHits.numberOfInnermostPixelLayerSharedHits.numberOfNextToInnermostPixelLayerSharedHits", + "InDetTrackParticles.numberOfPixelSplitHits.numberOfInnermostPixelLayerSplitHits.numberOfNextToInnermostPixelLayerSplitHits", + "InDetTrackParticles.hitPattern.radiusOfFirstHit", + "AntiKt10LCTopoJets.GhostAntiKt2TrackJet", + "AntiKt10TrackCaloClusterJets.GhostVR30Rmax4Rmin02TrackJet_BTagging201810", + "AntiKt10TrackCaloClusterJets.GhostVR30Rmax4Rmin02TrackJet_BTagging201810GhostTag", + "AntiKt10LCTopoJets.GhostVR30Rmax4Rmin02TrackJet_BTagging201810", + "AntiKt10LCTopoJets.GhostVR30Rmax4Rmin02TrackJet_BTagging201810GhostTag", + "InDetTrackParticles.btagIp_d0.btagIp_z0SinTheta.btagIp_d0Uncertainty.btagIp_z0SinThetaUncertainty.btagIp_trackDisplacement.btagIp_trackMomentum", + "TrackCaloClustersCombinedAndNeutral.m.pt.phi.eta.taste.trackParticleLink.DetectorEta.iparticleLinks" +] +FTAG5SlimmingHelper.ExtraVariables += xbbTaggerExtraVariables + +# adding default b-tag alg varibles for antikt2 collection (smart collection no longer supported) +akt2variables_btag = ['.'.join(["BTagging_AntiKt2Track"] + bvars.BTaggingStandardAux)] +akt2variables_kin = ['.'.join(["AntiKt2PV0TrackJets"] + bvars.JetStandardAux)] +FTAG5SlimmingHelper.ExtraVariables += akt2variables_btag +FTAG5SlimmingHelper.ExtraVariables += akt2variables_kin + +# add the extra variables that come from the BTagJetAugmenterAlg +extra_btag = list(complex_jet_discriminants) +extra_btag += ['JetFitter_JFvertices', 'SV1_vertices'] +for jc in FTAG5BTaggedJets: + FTAG5SlimmingHelper.ExtraVariables.append('.'.join([ + "BTagging_"+jc.replace("Jets","")] + extra_btag)) + +# add some more extra variables for ghost associated particles +ghost_particles = [ + 'HBosons', + 'WBosons', + 'ZBosons', + 'TQuarksFinal', + 'BHadronsFinal', + 'CHadronsFinal', +] +ghost_counts = ['Ghost' + gp + 'Count' for gp in ghost_particles] +ghost_pts = ['Ghost' + gp + 'Pt' for gp in ghost_particles] +ghost_subjets = [ + 'GhostVR30Rmax4Rmin02TrackJet_BTagging201810GhostTag', + 'GhostVR30Rmax4Rmin02TrackJet_BTagging201903'] +for jc in ['AntiKt10LCTopoJets', 'AntiKt10TrackCaloClusterJets']: + FTAG5SlimmingHelper.ExtraVariables.append( + '.'.join([jc] + ghost_counts + ghost_pts + ghost_subjets)) + +# add some extra retrained taggers +augmented_btag_containers = [ + 'BTagging_AntiKtVR30Rmax4Rmin02Track_201810', + 'BTagging_AntiKtVR30Rmax4Rmin02Track_201810GhostTag'] +for cont in augmented_btag_containers: + FTAG5SlimmingHelper.ExtraVariables.append( + '.'.join([cont] + dl1_remap.values())) + +FTAG5SlimmingHelper.IncludeMuonTriggerContent = False +FTAG5SlimmingHelper.IncludeEGammaTriggerContent = False +FTAG5SlimmingHelper.IncludeJetTriggerContent = False +FTAG5SlimmingHelper.IncludeEtMissTriggerContent = False +FTAG5SlimmingHelper.IncludeBJetTriggerContent = False + +# Add truth3 +addTruth3ContentToSlimmerTool(FTAG5SlimmingHelper) +# extra for H/W/Z/t taggers +FTAG5SlimmingHelper.AllVariables += [ + "AntiKt10TruthTrimmedPtFrac5SmallR20Jets", +] + +FTAG5SlimmingHelper.AppendContentToStream(FTAG5Stream) diff --git a/PhysicsAnalysis/DerivationFramework/DerivationFrameworkFlavourTag/src/BTagJetAugmenterAlg.cxx b/PhysicsAnalysis/DerivationFramework/DerivationFrameworkFlavourTag/src/BTagJetAugmenterAlg.cxx new file mode 100644 index 0000000000000000000000000000000000000000..55a741abf2e38fd746ab262ff3c268c3ceb5586c --- /dev/null +++ b/PhysicsAnalysis/DerivationFramework/DerivationFrameworkFlavourTag/src/BTagJetAugmenterAlg.cxx @@ -0,0 +1,35 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +#include "BTagJetAugmenterAlg.h" + +#include "xAODJet/JetContainer.h" + +BTagJetAugmenterAlg::BTagJetAugmenterAlg( + const std::string& name, ISvcLocator* loc): + AthAlgorithm(name, loc), + m_jet_collection(), + m_augmenter(nullptr) +{ + declareProperty("JetCollectionName", m_jet_collection); +} + +StatusCode BTagJetAugmenterAlg::initialize() { + + m_augmenter.reset(new BTagJetAugmenter("")); + return StatusCode::SUCCESS; +} + +StatusCode BTagJetAugmenterAlg::finalize() { + return StatusCode::SUCCESS; +} + +StatusCode BTagJetAugmenterAlg::execute() { + const xAOD::JetContainer *jets = nullptr; + CHECK( evtStore()->retrieve(jets, m_jet_collection) ); + for (const auto* jet: *jets) { + m_augmenter->augment(*jet); + } + return StatusCode::SUCCESS; +} diff --git a/PhysicsAnalysis/DerivationFramework/DerivationFrameworkFlavourTag/src/BTagJetAugmenterAlg.h b/PhysicsAnalysis/DerivationFramework/DerivationFrameworkFlavourTag/src/BTagJetAugmenterAlg.h new file mode 100644 index 0000000000000000000000000000000000000000..f4bf633ca7ac7f52d20ecc6ad034714af21aa99a --- /dev/null +++ b/PhysicsAnalysis/DerivationFramework/DerivationFrameworkFlavourTag/src/BTagJetAugmenterAlg.h @@ -0,0 +1,25 @@ +/* + Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration +*/ + +#ifndef BTAG_JET_AUGMENTER_ALG_HH +#define BTAG_JET_AUGMENTER_ALG_HH + +#include "AthenaBaseComps/AthAlgorithm.h" +#include "GaudiKernel/ToolHandle.h" +#include "FlavorTagDiscriminants/BTagJetAugmenter.h" + +class BTagJetAugmenterAlg: public AthAlgorithm { +public: + BTagJetAugmenterAlg(const std::string& name, + ISvcLocator* pSvcLocator ); + + virtual StatusCode initialize(); + virtual StatusCode execute(); + virtual StatusCode finalize(); +private: + std::string m_jet_collection; + std::unique_ptr<BTagJetAugmenter> m_augmenter; +}; + +#endif diff --git a/PhysicsAnalysis/DerivationFramework/DerivationFrameworkFlavourTag/src/BTagVertexAugmenter.cxx b/PhysicsAnalysis/DerivationFramework/DerivationFrameworkFlavourTag/src/BTagVertexAugmenter.cxx new file mode 100644 index 0000000000000000000000000000000000000000..048a21ce0f58062ab95da876c8adf3d637eb8ed1 --- /dev/null +++ b/PhysicsAnalysis/DerivationFramework/DerivationFrameworkFlavourTag/src/BTagVertexAugmenter.cxx @@ -0,0 +1,50 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +#include "BTagVertexAugmenter.h" +#include "GaudiKernel/ServiceHandle.h" + +#include "xAODTracking/Vertex.h" +#include "xAODTracking/VertexContainer.h" +#include "xAODTracking/TrackParticleContainer.h" + + +BTagVertexAugmenter::BTagVertexAugmenter( + const std::string& name, ISvcLocator* loc): + AthAlgorithm(name, loc) +{ +} + +StatusCode BTagVertexAugmenter::initialize() { + return StatusCode::SUCCESS; +} + +StatusCode BTagVertexAugmenter::finalize() { + return StatusCode::SUCCESS; +} + +StatusCode BTagVertexAugmenter::execute() { + const xAOD::VertexContainer *vertices = 0; + CHECK( evtStore()->retrieve(vertices, "PrimaryVertices") ); + int npv = 0; + size_t indexPV_tmp = 0; + xAOD::VertexContainer::const_iterator vtx_itr = vertices->begin(); + xAOD::VertexContainer::const_iterator vtx_end = vertices->end(); + int count = -1; + for (; vtx_itr != vtx_end; ++vtx_itr) { + count++; + if ((*vtx_itr)->nTrackParticles() >= 2) { + npv++; + if ((*vtx_itr)->vertexType() == 1) { + indexPV_tmp = count; + } + } + } + std::unique_ptr<int> pv_index_ptr(new int(indexPV_tmp)); + CHECK(evtStore()->record(std::move(pv_index_ptr), "BTaggingVertexIndex")); + std::unique_ptr<int> npv_ptr(new int(npv)); + CHECK(evtStore()->record(std::move(npv_ptr), + "BTaggingNumberOfPrimaryVertices")); + return StatusCode::SUCCESS; +} diff --git a/PhysicsAnalysis/DerivationFramework/DerivationFrameworkFlavourTag/src/BTagVertexAugmenter.h b/PhysicsAnalysis/DerivationFramework/DerivationFrameworkFlavourTag/src/BTagVertexAugmenter.h new file mode 100644 index 0000000000000000000000000000000000000000..97a58899f3ae77d0d07bfa655604c566317ef9d4 --- /dev/null +++ b/PhysicsAnalysis/DerivationFramework/DerivationFrameworkFlavourTag/src/BTagVertexAugmenter.h @@ -0,0 +1,22 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +#ifndef BTAGGING_VERTEX_AUGMENTER_HH +#define BTAGGING_VERTEX_AUGMENTER_HH + +#include "AthenaBaseComps/AthAlgorithm.h" +#include "GaudiKernel/ToolHandle.h" + +class BTagVertexAugmenter: public AthAlgorithm { +public: + BTagVertexAugmenter(const std::string& name, + ISvcLocator* pSvcLocator ); + + virtual StatusCode initialize(); + virtual StatusCode execute(); + virtual StatusCode finalize(); +private: +}; + +#endif diff --git a/PhysicsAnalysis/DerivationFramework/DerivationFrameworkFlavourTag/src/components/DerivationFrameworkFlavourTag_entries.cxx b/PhysicsAnalysis/DerivationFramework/DerivationFrameworkFlavourTag/src/components/DerivationFrameworkFlavourTag_entries.cxx new file mode 100644 index 0000000000000000000000000000000000000000..265ff9f5bdbead5a69803f3dd9b2c5495e535ce6 --- /dev/null +++ b/PhysicsAnalysis/DerivationFramework/DerivationFrameworkFlavourTag/src/components/DerivationFrameworkFlavourTag_entries.cxx @@ -0,0 +1,5 @@ +#include "../BTagVertexAugmenter.h" +#include "../BTagJetAugmenterAlg.h" + +DECLARE_COMPONENT(BTagVertexAugmenter) +DECLARE_COMPONENT(BTagJetAugmenterAlg) diff --git a/PhysicsAnalysis/DerivationFramework/DerivationFrameworkFlavourTag/src/components/DerivationFrameworkFlavourTag_load.cxx b/PhysicsAnalysis/DerivationFramework/DerivationFrameworkFlavourTag/src/components/DerivationFrameworkFlavourTag_load.cxx new file mode 100644 index 0000000000000000000000000000000000000000..8eb489f36fb60f3553e801c811fbf2e5581d0dfe --- /dev/null +++ b/PhysicsAnalysis/DerivationFramework/DerivationFrameworkFlavourTag/src/components/DerivationFrameworkFlavourTag_load.cxx @@ -0,0 +1,4 @@ +#include "GaudiKernel/LoadFactoryEntries.h" + +LOAD_FACTORY_ENTRIES( DerivationFrameworkFlavourTag ) + diff --git a/PhysicsAnalysis/DerivationFramework/DerivationFrameworkFlavourTag/util/test-btagging.cxx b/PhysicsAnalysis/DerivationFramework/DerivationFrameworkFlavourTag/util/test-btagging.cxx new file mode 100644 index 0000000000000000000000000000000000000000..680ce2b91ae69fe907f87845bd468e43e0e43501 --- /dev/null +++ b/PhysicsAnalysis/DerivationFramework/DerivationFrameworkFlavourTag/util/test-btagging.cxx @@ -0,0 +1,63 @@ +#include "xAODRootAccess/Init.h" +#include "xAODRootAccess/tools/ReturnCheck.h" +#include "xAODRootAccess/TEvent.h" +#include "xAODJet/JetContainer.h" + +#include "TFile.h" +#include "TTree.h" + +int main (int argc, char *argv[]) { + + if (argc != 3) { + std::cerr << "usage: " << argv[0] << ": <DAOD> <jet collection>" + << std::endl; + return 1; + } + std::string file = argv[1]; + std::string jets_name = argv[2]; + + // The name of the application: + const char *const APP_NAME = "BTagTestDumper"; + + // Set up the environment: + RETURN_CHECK( APP_NAME, xAOD::Init() ); + + // Set up the event object: + xAOD::TEvent event(xAOD::TEvent::kClassAccess); + + // Open the file: + std::unique_ptr<TFile> ifile(TFile::Open(file.c_str(), "READ")); + if ( ! ifile.get() || ifile->IsZombie()) { + Error( APP_NAME, "Couldn't open file: %s", file.c_str() ); + return 1; + } + Info( APP_NAME, "Opened file: %s", file.c_str() ); + + // Connect the event object to it: + RETURN_CHECK( APP_NAME, event.readFrom(ifile.get()) ); + + unsigned long long nbad = 0; + unsigned long long ngood = 0; + unsigned long long entries = event.getEntries(); + for (unsigned long long entry = 0; entry < entries; ++entry) { + // Load the event: + if (event.getEntry(entry) < 0) { + Error( APP_NAME, "Couldn't load entry %lld from file: %s", + entry, file.c_str() ); + return 1; + } + const xAOD::JetContainer *jets = nullptr; + RETURN_CHECK( APP_NAME, event.retrieve(jets, jets_name) ); + for (const xAOD::Jet *const jet : *jets) { + const xAOD::BTagging* btag = jet->btagging(); + if (!btag) { + nbad++; + } else { + ngood++; + } + } + } + std::cout << "found " << nbad << " jets with no valid btagging link " + << "in " << nbad + ngood << " jets" << std::endl; + return nbad > 0; +} diff --git a/PhysicsAnalysis/DerivationFramework/DerivationFrameworkFlavourTag/util/test-jet-links.cxx b/PhysicsAnalysis/DerivationFramework/DerivationFrameworkFlavourTag/util/test-jet-links.cxx new file mode 100644 index 0000000000000000000000000000000000000000..c5be0b288a193fc43c171a7bcedc9e4fbfa5863b --- /dev/null +++ b/PhysicsAnalysis/DerivationFramework/DerivationFrameworkFlavourTag/util/test-jet-links.cxx @@ -0,0 +1,65 @@ +// Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration + +#include "xAODRootAccess/Init.h" +#include "xAODRootAccess/tools/ReturnCheck.h" +#include "xAODRootAccess/TEvent.h" +#include "xAODJet/JetContainer.h" + +#include "TFile.h" +#include "TTree.h" + +int main (int argc, char *argv[]) { + + if (argc != 4) { + std::cerr << "usage: " << argv[0] << ": <DAOD> <parent jet collection> <associated collection>" + << std::endl; + return 1; + } + std::string file = argv[1]; + std::string jets_name = argv[2]; + std::string linked_jets_name = argv[3]; + + // The name of the application: + const char *const APP_NAME = "JetLinksTestDumper"; + + // Set up the environment: + RETURN_CHECK( APP_NAME, xAOD::Init() ); + + // Set up the event object: + xAOD::TEvent event(xAOD::TEvent::kClassAccess); + + // Open the file: + std::unique_ptr<TFile> ifile(TFile::Open(file.c_str(), "READ")); + if ( ! ifile.get() || ifile->IsZombie()) { + Error( APP_NAME, "Couldn't open file: %s", file.c_str() ); + return 1; + } + Info( APP_NAME, "Opened file: %s", file.c_str() ); + + // Connect the event object to it: + RETURN_CHECK( APP_NAME, event.readFrom(ifile.get()) ); + + unsigned long long nbad = 0; + unsigned long long ngood = 0; + unsigned long long entries = event.getEntries(); + for (unsigned long long entry = 0; entry < entries; ++entry) { + // Load the event: + if (event.getEntry(entry) < 0) { + Error( APP_NAME, "Couldn't load entry %lld from file: %s", + entry, file.c_str() ); + return 1; + } + const xAOD::JetContainer *jets = nullptr; + RETURN_CHECK( APP_NAME, event.retrieve(jets, jets_name) ); + for (const xAOD::Jet *const jet : *jets) { + std::vector<const xAOD::Jet*> linked_jets; + if (!jet->getAssociatedObjects<xAOD::Jet>(linked_jets_name, linked_jets)){ + nbad++; + } else { + ngood++; + } + } + } + std::cout << "JetLinksTestDumper Summary: found " << nbad << " out of " << nbad + ngood <<" large-R jets with no valid links to associated track-jets " << std::endl; + return nbad > 0; +} diff --git a/PhysicsAnalysis/DerivationFramework/DerivationFrameworkJetEtMiss/src/JetAugmentationTool.h b/PhysicsAnalysis/DerivationFramework/DerivationFrameworkJetEtMiss/src/JetAugmentationTool.h index 390640b04176bbced8f7435781b677caf2e0aecd..b6e723fc9bf8eee692b76c5e52d2daf9b89324b5 100644 --- a/PhysicsAnalysis/DerivationFramework/DerivationFrameworkJetEtMiss/src/JetAugmentationTool.h +++ b/PhysicsAnalysis/DerivationFramework/DerivationFrameworkJetEtMiss/src/JetAugmentationTool.h @@ -19,7 +19,7 @@ #include "JetInterface/IJetModifier.h" #include "JetInterface/IJetUpdateJvt.h" -#include "xAODBTaggingEfficiency/IBTaggingSelectionTool.h" +#include "FTagAnalysisInterfaces/IBTaggingSelectionTool.h" #include "xAODJet/JetContainer.h" namespace DerivationFramework { diff --git a/PhysicsAnalysis/DerivationFramework/DerivationFrameworkPhys/CMakeLists.txt b/PhysicsAnalysis/DerivationFramework/DerivationFrameworkPhys/CMakeLists.txt new file mode 100644 index 0000000000000000000000000000000000000000..59fdd1dc0ac2865812f41af81cc1fa79238ab9a2 --- /dev/null +++ b/PhysicsAnalysis/DerivationFramework/DerivationFrameworkPhys/CMakeLists.txt @@ -0,0 +1,11 @@ +################################################################################ +# Package: DerivationFrameworkPhys +################################################################################ + +# Declare the package name: +atlas_subdir( DerivationFrameworkPhys ) + +# Install files from the package: +atlas_install_python_modules( python/*.py ) +atlas_install_joboptions( share/*.py ) + diff --git a/PhysicsAnalysis/DerivationFramework/DerivationFrameworkPhys/python/PHYS_DataCompressionList.py b/PhysicsAnalysis/DerivationFramework/DerivationFrameworkPhys/python/PHYS_DataCompressionList.py new file mode 100644 index 0000000000000000000000000000000000000000..d08346d71d90ed041d334846424cc196c45b229d --- /dev/null +++ b/PhysicsAnalysis/DerivationFramework/DerivationFrameworkPhys/python/PHYS_DataCompressionList.py @@ -0,0 +1,3 @@ +PHYS_DataCompressionList=[ +"SoftBVrtClusterTool_Loose_VerticesAux.", "SoftBVrtClusterTool_Medium_VerticesAux.", "SoftBVrtClusterTool_Tight_VerticesAux.", "AntiKt10LCTopoJetsAux.", "AntiKt10LCTopoTrimmedPtFrac5SmallR20JetsAux.", "AntiKt2PV0TrackJetsAux.", "AntiKt4EMPFlowJetsAux.", "AntiKt4EMTopoJetsAux.", "AntiKtVR30Rmax4Rmin02TrackJets_BTagging201903Aux.", "AntiKt4EMPFlowJets_BTagging201810Aux.", "AntiKt4EMPFlowJets_BTagging201903Aux.", "AntiKt4EMTopoJets_BTagging201810Aux.", "xTrigDecisionAux.", "Kt4EMPFlowEventShapeAux.", "Kt4EMTopoOriginEventShapeAux.", "NeutralParticleFlowIsoCentralEventShapeAux.", "NeutralParticleFlowIsoForwardEventShapeAux.", "TopoClusterIsoCentralEventShapeAux.", "TopoClusterIsoForwardEventShapeAux.", "BTagging_AntiKt4EMPFlow_201810Aux.", "BTagging_AntiKt4EMPFlow_201903Aux.", "BTagging_AntiKt4EMTopo_201810Aux.", "BTagging_AntiKtVR30Rmax4Rmin02Track_201903Aux.", "CombinedMuonTrackParticlesAux.", "DiTauJetsAux.", "DiTauJetsLowPtAux.", "ElectronsAux.", "GSFConversionVerticesAux.", "GSFTrackParticlesAux.", "InDetForwardTrackParticlesAux.", "InDetTrackParticlesAux.", "MET_Core_AntiKt4EMPFlowAux.", "MET_Core_AntiKt4EMTopoAux.", "MET_TrackAux.", "MuonSpectrometerTrackParticlesAux.", "MuonsAux.", "PhotonsAux.", "PrimaryVerticesAux.", "TauJetsAux.", "TauTracksAux.", "TrigMatch_HLT_2e12_lhloose_nod0_mu10Aux.", "TrigMatch_HLT_2e17_lhvloose_nod0Aux.", "TrigMatch_HLT_2e17_lhvloose_nod0_L12EM15VHIAux.", "TrigMatch_HLT_2e24_lhvloose_nod0Aux.", "TrigMatch_HLT_2g20_tight_icalovloose_L12EM15VHIAux.", "TrigMatch_HLT_2g22_tightAux.", "TrigMatch_HLT_2g22_tight_L12EM15VHIAux.", "TrigMatch_HLT_2g22_tight_L1EM7_EMPTYAux.", "TrigMatch_HLT_2g22_tight_L1EM7_UNPAIRED_ISOAux.", "TrigMatch_HLT_2g22_tight_icalovlooseAux.", "TrigMatch_HLT_2g25_loose_g15_looseAux.", "TrigMatch_HLT_2g25_tight_L12EM20VHAux.", "TrigMatch_HLT_2g50_loose_L12EM20VHAux.", "TrigMatch_HLT_2mu14Aux.", "TrigMatch_HLT_2mu20_L12MU20_OVERLAYAux.", "TrigMatch_HLT_3g20_looseAux.", "TrigMatch_HLT_3mu3_mu3noL1_L13MU4Aux.", "TrigMatch_HLT_3mu4Aux.", "TrigMatch_HLT_3mu4_mu2noL1Aux.", "TrigMatch_HLT_3mu6Aux.", "TrigMatch_HLT_3mu6_msonlyAux.", "TrigMatch_HLT_3mu6_msonly_L1MU4_UNPAIRED_ISOAux.", "TrigMatch_HLT_3mu6_msonly_L1MU6_EMPTYAux.", "TrigMatch_HLT_4mu4Aux.", "TrigMatch_HLT_e12_lhloose_nod0_2mu10Aux.", "TrigMatch_HLT_e140_lhloose_nod0Aux.", "TrigMatch_HLT_e140_lhloose_nod0_L1EM24VHIAux.", "TrigMatch_HLT_e140_lhvloose_nod0Aux.", "TrigMatch_HLT_e160_lhvloose_nod0Aux.", "TrigMatch_HLT_e17_lhloose_nod0_2e12_lhloose_nod0_L1EM15VH_3EM10VHAux.", "TrigMatch_HLT_e17_lhloose_nod0_mu14Aux.", "TrigMatch_HLT_e17_lhmedium_nod0_ivarloose_tau25_medium1_tracktwoAux.", "TrigMatch_HLT_e17_lhmedium_nod0_ivarloose_tau25_medium1_tracktwoEFAux.", "TrigMatch_HLT_e17_lhmedium_nod0_ivarloose_tau25_medium1_tracktwoEF_L1DR-EM15TAU12I-J25Aux.", "TrigMatch_HLT_e17_lhmedium_nod0_ivarloose_tau25_medium1_tracktwoEF_L1EM15VHI_2TAU12IM_4J12Aux.", "TrigMatch_HLT_e17_lhmedium_nod0_ivarloose_tau25_medium1_tracktwoMVA_L1DR-EM15TAU12I-J25Aux.", "TrigMatch_HLT_e17_lhmedium_nod0_ivarloose_tau25_medium1_tracktwoMVA_L1EM15VHI_2TAU12IM_4J12Aux.", "TrigMatch_HLT_e17_lhmedium_nod0_ivarloose_tau25_medium1_tracktwo_L1DR-EM15TAU12I-J25Aux.", "TrigMatch_HLT_e17_lhmedium_nod0_ivarloose_tau25_medium1_tracktwo_L1EM15VHI_2TAU12IM_4J12Aux.", "TrigMatch_HLT_e17_lhmedium_nod0_ivarloose_tau25_mediumRNN_tracktwoMVAAux.", "TrigMatch_HLT_e17_lhmedium_nod0_ivarloose_tau25_mediumRNN_tracktwoMVA_L1DR-EM15TAU12I-J25Aux.", "TrigMatch_HLT_e17_lhmedium_nod0_ivarloose_tau25_mediumRNN_tracktwoMVA_L1EM15VHI_2TAU12IM_4J12Aux.", "TrigMatch_HLT_e17_lhmedium_nod0_tau80_medium1_tracktwoAux.", "TrigMatch_HLT_e200_etcutAux.", "TrigMatch_HLT_e22_lhvloose_nod0_e12_lhvloose_nod0_e10_lhvloose_nod0_L1EM20VH_2EM10VH_3EM8VHAux.", "TrigMatch_HLT_e24_lhmedium_nod0_ivarloose_tau35_medium1_tracktwoAux.", "TrigMatch_HLT_e24_lhmedium_nod0_ivarloose_tau35_medium1_tracktwoEFAux.", "TrigMatch_HLT_e24_lhmedium_nod0_ivarloose_tau35_medium1_tracktwoMVAAux.", "TrigMatch_HLT_e24_lhmedium_nod0_ivarloose_tau35_mediumRNN_tracktwoMVAAux.", "TrigMatch_HLT_e24_lhtight_nod0_ivarlooseAux.", "TrigMatch_HLT_e24_lhvloose_nod0_2e12_lhvloose_nod0_L1EM20VH_3EM10VHAux.", "TrigMatch_HLT_e26_lhloose_nod0Aux.", "TrigMatch_HLT_e26_lhmedium_nod0_mu8noL1Aux.", "TrigMatch_HLT_e26_lhtight_nod0Aux.", "TrigMatch_HLT_e26_lhtight_nod0_e15_etcut_L1EM7_ZeeAux.", "TrigMatch_HLT_e26_lhtight_nod0_ivarlooseAux.", "TrigMatch_HLT_e28_lhmedium_nod0_mu8noL1Aux.", "TrigMatch_HLT_e28_lhtight_nod0_L1EM22VHIAux.", "TrigMatch_HLT_e28_lhtight_nod0_e15_etcut_L1EM7_ZeeAux.", "TrigMatch_HLT_e28_lhtight_nod0_ivarlooseAux.", "TrigMatch_HLT_e28_lhtight_nod0_noringer_ivarlooseAux.", "TrigMatch_HLT_e300_etcutAux.", "TrigMatch_HLT_e60_lhmedium_nod0Aux.", "TrigMatch_HLT_e60_lhmedium_nod0_L1EM24VHIAux.", "TrigMatch_HLT_e7_lhmedium_nod0_mu24Aux.", "TrigMatch_HLT_e9_lhvloose_nod0_mu20_mu8noL1Aux.", "TrigMatch_HLT_e9_lhvloose_nod0_mu20_mu8noL1_L1EM7_MU20Aux.", "TrigMatch_HLT_g120_looseAux.", "TrigMatch_HLT_g140_looseAux.", "TrigMatch_HLT_g140_tightAux.", "TrigMatch_HLT_g200_etcutAux.", "TrigMatch_HLT_g200_looseAux.", "TrigMatch_HLT_g300_etcutAux.", "TrigMatch_HLT_g300_etcut_L1EM24VHIAux.", "TrigMatch_HLT_g35_loose_g25_looseAux.", "TrigMatch_HLT_g35_loose_g25_loose_L12EM20VHAux.", "TrigMatch_HLT_g35_medium_g25_medium_L12EM20VHAux.", "TrigMatch_HLT_g35_medium_g25_medium_L1EM7_EMPTYAux.", "TrigMatch_HLT_g35_medium_g25_medium_L1EM7_UNPAIRED_ISOAux.", "TrigMatch_HLT_id_cosmicid_L1MU11_EMPTYAux.", "TrigMatch_HLT_mu13_mu13_idperf_ZmumuAux.", "TrigMatch_HLT_mu14_ivarloose_L1MU11_tau35_medium1_tracktwoEF_L1MU11_TAU20IMAux.", "TrigMatch_HLT_mu14_ivarloose_L1MU11_tau35_medium1_tracktwoMVA_L1MU11_TAU20IMAux.", "TrigMatch_HLT_mu14_ivarloose_L1MU11_tau35_medium1_tracktwo_L1MU11_TAU20IMAux.", "TrigMatch_HLT_mu14_ivarloose_L1MU11_tau35_mediumRNN_tracktwoMVA_L1MU11_TAU20IMAux.", "TrigMatch_HLT_mu14_ivarloose_tau25_medium1_tracktwoAux.", "TrigMatch_HLT_mu14_ivarloose_tau25_medium1_tracktwoEFAux.", "TrigMatch_HLT_mu14_ivarloose_tau25_medium1_tracktwoEF_L1DR-MU10TAU12I_TAU12I-J25Aux.", "TrigMatch_HLT_mu14_ivarloose_tau25_medium1_tracktwoEF_L1MU10_TAU12IM_3J12Aux.", "TrigMatch_HLT_mu14_ivarloose_tau25_medium1_tracktwoMVA_L1DR-MU10TAU12I_TAU12I-J25Aux.", "TrigMatch_HLT_mu14_ivarloose_tau25_medium1_tracktwoMVA_L1MU10_TAU12IM_3J12Aux.", "TrigMatch_HLT_mu14_ivarloose_tau25_medium1_tracktwo_L1DR-MU10TAU12I_TAU12I-J25Aux.", "TrigMatch_HLT_mu14_ivarloose_tau25_medium1_tracktwo_L1MU10_TAU12IM_3J12Aux.", "TrigMatch_HLT_mu14_ivarloose_tau25_mediumRNN_tracktwoMVAAux.", "TrigMatch_HLT_mu14_ivarloose_tau25_mediumRNN_tracktwoMVA_L1DR-MU10TAU12I_TAU12I-J25Aux.", "TrigMatch_HLT_mu14_ivarloose_tau25_mediumRNN_tracktwoMVA_L1MU10_TAU12IM_3J12Aux.", "TrigMatch_HLT_mu14_ivarloose_tau35_medium1_tracktwoAux.", "TrigMatch_HLT_mu14_ivarloose_tau35_medium1_tracktwoEFAux.", "TrigMatch_HLT_mu14_ivarloose_tau35_medium1_tracktwoEF_L1MU10_TAU20IM_J25_2J20Aux.", "TrigMatch_HLT_mu14_ivarloose_tau35_medium1_tracktwoMVA_L1MU10_TAU20IM_J25_2J20Aux.", "TrigMatch_HLT_mu14_ivarloose_tau35_medium1_tracktwo_L1MU10_TAU20IM_J25_2J20Aux.", "TrigMatch_HLT_mu14_ivarloose_tau35_mediumRNN_tracktwoMVAAux.", "TrigMatch_HLT_mu14_ivarloose_tau35_mediumRNN_tracktwoMVA_L1MU10_TAU20IM_J25_2J20Aux.", "TrigMatch_HLT_mu20_2mu2noL1_JpsimumuFSAux.", "TrigMatch_HLT_mu20_2mu4_JpsimumuL2Aux.", "TrigMatch_HLT_mu20_2mu4noL1Aux.", "TrigMatch_HLT_mu20_ivarmedium_mu8noL1Aux.", "TrigMatch_HLT_mu20_msonly_iloosems_mu6noL1_msonly_nscan05_L1MU4_UNPAIRED_ISOAux.", "TrigMatch_HLT_mu20_msonly_iloosems_mu6noL1_msonly_nscan05_L1MU6_EMPTYAux.", "TrigMatch_HLT_mu20_msonly_mu15noL1_msonly_nscan05_noCombAux.", "TrigMatch_HLT_mu20_msonly_mu15noL1_msonly_nscan05_noComb_L1MU4_UNPAIRED_ISOAux.", "TrigMatch_HLT_mu20_msonly_mu15noL1_msonly_nscan05_noComb_L1MU6_EMPTYAux.", "TrigMatch_HLT_mu20_msonly_mu6noL1_msonly_nscan05Aux.", "TrigMatch_HLT_mu22_mu8noL1Aux.", "TrigMatch_HLT_mu22_mu8noL1_TagandProbeAux.", "TrigMatch_HLT_mu24_ivarmediumAux.", "TrigMatch_HLT_mu24_mu8noL1Aux.", "TrigMatch_HLT_mu26_ivarmediumAux.", "TrigMatch_HLT_mu50Aux.", "TrigMatch_HLT_mu60Aux.", "TrigMatch_HLT_mu60_0eta105_msonlyAux.", "TrigMatch_HLT_mu6_2mu4Aux.", "TrigMatch_HLT_mu6_dRl1_mu20_msonly_iloosems_mu6noL1_dRl1_msonlyAux.", "TrigMatch_HLT_mu6_nomucomb_2mu4_nomucomb_L1MU6_3MU4Aux.", "TrigMatch_HLT_mu80_msonly_3layersECAux.", "TrigMatch_HLT_tau125_medium1_tracktwoAux.", "TrigMatch_HLT_tau160_medium1_tracktwoAux.", "TrigMatch_HLT_tau160_medium1_tracktwoEF_L1TAU100Aux.", "TrigMatch_HLT_tau160_medium1_tracktwoMVA_L1TAU100Aux.", "TrigMatch_HLT_tau160_medium1_tracktwo_L1TAU100Aux.", "TrigMatch_HLT_tau160_mediumRNN_tracktwoMVA_L1TAU100Aux.", "TrigMatch_HLT_tau35_loose1_tracktwo_tau25_loose1_tracktwoAux.", "TrigMatch_HLT_tau35_medium1_tracktwoEF_tau25_medium1_tracktwoEF_03dR30_L1DR-TAU20ITAU12I-J25Aux.", "TrigMatch_HLT_tau35_medium1_tracktwoEF_tau25_medium1_tracktwoEF_L1DR-TAU20ITAU12I-J25Aux.", "TrigMatch_HLT_tau35_medium1_tracktwoEF_tau25_medium1_tracktwoEF_L1TAU20IM_2TAU12IM_4J12_0ETA23Aux.", "TrigMatch_HLT_tau35_medium1_tracktwoMVA_tau25_medium1_tracktwoMVA_03dR30_L1DR-TAU20ITAU12I-J25Aux.", "TrigMatch_HLT_tau35_medium1_tracktwoMVA_tau25_medium1_tracktwoMVA_L1DR-TAU20ITAU12I-J25Aux.", "TrigMatch_HLT_tau35_medium1_tracktwoMVA_tau25_medium1_tracktwoMVA_L1TAU20IM_2TAU12IM_4J12_0ETA23Aux.", "TrigMatch_HLT_tau35_medium1_tracktwo_tau25_medium1_tracktwoAux.", "TrigMatch_HLT_tau35_medium1_tracktwo_tau25_medium1_tracktwo_03dR30_L1DR-TAU20ITAU12I-J25Aux.", "TrigMatch_HLT_tau35_medium1_tracktwo_tau25_medium1_tracktwo_L1DR-TAU20ITAU12I-J25Aux.", "TrigMatch_HLT_tau35_medium1_tracktwo_tau25_medium1_tracktwo_L1TAU20IM_2TAU12IMAux.", "TrigMatch_HLT_tau35_medium1_tracktwo_tau25_medium1_tracktwo_L1TAU20IM_2TAU12IM_4J12Aux.", "TrigMatch_HLT_tau35_medium1_tracktwo_tau25_medium1_tracktwo_L1TAU20IM_2TAU12IM_4J12_0ETA23Aux.", "TrigMatch_HLT_tau35_medium1_tracktwo_tau25_medium1_tracktwo_tautsf_L1DR-TAU20ITAU12I-J25Aux.", "TrigMatch_HLT_tau35_mediumRNN_tracktwoMVA_tau25_mediumRNN_tracktwoMVA_03dR30_L1DR-TAU20ITAU12I-J25Aux.", "TrigMatch_HLT_tau35_mediumRNN_tracktwoMVA_tau25_mediumRNN_tracktwoMVA_L1DR-TAU20ITAU12I-J25Aux.", "TrigMatch_HLT_tau35_mediumRNN_tracktwoMVA_tau25_mediumRNN_tracktwoMVA_L1TAU20IM_2TAU12IM_4J12_0ETA23Aux.", "TrigMatch_HLT_tau40_medium1_tracktwoEF_tau35_medium1_tracktwoEFAux.", "TrigMatch_HLT_tau40_medium1_tracktwoMVA_tau35_medium1_tracktwoMVAAux.", "TrigMatch_HLT_tau40_medium1_tracktwo_tau35_medium1_tracktwoAux.", "TrigMatch_HLT_tau40_mediumRNN_tracktwoMVA_tau35_mediumRNN_tracktwoMVAAux.", "TrigMatch_HLT_tau60_medium1_tracktwo_tau35_medium1_tracktwoAux.", "TrigMatch_HLT_tau80_medium1_tracktwoEF_L1TAU60_tau35_medium1_tracktwoEF_L1TAU12IM_L1TAU60_DR-TAU20ITAU12IAux.", "TrigMatch_HLT_tau80_medium1_tracktwoEF_L1TAU60_tau60_medium1_tracktwoEF_L1TAU40Aux.", "TrigMatch_HLT_tau80_medium1_tracktwoMVA_L1TAU60_tau35_medium1_tracktwoMVA_L1TAU12IM_L1TAU60_DR-TAU20ITAU12IAux.", "TrigMatch_HLT_tau80_medium1_tracktwoMVA_L1TAU60_tau60_medium1_tracktwoMVA_L1TAU40Aux.", "TrigMatch_HLT_tau80_medium1_tracktwo_L1TAU60Aux.", "TrigMatch_HLT_tau80_medium1_tracktwo_L1TAU60_tau35_medium1_tracktwo_L1TAU12IM_L1TAU60_DR-TAU20ITAU12IAux.", "TrigMatch_HLT_tau80_medium1_tracktwo_L1TAU60_tau50_medium1_tracktwo_L1TAU12Aux.", "TrigMatch_HLT_tau80_medium1_tracktwo_L1TAU60_tau60_medium1_tracktwo_L1TAU40Aux.", "TrigMatch_HLT_tau80_mediumRNN_tracktwoMVA_L1TAU60_tau35_mediumRNN_tracktwoMVA_L1TAU12IM_L1TAU60_DR-TAU20ITAU12IAux.", "TrigMatch_HLT_tau80_mediumRNN_tracktwoMVA_L1TAU60_tau60_mediumRNN_tracktwoMVA_L1TAU40Aux.", "egammaClustersAux.", "METAssoc_AntiKt4EMPFlowAux.", "METAssoc_AntiKt4EMTopoAux.", +] diff --git a/PhysicsAnalysis/DerivationFramework/DerivationFrameworkPhys/python/PHYS_MCCompressionList.py b/PhysicsAnalysis/DerivationFramework/DerivationFrameworkPhys/python/PHYS_MCCompressionList.py new file mode 100644 index 0000000000000000000000000000000000000000..fafd173090ff8da74e22bdaa833e26b3e7b3e48a --- /dev/null +++ b/PhysicsAnalysis/DerivationFramework/DerivationFrameworkPhys/python/PHYS_MCCompressionList.py @@ -0,0 +1,3 @@ +PHYS_MCCompressionList=[ +"SoftBVrtClusterTool_Loose_VerticesAux.", "SoftBVrtClusterTool_Medium_VerticesAux.", "SoftBVrtClusterTool_Tight_VerticesAux.", "AntiKt10LCTopoJetsAux.", "AntiKt10LCTopoTrimmedPtFrac5SmallR20JetsAux.", "AntiKt10TruthTrimmedPtFrac5SmallR20JetsAux.", "AntiKt2PV0TrackJetsAux.", "AntiKt4EMPFlowJetsAux.", "AntiKt4EMTopoJetsAux.", "AntiKt4TruthDressedWZJetsAux.", "AntiKtVR30Rmax4Rmin02TrackJets_BTagging201903Aux.", "AntiKt4EMPFlowJets_BTagging201810Aux.", "AntiKt4EMPFlowJets_BTagging201903Aux.", "AntiKt4EMTopoJets_BTagging201810Aux.", "xTrigDecisionAux.", "Kt4EMPFlowEventShapeAux.", "Kt4EMTopoOriginEventShapeAux.", "NeutralParticleFlowIsoCentralEventShapeAux.", "NeutralParticleFlowIsoForwardEventShapeAux.", "TopoClusterIsoCentralEventShapeAux.", "TopoClusterIsoForwardEventShapeAux.", "BTagging_AntiKt4EMPFlow_201810Aux.", "BTagging_AntiKt4EMPFlow_201903Aux.", "BTagging_AntiKt4EMTopo_201810Aux.", "BTagging_AntiKtVR30Rmax4Rmin02Track_201903Aux.", "BornLeptonsAux.", "CombinedMuonTrackParticlesAux.", "DiTauJetsAux.", "DiTauJetsLowPtAux.", "ElectronsAux.", "GSFConversionVerticesAux.", "GSFTrackParticlesAux.", "HardScatterParticlesAux.", "HardScatterVerticesAux.", "InDetForwardTrackParticlesAux.", "InDetTrackParticlesAux.", "MET_Core_AntiKt4EMPFlowAux.", "MET_Core_AntiKt4EMTopoAux.", "MET_TrackAux.", "MET_TruthAux.", "MuonSpectrometerTrackParticlesAux.", "MuonsAux.", "PhotonsAux.", "PrimaryVerticesAux.", "TauJetsAux.", "TauTracksAux.", "TrigMatch_HLT_2e12_lhloose_nod0_mu10Aux.", "TrigMatch_HLT_2e12_lhloose_nodeta_L12EM10VHAux.", "TrigMatch_HLT_2e12_lhloose_nodphires_L12EM10VHAux.", "TrigMatch_HLT_2e17_lhvloose_nod0Aux.", "TrigMatch_HLT_2e17_lhvloose_nod0_L12EM15VHIAux.", "TrigMatch_HLT_2e17_lhvloose_nod0_ringerAux.", "TrigMatch_HLT_2e17_lhvloose_nod0_ringer_L12EM15VHIAux.", "TrigMatch_HLT_2e24_lhvloose_nod0Aux.", "TrigMatch_HLT_2g20_loose_g15_looseAux.", "TrigMatch_HLT_2g20_tightAux.", "TrigMatch_HLT_2g20_tight_icalovloose_L12EM15VHIAux.", "TrigMatch_HLT_2g22_tightAux.", "TrigMatch_HLT_2g22_tight_L12EM15VHIAux.", "TrigMatch_HLT_2g22_tight_L1EM7_EMPTYAux.", "TrigMatch_HLT_2g22_tight_L1EM7_UNPAIRED_ISOAux.", "TrigMatch_HLT_2g22_tight_icalovlooseAux.", "TrigMatch_HLT_2g25_loose_g15_looseAux.", "TrigMatch_HLT_2g25_tight_L12EM20VHAux.", "TrigMatch_HLT_2g50_loose_L12EM20VHAux.", "TrigMatch_HLT_2mu10Aux.", "TrigMatch_HLT_2mu10_nomucombAux.", "TrigMatch_HLT_2mu14Aux.", "TrigMatch_HLT_2mu14_nomucombAux.", "TrigMatch_HLT_2mu20_L12MU20_OVERLAYAux.", "TrigMatch_HLT_2mu4_mu3_mu2noL1_L13MU4Aux.", "TrigMatch_HLT_2mu4_mu3_mu2noL1_calotag_0eta010_L13MU4Aux.", "TrigMatch_HLT_2mu6_10invm30_pt2_z10Aux.", "TrigMatch_HLT_3g20_looseAux.", "TrigMatch_HLT_3mu3_mu3noL1_L13MU4Aux.", "TrigMatch_HLT_3mu3_mu3noL1_calotag_0eta010_L13MU4Aux.", "TrigMatch_HLT_3mu4Aux.", "TrigMatch_HLT_3mu4_mu2noL1Aux.", "TrigMatch_HLT_3mu4_mu2noL1_calotag_0eta010Aux.", "TrigMatch_HLT_3mu4_nomucombAux.", "TrigMatch_HLT_3mu4_nomucomb_mu2noL1Aux.", "TrigMatch_HLT_3mu6Aux.", "TrigMatch_HLT_3mu6_msonlyAux.", "TrigMatch_HLT_3mu6_msonly_L1MU4_UNPAIRED_ISOAux.", "TrigMatch_HLT_3mu6_msonly_L1MU6_EMPTYAux.", "TrigMatch_HLT_4mu4Aux.", "TrigMatch_HLT_4mu4_nomucombAux.", "TrigMatch_HLT_e120_lhloose_nod0Aux.", "TrigMatch_HLT_e12_lhloose_nod0_2mu10Aux.", "TrigMatch_HLT_e140_lhloose_nod0Aux.", "TrigMatch_HLT_e140_lhloose_nod0_L1EM24VHIAux.", "TrigMatch_HLT_e140_lhloose_nod0_ringerAux.", "TrigMatch_HLT_e140_lhvloose_nod0Aux.", "TrigMatch_HLT_e160_lhvloose_nod0Aux.", "TrigMatch_HLT_e17_lhloose_nod0_2e12_lhloose_nod0_L1EM15VH_3EM10VHAux.", "TrigMatch_HLT_e17_lhloose_nod0_2e9_lhloose_nod0Aux.", "TrigMatch_HLT_e17_lhloose_nod0_mu14Aux.", "TrigMatch_HLT_e17_lhmedium_iloose_tau25_medium1_tracktwoAux.", "TrigMatch_HLT_e17_lhmedium_nod0_iloose_tau25_medium1_tracktwoAux.", "TrigMatch_HLT_e17_lhmedium_nod0_ivarloose_tau25_medium1_tracktwoAux.", "TrigMatch_HLT_e17_lhmedium_nod0_ivarloose_tau25_medium1_tracktwo_L1DR-EM15TAU12I-J25Aux.", "TrigMatch_HLT_e17_lhmedium_nod0_ivarloose_tau25_medium1_tracktwo_L1EM15VHI_2TAU12IM_4J12Aux.", "TrigMatch_HLT_e17_lhmedium_nod0_tau25_medium1_tracktwoAux.", "TrigMatch_HLT_e17_lhmedium_nod0_tau80_medium1_tracktwoAux.", "TrigMatch_HLT_e17_lhmedium_tau25_medium1_tracktwoAux.", "TrigMatch_HLT_e17_lhmedium_tau80_medium1_tracktwoAux.", "TrigMatch_HLT_e200_etcutAux.", "TrigMatch_HLT_e22_lhvloose_nod0_e12_lhvloose_nod0_e10_lhvloose_nod0_L1EM20VH_2EM10VH_3EM8VHAux.", "TrigMatch_HLT_e24_lhmedium_nod0_L1EM20VHI_mu8noL1Aux.", "TrigMatch_HLT_e24_lhmedium_nod0_ivarloose_tau35_medium1_tracktwoAux.", "TrigMatch_HLT_e24_lhtight_nod0_ivarlooseAux.", "TrigMatch_HLT_e24_lhvloose_nod0_2e12_lhvloose_nod0_L1EM20VH_3EM10VHAux.", "TrigMatch_HLT_e26_lhloose_nod0Aux.", "TrigMatch_HLT_e26_lhloose_nod0_ringerAux.", "TrigMatch_HLT_e26_lhmedium_nod0_mu8noL1Aux.", "TrigMatch_HLT_e26_lhtight_cutd0dphideta_ivarlooseAux.", "TrigMatch_HLT_e26_lhtight_nod0Aux.", "TrigMatch_HLT_e26_lhtight_nod0_e15_etcut_L1EM7_ZeeAux.", "TrigMatch_HLT_e26_lhtight_nod0_ivarlooseAux.", "TrigMatch_HLT_e26_lhtight_nod0_ringer_ivarlooseAux.", "TrigMatch_HLT_e28_lhmedium_nod0_mu8noL1Aux.", "TrigMatch_HLT_e28_lhtight_nod0_L1EM22VHIAux.", "TrigMatch_HLT_e28_lhtight_nod0_e15_etcut_L1EM7_ZeeAux.", "TrigMatch_HLT_e28_lhtight_nod0_ivarlooseAux.", "TrigMatch_HLT_e28_lhtight_nod0_noringer_ivarlooseAux.", "TrigMatch_HLT_e28_lhtight_nod0_ringer_ivarlooseAux.", "TrigMatch_HLT_e300_etcutAux.", "TrigMatch_HLT_e60_lhmedium_nod0Aux.", "TrigMatch_HLT_e60_lhmedium_nod0_L1EM24VHIAux.", "TrigMatch_HLT_e60_lhmedium_nod0_ringerAux.", "TrigMatch_HLT_e60_mediumAux.", "TrigMatch_HLT_e7_lhmedium_nod0_mu24Aux.", "TrigMatch_HLT_g120_looseAux.", "TrigMatch_HLT_g140_looseAux.", "TrigMatch_HLT_g140_tightAux.", "TrigMatch_HLT_g200_etcutAux.", "TrigMatch_HLT_g200_looseAux.", "TrigMatch_HLT_g300_etcutAux.", "TrigMatch_HLT_g300_etcut_L1EM24VHIAux.", "TrigMatch_HLT_g35_loose_g25_looseAux.", "TrigMatch_HLT_g35_loose_g25_loose_L12EM20VHAux.", "TrigMatch_HLT_g35_medium_g25_medium_L12EM20VHAux.", "TrigMatch_HLT_g35_medium_g25_medium_L1EM7_EMPTYAux.", "TrigMatch_HLT_g35_medium_g25_medium_L1EM7_UNPAIRED_ISOAux.", "TrigMatch_HLT_id_cosmicid_L1MU11_EMPTYAux.", "TrigMatch_HLT_mu11_2mu4noL1_nscan03_L1MU11_2MU6Aux.", "TrigMatch_HLT_mu11_L1MU10_2mu4noL1_nscan03_L1MU10_2MU6Aux.", "TrigMatch_HLT_mu11_nomucomb_2mu4noL1_nscan03_L1MU11_2MU6Aux.", "TrigMatch_HLT_mu13_mu13_idperf_ZmumuAux.", "TrigMatch_HLT_mu14_iloose_tau25_medium1_tracktwoAux.", "TrigMatch_HLT_mu14_iloose_tau35_medium1_tracktwoAux.", "TrigMatch_HLT_mu14_ivarloose_L1MU11_tau35_medium1_tracktwo_L1MU11_TAU20IMAux.", "TrigMatch_HLT_mu14_ivarloose_tau25_medium1_tracktwoAux.", "TrigMatch_HLT_mu14_ivarloose_tau25_medium1_tracktwo_L1DR-MU10TAU12I_TAU12I-J25Aux.", "TrigMatch_HLT_mu14_ivarloose_tau25_medium1_tracktwo_L1MU10_TAU12IM_3J12Aux.", "TrigMatch_HLT_mu14_ivarloose_tau35_medium1_tracktwoAux.", "TrigMatch_HLT_mu14_ivarloose_tau35_medium1_tracktwo_L1MU10_TAU20IM_J25_2J20Aux.", "TrigMatch_HLT_mu14_tau25_medium1_tracktwoAux.", "TrigMatch_HLT_mu14_tau35_medium1_tracktwoAux.", "TrigMatch_HLT_mu20_2mu2noL1_JpsimumuFSAux.", "TrigMatch_HLT_mu20_2mu4_JpsimumuL2Aux.", "TrigMatch_HLT_mu20_2mu4noL1Aux.", "TrigMatch_HLT_mu20_ivarmedium_mu8noL1Aux.", "TrigMatch_HLT_mu20_msonly_iloosems_mu6noL1_msonly_nscan05_L1MU4_UNPAIRED_ISOAux.", "TrigMatch_HLT_mu20_msonly_iloosems_mu6noL1_msonly_nscan05_L1MU6_EMPTYAux.", "TrigMatch_HLT_mu20_msonly_mu10noL1_msonly_nscan05_noCombAux.", "TrigMatch_HLT_mu20_msonly_mu10noL1_msonly_nscan05_noComb_L1MU4_UNPAIRED_ISOAux.", "TrigMatch_HLT_mu20_msonly_mu10noL1_msonly_nscan05_noComb_L1MU6_EMPTYAux.", "TrigMatch_HLT_mu20_msonly_mu15noL1_msonly_nscan05_noCombAux.", "TrigMatch_HLT_mu20_msonly_mu15noL1_msonly_nscan05_noComb_L1MU4_UNPAIRED_ISOAux.", "TrigMatch_HLT_mu20_msonly_mu15noL1_msonly_nscan05_noComb_L1MU6_EMPTYAux.", "TrigMatch_HLT_mu20_msonly_mu6noL1_msonly_nscan05Aux.", "TrigMatch_HLT_mu20_mu8noL1Aux.", "TrigMatch_HLT_mu20_mu8noL1_calotag_0eta010Aux.", "TrigMatch_HLT_mu20_mu8noL1_e9_lhvloose_nod0Aux.", "TrigMatch_HLT_mu20_mu8noL1_e9_lhvloose_nod0_L1EM7_MU20Aux.", "TrigMatch_HLT_mu20_nomucomb_mu6noL1_nscan03Aux.", "TrigMatch_HLT_mu22_mu8noL1Aux.", "TrigMatch_HLT_mu22_mu8noL1_calotag_0eta010Aux.", "TrigMatch_HLT_mu24_ilooseAux.", "TrigMatch_HLT_mu24_imediumAux.", "TrigMatch_HLT_mu24_ivarlooseAux.", "TrigMatch_HLT_mu24_ivarmediumAux.", "TrigMatch_HLT_mu24_mu8noL1Aux.", "TrigMatch_HLT_mu26_ivarmediumAux.", "TrigMatch_HLT_mu40Aux.", "TrigMatch_HLT_mu50Aux.", "TrigMatch_HLT_mu60Aux.", "TrigMatch_HLT_mu60_0eta105_msonlyAux.", "TrigMatch_HLT_mu6_2mu4Aux.", "TrigMatch_HLT_mu6_dRl1_mu20_msonly_iloosems_mu6noL1_dRl1_msonlyAux.", "TrigMatch_HLT_mu6_iloose_mu6_11invm24_noosAux.", "TrigMatch_HLT_mu6_nomucomb_2mu4_nomucomb_L1MU6_3MU4Aux.", "TrigMatch_HLT_tau125_medium1_trackAux.", "TrigMatch_HLT_tau125_medium1_tracktwoAux.", "TrigMatch_HLT_tau160_medium1_tracktwoAux.", "TrigMatch_HLT_tau160_medium1_tracktwo_L1TAU100Aux.", "TrigMatch_HLT_tau35_loose1_tracktwo_tau25_loose1_tracktwoAux.", "TrigMatch_HLT_tau35_medium1_tracktwo_tau25_medium1_tracktwoAux.", "TrigMatch_HLT_tau35_medium1_tracktwo_tau25_medium1_tracktwo_03dR30Aux.", "TrigMatch_HLT_tau35_medium1_tracktwo_tau25_medium1_tracktwo_03dR30_L1DR-TAU20ITAU12I-J25Aux.", "TrigMatch_HLT_tau35_medium1_tracktwo_tau25_medium1_tracktwo_L1DR-TAU20ITAU12I-J25Aux.", "TrigMatch_HLT_tau35_medium1_tracktwo_tau25_medium1_tracktwo_L1TAU20IM_2TAU12IMAux.", "TrigMatch_HLT_tau35_medium1_tracktwo_tau25_medium1_tracktwo_L1TAU20IM_2TAU12IM_4J12Aux.", "TrigMatch_HLT_tau35_medium1_tracktwo_tau25_medium1_tracktwo_tautsf_L1DR-TAU20ITAU12I-J25Aux.", "TrigMatch_HLT_tau40_medium1_tracktwo_tau35_medium1_tracktwoAux.", "TrigMatch_HLT_tau60_medium1_tracktwo_tau35_medium1_tracktwoAux.", "TrigMatch_HLT_tau80_medium1_tracktwo_L1TAU60Aux.", "TrigMatch_HLT_tau80_medium1_tracktwo_L1TAU60_tau35_medium1_tracktwo_L1TAU12IM_L1TAU60_DR-TAU20ITAU12IAux.", "TrigMatch_HLT_tau80_medium1_tracktwo_L1TAU60_tau50_medium1_tracktwo_L1TAU12Aux.", "TrigMatch_HLT_tau80_medium1_tracktwo_L1TAU60_tau60_medium1_tracktwo_L1TAU40Aux.", "TruthBSMAux.", "TruthBSMWithDecayParticlesAux.", "TruthBSMWithDecayVerticesAux.", "TruthBosonAux.", "TruthBosonsWithDecayParticlesAux.", "TruthBosonsWithDecayVerticesAux.", "TruthBottomAux.", "TruthCharmAux.", "TruthElectronsAux.", "TruthEventsAux.", "TruthForwardProtonsAux.", "TruthHFWithDecayParticlesAux.", "TruthHFWithDecayVerticesAux.", "TruthMuonsAux.", "TruthNeutrinosAux.", "TruthPhotonsAux.", "TruthPrimaryVerticesAux.", "TruthTausAux.", "TruthTopAux.", "egammaClustersAux.", "METAssoc_AntiKt4EMPFlowAux.", "METAssoc_AntiKt4EMTopoAux.", +] diff --git a/PhysicsAnalysis/DerivationFramework/DerivationFrameworkPhys/python/__init__.py b/PhysicsAnalysis/DerivationFramework/DerivationFrameworkPhys/python/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..8b137891791fe96927ad78e64b0aad7bded08bdc --- /dev/null +++ b/PhysicsAnalysis/DerivationFramework/DerivationFrameworkPhys/python/__init__.py @@ -0,0 +1 @@ + diff --git a/PhysicsAnalysis/DerivationFramework/DerivationFrameworkPhys/share/PHYS.py b/PhysicsAnalysis/DerivationFramework/DerivationFrameworkPhys/share/PHYS.py new file mode 100644 index 0000000000000000000000000000000000000000..09564d0ec4f956769d96a7671fe43cfecd78773c --- /dev/null +++ b/PhysicsAnalysis/DerivationFramework/DerivationFrameworkPhys/share/PHYS.py @@ -0,0 +1,317 @@ +# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration + +#==================================================================== +# DAOD_PHYS.py +# This defines DAOD_PHYS, an unskimmed DAOD format for Run 3. +# It contains the variables and objects needed for the large majority +# of physics analyses in ATLAS. +# It requires the reductionConf flag PHYS in Reco_tf.py +#==================================================================== + +from DerivationFrameworkCore.DerivationFrameworkMaster import * +from DerivationFrameworkInDet.InDetCommon import * +from DerivationFrameworkJetEtMiss.JetCommon import * +from DerivationFrameworkJetEtMiss.ExtendedJetCommon import * +from DerivationFrameworkJetEtMiss.METCommon import * +from DerivationFrameworkMuons.MuonsCommon import * +from TriggerMenu.api.TriggerAPI import TriggerAPI +from TriggerMenu.api.TriggerEnums import TriggerPeriod, TriggerType + +#==================================================================== +# SET UP STREAM +#==================================================================== +streamName = derivationFlags.WriteDAOD_PHYSStream.StreamName +fileName = buildFileName( derivationFlags.WriteDAOD_PHYSStream ) +PHYSStream = MSMgr.NewPoolRootStream( streamName, fileName ) +PHYSStream.AcceptAlgs(["PHYSKernel"]) + +### Thinning and augmentation tools lists +from DerivationFrameworkCore.ThinningHelper import ThinningHelper +PHYSThinningHelper = ThinningHelper( "PHYSThinningHelper" ) +PHYSThinningHelper.AppendToStream( PHYSStream ) +thinningTools = [] +AugmentationTools = [] + +# Special sequence +SeqPHYS = CfgMgr.AthSequencer("SeqPHYS") + +#==================================================================== +# TRIGGER CONTENT +#==================================================================== +# See https://twiki.cern.ch/twiki/bin/view/Atlas/TriggerAPI +# Get single and multi mu, e, photon triggers +# Jet, tau, multi-object triggers not available in the matching code +allperiods = TriggerPeriod.y2015 | TriggerPeriod.y2016 | TriggerPeriod.y2017 | TriggerPeriod.y2018 | TriggerPeriod.future2e34 +trig_el = TriggerAPI.getLowestUnprescaledAnyPeriod(allperiods, triggerType=TriggerType.el, livefraction=0.8) +trig_mu = TriggerAPI.getLowestUnprescaledAnyPeriod(allperiods, triggerType=TriggerType.mu, livefraction=0.8) +trig_g = TriggerAPI.getLowestUnprescaledAnyPeriod(allperiods, triggerType=TriggerType.g, livefraction=0.8) +trig_tau = TriggerAPI.getLowestUnprescaledAnyPeriod(allperiods, triggerType=TriggerType.tau, livefraction=0.8) +# Add cross-triggers for some sets +trig_em = TriggerAPI.getLowestUnprescaledAnyPeriod(allperiods, triggerType=TriggerType.el, additionalTriggerType=TriggerType.mu, livefraction=0.8) +trig_et = TriggerAPI.getLowestUnprescaledAnyPeriod(allperiods, triggerType=TriggerType.el, additionalTriggerType=TriggerType.tau, livefraction=0.8) +trig_mt = TriggerAPI.getLowestUnprescaledAnyPeriod(allperiods, triggerType=TriggerType.mu, additionalTriggerType=TriggerType.tau, livefraction=0.8) +# Note that this seems to pick up both isolated and non-isolated triggers already, so no need for extra grabs +trig_txe = TriggerAPI.getLowestUnprescaledAnyPeriod(allperiods, triggerType=TriggerType.tau, additionalTriggerType=TriggerType.xe, livefraction=0.8) + +# Merge and remove duplicates +trigger_names_full_notau = list(set(trig_el+trig_mu+trig_g+trig_em+trig_et+trig_mt)) +trigger_names_full_tau = list(set(trig_tau+trig_txe)) + +# Now reduce the list... +from RecExConfig.InputFilePeeker import inputFileSummary +trigger_names_notau = [] +trigger_names_tau = [] +for trig_item in inputFileSummary['metadata']['/TRIGGER/HLT/Menu']: + if not 'ChainName' in trig_item: continue + if trig_item['ChainName'] in trigger_names_full_notau: trigger_names_notau += [ trig_item['ChainName'] ] + if trig_item['ChainName'] in trigger_names_full_tau: trigger_names_tau += [ trig_item['ChainName'] ] + + +#==================================================================== +# INNER DETECTOR TRACK THINNING +#==================================================================== +# See recommedations here: +# https://twiki.cern.ch/twiki/bin/viewauth/AtlasProtected/DaodRecommendations + +# Inner detector group recommendations for indet tracks in analysis +# PHYS_thinning_expression = "InDetTrackParticles.DFCommonTightPrimary && abs(DFCommonInDetTrackZ0AtPV)*sin(InDetTrackParticles.theta) < 3.0*mm && InDetTrackParticles.pt > 10*GeV" +# from DerivationFrameworkInDet.DerivationFrameworkInDetConf import DerivationFramework__TrackParticleThinning +# PHYSTrackParticleThinningTool = DerivationFramework__TrackParticleThinning(name = "PHYSTrackParticleThinningTool", +# ThinningService = PHYSThinningHelper.ThinningSvc(), +# SelectionString = PHYS_thinning_expression, +# InDetTrackParticlesKey = "InDetTrackParticles", +# ApplyAnd = False) + +# ToolSvc += PHYSTrackParticleThinningTool +# thinningTools.append(PHYSTrackParticleThinningTool) + +# Include inner detector tracks associated with muons +# from DerivationFrameworkInDet.DerivationFrameworkInDetConf import DerivationFramework__MuonTrackParticleThinning +# PHYSMuonTPThinningTool = DerivationFramework__MuonTrackParticleThinning(name = "PHYSMuonTPThinningTool", +# ThinningService = PHYSThinningHelper.ThinningSvc(), +# MuonKey = "Muons", +# InDetTrackParticlesKey = "InDetTrackParticles", +# ApplyAnd = False) + +# ToolSvc += PHYSMuonTPThinningTool +# thinningTools.append(PHYSMuonTPThinningTool) + +# # TauJets thinning +# tau_thinning_expression = "(TauJets.ptFinalCalib >= 13.*GeV) && (TauJets.nTracks>=1) && (TauJets.nTracks<=3) && (TauJets.RNNJetScoreSigTrans>0.01)" +# from DerivationFrameworkTools.DerivationFrameworkToolsConf import DerivationFramework__GenericObjectThinning +# PHYSTauJetsThinningTool = DerivationFramework__GenericObjectThinning(name = "PHYSTauJetsThinningTool", +# ThinningService = PHYSThinningHelper.ThinningSvc(), +# ContainerName = "TauJets", +# SelectionString = tau_thinning_expression) +# ToolSvc += PHYSTauJetsThinningTool +# thinningTools.append(PHYSTauJetsThinningTool) + +# # Only keep tau tracks (and associated ID tracks) classified as charged tracks +# from DerivationFrameworkInDet.DerivationFrameworkInDetConf import DerivationFramework__TauTrackParticleThinning +# PHYSTauTPThinningTool = DerivationFramework__TauTrackParticleThinning(name = "PHYSTauTPThinningTool", +# ThinningService = PHYSThinningHelper.ThinningSvc(), +# TauKey = "TauJets", +# InDetTrackParticlesKey = "InDetTrackParticles", +# SelectionString = tau_thinning_expression, +# ApplyAnd = False, +# DoTauTracksThinning = True, +# TauTracksKey = "TauTracks") +# ToolSvc += PHYSTauTPThinningTool +# thinningTools.append(PHYSTauTPThinningTool) + +# # ID tracks associated with high-pt di-tau +# from DerivationFrameworkInDet.DerivationFrameworkInDetConf import DerivationFramework__DiTauTrackParticleThinning +# PHYSDiTauTPThinningTool = DerivationFramework__DiTauTrackParticleThinning(name = "PHYSDiTauTPThinningTool", +# ThinningService = PHYSThinningHelper.ThinningSvc(), +# DiTauKey = "DiTauJets", +# InDetTrackParticlesKey = "InDetTrackParticles") +# ToolSvc += PHYSDiTauTPThinningTool +# thinningTools.append(PHYSDiTauTPThinningTool) + +#==================================================================== +# JET/MET +#==================================================================== + +OutputJets["PHYS"] = ["AntiKt10LCTopoTrimmedPtFrac5SmallR20Jets"] +reducedJetList = ["AntiKt2PV0TrackJets","AntiKt4PV0TrackJets"] + +if (DerivationFrameworkIsMonteCarlo): + OutputJets["PHYS"].append("AntiKt10TruthTrimmedPtFrac5SmallR20Jets") + +# replaceAODReducedJets(reducedJetList,SeqPHYS,"PHYS") +# add_largeR_truth_jets = DerivationFrameworkIsMonteCarlo and not hasattr(SeqPHYS,'jetalgAntiKt10TruthTrimmedPtFrac5SmallR20') +# addDefaultTrimmedJets(SeqPHYS,"PHYS",dotruth=add_largeR_truth_jets) + +# Add large-R jet truth labeling +# if (DerivationFrameworkIsMonteCarlo): +# addJetTruthLabel(jetalg="AntiKt10LCTopoTrimmedPtFrac5SmallR20",sequence=SeqPHYS,algname="JetTruthLabelingAlg",labelname="R10TruthLabel_R21Consolidated") + +# addQGTaggerTool(jetalg="AntiKt4EMTopo",sequence=SeqPHYS,algname="QGTaggerToolAlg") +# addQGTaggerTool(jetalg="AntiKt4EMPFlow",sequence=SeqPHYS,algname="QGTaggerToolPFAlg") + +# fJVT +# getPFlowfJVT(jetalg='AntiKt4EMPFlow',sequence=SeqPHYS, algname='PHYSJetForwardPFlowJvtToolAlg') + +#==================================================================== +# Add our sequence to the top sequence +#==================================================================== +# Ideally, this should come at the end of the job, but the tau additions +# below make it such that we need it here +DerivationFrameworkJob += SeqPHYS + +#==================================================================== +# Tau +#==================================================================== + +# Schedule low-pt di-tau reconstruction (needs AntiKt2PV0TrackJets) +# from DerivationFrameworkTau.TauCommon import addDiTauLowPt +# addDiTauLowPt() + +# Low-pt di-tau thinning +# from DerivationFrameworkTools.DerivationFrameworkToolsConf import DerivationFramework__GenericObjectThinning +# PHYSDiTauLowPtThinningTool = DerivationFramework__GenericObjectThinning(name = "PHYSDiTauLowPtThinningTool", +# ThinningService = PHYSThinningHelper.ThinningSvc(), +# ContainerName = "DiTauJetsLowPt", +# SelectionString = "DiTauJetsLowPt.nSubjets > 1") +# ToolSvc += PHYSDiTauLowPtThinningTool +# thinningTools.append(PHYSDiTauLowPtThinningTool) + +# ID tracks associated with low-pt ditau +# PHYSDiTauLowPtTPThinningTool = DerivationFramework__DiTauTrackParticleThinning(name = "PHYSDiTauLowPtTPThinningTool", +# ThinningService = PHYSThinningHelper.ThinningSvc(), +# DiTauKey = "DiTauJetsLowPt", +# InDetTrackParticlesKey = "InDetTrackParticles", +# SelectionString = "DiTauJetsLowPt.nSubjets > 1") +# ToolSvc += PHYSDiTauLowPtTPThinningTool +# thinningTools.append(PHYSDiTauLowPtTPThinningTool) + +#==================================================================== +# CREATE THE DERIVATION KERNEL ALGORITHM +#==================================================================== +# Add the kernel for thinning (requires the objects be defined) +from DerivationFrameworkCore.DerivationFrameworkCoreConf import DerivationFramework__DerivationKernel +DerivationFrameworkJob += CfgMgr.DerivationFramework__DerivationKernel("PHYSKernel", + ThinningTools = thinningTools) + + +#==================================================================== +# FLAVOUR TAGGING +#==================================================================== +# Create variable-R trackjets and dress AntiKt10LCTopo with ghost VR-trkjet +# addVRJets(SeqPHYS) +# addVRJets(SeqPHYS, training='201903') +#addVRJetsTCC(DerivationFrameworkJob, "AntiKtVR30Rmax4Rmin02Track", "GhostVR30Rmax4Rmin02TrackJet", +# VRJetAlg="AntiKt", VRJetRadius=0.4, VRJetInputs="pv0track", +# ghostArea = 0 , ptmin = 2000, ptminFilter = 2000, +# variableRMinRadius = 0.02, variableRMassScale = 30000, calibOpt = "none") +# add xbb taggers +# from DerivationFrameworkFlavourTag.HbbCommon import addRecommendedXbbTaggers +# addRecommendedXbbTaggers(SeqPHYS, ToolSvc) + +# FlavorTagInit(JetCollections = [ 'AntiKt4EMTopoJets','AntiKt4EMPFlowJets'], Sequencer = SeqPHYS) + +#==================================================================== +# TC-LVT Vertices +#==================================================================== + +# from SoftBVrtClusterTool.SoftBVrtConfig import addSoftBVrt +# addSoftBVrt(SeqPHYS,'Loose') +# addSoftBVrt(SeqPHYS,'Medium') +# addSoftBVrt(SeqPHYS,'Tight') + +#==================================================================== +# CONTENTS +#==================================================================== +from DerivationFrameworkCore.SlimmingHelper import SlimmingHelper +PHYSSlimmingHelper = SlimmingHelper("PHYSSlimmingHelper") + +PHYSSlimmingHelper.SmartCollections = ["Electrons", + "Photons", + "Muons", + "PrimaryVertices", + "InDetTrackParticles", + "AntiKt4EMTopoJets", + "AntiKt4EMPFlowJets", + #"BTagging_AntiKt4EMTopo_201810", + #"BTagging_AntiKt4EMPFlow_201810", + #"BTagging_AntiKt4EMPFlow_201903", + #"MET_Baseline_AntiKt4EMTopo", + #"MET_Baseline_AntiKt4EMPFlow", + "TauJets", + #"DiTauJets", + #"DiTauJetsLowPt", + #"AntiKt10LCTopoTrimmedPtFrac5SmallR20Jets", + #"AntiKtVR30Rmax4Rmin02TrackJets_BTagging201903", + #"BTagging_AntiKtVR30Rmax4Rmin02Track_201903" + ] + +excludedVertexAuxData = "-vxTrackAtVertex.-MvfFitInfo.-isInitialized.-VTAV" +StaticContent = [] +StaticContent += ["xAOD::VertexContainer#SoftBVrtClusterTool_Tight_Vertices"] +StaticContent += ["xAOD::VertexAuxContainer#SoftBVrtClusterTool_Tight_VerticesAux." + excludedVertexAuxData] +StaticContent += ["xAOD::VertexContainer#SoftBVrtClusterTool_Medium_Vertices"] +StaticContent += ["xAOD::VertexAuxContainer#SoftBVrtClusterTool_Medium_VerticesAux." + excludedVertexAuxData] +StaticContent += ["xAOD::VertexContainer#SoftBVrtClusterTool_Loose_Vertices"] +StaticContent += ["xAOD::VertexAuxContainer#SoftBVrtClusterTool_Loose_VerticesAux." + excludedVertexAuxData] + +PHYSSlimmingHelper.StaticContent = StaticContent + +# Trigger content +PHYSSlimmingHelper.IncludeTriggerNavigation = False +PHYSSlimmingHelper.IncludeJetTriggerContent = False +PHYSSlimmingHelper.IncludeMuonTriggerContent = False +PHYSSlimmingHelper.IncludeEGammaTriggerContent = False +PHYSSlimmingHelper.IncludeJetTauEtMissTriggerContent = False +PHYSSlimmingHelper.IncludeTauTriggerContent = False +PHYSSlimmingHelper.IncludeEtMissTriggerContent = False +PHYSSlimmingHelper.IncludeBJetTriggerContent = False +PHYSSlimmingHelper.IncludeBPhysTriggerContent = False +PHYSSlimmingHelper.IncludeMinBiasTriggerContent = False + +# Add the jet containers to the stream (defined in JetCommon if import needed) +#addJetOutputs(PHYSSlimmingHelper,["PHYS"]) + +# Truth containers +if DerivationFrameworkIsMonteCarlo: + PHYSSlimmingHelper.AppendToDictionary = {'TruthEvents':'xAOD::TruthEventContainer','TruthEventsAux':'xAOD::TruthEventAuxContainer', + 'MET_Truth':'xAOD::MissingETContainer','MET_TruthAux':'xAOD::MissingETAuxContainer', + 'TruthElectrons':'xAOD::TruthParticleContainer','TruthElectronsAux':'xAOD::TruthParticleAuxContainer', + 'TruthMuons':'xAOD::TruthParticleContainer','TruthMuonsAux':'xAOD::TruthParticleAuxContainer', + 'TruthPhotons':'xAOD::TruthParticleContainer','TruthPhotonsAux':'xAOD::TruthParticleAuxContainer', + 'TruthTaus':'xAOD::TruthParticleContainer','TruthTausAux':'xAOD::TruthParticleAuxContainer', + 'TruthNeutrinos':'xAOD::TruthParticleContainer','TruthNeutrinosAux':'xAOD::TruthParticleAuxContainer', + 'TruthBSM':'xAOD::TruthParticleContainer','TruthBSMAux':'xAOD::TruthParticleAuxContainer', + 'TruthBoson':'xAOD::TruthParticleContainer','TruthBosonAux':'xAOD::TruthParticleAuxContainer', + 'TruthTop':'xAOD::TruthParticleContainer','TruthTopAux':'xAOD::TruthParticleAuxContainer', + 'TruthForwardProtons':'xAOD::TruthParticleContainer','TruthForwardProtonsAux':'xAOD::TruthParticleAuxContainer', + 'BornLeptons':'xAOD::TruthParticleContainer','BornLeptonsAux':'xAOD::TruthParticleAuxContainer', + 'TruthBosonsWithDecayParticles':'xAOD::TruthParticleContainer','TruthBosonsWithDecayParticlesAux':'xAOD::TruthParticleAuxContainer', + 'TruthBosonsWithDecayVertices':'xAOD::TruthVertexContainer','TruthBosonsWithDecayVerticesAux':'xAOD::TruthVertexAuxContainer', + 'TruthBSMWithDecayParticles':'xAOD::TruthParticleContainer','TruthBSMWithDecayParticlesAux':'xAOD::TruthParticleAuxContainer', + 'TruthBSMWithDecayVertices':'xAOD::TruthVertexContainer','TruthBSMWithDecayVerticesAux':'xAOD::TruthVertexAuxContainer', + 'HardScatterParticles':'xAOD::TruthParticleContainer','HardScatterParticlesAux':'xAOD::TruthParticleAuxContainer', + 'HardScatterVertices':'xAOD::TruthVertexContainer','HardScatterVerticesAux':'xAOD::TruthVertexAuxContainer', + 'TruthHFWithDecayParticles':'xAOD::TruthParticleContainer','TruthHFWithDecayParticlesAux':'xAOD::TruthParticleAuxContainer', + 'TruthHFWithDecayVertices':'xAOD::TruthVertexContainer','TruthHFWithDecayVerticesAux':'xAOD::TruthVertexAuxContainer', + 'TruthCharm':'xAOD::TruthParticleContainer','TruthCharmAux':'xAOD::TruthParticleAuxContainer', + 'TruthPrimaryVertices':'xAOD::TruthVertexContainer','TruthPrimaryVerticesAux':'xAOD::TruthVertexAuxContainer', + 'AntiKt10TruthTrimmedPtFrac5SmallR20Jets':'xAOD::JetContainer', 'AntiKt10TruthTrimmedPtFrac5SmallR20JetsAux':'xAOD::JetAuxContainer' + } + + # from DerivationFrameworkMCTruth.MCTruthCommon import addTruth3ContentToSlimmerTool + # addTruth3ContentToSlimmerTool(PHYSSlimmingHelper) + # PHYSSlimmingHelper.AllVariables += ['TruthHFWithDecayParticles','TruthHFWithDecayVertices','TruthCharm'] + +PHYSSlimmingHelper.ExtraVariables += ["AntiKt10TruthTrimmedPtFrac5SmallR20Jets.Tau1_wta.Tau2_wta.Tau3_wta.D2.GhostBHadronsFinalCount", + "Electrons.TruthLink", + "Muons.TruthLink", + "Photons.TruthLink", + "AntiKt2PV0TrackJets.pt.eta.phi.m", + "AntiKt4EMTopoJets.DFCommonJets_QGTagger_truthjet_nCharged.DFCommonJets_QGTagger_truthjet_pt.DFCommonJets_QGTagger_truthjet_eta.DFCommonJets_QGTagger_NTracks.DFCommonJets_QGTagger_TracksWidth.DFCommonJets_QGTagger_TracksC1.PartonTruthLabelID", + "AntiKt4EMPFlowJets.DFCommonJets_QGTagger_truthjet_nCharged.DFCommonJets_QGTagger_truthjet_pt.DFCommonJets_QGTagger_truthjet_eta.DFCommonJets_QGTagger_NTracks.DFCommonJets_QGTagger_TracksWidth.DFCommonJets_QGTagger_TracksC1.PartonTruthLabelID.DFCommonJets_fJvt", + "TruthPrimaryVertices.t.x.y.z"] + + +# Final construction of output stream +PHYSSlimmingHelper.AppendContentToStream(PHYSStream) + diff --git a/PhysicsAnalysis/DerivationFramework/DerivationFrameworkPhys/share/PHYS2.py b/PhysicsAnalysis/DerivationFramework/DerivationFrameworkPhys/share/PHYS2.py new file mode 100644 index 0000000000000000000000000000000000000000..4a7a7c73ebdf97b3bfdf3fd7f80fc73f75db5ef2 --- /dev/null +++ b/PhysicsAnalysis/DerivationFramework/DerivationFrameworkPhys/share/PHYS2.py @@ -0,0 +1,365 @@ +# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + +#==================================================================== +# DAOD_PHYS2.py +# This defines DAOD_PHYS2, an unskimmed DAOD format for Run 3. +# It is a clone of DAOD_PHYS but also includes lossy compression +# In the end it will be merged back into DAOD_PHYS +# It requires the reductionConf flag PHYS2 in Reco_tf.py +#==================================================================== + +from DerivationFrameworkCore.DerivationFrameworkMaster import * +from DerivationFrameworkInDet.InDetCommon import * +from DerivationFrameworkJetEtMiss.JetCommon import * +from DerivationFrameworkJetEtMiss.ExtendedJetCommon import * +from DerivationFrameworkJetEtMiss.METCommon import * +from DerivationFrameworkEGamma.EGammaCommon import * +from DerivationFrameworkEGamma.ElectronsCPDetailedContent import * +from DerivationFrameworkMuons.MuonsCommon import * +from DerivationFrameworkCore.WeightMetadata import * +from DerivationFrameworkFlavourTag.FlavourTagCommon import FlavorTagInit +from DerivationFrameworkFlavourTag.HbbCommon import * +from TriggerMenu.api.TriggerAPI import TriggerAPI +from TriggerMenu.api.TriggerEnums import TriggerPeriod, TriggerType +from DerivationFrameworkTrigger.TriggerMatchingHelper import TriggerMatchingHelper + +#==================================================================== +# SET UP STREAM +#==================================================================== +streamName = derivationFlags.WriteDAOD_PHYS2Stream.StreamName +fileName = buildFileName( derivationFlags.WriteDAOD_PHYS2Stream ) +PHYS2Stream = MSMgr.NewPoolRootStream( streamName, fileName ) +PHYS2Stream.AcceptAlgs(["PHYS2Kernel"]) + +### Thinning and augmentation tools lists +from DerivationFrameworkCore.ThinningHelper import ThinningHelper +PHYS2ThinningHelper = ThinningHelper( "PHYS2ThinningHelper" ) +PHYS2ThinningHelper.AppendToStream( PHYS2Stream ) +thinningTools = [] +AugmentationTools = [] + +# Special sequence +SeqPHYS2 = CfgMgr.AthSequencer("SeqPHYS2") +DerivationFrameworkJob += SeqPHYS2 + +#==================================================================== +# Truth collections +#==================================================================== +if (DerivationFrameworkIsMonteCarlo): + from DerivationFrameworkMCTruth.MCTruthCommon import addStandardTruthContents,addMiniTruthCollectionLinks,addHFAndDownstreamParticles,addPVCollection + import DerivationFrameworkHiggs.TruthCategories + # Add charm quark collection + from DerivationFrameworkMCTruth.DerivationFrameworkMCTruthConf import DerivationFramework__TruthCollectionMaker + PHYS2TruthCharmTool = DerivationFramework__TruthCollectionMaker(name = "PHYS2TruthCharmTool", + NewCollectionName = "TruthCharm", + KeepNavigationInfo = False, + ParticleSelectionString = "(abs(TruthParticles.pdgId) == 4)", + Do_Compress = True) + ToolSvc += PHYS2TruthCharmTool + from DerivationFrameworkCore.DerivationFrameworkCoreConf import DerivationFramework__CommonAugmentation + SeqPHYS2 += CfgMgr.DerivationFramework__CommonAugmentation("PHYS2TruthCharmKernel",AugmentationTools=[PHYS2TruthCharmTool]) + # Add HF particles + addHFAndDownstreamParticles(SeqPHYS2) + # Add standard truth + addStandardTruthContents(SeqPHYS2,prefix='PHYS2_') + # Update to include charm quarks and HF particles - require a separate instance to be train safe + from DerivationFrameworkMCTruth.DerivationFrameworkMCTruthConf import DerivationFramework__TruthNavigationDecorator + PHYS2TruthNavigationDecorator = DerivationFramework__TruthNavigationDecorator( name="PHYS2TruthNavigationDecorator", + InputCollections=["TruthElectrons", "TruthMuons", "TruthPhotons", "TruthTaus", "TruthNeutrinos", "TruthBSM", "TruthBottom", "TruthTop", "TruthBoson","TruthCharm","TruthHFWithDecayParticles"]) + ToolSvc += PHYS2TruthNavigationDecorator + SeqPHYS2.PHYS2_MCTruthNavigationDecoratorKernel.AugmentationTools = [PHYS2TruthNavigationDecorator] + # Re-point links on reco objects + addMiniTruthCollectionLinks(SeqPHYS2) + addPVCollection(SeqPHYS2) + # Set appropriate truth jet collection for tau truth matching + ToolSvc.DFCommonTauTruthMatchingTool.TruthJetContainerName = "AntiKt4TruthDressedWZJets" + # SUSY signal + from DerivationFrameworkSUSY.DecorateSUSYProcess import IsSUSYSignal + if IsSUSYSignal(): + from DerivationFrameworkSUSY.SUSYWeightMetadata import * + # Add sumOfWeights metadata for LHE3 multiweights ======= + from DerivationFrameworkCore.LHE3WeightMetadata import * + +#==================================================================== +# TRIGGER CONTENT +#==================================================================== +# See https://twiki.cern.ch/twiki/bin/view/Atlas/TriggerAPI +# Get single and multi mu, e, photon triggers +# Jet, tau, multi-object triggers not available in the matching code +allperiods = TriggerPeriod.y2015 | TriggerPeriod.y2016 | TriggerPeriod.y2017 | TriggerPeriod.y2018 | TriggerPeriod.future2e34 +trig_el = TriggerAPI.getLowestUnprescaledAnyPeriod(allperiods, triggerType=TriggerType.el, livefraction=0.8) +trig_mu = TriggerAPI.getLowestUnprescaledAnyPeriod(allperiods, triggerType=TriggerType.mu, livefraction=0.8) +trig_g = TriggerAPI.getLowestUnprescaledAnyPeriod(allperiods, triggerType=TriggerType.g, livefraction=0.8) +trig_tau = TriggerAPI.getLowestUnprescaledAnyPeriod(allperiods, triggerType=TriggerType.tau, livefraction=0.8) +# Add cross-triggers for some sets +trig_em = TriggerAPI.getLowestUnprescaledAnyPeriod(allperiods, triggerType=TriggerType.el, additionalTriggerType=TriggerType.mu, livefraction=0.8) +trig_et = TriggerAPI.getLowestUnprescaledAnyPeriod(allperiods, triggerType=TriggerType.el, additionalTriggerType=TriggerType.tau, livefraction=0.8) +trig_mt = TriggerAPI.getLowestUnprescaledAnyPeriod(allperiods, triggerType=TriggerType.mu, additionalTriggerType=TriggerType.tau, livefraction=0.8) +# Note that this seems to pick up both isolated and non-isolated triggers already, so no need for extra grabs + +# Merge and remove duplicates +trigger_names_full = list(set(trig_el+trig_mu+trig_g+trig_tau+trig_em+trig_et+trig_mt)) + +# Now reduce the list... +from RecExConfig.InputFilePeeker import inputFileSummary +trigger_names = [] +for trig_item in inputFileSummary['metadata']['/TRIGGER/HLT/Menu']: + if not 'ChainName' in trig_item: continue + if trig_item['ChainName'] in trigger_names_full: trigger_names += [ trig_item['ChainName'] ] + +# Create trigger matching decorations +trigmatching_helper = TriggerMatchingHelper( + trigger_list = trigger_names, add_to_df_job=True) + +#==================================================================== +# INNER DETECTOR TRACK THINNING +#==================================================================== +# See recommedations here: +# https://twiki.cern.ch/twiki/bin/viewauth/AtlasProtected/DaodRecommendations + +# Inner detector group recommendations for indet tracks in analysis +PHYS2_thinning_expression = "InDetTrackParticles.DFCommonTightPrimary && abs(DFCommonInDetTrackZ0AtPV)*sin(InDetTrackParticles.theta) < 3.0*mm && InDetTrackParticles.pt > 10*GeV" +from DerivationFrameworkInDet.DerivationFrameworkInDetConf import DerivationFramework__TrackParticleThinning +PHYS2TrackParticleThinningTool = DerivationFramework__TrackParticleThinning(name = "PHYS2TrackParticleThinningTool", + ThinningService = PHYS2ThinningHelper.ThinningSvc(), + SelectionString = PHYS2_thinning_expression, + InDetTrackParticlesKey = "InDetTrackParticles", + ApplyAnd = False) + +ToolSvc += PHYS2TrackParticleThinningTool +thinningTools.append(PHYS2TrackParticleThinningTool) + +# Include inner detector tracks associated with muons +from DerivationFrameworkInDet.DerivationFrameworkInDetConf import DerivationFramework__MuonTrackParticleThinning +PHYS2MuonTPThinningTool = DerivationFramework__MuonTrackParticleThinning(name = "PHYS2MuonTPThinningTool", + ThinningService = PHYS2ThinningHelper.ThinningSvc(), + MuonKey = "Muons", + InDetTrackParticlesKey = "InDetTrackParticles", + ApplyAnd = False) +ToolSvc += PHYS2MuonTPThinningTool +thinningTools.append(PHYS2MuonTPThinningTool) + +# TauJets thinning +tau_thinning_expression = "(TauJets.ptFinalCalib >= 13.*GeV) && (TauJets.nTracks>=1) && (TauJets.nTracks<=3) && (TauJets.RNNJetScoreSigTrans>0.01)" +from DerivationFrameworkTools.DerivationFrameworkToolsConf import DerivationFramework__GenericObjectThinning +PHYS2TauJetsThinningTool = DerivationFramework__GenericObjectThinning(name = "PHYS2TauJetsThinningTool", + ThinningService = PHYS2ThinningHelper.ThinningSvc(), + ContainerName = "TauJets", + SelectionString = tau_thinning_expression) +ToolSvc += PHYS2TauJetsThinningTool +thinningTools.append(PHYS2TauJetsThinningTool) + +# Only keep tau tracks (and associated ID tracks) classified as charged tracks +from DerivationFrameworkInDet.DerivationFrameworkInDetConf import DerivationFramework__TauTrackParticleThinning +PHYS2TauTPThinningTool = DerivationFramework__TauTrackParticleThinning(name = "PHYS2TauTPThinningTool", + ThinningService = PHYS2ThinningHelper.ThinningSvc(), + TauKey = "TauJets", + InDetTrackParticlesKey = "InDetTrackParticles", + SelectionString = tau_thinning_expression, + ApplyAnd = False, + DoTauTracksThinning = True, + TauTracksKey = "TauTracks") +ToolSvc += PHYS2TauTPThinningTool +thinningTools.append(PHYS2TauTPThinningTool) + +# ID tracks associated with high-pt di-tau +from DerivationFrameworkInDet.DerivationFrameworkInDetConf import DerivationFramework__DiTauTrackParticleThinning +PHYS2DiTauTPThinningTool = DerivationFramework__DiTauTrackParticleThinning(name = "PHYS2DiTauTPThinningTool", + ThinningService = PHYS2ThinningHelper.ThinningSvc(), + DiTauKey = "DiTauJets", + InDetTrackParticlesKey = "InDetTrackParticles") +ToolSvc += PHYS2DiTauTPThinningTool +thinningTools.append(PHYS2DiTauTPThinningTool) + +#==================================================================== +# JET/MET +#==================================================================== + +OutputJets["PHYS2"] = ["AntiKt10LCTopoTrimmedPtFrac5SmallR20Jets"] +reducedJetList = ["AntiKt2PV0TrackJets","AntiKt4PV0TrackJets"] + +if (DerivationFrameworkIsMonteCarlo): + OutputJets["PHYS2"].append("AntiKt10TruthTrimmedPtFrac5SmallR20Jets") + +replaceAODReducedJets(reducedJetList,SeqPHYS2,"PHYS2") +addDefaultTrimmedJets(SeqPHYS2,"PHYS2",dotruth=DerivationFrameworkIsMonteCarlo) + +# Add large-R jet truth labeling +if (DerivationFrameworkIsMonteCarlo): + addJetTruthLabel(jetalg="AntiKt10LCTopoTrimmedPtFrac5SmallR20",sequence=SeqPHYS2,algname="JetTruthLabelingAlg",labelname="R10TruthLabel_R21Consolidated") + +addQGTaggerTool(jetalg="AntiKt4EMTopo",sequence=SeqPHYS2,algname="QGTaggerToolAlg") +addQGTaggerTool(jetalg="AntiKt4EMPFlow",sequence=SeqPHYS2,algname="QGTaggerToolPFAlg") + +# fJVT +getPFlowfJVT(jetalg='AntiKt4EMPFlow',sequence=DerivationFrameworkJob, algname='PHYS2JetForwardPFlowJvtToolAlg') + +#==================================================================== +# Tau +#==================================================================== + +# Schedule low-pt di-tau reconstruction (needs AntiKt2PV0TrackJets) +from DerivationFrameworkTau.TauCommon import addDiTauLowPt +addDiTauLowPt() + +# Low-pt di-tau thinning +from DerivationFrameworkTools.DerivationFrameworkToolsConf import DerivationFramework__GenericObjectThinning +PHYS2DiTauLowPtThinningTool = DerivationFramework__GenericObjectThinning(name = "PHYS2DiTauLowPtThinningTool", + ThinningService = PHYS2ThinningHelper.ThinningSvc(), + ContainerName = "DiTauJetsLowPt", + SelectionString = "DiTauJetsLowPt.nSubjets > 1") +ToolSvc += PHYS2DiTauLowPtThinningTool +thinningTools.append(PHYS2DiTauLowPtThinningTool) + +# ID tracks associated with low-pt ditau +PHYS2DiTauLowPtTPThinningTool = DerivationFramework__DiTauTrackParticleThinning(name = "PHYS2DiTauLowPtTPThinningTool", + ThinningService = PHYS2ThinningHelper.ThinningSvc(), + DiTauKey = "DiTauJetsLowPt", + InDetTrackParticlesKey = "InDetTrackParticles", + SelectionString = "DiTauJetsLowPt.nSubjets > 1") +ToolSvc += PHYS2DiTauLowPtTPThinningTool +thinningTools.append(PHYS2DiTauLowPtTPThinningTool) + +#==================================================================== +# CREATE THE DERIVATION KERNEL ALGORITHM +#==================================================================== + +from DerivationFrameworkCore.DerivationFrameworkCoreConf import DerivationFramework__DerivationKernel +DerivationFrameworkJob += CfgMgr.DerivationFramework__DerivationKernel("PHYS2Kernel", + ThinningTools = thinningTools) + + +#==================================================================== +# FLAVOUR TAGGING +#==================================================================== +# Create variable-R trackjets and dress AntiKt10LCTopo with ghost VR-trkjet +addVRJets(SeqPHYS2) +addVRJets(SeqPHYS2, training='201903') +#addVRJetsTCC(DerivationFrameworkJob, "AntiKtVR30Rmax4Rmin02Track", "GhostVR30Rmax4Rmin02TrackJet", +# VRJetAlg="AntiKt", VRJetRadius=0.4, VRJetInputs="pv0track", +# ghostArea = 0 , ptmin = 2000, ptminFilter = 2000, +# variableRMinRadius = 0.02, variableRMassScale = 30000, calibOpt = "none") +# add xbb taggers +from DerivationFrameworkFlavourTag.HbbCommon import addRecommendedXbbTaggers +addRecommendedXbbTaggers(SeqPHYS2, ToolSvc) + +FlavorTagInit(JetCollections = [ 'AntiKt4EMTopoJets','AntiKt4EMPFlowJets'], Sequencer = SeqPHYS2) + +#==================================================================== +# TC-LVT Vertices +#==================================================================== + +from SoftBVrtClusterTool.SoftBVrtConfig import addSoftBVrt +addSoftBVrt(DerivationFrameworkJob,'Loose') +addSoftBVrt(DerivationFrameworkJob,'Medium') +addSoftBVrt(DerivationFrameworkJob,'Tight') + +#==================================================================== +# CONTENTS +#==================================================================== +from DerivationFrameworkCore.SlimmingHelper import SlimmingHelper +PHYS2SlimmingHelper = SlimmingHelper("PHYS2SlimmingHelper") + +PHYS2SlimmingHelper.SmartCollections = ["Electrons", + "Photons", + "Muons", + "PrimaryVertices", + "InDetTrackParticles", + "AntiKt4EMTopoJets", + "AntiKt4EMPFlowJets", + "BTagging_AntiKt4EMTopo_201810", + "BTagging_AntiKt4EMPFlow_201810", + "BTagging_AntiKt4EMPFlow_201903", + "MET_Baseline_AntiKt4EMTopo", + "MET_Baseline_AntiKt4EMPFlow", + "TauJets", + "DiTauJets", + "DiTauJetsLowPt", + "AntiKt10LCTopoTrimmedPtFrac5SmallR20Jets", + "AntiKtVR30Rmax4Rmin02TrackJets_BTagging201903", + "BTagging_AntiKtVR30Rmax4Rmin02Track_201903" + ] + +excludedVertexAuxData = "-vxTrackAtVertex.-MvfFitInfo.-isInitialized.-VTAV" +StaticContent = [] +StaticContent += ["xAOD::VertexContainer#SoftBVrtClusterTool_Tight_Vertices"] +StaticContent += ["xAOD::VertexAuxContainer#SoftBVrtClusterTool_Tight_VerticesAux." + excludedVertexAuxData] +StaticContent += ["xAOD::VertexContainer#SoftBVrtClusterTool_Medium_Vertices"] +StaticContent += ["xAOD::VertexAuxContainer#SoftBVrtClusterTool_Medium_VerticesAux." + excludedVertexAuxData] +StaticContent += ["xAOD::VertexContainer#SoftBVrtClusterTool_Loose_Vertices"] +StaticContent += ["xAOD::VertexAuxContainer#SoftBVrtClusterTool_Loose_VerticesAux." + excludedVertexAuxData] + +PHYS2SlimmingHelper.StaticContent = StaticContent + +# Trigger content +PHYS2SlimmingHelper.IncludeTriggerNavigation = False +PHYS2SlimmingHelper.IncludeJetTriggerContent = False +PHYS2SlimmingHelper.IncludeMuonTriggerContent = False +PHYS2SlimmingHelper.IncludeEGammaTriggerContent = False +PHYS2SlimmingHelper.IncludeJetTauEtMissTriggerContent = False +PHYS2SlimmingHelper.IncludeTauTriggerContent = False +PHYS2SlimmingHelper.IncludeEtMissTriggerContent = False +PHYS2SlimmingHelper.IncludeBJetTriggerContent = False +PHYS2SlimmingHelper.IncludeBPhysTriggerContent = False +PHYS2SlimmingHelper.IncludeMinBiasTriggerContent = False + +# Add the jet containers to the stream (defined in JetCommon if import needed) +#addJetOutputs(PHYS2SlimmingHelper,["PHYS2"]) + +# Truth containers +if DerivationFrameworkIsMonteCarlo: + PHYS2SlimmingHelper.AppendToDictionary = {'TruthEvents':'xAOD::TruthEventContainer','TruthEventsAux':'xAOD::TruthEventAuxContainer', + 'MET_Truth':'xAOD::MissingETContainer','MET_TruthAux':'xAOD::MissingETAuxContainer', + 'TruthElectrons':'xAOD::TruthParticleContainer','TruthElectronsAux':'xAOD::TruthParticleAuxContainer', + 'TruthMuons':'xAOD::TruthParticleContainer','TruthMuonsAux':'xAOD::TruthParticleAuxContainer', + 'TruthPhotons':'xAOD::TruthParticleContainer','TruthPhotonsAux':'xAOD::TruthParticleAuxContainer', + 'TruthTaus':'xAOD::TruthParticleContainer','TruthTausAux':'xAOD::TruthParticleAuxContainer', + 'TruthNeutrinos':'xAOD::TruthParticleContainer','TruthNeutrinosAux':'xAOD::TruthParticleAuxContainer', + 'TruthBSM':'xAOD::TruthParticleContainer','TruthBSMAux':'xAOD::TruthParticleAuxContainer', + 'TruthBoson':'xAOD::TruthParticleContainer','TruthBosonAux':'xAOD::TruthParticleAuxContainer', + 'TruthTop':'xAOD::TruthParticleContainer','TruthTopAux':'xAOD::TruthParticleAuxContainer', + 'TruthForwardProtons':'xAOD::TruthParticleContainer','TruthForwardProtonsAux':'xAOD::TruthParticleAuxContainer', + 'BornLeptons':'xAOD::TruthParticleContainer','BornLeptonsAux':'xAOD::TruthParticleAuxContainer', + 'TruthBosonsWithDecayParticles':'xAOD::TruthParticleContainer','TruthBosonsWithDecayParticlesAux':'xAOD::TruthParticleAuxContainer', + 'TruthBosonsWithDecayVertices':'xAOD::TruthVertexContainer','TruthBosonsWithDecayVerticesAux':'xAOD::TruthVertexAuxContainer', + 'TruthBSMWithDecayParticles':'xAOD::TruthParticleContainer','TruthBSMWithDecayParticlesAux':'xAOD::TruthParticleAuxContainer', + 'TruthBSMWithDecayVertices':'xAOD::TruthVertexContainer','TruthBSMWithDecayVerticesAux':'xAOD::TruthVertexAuxContainer', + 'HardScatterParticles':'xAOD::TruthParticleContainer','HardScatterParticlesAux':'xAOD::TruthParticleAuxContainer', + 'HardScatterVertices':'xAOD::TruthVertexContainer','HardScatterVerticesAux':'xAOD::TruthVertexAuxContainer', + 'TruthHFWithDecayParticles':'xAOD::TruthParticleContainer','TruthHFWithDecayParticlesAux':'xAOD::TruthParticleAuxContainer', + 'TruthHFWithDecayVertices':'xAOD::TruthVertexContainer','TruthHFWithDecayVerticesAux':'xAOD::TruthVertexAuxContainer', + 'TruthCharm':'xAOD::TruthParticleContainer','TruthCharmAux':'xAOD::TruthParticleAuxContainer', + 'TruthPrimaryVertices':'xAOD::TruthVertexContainer','TruthPrimaryVerticesAux':'xAOD::TruthVertexAuxContainer', + 'AntiKt10TruthTrimmedPtFrac5SmallR20Jets':'xAOD::JetContainer', 'AntiKt10TruthTrimmedPtFrac5SmallR20JetsAux':'xAOD::JetAuxContainer', + 'AntiKtVR30Rmax4Rmin02TrackJets_BTagging201903':'xAOD::JetContainer','BTagging_AntiKtVR30Rmax4Rmin02Track_201903':'xAOD::BTagging' + } + + from DerivationFrameworkMCTruth.MCTruthCommon import addTruth3ContentToSlimmerTool + addTruth3ContentToSlimmerTool(PHYS2SlimmingHelper) + PHYS2SlimmingHelper.AllVariables += ['TruthHFWithDecayParticles','TruthHFWithDecayVertices','TruthCharm'] + +PHYS2SlimmingHelper.ExtraVariables += ["AntiKt10TruthTrimmedPtFrac5SmallR20Jets.Tau1_wta.Tau2_wta.Tau3_wta.D2.GhostBHadronsFinalCount", + "Electrons.TruthLink", + "Muons.TruthLink", + "Photons.TruthLink", + "AntiKt2PV0TrackJets.pt.eta.phi.m", + "AntiKt4EMTopoJets.DFCommonJets_QGTagger_truthjet_nCharged.DFCommonJets_QGTagger_truthjet_pt.DFCommonJets_QGTagger_truthjet_eta.DFCommonJets_QGTagger_NTracks.DFCommonJets_QGTagger_TracksWidth.DFCommonJets_QGTagger_TracksC1.PartonTruthLabelID", + "AntiKt4EMPFlowJets.DFCommonJets_QGTagger_truthjet_nCharged.DFCommonJets_QGTagger_truthjet_pt.DFCommonJets_QGTagger_truthjet_eta.DFCommonJets_QGTagger_NTracks.DFCommonJets_QGTagger_TracksWidth.DFCommonJets_QGTagger_TracksC1.PartonTruthLabelID.DFCommonJets_fJvt", + "TruthPrimaryVertices.t.x.y.z"] + +# Float compression +from DerivationFrameworkPhys.PHYS_MCCompressionList import PHYS_MCCompressionList +from DerivationFrameworkPhys.PHYS_DataCompressionList import PHYS_DataCompressionList +PHYS2_compression_list = [] +if (DerivationFrameworkIsMonteCarlo): PHYS2_compression_list = PHYS_MCCompressionList +else: PHYS2_compression_list = PHYS_DataCompressionList +PHYS2_SeqCompress = CfgMgr.AthSequencer("PHYS2_SeqCompress") +DerivationFrameworkJob += PHYS2_SeqCompress +PHYS2_SeqCompress += CfgMgr.DerivationFramework__FloatCompressionAlg("CompressFloatCompression", SGKeys=PHYS2_compression_list) + +# Add trigger matching +trigmatching_helper.add_to_slimming(PHYS2SlimmingHelper) + +# Final construction of output stream +PHYS2SlimmingHelper.AppendContentToStream(PHYS2Stream) + diff --git a/PhysicsAnalysis/DerivationFramework/DerivationFrameworkPhys/share/PHYSLITE.py b/PhysicsAnalysis/DerivationFramework/DerivationFrameworkPhys/share/PHYSLITE.py new file mode 100644 index 0000000000000000000000000000000000000000..3a081d2480302f6f806114023b5b0ddfdfdaa026 --- /dev/null +++ b/PhysicsAnalysis/DerivationFramework/DerivationFrameworkPhys/share/PHYSLITE.py @@ -0,0 +1,481 @@ +# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +#******************************************************************** +# PHYSLITE.py +# reductionConf flag PHYSLITE in Reco_tf.py +#******************************************************************** + +from AthenaCommon import Logging +nanolog = Logging.logging.getLogger('PHYSLITE') + +from DerivationFrameworkCore.DerivationFrameworkMaster import * +from DerivationFrameworkInDet.InDetCommon import * +from DerivationFrameworkJetEtMiss.JetCommon import * +from DerivationFrameworkJetEtMiss.ExtendedJetCommon import * +from DerivationFrameworkJetEtMiss.METCommon import * +from DerivationFrameworkEGamma.EGammaCommon import * +from DerivationFrameworkEGamma.ElectronsCPDetailedContent import * +from DerivationFrameworkMuons.MuonsCommon import * +from DerivationFrameworkCore.WeightMetadata import * +from DerivationFrameworkFlavourTag.FlavourTagCommon import FlavorTagInit +from DerivationFrameworkFlavourTag.HbbCommon import * +from TriggerMenu.api.TriggerAPI import TriggerAPI +from TriggerMenu.api.TriggerEnums import TriggerPeriod, TriggerType +from DerivationFrameworkTrigger.TriggerMatchingHelper import TriggerMatchingHelper + +#==================================================================== +# SET UP STREAM +#==================================================================== +streamName = derivationFlags.WriteDAOD_PHYSLITEStream.StreamName +fileName = buildFileName( derivationFlags.WriteDAOD_PHYSLITEStream ) +PHYSLITEStream = MSMgr.NewPoolRootStream( streamName, fileName ) +PHYSLITEStream.AcceptAlgs(["PHYSLITEKernel"]) + +### Thinning and augmentation tools lists +from DerivationFrameworkCore.ThinningHelper import ThinningHelper +PHYSLITEThinningHelper = ThinningHelper( "PHYSLITEThinningHelper" ) +PHYSLITEThinningHelper.AppendToStream( PHYSLITEStream ) +thinningTools = [] +AugmentationTools = [] + +# Special sequence +SeqPHYSLITE = CfgMgr.AthSequencer("SeqPHYSLITE") + +#==================================================================== +# TRUTH CONTENT +#==================================================================== +if DerivationFrameworkIsMonteCarlo: + from DerivationFrameworkMCTruth.MCTruthCommon import addStandardTruthContents,addPVCollection + addStandardTruthContents(SeqPHYSLITE) + addPVCollection(SeqPHYSLITE) + from DerivationFrameworkMCTruth.HFHadronsCommon import * + # Extra classifiers for the Higgs group + import DerivationFrameworkHiggs.TruthCategories + # Set appropriate truth jet collection for tau truth matching + ToolSvc.DFCommonTauTruthMatchingTool.TruthJetContainerName = "AntiKt4TruthDressedWZJets" + # Add sumOfWeights metadata for LHE3 multiweights ======= + from DerivationFrameworkCore.LHE3WeightMetadata import * + from DerivationFrameworkSUSY.DecorateSUSYProcess import IsSUSYSignal + if IsSUSYSignal(): + from DerivationFrameworkSUSY.SUSYWeightMetadata import * + +#============================================================================== +# HEAVY FLAVOR DECORATION +#============================================================================== +# PhysicsAnalysis/DerivationFramework/DerivationFrameworkTop/trunk/src/TTbarPlusHeavyFlavorFilterTool.cxx +# PhysicsAnalysis/DerivationFramework/DerivationFrameworkTop/trunk/src/TopHeavyFlavorFilterAugmentation.cxx +# these are supposed to mimic the TTbarPlusBFilter, TTbarPlusBBFilter, and TTbarPlusCFilter Filters in https://svnweb.cern.ch/trac/atlasoff/browser/Generators/MC15JobOptions/trunk/common/Filters +if DerivationFrameworkIsMonteCarlo: + from DerivationFrameworkTop.DerivationFrameworkTopConf import DerivationFramework__TTbarPlusHeavyFlavorFilterTool + + PHYSLITEttbarBfiltertool = DerivationFramework__TTbarPlusHeavyFlavorFilterTool("PHYSLITETTbarPlusBFilterTool") + PHYSLITEttbarBfiltertool.SelectB = True + PHYSLITEttbarBfiltertool.BpTMinCut = 5000 + PHYSLITEttbarBfiltertool.BMultiplicityCut = 1 # >= + ToolSvc += PHYSLITEttbarBfiltertool + + PHYSLITEttbarBBfiltertool = DerivationFramework__TTbarPlusHeavyFlavorFilterTool("PHYSLITETTbarPlusBBFilterTool") + PHYSLITEttbarBBfiltertool.SelectB = True + PHYSLITEttbarBBfiltertool.BpTMinCut = 15000 + PHYSLITEttbarBBfiltertool.BMultiplicityCut = 2 # >= + ToolSvc += PHYSLITEttbarBBfiltertool + + PHYSLITEttbarCfiltertool = DerivationFramework__TTbarPlusHeavyFlavorFilterTool("PHYSLITETTbarPlusCFilterTool") + PHYSLITEttbarCfiltertool.SelectC = True + PHYSLITEttbarCfiltertool.CpTMinCut = 15000 + PHYSLITEttbarCfiltertool.CMultiplicityCut = 1 # >= + # these two are the default values + # B-hadrons have precedence; if one B is found, it won't pass the CFilter + PHYSLITEttbarCfiltertool.BpTMinCut = 5000 + PHYSLITEttbarCfiltertool.BMultiplicityCut = 1 # >= + ToolSvc += PHYSLITEttbarCfiltertool + + from DerivationFrameworkTop.DerivationFrameworkTopConf import DerivationFramework__TopHeavyFlavorFilterAugmentation + PHYSLITETopHFFilterAugmentation = DerivationFramework__TopHeavyFlavorFilterAugmentation(name = "PHYSLITETopHFFilterAugmentation") + PHYSLITETopHFFilterAugmentation.BFilterTool = PHYSLITEttbarBfiltertool + PHYSLITETopHFFilterAugmentation.BBFilterTool = PHYSLITEttbarBBfiltertool + PHYSLITETopHFFilterAugmentation.CFilterTool = PHYSLITEttbarCfiltertool + ToolSvc += PHYSLITETopHFFilterAugmentation + AugmentationTools.append(PHYSLITETopHFFilterAugmentation) + nanolog.info("PHYSLITETopHFFilterAugmentationTool: {!s}".format(PHYSLITETopHFFilterAugmentation)) + +#==================================================================== +# THINNING +#==================================================================== + +# Cluster thinning +from DerivationFrameworkCalo.DerivationFrameworkCaloConf import DerivationFramework__CaloClusterThinning + +# Caloclusters associated to electrons +PHYSLITEElectronClusterThinningTool = DerivationFramework__CaloClusterThinning( name = "PHYSLITEElectronClusterThinningTool", + ThinningService = PHYSLITEThinningHelper.ThinningSvc(), + SGKey = "AnalysisElectrons", + CaloClCollectionSGKey = "egammaClusters", + TopoClCollectionSGKey = "CaloCalTopoClusters", + #SelectionString = "Electrons.pt > 7*GeV", + ConeSize = 0.4) +ToolSvc += PHYSLITEElectronClusterThinningTool +thinningTools.append(PHYSLITEElectronClusterThinningTool) + +# Caloclusters associated to photons +PHYSLITEPhotonClusterThinningTool = DerivationFramework__CaloClusterThinning( name = "PHYSLITEPhotonClusterThinningTool", + ThinningService = PHYSLITEThinningHelper.ThinningSvc(), + SGKey = "AnalysisPhotons", + CaloClCollectionSGKey = "egammaClusters", + TopoClCollectionSGKey = "CaloCalTopoClusters", + #SelectionString = ""Photons.pt > 10*GeV"", + ConeSize = 0.4) +ToolSvc += PHYSLITEPhotonClusterThinningTool +thinningTools.append(PHYSLITEPhotonClusterThinningTool) + +# GSF track particles thinning +from DerivationFrameworkInDet.DerivationFrameworkInDetConf import DerivationFramework__EgammaTrackParticleThinning + +# GSF track associated to electrons +PHYSLITEElectronGsfTrackThinningTool = DerivationFramework__EgammaTrackParticleThinning(name = "PHYSLITEElectronGsfTrackThinningTool", + ThinningService = PHYSLITEThinningHelper.ThinningSvc(), + SGKey = "AnalysisElectrons", + BestMatchOnly = False, + GSFTrackParticlesKey = "GSFTrackParticles") +ToolSvc += PHYSLITEElectronGsfTrackThinningTool +thinningTools.append(PHYSLITEElectronGsfTrackThinningTool) + +# GSF track associated to photons +PHYSLITEPhotonGsfTrackThinningTool = DerivationFramework__EgammaTrackParticleThinning(name = "PHYSLITEPhotonGsfTrackThinningTool", + ThinningService = PHYSLITEThinningHelper.ThinningSvc(), + SGKey = "AnalysisPhotons", + BestMatchOnly = False, + GSFTrackParticlesKey = "GSFTrackParticles") +ToolSvc += PHYSLITEPhotonGsfTrackThinningTool +thinningTools.append(PHYSLITEPhotonGsfTrackThinningTool) + +# INNER DETECTOR TRACK THINNING +# See recommedations here: +# https://twiki.cern.ch/twiki/bin/viewauth/AtlasProtected/DaodRecommendations +# Inner detector group recommendations for indet tracks in analysis +PHYSLITE_thinning_expression = "InDetTrackParticles.DFCommonTightPrimary && abs(DFCommonInDetTrackZ0AtPV)*sin(InDetTrackParticles.theta) < 3.0*mm && InDetTrackParticles.pt > 10*GeV" +from DerivationFrameworkInDet.DerivationFrameworkInDetConf import DerivationFramework__TrackParticleThinning +PHYSLITETrackParticleThinningTool = DerivationFramework__TrackParticleThinning(name = "PHYSLITETrackParticleThinningTool", + ThinningService = PHYSLITEThinningHelper.ThinningSvc(), + SelectionString = PHYSLITE_thinning_expression, + InDetTrackParticlesKey = "InDetTrackParticles", + ApplyAnd = False) +ToolSvc += PHYSLITETrackParticleThinningTool +thinningTools.append(PHYSLITETrackParticleThinningTool) + + +# Include inner detector tracks associated with muons +from DerivationFrameworkInDet.DerivationFrameworkInDetConf import DerivationFramework__MuonTrackParticleThinning +PHYSLITEMuonTPThinningTool = DerivationFramework__MuonTrackParticleThinning(name = "PHYSLITEMuonTPThinningTool", + ThinningService = PHYSLITEThinningHelper.ThinningSvc(), + MuonKey = "AnalysisMuons", + InDetTrackParticlesKey = "InDetTrackParticles", + ApplyAnd = False) +ToolSvc += PHYSLITEMuonTPThinningTool +thinningTools.append(PHYSLITEMuonTPThinningTool) + +# TauJets thinning +tau_thinning_expression = "(AnalysisTauJets.ptFinalCalib >= 13.*GeV) && (AnalysisTauJets.nTracks>=1) && (AnalysisTauJets.nTracks<=3) && (AnalysisTauJets.RNNJetScoreSigTrans>0.01)" +from DerivationFrameworkTools.DerivationFrameworkToolsConf import DerivationFramework__GenericObjectThinning +PHYSLITETauJetsThinningTool = DerivationFramework__GenericObjectThinning(name = "PHYSLITETauJetsThinningTool", + ThinningService = PHYSLITEThinningHelper.ThinningSvc(), + ContainerName = "AnalysisTauJets", + SelectionString = tau_thinning_expression) +ToolSvc += PHYSLITETauJetsThinningTool +thinningTools.append(PHYSLITETauJetsThinningTool) + +# Only keep tau tracks (and associated ID tracks) classified as charged tracks +from DerivationFrameworkInDet.DerivationFrameworkInDetConf import DerivationFramework__TauTrackParticleThinning +PHYSLITETauTPThinningTool = DerivationFramework__TauTrackParticleThinning(name = "PHYSLITETauTPThinningTool", + ThinningService = PHYSLITEThinningHelper.ThinningSvc(), + TauKey = "AnalysisTauJets", + InDetTrackParticlesKey = "InDetTrackParticles", + SelectionString = tau_thinning_expression, + ApplyAnd = False, + DoTauTracksThinning = True, + TauTracksKey = "TauTracks") +ToolSvc += PHYSLITETauTPThinningTool +thinningTools.append(PHYSLITETauTPThinningTool) + +# Only keep the highest sum pT2 primary vertex +from DerivationFrameworkInDet.DerivationFrameworkInDetConf import DerivationFramework__VertexThinning +PHYSLITEVertexThinningTool = DerivationFramework__VertexThinning(name = "PHYSLITEVertexThinningTool", + ThinningService = PHYSLITEThinningHelper.ThinningSvc(), + VertexKey = "PrimaryVertices") +ToolSvc += PHYSLITEVertexThinningTool +thinningTools.append(PHYSLITEVertexThinningTool) + +#============================================================================== +# Jet building +#============================================================================== +OutputJets["PHYSLITE"] = ["AntiKt10LCTopoTrimmedPtFrac5SmallR20Jets"] +reducedJetList = ["AntiKt2PV0TrackJets","AntiKt4PV0TrackJets"] + +if (DerivationFrameworkIsMonteCarlo): + OutputJets["PHYSLITE"].append("AntiKt10TruthTrimmedPtFrac5SmallR20Jets") + +replaceAODReducedJets(reducedJetList,SeqPHYSLITE,"PHYSLITE") +add_largeR_truth_jets = DerivationFrameworkIsMonteCarlo and not hasattr(SeqPHYSLITE,'jetalgAntiKt10TruthTrimmedPtFrac5SmallR20') +addDefaultTrimmedJets(SeqPHYSLITE,"PHYSLITE",dotruth=add_largeR_truth_jets) + +# Add large-R jet truth labeling +if (DerivationFrameworkIsMonteCarlo): + addJetTruthLabel(jetalg="AntiKt10LCTopoTrimmedPtFrac5SmallR20",sequence=SeqPHYSLITE,algname="JetTruthLabelingAlg",labelname="R10TruthLabel_R21Consolidated") + +# q/g discrimination +addQGTaggerTool(jetalg="AntiKt4EMPFlow",sequence=SeqPHYSLITE,algname="QGTaggerToolPFAlg") + +# fJVT +getPFlowfJVT(jetalg='AntiKt4EMPFlow',sequence=SeqPHYSLITE, algname='PHYSLITEJetForwardPFlowJvtToolAlg') + +#==================================================================== +# Flavour tagging +#==================================================================== +# Create variable-R trackjets and dress AntiKt10LCTopo with ghost VR-trkjet +addVRJets(SeqPHYSLITE) +#addVRJetsTCC(DerivationFrameworkJob, "AntiKtVR30Rmax4Rmin02Track", "GhostVR30Rmax4Rmin02TrackJet", +# VRJetAlg="AntiKt", VRJetRadius=0.4, VRJetInputs="pv0track", +# ghostArea = 0 , ptmin = 2000, ptminFilter = 2000, +# variableRMinRadius = 0.02, variableRMassScale = 30000, calibOpt = "none") +# add xbb taggers +from DerivationFrameworkFlavourTag.HbbCommon import addRecommendedXbbTaggers +addRecommendedXbbTaggers(SeqPHYSLITE, ToolSvc) + +FlavorTagInit(JetCollections = [ 'AntiKt4EMPFlowJets'], Sequencer = SeqPHYSLITE) + +#============================================================================== +# Systematics +#============================================================================== + +# Set up the systematics loader/handler algorithm: +sysLoader = CfgMgr.CP__SysListLoaderAlg( 'SysLoaderAlg' ) +#sysLoader.sigmaRecommended = 1 +sysLoader.systematicsList= [''] +SeqPHYSLITE += sysLoader + +dataType = "data" + +if DerivationFrameworkIsMonteCarlo: + dataType = "mc" + +#in your c++ code, create a ToolHandle<IPileupReweightingTool> +#the ToolHandle constructor should be given "CP::PileupReweightingTool/myTool" as its string argument +from PileupReweighting.AutoconfigurePRW import getLumiCalcFiles +ToolSvc += CfgMgr.CP__PileupReweightingTool("PHYSLITE_PRWTool", + ConfigFiles=[], + UnrepresentedDataAction=2, + LumiCalcFiles=getLumiCalcFiles()) +SeqPHYSLITE += CfgMgr.CP__PileupReweightingProvider(Tool=ToolSvc.PHYSLITE_PRWTool,RunSystematics=False) + +# Include, and then set up the electron analysis sequence: +from EgammaAnalysisAlgorithms.ElectronAnalysisSequence import \ + makeElectronAnalysisSequence +electronSequence = makeElectronAnalysisSequence( dataType, 'LooseLHElectron.NonIso', shallowViewOutput = False, deepCopyOutput = True ) +electronSequence.configure( inputName = 'Electrons', + outputName = 'AnalysisElectrons' ) +print( electronSequence ) # For debugging + +# Add the electron sequence to the job: +SeqPHYSLITE += electronSequence + +# Include, and then set up the photon analysis sequence: +from EgammaAnalysisAlgorithms.PhotonAnalysisSequence import \ + makePhotonAnalysisSequence +photonSequence = makePhotonAnalysisSequence( dataType, 'Loose.Undefined', deepCopyOutput = True, recomputeIsEM=True ) +photonSequence.configure( inputName = 'Photons', + outputName = 'AnalysisPhotons' ) +print( photonSequence ) # For debugging + +SeqPHYSLITE += photonSequence + +# Include, and then set up the muon analysis algorithm sequence: + +from MuonAnalysisAlgorithms.MuonAnalysisSequence import makeMuonAnalysisSequence +muonSequence = makeMuonAnalysisSequence( dataType, shallowViewOutput = False, deepCopyOutput = True, workingPoint = 'Loose.NonIso' ) +muonSequence.configure( inputName = 'Muons', + outputName = 'AnalysisMuons' ) +print( muonSequence ) # For debugging + +# Add the sequence to the job: + +SeqPHYSLITE += muonSequence + +# Include, and then set up the tau analysis algorithm sequence: +from TauAnalysisAlgorithms.TauAnalysisSequence import makeTauAnalysisSequence +tauSequence = makeTauAnalysisSequence( dataType, 'Baseline', shallowViewOutput = False, deepCopyOutput = True ) +tauSequence.configure( inputName = 'TauJets', outputName = 'AnalysisTauJets' ) +print( tauSequence ) # For debugging +# Add the sequence to the job: +SeqPHYSLITE += tauSequence + +jetContainer = 'AntiKt4EMPFlowJets_BTagging201903' + +# Include, and then set up the jet analysis algorithm sequence: +from JetAnalysisAlgorithms.JetAnalysisSequence import makeJetAnalysisSequence +jetSequence = makeJetAnalysisSequence( dataType, jetContainer, deepCopyOutput = True, shallowViewOutput = False , runFJvtUpdate = False , runFJvtSelection = False ) +jetSequence.configure( inputName = jetContainer, outputName = 'AnalysisJets' ) +print( jetSequence ) # For debugging + +SeqPHYSLITE += jetSequence + +# Make sure the MET knows what we've done +# First we need to rebuild charged pflow objects +from eflowRec.ScheduleCHSPFlowMods import scheduleCHSPFlowMods +scheduleCHSPFlowMods(SeqPHYSLITE) +# Now build MET from our analysis objects +from DerivationFrameworkJetEtMiss import METCommon +from METReconstruction.METAssocConfig import METAssocConfig,AssocConfig +associators = [AssocConfig('PFlowJet', 'AnalysisJets'), + AssocConfig('Muon', 'AnalysisMuons'), + AssocConfig('Ele', 'AnalysisElectrons'), + AssocConfig('Gamma', 'AnalysisPhotons'), + AssocConfig('Tau', 'AnalysisTauJets'), + AssocConfig('Soft', '')] +PHYSLITE_cfg = METAssocConfig('AnalysisMET', + associators, + doPFlow=True) +METCommon.customMETConfigs.setdefault('AnalysisMET',{})[PHYSLITE_cfg.suffix] = PHYSLITE_cfg +scheduleMETAssocAlg(sequence=SeqPHYSLITE,configlist="AnalysisMET") + +#==================================================================== +# TRIGGER CONTENT +#==================================================================== +# See https://twiki.cern.ch/twiki/bin/view/Atlas/TriggerAPI +# Get single and multi mu, e, photon triggers +# Jet, tau, multi-object triggers not available in the matching code +# Note this comes relatively late as we have to re-do the matching to our analysis objects +allperiods = TriggerPeriod.y2015 | TriggerPeriod.y2016 | TriggerPeriod.y2017 | TriggerPeriod.y2018 | TriggerPeriod.future2e34 +trig_el = TriggerAPI.getLowestUnprescaledAnyPeriod(allperiods, triggerType=TriggerType.el, livefraction=0.8) +trig_mu = TriggerAPI.getLowestUnprescaledAnyPeriod(allperiods, triggerType=TriggerType.mu, livefraction=0.8) +trig_g = TriggerAPI.getLowestUnprescaledAnyPeriod(allperiods, triggerType=TriggerType.g, livefraction=0.8) +trig_tau = TriggerAPI.getLowestUnprescaledAnyPeriod(allperiods, triggerType=TriggerType.tau, livefraction=0.8) +# Add cross-triggers for some sets +trig_em = TriggerAPI.getLowestUnprescaledAnyPeriod(allperiods, triggerType=TriggerType.el, additionalTriggerType=TriggerType.mu, livefraction=0.8) +trig_et = TriggerAPI.getLowestUnprescaledAnyPeriod(allperiods, triggerType=TriggerType.el, additionalTriggerType=TriggerType.tau, livefraction=0.8) +trig_mt = TriggerAPI.getLowestUnprescaledAnyPeriod(allperiods, triggerType=TriggerType.mu, additionalTriggerType=TriggerType.tau, livefraction=0.8) +# Note that this seems to pick up both isolated and non-isolated triggers already, so no need for extra grabs +trig_txe = TriggerAPI.getLowestUnprescaledAnyPeriod(allperiods, triggerType=TriggerType.tau, additionalTriggerType=TriggerType.xe, livefraction=0.8) + +# Merge and remove duplicates +trigger_names_full_notau = list(set(trig_el+trig_mu+trig_g+trig_em+trig_et+trig_mt)) +trigger_names_full_tau = list(set(trig_tau+trig_txe)) + +# Now reduce the list... +from RecExConfig.InputFilePeeker import inputFileSummary +trigger_names_notau = [] +trigger_names_tau = [] +for trig_item in inputFileSummary['metadata']['/TRIGGER/HLT/Menu']: + if not 'ChainName' in trig_item: continue + if trig_item['ChainName'] in trigger_names_full_notau: trigger_names_notau += [ trig_item['ChainName'] ] + if trig_item['ChainName'] in trigger_names_full_tau: trigger_names_tau += [ trig_item['ChainName'] ] + +# Create trigger matching decorations +trigmatching_helper_notau = TriggerMatchingHelper(name='PHSYLITETriggerMatchingToolNoTau', + OutputContainerPrefix = "Analysis", + trigger_list = trigger_names_notau, add_to_df_job=False, + InputElectrons="AnalysisElectrons",InputPhotons="AnalysisPhotons", + InputMuons="AnalysisMuons",InputTaus="AnalysisTauJets") +trigmatching_helper_tau = TriggerMatchingHelper(name='PHSYLITETriggerMatchingToolTau', + OutputContainerPrefix = "Analysis", + trigger_list = trigger_names_tau, add_to_df_job=False, DRThreshold=0.2, + InputElectrons="AnalysisElectrons",InputPhotons="AnalysisPhotons", + InputMuons="AnalysisMuons",InputTaus="AnalysisTauJets") +SeqPHYSLITE += trigmatching_helper_notau.alg +SeqPHYSLITE += trigmatching_helper_tau.alg + +#==================================================================== +# MAIN KERNEL +#==================================================================== +# Put our sequence into the top sequence +DerivationFrameworkJob += SeqPHYSLITE +# Add thinning tools kernel +from DerivationFrameworkCore.DerivationFrameworkCoreConf import DerivationFramework__DerivationKernel +SeqPHYSLITE += CfgMgr.DerivationFramework__DerivationKernel( + "PHYSLITEKernel", + AugmentationTools = AugmentationTools, + ThinningTools = thinningTools, + ) + +#==================================================================== +# CONTENT LIST +#==================================================================== +from DerivationFrameworkCore.SlimmingHelper import SlimmingHelper +PHYSLITESlimmingHelper = SlimmingHelper("PHYSLITESlimmingHelper") + +PHYSLITESlimmingHelper.IncludeTriggerNavigation = False +PHYSLITESlimmingHelper.IncludeJetTriggerContent = False +PHYSLITESlimmingHelper.IncludeMuonTriggerContent = False +PHYSLITESlimmingHelper.IncludeEGammaTriggerContent = False +PHYSLITESlimmingHelper.IncludeJetTauEtMissTriggerContent = False +PHYSLITESlimmingHelper.IncludeTauTriggerContent = False #True +PHYSLITESlimmingHelper.IncludeEtMissTriggerContent = False +PHYSLITESlimmingHelper.IncludeBJetTriggerContent = False +PHYSLITESlimmingHelper.IncludeBPhysTriggerContent = False +PHYSLITESlimmingHelper.IncludeMinBiasTriggerContent = False + +# Most of the new containers are centrally added to SlimmingHelper via DerivationFrameworkCore ContainersOnTheFly.py +PHYSLITESlimmingHelper.AppendToDictionary = { + 'TruthEvents':'xAOD::TruthEventContainer','TruthEventsAux':'xAOD::TruthEventAuxContainer', + 'MET_Truth':'xAOD::MissingETContainer','MET_TruthAux':'xAOD::MissingETAuxContainer', + 'TruthElectrons':'xAOD::TruthParticleContainer','TruthElectronsAux':'xAOD::TruthParticleAuxContainer', + 'TruthMuons':'xAOD::TruthParticleContainer','TruthMuonsAux':'xAOD::TruthParticleAuxContainer', + 'TruthPhotons':'xAOD::TruthParticleContainer','TruthPhotonsAux':'xAOD::TruthParticleAuxContainer', + 'TruthTaus':'xAOD::TruthParticleContainer','TruthTausAux':'xAOD::TruthParticleAuxContainer', + 'TruthNeutrinos':'xAOD::TruthParticleContainer','TruthNeutrinosAux':'xAOD::TruthParticleAuxContainer', + 'TruthBSM':'xAOD::TruthParticleContainer','TruthBSMAux':'xAOD::TruthParticleAuxContainer', + 'TruthBoson':'xAOD::TruthParticleContainer','TruthBosonAux':'xAOD::TruthParticleAuxContainer', + 'TruthTop':'xAOD::TruthParticleContainer','TruthTopAux':'xAOD::TruthParticleAuxContainer', + 'TruthForwardProtons':'xAOD::TruthParticleContainer','TruthForwardProtonsAux':'xAOD::TruthParticleAuxContainer', + 'BornLeptons':'xAOD::TruthParticleContainer','BornLeptonsAux':'xAOD::TruthParticleAuxContainer', + 'TruthBosonsWithDecayParticles':'xAOD::TruthParticleContainer','TruthBosonsWithDecayParticlesAux':'xAOD::TruthParticleAuxContainer', + 'TruthBosonsWithDecayVertices':'xAOD::TruthVertexContainer','TruthBosonsWithDecayVerticesAux':'xAOD::TruthVertexAuxContainer', + 'TruthBSMWithDecayParticles':'xAOD::TruthParticleContainer','TruthBSMWithDecayParticlesAux':'xAOD::TruthParticleAuxContainer', + 'TruthBSMWithDecayVertices':'xAOD::TruthVertexContainer','TruthBSMWithDecayVerticesAux':'xAOD::TruthVertexAuxContainer', + 'HardScatterParticles':'xAOD::TruthParticleContainer','HardScatterParticlesAux':'xAOD::TruthParticleAuxContainer', + 'HardScatterVertices':'xAOD::TruthVertexContainer','HardScatterVerticesAux':'xAOD::TruthVertexAuxContainer', + 'TruthPrimaryVertices':'xAOD::TruthVertexContainer','TruthPrimaryVerticesAux':'xAOD::TruthVertexAuxContainer', + 'AnalysisElectrons':'xAOD::ElectronContainer', 'AnalysisElectronsAux':'xAOD::ElectronAuxContainer', + 'AnalysisMuons':'xAOD::MuonContainer', 'AnalysisMuonsAux':'xAOD::MuonAuxContainer', + 'AnalysisJets':'xAOD::JetContainer','AnalysisJetsAux':'xAOD::AuxContainerBase', + 'AnalysisPhotons':'xAOD::PhotonContainer', 'AnalysisPhotonsAux':'xAOD::PhotonAuxContainer', + 'AnalysisTauJets':'xAOD::TauJetContainer', 'AnalysisTauJetsAux':'xAOD::TauJetAuxContainer', + 'MET_Core_AnalysisMET':'xAOD::MissingETContainer', 'MET_Core_AnalysisMETAux':'xAOD::MissingETAuxContainer', + 'METAssoc_AnalysisMET':'xAOD::MissingETAssociationMap', 'METAssoc_AnalysisMETAux':'xAOD::MissingETAuxAssociationMap', + 'AntiKt10TruthTrimmedPtFrac5SmallR20Jets':'xAOD::JetContainer', 'AntiKt10TruthTrimmedPtFrac5SmallR20JetsAux':'xAOD::JetAuxContainer', + } + +# Leaving these as smart collections + +PHYSLITESlimmingHelper.SmartCollections = [ + "InDetTrackParticles", + "PrimaryVertices", + ] + +# Variables to save, per object type + +PHYSLITESlimmingHelper.ExtraVariables = [ + "AnalysisElectrons.trackParticleLinks.pt.eta.phi.m.charge.author.DFCommonElectronsLHVeryLoose.DFCommonElectronsLHLoose.DFCommonElectronsLHLooseBL.DFCommonElectronsLHMedium.DFCommonElectronsLHTight.DFCommonElectronsLHVeryLooseIsEMValue.DFCommonElectronsLHLooseIsEMValue.DFCommonElectronsLHLooseBLIsEMValue.DFCommonElectronsLHMediumIsEMValue.DFCommonElectronsLHTightIsEMValue.DFCommonElectronsECIDS.DFCommonElectronsECIDSResult.ptvarcone20.ptvarcone40.topoetcone20.topoetcone20ptCorrection.ptcone20_TightTTVA_pt500.ptcone20_TightTTVA_pt1000.ptvarcone20_TightTTVA_pt1000.ptvarcone30_TightTTVA_pt500.ptvarcone30_TightTTVA_pt1000.caloClusterLinks.ambiguityLink.truthParticleLink.truthOrigin.truthType.truthPdgId.firstEgMotherTruthType.firstEgMotherTruthOrigin.firstEgMotherTruthParticleLink.firstEgMotherPdgId.ambiguityType.OQ", + "AnalysisPhotons.pt.eta.phi.m.author.OQ.DFCommonPhotonsIsEMLoose.DFCommonPhotonsIsEMTight.DFCommonPhotonsIsEMTightIsEMValue.DFCommonPhotonsIsEMTightPtIncl.DFCommonPhotonsIsEMTightPtInclIsEMValue.DFCommonPhotonsCleaning.DFCommonPhotonsCleaningNoTime.ptcone20.topoetcone20.topoetcone40.topoetcone20ptCorrection.topoetcone40ptCorrection.caloClusterLinks.vertexLinks.ambiguityLink.truthParticleLink.truthOrigin.truthType", + "GSFTrackParticles.chiSquared.phi.d0.theta.qOverP.definingParametersCovMatrix.z0.vz.charge.vertexLink", + "CaloCalTopoClusters.rawE.rawEta.rawPhi.rawM.calE.calEta.calPhi.calM.e_sampl", + "egammaClusters.calE.calEta.calPhi.e_sampl.eta_sampl.ETACALOFRAME.PHICALOFRAME.ETA2CALOFRAME.PHI2CALOFRAME.constituentClusterLinks", + "AnalysisMuons.pt.eta.phi.truthType.truthOrigin.author.muonType.quality.inDetTrackParticleLink.muonSpectrometerTrackParticleLink.combinedTrackParticleLink.InnerDetectorPt.MuonSpectrometerPt.DFCommonGoodMuon.ptcone20.ptcone30.ptcone40.ptvarcone20.ptvarcone30.ptvarcone40.topoetcone20.topoetcone30.topoetcone40.truthParticleLink.charge.extrapolatedMuonSpectrometerTrackParticleLink.allAuthors.ptcone20_TightTTVA_pt1000.ptcone20_TightTTVA_pt500.ptvarcone30_TightTTVA_pt1000.ptvarcone30_TightTTVA_pt500.numberOfPrecisionLayers.combinedTrackOutBoundsPrecisionHits.numberOfPrecisionLayers.numberOfPrecisionHoleLayers.numberOfGoodPrecisionLayers.innerSmallHits.innerLargeHits.middleSmallHits.middleLargeHits.outerSmallHits.outerLargeHits.extendedSmallHits.extendedLargeHits.extendedSmallHoles.isSmallGoodSectors.cscUnspoiledEtaHits.EnergyLoss.energyLossType.momentumBalanceSignificance.scatteringCurvatureSignificance.scatteringNeighbourSignificance", + "CombinedMuonTrackParticles.qOverP.d0.z0.vz.phi.theta.truthOrigin.truthType.definingParametersCovMatrix.numberOfPixelDeadSensors.numberOfPixelHits.numberOfPixelHoles.numberOfSCTDeadSensors.numberOfSCTHits.numberOfSCTHoles.numberOfTRTHits.numberOfTRTOutliers.chiSquared.numberDoF", + "ExtrapolatedMuonTrackParticles.d0.z0.vz.definingParametersCovMatrix.truthOrigin.truthType.qOverP.theta.phi", + "MuonSpectrometerTrackParticles.phi.d0.z0.vz.definingParametersCovMatrix.vertexLink.theta.qOverP.truthParticleLink", + "AnalysisTauJets.pt.eta.phi.m.tauTrackLinks.jetLink.charge.isTauFlags.BDTJetScore.BDTEleScore.ptFinalCalib.etaFinalCalib.phiFinalCalib.mFinalCalib.electronLink.EleMatchLikelihoodScore.pt_combined.eta_combined.phi_combined.m_combined.BDTJetScoreSigTrans.BDTEleScoreSigTrans.PanTau_DecayMode.RNNJetScore.RNNJetScoreSigTrans.IsTruthMatched.truthOrigin.truthType.truthParticleLink.truthJetLink", + "AnalysisJets.pt.eta.phi.m.JetConstitScaleMomentum_pt.JetConstitScaleMomentum_eta.JetConstitScaleMomentum_phi.JetConstitScaleMomentum_m.NumTrkPt500.SumPtTrkPt500.DetectorEta.Jvt.JVFCorr.JvtRpt.NumTrkPt1000.TrackWidthPt1000.GhostMuonSegmentCount.PartonTruthLabelID.ConeTruthLabelID.HadronConeExclExtendedTruthLabelID.HadronConeExclTruthLabelID.TrueFlavor.DFCommonJets_jetClean_LooseBad.DFCommonJets_jetClean_TightBad.Timing.btagging.btaggingLink.GhostTrack.DFCommonJets_fJvt.DFCommonJets_QGTagger_NTracks.DFCommonJets_QGTagger_TracksWidth.DFCommonJets_QGTagger_TracksC1", + "BTagging_AntiKt4EMPFlow_201903.DL1r_pu.DL1rmu_pu.DL1r_pb.DL1rmu_pb.DL1r_pc.DL1rmu_pc", + "TruthPrimaryVertices.t.x.y.z", + "MET_Core_AnalysisMET.name.mpx.mpy.sumet.source", + "METAssoc_AnalysisMET.", + ] + +if DerivationFrameworkIsMonteCarlo: + from DerivationFrameworkMCTruth.MCTruthCommon import addTruth3ContentToSlimmerTool + addTruth3ContentToSlimmerTool(PHYSLITESlimmingHelper) + +# Extra trigger collections +trigmatching_helper_notau.add_to_slimming(PHYSLITESlimmingHelper) +trigmatching_helper_tau.add_to_slimming(PHYSLITESlimmingHelper) + +PHYSLITESlimmingHelper.AppendContentToStream(PHYSLITEStream) diff --git a/PhysicsAnalysis/HeavyIonPhys/HIEventUtils/CMakeLists.txt b/PhysicsAnalysis/HeavyIonPhys/HIEventUtils/CMakeLists.txt index 3fa7a48eb2fd9e05dd9b4ce765af15f64424ef57..4194416613b8d34ad69ce3880392b338f388b1fa 100644 --- a/PhysicsAnalysis/HeavyIonPhys/HIEventUtils/CMakeLists.txt +++ b/PhysicsAnalysis/HeavyIonPhys/HIEventUtils/CMakeLists.txt @@ -9,9 +9,17 @@ atlas_subdir( HIEventUtils ) atlas_depends_on_subdirs( PUBLIC Calorimeter/CaloGeoHelpers Control/AthToolSupport/AsgTools + Event/xAOD/xAODCaloEvent + Event/xAOD/xAODEventInfo Event/xAOD/xAODForward Event/xAOD/xAODHIEvent + Event/xAOD/xAODTracking + Event/xAOD/xAODTrigL1Calo GaudiKernel + InnerDetector/InDetRecTools/InDetTrackSelectionTool + ForwardDetectors/ZDC/ZdcAnalysis + Tools/PathResolver + PhysicsAnalysis/AnalysisCommon/PATCore PRIVATE Control/CxxUtils ) @@ -23,14 +31,15 @@ atlas_add_library( HIEventUtilsLib Root/*.cxx PUBLIC_HEADERS HIEventUtils INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} - LINK_LIBRARIES ${ROOT_LIBRARIES} CaloGeoHelpers AsgTools xAODForward xAODHIEvent GaudiKernel + LINK_LIBRARIES ${ROOT_LIBRARIES} CaloGeoHelpers AsgTools xAODCaloEvent xAODEventInfo xAODForward xAODHIEvent xAODTracking xAODTrigL1Calo GaudiKernel PathResolver PATCoreLib PRIVATE_LINK_LIBRARIES CxxUtils ) atlas_add_component( HIEventUtils src/components/*.cxx INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} - LINK_LIBRARIES ${ROOT_LIBRARIES} CaloGeoHelpers AsgTools xAODForward xAODHIEvent GaudiKernel CxxUtils HIEventUtilsLib ) + LINK_LIBRARIES ${ROOT_LIBRARIES} CaloGeoHelpers AsgTools xAODForward xAODHIEvent xAODTracking xAODTrigL1Calo GaudiKernel PATCoreLib CxxUtils HIEventUtilsLib ) # Install files from the package: atlas_install_joboptions( share/*.py ) +atlas_install_data( share/*.root ) diff --git a/PhysicsAnalysis/HeavyIonPhys/HIEventUtils/HIEventUtils/HICaloRange.h b/PhysicsAnalysis/HeavyIonPhys/HIEventUtils/HIEventUtils/HICaloRange.h index 3af58657cb14d9637ad1e83768164367799b1dc9..f6e1168c931255f99a2511bc0f25a5691f6ed5a6 100644 --- a/PhysicsAnalysis/HeavyIonPhys/HIEventUtils/HIEventUtils/HICaloRange.h +++ b/PhysicsAnalysis/HeavyIonPhys/HIEventUtils/HIEventUtils/HICaloRange.h @@ -1,9 +1,9 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ -#ifndef HICALORANGE_H -#define HICALORANGE_H +#ifndef HIEVENTUTILS_HICALORANGE_H +#define HIEVENTUTILS_HICALORANGE_H #include "xAODHIEvent/HIEventShapeContainer.h" #include "HIEventUtils/HIEventDefs.h" @@ -27,7 +27,7 @@ public: bool LayerInRange(float eta, int layer); inline float getRangeMin(int layer) const {return m_range.find(layer)->second.first;}; inline float getRangeMax(int layer) const {return m_range.find(layer)->second.second;}; - + private: //private constructor for singleton HICaloRange(); @@ -39,7 +39,7 @@ private: //members typedef std::pair<float,float> range_t; - std::map<int, range_t > m_range; + std::map<int, range_t > m_range; static HICaloRange s_range; static bool s_init; diff --git a/PhysicsAnalysis/HeavyIonPhys/HIEventUtils/HIEventUtils/HIEventDefs.h b/PhysicsAnalysis/HeavyIonPhys/HIEventUtils/HIEventUtils/HIEventDefs.h index 1c86711493ee4d0616a947844f8a44cb55e0fb5f..4f75e0986681a2e3376cb424ba70d5d2de6c23f7 100644 --- a/PhysicsAnalysis/HeavyIonPhys/HIEventUtils/HIEventUtils/HIEventDefs.h +++ b/PhysicsAnalysis/HeavyIonPhys/HIEventUtils/HIEventUtils/HIEventDefs.h @@ -1,9 +1,9 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ -#ifndef HI_HIEVENTDEFS_H -#define HI_HIEVENTDEFS_H +#ifndef HIEVENTUTILS_HIEVENTDEFS_H +#define HIEVENTUTILS_HIEVENTDEFS_H #include <utility> #include <cmath> @@ -43,7 +43,7 @@ namespace HI{ inline float getBinCenterPhi(unsigned int pb) {return PhiMin()+(pb+0.5)*getBinSizePhi();} inline unsigned int findBinEta(float eta) {return std::floor((eta-etaMin())/getBinSizeEta());} - inline unsigned int findBinPhi(float phi) + inline unsigned int findBinPhi(float phi) { int pb=std::floor((phi-PhiMin()) /getBinSizePhi()); return pb % numPhiBins(); @@ -82,7 +82,7 @@ namespace HI{ CaloSampling::TileGap1, CaloSampling::TileGap2, CaloSampling::TileGap3, CaloSampling::TileExt0, CaloSampling::TileExt1, CaloSampling::TileExt2, CaloSampling::FCAL0, CaloSampling::FCAL1, CaloSampling::FCAL2}; - + } } //selectors @@ -126,10 +126,10 @@ namespace HI{ constexpr ByLayersN HCal_N=SubCalo::Lists::HCal; constexpr ByLayersN PreSampler_N=SubCalo::Lists::PreSampler; constexpr ByLayersN ALL_N=SubCalo::Lists::ALL; - + } - + } #endif diff --git a/PhysicsAnalysis/HeavyIonPhys/HIEventUtils/HIEventUtils/HIEventSelectionTool.h b/PhysicsAnalysis/HeavyIonPhys/HIEventUtils/HIEventUtils/HIEventSelectionTool.h new file mode 100644 index 0000000000000000000000000000000000000000..4651775defb97be3116e51783ef847ecb354786c --- /dev/null +++ b/PhysicsAnalysis/HeavyIonPhys/HIEventUtils/HIEventUtils/HIEventSelectionTool.h @@ -0,0 +1,67 @@ +/* + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration +*/ + +#ifndef HIEVENTUTILS_HIEVENTSELECTIONTOOL_H +#define HIEVENTUTILS_HIEVENTSELECTIONTOOL_H + +#include "AsgTools/AsgTool.h" +#include "AsgTools/ToolHandle.h" +#include "HIEventUtils/IHIEventSelectionTool.h" +#include "HIEventUtils/IHIVertexSelectionTool.h" +#include "HIEventUtils/IHIPileupTool.h" + +namespace HI +{ + + class HIEventSelectionTool : + public virtual HI::IHIEventSelectionTool, public asg::AsgTool + { + + ASG_TOOL_CLASS( HIEventSelectionTool, IHIEventSelectionTool ) + + public: + + HIEventSelectionTool(const std::string& name = "HIEventSelection"); + virtual ~HIEventSelectionTool(); + virtual StatusCode initialize() override; + virtual StatusCode finalize() override; + virtual const asg::AcceptInfo& getAcceptInfo() const override; + + // MBTS timing cut member functions + void checkMBTSTime( asg::AcceptData& acceptData ) const; + bool isGoodMBTSTime() const; + + // Vertex member functions + void checkVertex( asg::AcceptData& acceptData ) const; + unsigned int getNPrimaryVertices() const; + + std::string dumpSelection() const; + + private: + + static const std::string m_MBTS_CNAME; + static const std::string m_FWD_CNAME; + static const std::string m_VERTEX_CNAME; + static const std::string m_SHAPE_CNAME; + static const std::string m_ZDC_CNAME; + + const std::string m_name; + asg::AcceptInfo m_accept; + + // MBTS external parameters + bool m_checkTime = false; + float m_timeCut = -1; + + // Vertex external parameters + ToolHandle<HI::IHIVertexSelectionTool> m_vertexSelectionTool; + ToolHandle<HI::IHIPileupTool> m_hiPileupTool; + float m_vtx_min_sumPt = -1; + int m_vtx_min_nTrk = -1; + bool m_exclusive_mode = false; + bool m_reject_pileup = true; + std::string m_track_cutlevel = "NoCut"; + }; + +} +#endif diff --git a/PhysicsAnalysis/HeavyIonPhys/HIEventUtils/HIEventUtils/HIEventShapeIndex.h b/PhysicsAnalysis/HeavyIonPhys/HIEventUtils/HIEventUtils/HIEventShapeIndex.h index 61bf1b9fa6e355531cb1c25b9c142be97f4c6e46..dc95d1db7d75f3a116408e2f11dcb19cfa01e635 100644 --- a/PhysicsAnalysis/HeavyIonPhys/HIEventUtils/HIEventUtils/HIEventShapeIndex.h +++ b/PhysicsAnalysis/HeavyIonPhys/HIEventUtils/HIEventUtils/HIEventShapeIndex.h @@ -1,9 +1,9 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ -#ifndef HIEVENTSHAPEINDEX_H -#define HIEVENTSHAPEINDEX_H +#ifndef HIEVENTUTILS_HIEVENTSHAPEINDEX_H +#define HIEVENTUTILS_HIEVENTSHAPEINDEX_H #include "xAODHIEvent/HIEventShapeContainer.h" #include "HIEventUtils/HIEventDefs.h" @@ -19,11 +19,11 @@ public: enum BinningScheme{ TOWER, COMPACT}; HIEventShapeIndex(); ~HIEventShapeIndex(); - + //initialize indexing given object or scheme //returns total number of bins - unsigned int setBinning(const TH2* h2, bool asMask); + unsigned int setBinning(const TH2* h2, bool asMask); unsigned int setBinning(const xAOD::HIEventShapeContainer* shape); unsigned int setBinning(BinningScheme scheme); @@ -48,7 +48,7 @@ private: range_index_t(float emin, float emax, unsigned int ii) : eta_min(emin), eta_max(emax),index(ii) {}; range_index_t()=default; - bool operator() (float eta) const + bool operator() (float eta) const { if (eta > this->eta_min && eta < this->eta_max) return true; if(eta==this->eta_min) return true; @@ -67,7 +67,7 @@ private: inline float roundToTenth(float d) const {return std::floor(d)+std::floor((d-std::floor(d))*10.0+0.5)/10.0;}; - + }; diff --git a/PhysicsAnalysis/HeavyIonPhys/HIEventUtils/HIEventUtils/HIEventShapeMap.h b/PhysicsAnalysis/HeavyIonPhys/HIEventUtils/HIEventUtils/HIEventShapeMap.h index 2d04e265f7e7b45ae56aa2a125095b2ec0a95e32..ab0c70f1ffc5dcaec41d0d1f3f54b47ac3ee0290 100644 --- a/PhysicsAnalysis/HeavyIonPhys/HIEventUtils/HIEventUtils/HIEventShapeMap.h +++ b/PhysicsAnalysis/HeavyIonPhys/HIEventUtils/HIEventUtils/HIEventShapeMap.h @@ -1,29 +1,30 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ -#ifndef HIEVENTSHAPEMAP_H -#define HIEVENTSHAPEMAP_H +#ifndef HIEVENTUTILS_HIEVENTSHAPEMAP_H +#define HIEVENTUTILS_HIEVENTSHAPEMAP_H #include "xAODHIEvent/HIEventShape.h" #include "HIEventUtils/HIEventShapeIndex.h" #include <string> +//Migration check: in this class keys are only used as strings to access the map. +//For the moment we leave it untouched and we pass the only string to the methods + class HIEventShapeMap { + public: -public: - - static const HIEventShapeIndex* insert(std::string key, const HIEventShapeIndex& index, bool clobber=false); - static const HIEventShapeIndex* getIndex(std::string key); - static bool hasKey(std::string key); - static HIEventShapeMap* getMap(); - -private: - HIEventShapeMap(){}; - std::map<std::string,HIEventShapeIndex> m_map; - static HIEventShapeMap s_obj; + static const HIEventShapeIndex* insert(std::string key, const HIEventShapeIndex& index, bool clobber=false); + static const HIEventShapeIndex* getIndex(std::string key); + static bool hasKey(std::string key); + static HIEventShapeMap* getMap(); + private: + HIEventShapeMap(){}; + std::map<std::string,HIEventShapeIndex> m_map; + static HIEventShapeMap s_obj; //TODO move to const implementation }; diff --git a/PhysicsAnalysis/HeavyIonPhys/HIEventUtils/HIEventUtils/HIEventShapeSummaryTool.h b/PhysicsAnalysis/HeavyIonPhys/HIEventUtils/HIEventUtils/HIEventShapeSummaryTool.h index 314e6fa110a2b566be1604b3ab89635465085e80..81523313ea8423e941e691a69d0b45cd784f19e8 100644 --- a/PhysicsAnalysis/HeavyIonPhys/HIEventUtils/HIEventUtils/HIEventShapeSummaryTool.h +++ b/PhysicsAnalysis/HeavyIonPhys/HIEventUtils/HIEventUtils/HIEventShapeSummaryTool.h @@ -1,9 +1,9 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ -#ifndef HI_HIEVENTSHAPESUMMARYTOOL_H -#define HI_HIEVENTSHAPESUMMARYTOOL_H +#ifndef HIEVENTUTILS_HIEVENTSHAPESUMMARYTOOL_H +#define HIEVENTUTILS_HIEVENTSHAPESUMMARYTOOL_H #include "AsgTools/AsgTool.h" #include "HIEventUtils/IHIEventShapeSummaryTool.h" @@ -15,43 +15,43 @@ class HIEventShapeSummaryTool : virtual public asg::AsgTool, virtual public IHIEventShapeSummaryTool { - ASG_TOOL_CLASS(HIEventShapeSummaryTool,IHIEventShapeSummaryTool); -public: - HIEventShapeSummaryTool(const std::string& n); - - - StatusCode summarize(const xAOD::HIEventShapeContainer* in, xAOD::HIEventShapeContainer* out) const; - StatusCode initialize(); - std::string dumpList() const; - -private: - typedef std::function<bool (const xAOD::HIEventShape*)> function_t; - struct summary_info_t - { - std::string name; - float eta_min; - float eta_max; - int layer; - function_t func; - - summary_info_t(std::string n, float emin, float emax, int ll, function_t ff) : name(n), eta_min(emin), eta_max(emax), layer(ll), func(ff) {}; - }; - - - std::vector<std::string> m_samp_names; - std::vector<std::string> m_subcalo_names; - bool m_do_sides; - - //using map instead of unordered version, really do want entries sorted by key - std::map<std::string,summary_info_t> m_summary_list; - - int getSubCaloLayer(const std::vector<int>& samps) const; - float getSubCaloEtaMin(const std::vector<int>& samps) const; - float getSubCaloEtaMax(const std::vector<int>& samps) const; - float roundToTenth(float v) const; - - static const std::vector<std::string> s_SubCaloNames; - static const std::vector<std::initializer_list<int> > s_SubCaloLists; + ASG_TOOL_CLASS(HIEventShapeSummaryTool,IHIEventShapeSummaryTool) + public: + HIEventShapeSummaryTool(const std::string& n); + + + StatusCode summarize(const xAOD::HIEventShapeContainer* in, xAOD::HIEventShapeContainer* out) const override; + StatusCode initialize() override; + std::string dumpList() const override; + + private: + typedef std::function<bool (const xAOD::HIEventShape*)> function_t; + struct summary_info_t + { + std::string name; + float eta_min; + float eta_max; + int layer; + function_t func; + + summary_info_t(std::string n, float emin, float emax, int ll, function_t ff) : name(n), eta_min(emin), eta_max(emax), layer(ll), func(ff) {}; + }; + + + std::vector<std::string> m_samp_names; + std::vector<std::string> m_subcalo_names; + bool m_do_sides; + + //using map instead of unordered version, really do want entries sorted by key + std::map<std::string,summary_info_t> m_summary_list; + + int getSubCaloLayer(const std::vector<int>& samps) const; + float getSubCaloEtaMin(const std::vector<int>& samps) const; + float getSubCaloEtaMax(const std::vector<int>& samps) const; + float roundToTenth(float v) const; + + static const std::vector<std::string> s_SubCaloNames; + static const std::vector<std::initializer_list<int> > s_SubCaloLists; }; diff --git a/PhysicsAnalysis/HeavyIonPhys/HIEventUtils/HIEventUtils/HIEventShapeSummaryUtils.h b/PhysicsAnalysis/HeavyIonPhys/HIEventUtils/HIEventUtils/HIEventShapeSummaryUtils.h index 42ac7557291d5c839bfb51f8272b8d55644537c4..24389e6ed1a2a319e276c4f046f230cd85bc0c4d 100644 --- a/PhysicsAnalysis/HeavyIonPhys/HIEventUtils/HIEventUtils/HIEventShapeSummaryUtils.h +++ b/PhysicsAnalysis/HeavyIonPhys/HIEventUtils/HIEventUtils/HIEventShapeSummaryUtils.h @@ -1,9 +1,9 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ -#ifndef HI_HIEVENTSHAPESUMMARYUTILS_H -#define HI_HIEVENTSHAPESUMMARYUTILS_H +#ifndef HIEVENTUTILS_HIEVENTSHAPESUMMARYUTILS_H +#define HIEVENTUTILS_HIEVENTSHAPESUMMARYUTILS_H #include "xAODHIEvent/HIEventShapeContainer.h" #include "xAODHIEvent/HIEventShape.h" @@ -20,8 +20,8 @@ namespace HI void fillSummary(const xAOD::HIEventShapeContainer* in, xAOD::HIEventShape* out, std::function<bool (const xAOD::HIEventShape*)> incFunction); - - + + void fillSummary(const xAOD::HIEventShapeContainer* in, xAOD::HIEventShape* out, const std::set<unsigned int> indices, std::function<void (xAOD::HIEventShape*,const xAOD::HIEventShape*)> addFunction); @@ -30,7 +30,7 @@ namespace HI { bool match_num_harmonics; - + AddEventShape(float ww) : match_num_harmonics(true), m_weight(ww){}; constexpr AddEventShape() : match_num_harmonics(true), m_weight(1){}; void operator()(xAOD::HIEventShape* slice, const xAOD::HIEventShape* in_slice) const; @@ -43,7 +43,7 @@ namespace HI // Predicates - + struct ByLayer { int layer; @@ -57,14 +57,14 @@ namespace HI constexpr ByLayers(std::initializer_list<int> ll) : layers(ll) {}; bool operator()(const xAOD::HIEventShape* in_slice) { - for(int i : layers) + for(int i : layers) { if(i==in_slice->layer()) return true; } return false; }; }; - + struct ByEtaRange { float eta_min; @@ -77,7 +77,7 @@ namespace HI { ByLayers layers_sel; ByEtaRange range_sel; - + constexpr ByLayersWithEtaRange(ByLayers& ll,float eta_min_i, float eta_max_i) : layers_sel(ll), range_sel(eta_min_i,eta_max_i){}; bool operator()(const xAOD::HIEventShape* in_slice) {return (layers_sel(in_slice) && range_sel(in_slice));}; }; @@ -103,5 +103,3 @@ namespace HI } #endif - - diff --git a/PhysicsAnalysis/HeavyIonPhys/HIEventUtils/HIEventUtils/HIPileupTool.h b/PhysicsAnalysis/HeavyIonPhys/HIEventUtils/HIEventUtils/HIPileupTool.h new file mode 100644 index 0000000000000000000000000000000000000000..f810cc7325e795d4e57be5b65c63c1dc1681931b --- /dev/null +++ b/PhysicsAnalysis/HeavyIonPhys/HIEventUtils/HIEventUtils/HIPileupTool.h @@ -0,0 +1,70 @@ +/* + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration +*/ + +#ifndef HIEVENTUTILS_HIPILEUPTOOL_H__ +#define HIEVENTUTILS_HIPILEUPTOOL_H__ + +// David Adams. +// January 2014 +// +// This is a simple ASG dual-use tool intended as an +// example for tool developers. + +#include "HIEventUtils/IHIPileupTool.h" +#include "AsgTools/AsgTool.h" +#include "AsgTools/ToolHandle.h" +#include "xAODForward/ZdcModuleContainer.h" +#include "xAODHIEvent/HIEventShapeContainer.h" + +class TH1D; +class TH2D; +class TFile; +namespace HI +{ + + class HIPileupTool : + public asg::AsgTool, virtual public HI::IHIPileupTool { + ASG_TOOL_CLASS(HIPileupTool, IHIPileupTool) + + public: + + HIPileupTool( const std::string& myname="HIPileupTool" ); + ~HIPileupTool(); + + virtual StatusCode initialize(); + + virtual void print() const; + void write(TFile* fOut) const; + + double get_efficiency(const xAOD::HIEventShapeContainer&, double ) const; + double get_purity(const xAOD::HIEventShapeContainer&, double& ); + bool is_pileup(const xAOD::HIEventShapeContainer&, const xAOD::ZdcModuleContainer& ) const override; + + virtual const asg::AcceptInfo& getAcceptInfo(const xAOD::HIEventShapeContainer& evShCont, const xAOD::ZdcModuleContainer& ZdcCont) const override; + + private: + + double get_et(const xAOD::HIEventShapeContainer& evShCont) const; + double get_nNeutrons(const xAOD::ZdcModuleContainer& ZdcCont) const; + + //R.Longo - 12/10/2019 - Replacing PATCore/TAccept (inherited from 21.0 HI-equalization) + asg::AcceptInfo m_accept; + + std::vector<double> m_etCutAndPurity; + std::string m_fname; + + double m_etThreshold; + double m_purityCut; + bool m_setup; + //Average energy deposited in the ZDC by neutrons + const double m_npeak = 2510.; + + TH2D* m_hEvents; + TH2D* m_hPileUp; + TH1D* m_hCut; + TH1D* m_hEff; + TH1D* m_hPurity; + }; +} +#endif diff --git a/PhysicsAnalysis/HeavyIonPhys/HIEventUtils/HIEventUtils/HITowerWeightTool.h b/PhysicsAnalysis/HeavyIonPhys/HIEventUtils/HIEventUtils/HITowerWeightTool.h new file mode 100644 index 0000000000000000000000000000000000000000..4d210cb2b96d8719dec9d764014c228f2fd7cb08 --- /dev/null +++ b/PhysicsAnalysis/HeavyIonPhys/HIEventUtils/HIEventUtils/HITowerWeightTool.h @@ -0,0 +1,55 @@ +/* + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration +*/ + +#ifndef HIEVENTUTILS_HITOWERWEIGHTTOOL_H +#define HIEVENTUTILS_HITOWERWEIGHTTOOL_H + +#include "HIEventUtils/IHITowerWeightTool.h" +#include "AsgTools/IAsgTool.h" +#include "AsgTools/AsgTool.h" +#include <map> + +class TH3F; + +//////////////////////////////////////////////////////////// +// Tool that gets the tower weights for by tower by tower +// difference in response during the HI jet reconstruction. +//////////////////////////////////////////////////////////// + +class HITowerWeightTool : virtual public asg::AsgTool, virtual public IHITowerWeightTool +{ + ASG_TOOL_CLASS(HITowerWeightTool,IHITowerWeightTool) + public: + HITowerWeightTool(const std::string& n); + + virtual ~HITowerWeightTool() {}; + virtual StatusCode initialize() override; + virtual StatusCode configureEvent() override; + virtual float getEtaPhiResponse(float eta, float phi) const override; + virtual float getEtaPhiOffset(float eta, float phi) const override; + virtual float getWeight(float eta, float phi, int sampling) const override; + virtual float getWeightEta(float eta, float phi, int sampling) const override; + virtual float getWeightPhi(float eta, float phi, int sampling) const override; + virtual float getWeightMag(float eta, float phi, int sampling) const override; + + private: + bool m_applycorrection; + std::string m_inputFile; + std::string m_configDir; + bool m_init; + TH3F* m_h3W; + TH3F* m_h3Eta; + TH3F* m_h3Phi; + TH3F* m_h3Mag; + TH3F* m_h3EtaPhiResponse; + TH3F* m_h3EtaPhiOffset; + unsigned int m_runNumber; + int m_runIndex; + std::map<unsigned int, int> m_runMap; + + +}; + + +#endif diff --git a/PhysicsAnalysis/HeavyIonPhys/HIEventUtils/HIEventUtils/HIVertexSelectionTool.h b/PhysicsAnalysis/HeavyIonPhys/HIEventUtils/HIEventUtils/HIVertexSelectionTool.h new file mode 100644 index 0000000000000000000000000000000000000000..8f4db0b98651f6f42d65e1fcf951a17dfd3b6767 --- /dev/null +++ b/PhysicsAnalysis/HeavyIonPhys/HIEventUtils/HIEventUtils/HIVertexSelectionTool.h @@ -0,0 +1,53 @@ +// -*- c++ -*- + +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +#pragma once +#ifndef HIEVENTUTILS_HIVERTEXSELECTIONTOOL_H +#define HIEVENTUTILS_HIVERTEXSELECTIONTOOL_H + +#include "HIEventUtils/IHIVertexSelectionTool.h" +#include "AsgTools/AsgTool.h" +#include "AsgTools/ToolHandle.h" +#include "InDetTrackSelectionTool/IInDetTrackSelectionTool.h" + +namespace HI { + + class HIVertexSelectionTool : public virtual HI::IHIVertexSelectionTool, + public asg::AsgTool { + ASG_TOOL_CLASS2( HIVertexSelectionTool, + IAsgSelectionTool, + HI::IHIVertexSelectionTool ) + public: + + HIVertexSelectionTool( const std::string& name ); + ~HIVertexSelectionTool(); + + virtual StatusCode initialize() override; + virtual StatusCode finalize() override; + //R.Longo 13-10-2019 - Replacing PATCore/TAccept (inherited from 21.0 HI-equalization) + virtual const asg::AcceptInfo& getAcceptInfo() const override; + // we have to implement the IParticle function in order to inherit from IAsgSelectionTool + // it will throw an exception + virtual asg::AcceptData accept( const xAOD::IParticle* ) const override; + virtual asg::AcceptData accept( const xAOD::Vertex& ) const override; + + private: + asg::AcceptInfo m_accept; + + // configureable properties + bool m_requirePrimary = true; //!< require the vertex to be of type PriVtx + double m_maxAbsZ = -1; //!< maximum |z| position of the vertex + + ToolHandle< InDet::IInDetTrackSelectionTool > m_trkSelTool; //!< track selection tool which can be optionally used for N_trk and sum pt cuts + int m_minNtrk = -1; + double m_minRmsPt = -1.; + bool m_checkTracks = false; // an internal flag to indicate whether or not to loop over the vertex's track + + }; +} + + +#endif // HIEVENTUTILS_HIVERTEXSELECTIONTOOL_H diff --git a/PhysicsAnalysis/HeavyIonPhys/HIEventUtils/HIEventUtils/IHIEventSelectionTool.h b/PhysicsAnalysis/HeavyIonPhys/HIEventUtils/HIEventUtils/IHIEventSelectionTool.h new file mode 100644 index 0000000000000000000000000000000000000000..f371c458265562dc13778704fb1ab624fc93e967 --- /dev/null +++ b/PhysicsAnalysis/HeavyIonPhys/HIEventUtils/HIEventUtils/IHIEventSelectionTool.h @@ -0,0 +1,32 @@ +/* + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration +*/ + +#ifndef HIEVENTUTILS_IHIEVENTSELECTIONTOOL_H__ +#define HIEVENTUTILS_IHIEVENTSELECTIONTOOL_H__ + +#include "AsgTools/IAsgTool.h" + +#include "PATCore/AcceptInfo.h" +#include "PATCore/AcceptData.h" + +namespace HI +{ + + class IHIEventSelectionTool : public virtual asg::IAsgTool + { + + ASG_TOOL_INTERFACE( HI::IHIEventSelectionTool ) + + public: + + virtual StatusCode initialize() = 0; + virtual StatusCode finalize() = 0; + + virtual const asg::AcceptInfo& getAcceptInfo() const = 0; + + }; + +} + +#endif diff --git a/PhysicsAnalysis/HeavyIonPhys/HIEventUtils/HIEventUtils/IHIEventShapeSummaryTool.h b/PhysicsAnalysis/HeavyIonPhys/HIEventUtils/HIEventUtils/IHIEventShapeSummaryTool.h index 78e75bfb20503b8ccebeb67e28d61758f7ab84f3..69f1ad98ee810ea0f954e148c6caa3b8fb49e376 100644 --- a/PhysicsAnalysis/HeavyIonPhys/HIEventUtils/HIEventUtils/IHIEventShapeSummaryTool.h +++ b/PhysicsAnalysis/HeavyIonPhys/HIEventUtils/HIEventUtils/IHIEventShapeSummaryTool.h @@ -1,22 +1,22 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ -#ifndef HI_IHIEVENTSHAPESUMMARYTOOL_H -#define HI_IHIEVENTSHAPESUMMARYTOOL_H +#ifndef HIEVENTUTILS_IHIEVENTSHAPESUMMARYTOOL_H +#define HIEVENTUTILS_IHIEVENTSHAPESUMMARYTOOL_H #include "AsgTools/IAsgTool.h" #include "xAODHIEvent/HIEventShapeContainer.h" class IHIEventShapeSummaryTool : virtual public asg::IAsgTool { ASG_TOOL_INTERFACE(IHIEventShapeSummaryTool) - + public: virtual ~IHIEventShapeSummaryTool() {}; virtual StatusCode summarize(const xAOD::HIEventShapeContainer* in, xAOD::HIEventShapeContainer* out) const = 0; virtual StatusCode initialize() = 0; virtual std::string dumpList() const {return std::string("");}; - + }; #endif diff --git a/PhysicsAnalysis/HeavyIonPhys/HIEventUtils/HIEventUtils/IHIPileupTool.h b/PhysicsAnalysis/HeavyIonPhys/HIEventUtils/HIEventUtils/IHIPileupTool.h new file mode 100644 index 0000000000000000000000000000000000000000..4479cea1662b4d7d4b5c0052c14735d7ed0e83d8 --- /dev/null +++ b/PhysicsAnalysis/HeavyIonPhys/HIEventUtils/HIEventUtils/IHIPileupTool.h @@ -0,0 +1,32 @@ +/* + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration +*/ + +// HIPileupTool.h + +#ifndef HIEVENTUTILS_IHIPILEUPTOOL_H +#define HIEVENTUTILS_IHIPILEUPTOOL_H + +#include "AsgTools/IAsgTool.h" +#include "xAODForward/ZdcModuleContainer.h" +#include "xAODHIEvent/HIEventShapeContainer.h" + +//R.Longo - 12/10/2019 - Replacing PATCore/TAccept (inherited from 21.0 HI-equalization) +#include "PATCore/AcceptInfo.h" +#include "PATCore/AcceptData.h" + +namespace HI +{ + + class IHIPileupTool : virtual public asg::IAsgTool { + ASG_TOOL_INTERFACE( HI::IHIPileupTool ) + + public: + + virtual const asg::AcceptInfo& getAcceptInfo(const xAOD::HIEventShapeContainer& evShCont, const xAOD::ZdcModuleContainer& ZdcCont) const = 0; + //Added by R.Longo and S.Tapia on 14-10-2019 to bypass an error in including 21.0 missing commits + virtual bool is_pileup(const xAOD::HIEventShapeContainer&, const xAOD::ZdcModuleContainer& ) const = 0; + + }; +} +#endif diff --git a/PhysicsAnalysis/HeavyIonPhys/HIEventUtils/HIEventUtils/IHITowerWeightTool.h b/PhysicsAnalysis/HeavyIonPhys/HIEventUtils/HIEventUtils/IHITowerWeightTool.h new file mode 100644 index 0000000000000000000000000000000000000000..0a8c61304053bf1d0e0cea13593fd55c852bfb29 --- /dev/null +++ b/PhysicsAnalysis/HeavyIonPhys/HIEventUtils/HIEventUtils/IHITowerWeightTool.h @@ -0,0 +1,30 @@ +/* + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration +*/ + +#ifndef HIEVENTUTILS_IHITOWERWEIGHTTOOL_H +#define HIEVENTUTILS_IHITOWERWEIGHTTOOL_H + +#include "AsgTools/IAsgTool.h" +#include "AsgTools/AsgTool.h" +#include <map> + +class TH3F; + +class IHITowerWeightTool : virtual public asg::IAsgTool { + ASG_TOOL_INTERFACE(IHITowerWeightTool) + + public: + + virtual ~IHITowerWeightTool() {}; + virtual StatusCode initialize() = 0; + virtual StatusCode configureEvent() = 0; + virtual float getEtaPhiResponse(float eta, float phi) const = 0; + virtual float getEtaPhiOffset(float eta, float phi) const = 0; + virtual float getWeight(float eta, float phi, int sampling) const = 0; + virtual float getWeightEta(float eta, float phi, int sampling) const = 0; + virtual float getWeightPhi(float eta, float phi, int sampling) const = 0; + virtual float getWeightMag(float eta, float phi, int sampling) const = 0; + +}; +#endif diff --git a/PhysicsAnalysis/HeavyIonPhys/HIEventUtils/HIEventUtils/IHIVertexSelectionTool.h b/PhysicsAnalysis/HeavyIonPhys/HIEventUtils/HIEventUtils/IHIVertexSelectionTool.h new file mode 100644 index 0000000000000000000000000000000000000000..0d047622695140fe9003c57e99fc6a3cd2c6feaf --- /dev/null +++ b/PhysicsAnalysis/HeavyIonPhys/HIEventUtils/HIEventUtils/IHIVertexSelectionTool.h @@ -0,0 +1,33 @@ +// -*- c++ -*- + +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +#pragma once +#ifndef HIEVENTUTILS_IHIVERTEXSELECTIONTOOL_H +#define HIEVENTUTILS_IHIVERTEXSELECTIONTOOL_H + +#include "PATCore/IAsgSelectionTool.h" +#include "xAODTracking/Vertex.h" + +namespace HI { + + class IHIVertexSelectionTool : public virtual ::IAsgSelectionTool { + ASG_TOOL_INTERFACE( HI::IHIVertexSelectionTool ) + public: + + virtual StatusCode initialize() = 0; + virtual StatusCode finalize() = 0; + + //R.Longo 13-10-2019 - Replacing PATCore/TAccept (inherited from 21.0 HI-equalization) + virtual const asg::AcceptInfo& getAcceptInfo() const = 0; + // we have to implement the IParticle function in order to inherit from IAsgSelectionTool + // it will throw an exception + virtual asg::AcceptData accept( const xAOD::IParticle* ) const = 0; + virtual asg::AcceptData accept( const xAOD::Vertex& ) const = 0; + }; +} + + +#endif // HIEVENTUTILS_IHIVERTEXSELECTIONTOOL_H diff --git a/PhysicsAnalysis/HeavyIonPhys/HIEventUtils/HIEventUtils/IZdcRecTool.h b/PhysicsAnalysis/HeavyIonPhys/HIEventUtils/HIEventUtils/IZdcRecTool.h new file mode 100644 index 0000000000000000000000000000000000000000..cacd11f8076642c324b8d3079a7db14a595898c7 --- /dev/null +++ b/PhysicsAnalysis/HeavyIonPhys/HIEventUtils/HIEventUtils/IZdcRecTool.h @@ -0,0 +1,29 @@ +/* + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration +*/ + +#ifndef HIEVENTUTILS_IZDCRECTOOL_H +#define HIEVENTUTILS_IZDCRECTOOL_H + +#include "AsgTools/IAsgTool.h" +#include "xAODForward/ZdcModuleContainer.h" + +namespace ZDC +{ + +class IZdcRecTool : virtual public asg::IAsgTool +{ + ASG_TOOL_INTERFACE( IZdcRecTool ) + + public: + + /// Initialize the tool. + virtual StatusCode initializeTool() = 0; + virtual StatusCode recoZdcModule(const xAOD::ZdcModule& module) = 0; + virtual StatusCode recoZdcModules(const xAOD::ZdcModuleContainer& moduleContainer) = 0; + virtual StatusCode reprocessZdc() = 0; +}; + +} + +#endif diff --git a/PhysicsAnalysis/HeavyIonPhys/HIEventUtils/HIEventUtils/ZdcRecTool.h b/PhysicsAnalysis/HeavyIonPhys/HIEventUtils/HIEventUtils/ZdcRecTool.h new file mode 100644 index 0000000000000000000000000000000000000000..6a71dfeff72cea027eb7b90f79d531389bd8270e --- /dev/null +++ b/PhysicsAnalysis/HeavyIonPhys/HIEventUtils/HIEventUtils/ZdcRecTool.h @@ -0,0 +1,67 @@ +/* + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration +*/ + +#ifndef HIEVENTUTILS_ZDCRECTOOL_H +#define HIEVENTUTILS_ZDCRECTOOL_H + +#include "AsgTools/AsgTool.h" +#include "HIEventUtils/IZdcRecTool.h" +#include "xAODForward/ZdcModuleContainer.h" +#include "xAODTrigL1Calo/TriggerTowerContainer.h" + +#include "TF1.h" +#include "TMath.h" + +namespace ZDC +{ + + double SincInterp(double* xvec, double* pvec); + double FermiExpFit(double* xvec, double* pvec); + + class ZdcRecTool : public virtual IZdcRecTool, public asg::AsgTool + { + + ASG_TOOL_CLASS(ZdcRecTool,IZdcRecTool) + + public: + ZdcRecTool(const std::string& name); + virtual ~ZdcRecTool(); + + //interface from AsgTool + virtual StatusCode initializeTool() override; + StatusCode initialize() {return initializeTool();} + virtual StatusCode recoZdcModule(const xAOD::ZdcModule& module) override; + virtual StatusCode recoZdcModules(const xAOD::ZdcModuleContainer& moduleContainer) override; + virtual StatusCode reprocessZdc() override; + + // methods for processing, used for decoration + // TODO: documentaton about the arguments of these methods must be written by experts + bool sigprocMaxFinder(const std::vector<unsigned short>& adc, float deltaT, float& amp, float& time, float& qual); + bool sigprocPeakFitter(const std::vector<unsigned short>& adc, float deltaT, float& amp, float& time, float& qual); + bool sigprocSincInterp(const std::vector<unsigned short>& adc, float deltaT, float& amp, float& time, float& qual); + + private: + + // internal functions - moved to private accoding to T.Bold request while merging into master + TF1* m_tf1SincInterp; + TF1* m_tf1FermiExpFit; + + // Name of the ZDC rec tool + std::string m_name; + // Boolean to flag initialization + bool m_init; + // Path to the configuring file + std::string m_zdcRecConfigPath; + + mutable bool m_eventReady; + float m_highLowTransition[2][4]; + float m_moduleWeights[2][4]; + std::string m_zdcModuleContainerName; + const xAOD::ZdcModuleContainer* m_zdcModules; + + }; + +} // namespace ZDC + +#endif diff --git a/PhysicsAnalysis/HeavyIonPhys/HIEventUtils/HIEventUtils/ZdcUtils.h b/PhysicsAnalysis/HeavyIonPhys/HIEventUtils/HIEventUtils/ZdcUtils.h index 1edacdf519d49005671a91e8df0e0b9ccc46ec21..4273d675edd1fb3532457a79723b7f0464b37567 100644 --- a/PhysicsAnalysis/HeavyIonPhys/HIEventUtils/HIEventUtils/ZdcUtils.h +++ b/PhysicsAnalysis/HeavyIonPhys/HIEventUtils/HIEventUtils/ZdcUtils.h @@ -1,9 +1,9 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ -#ifndef ZDCUTILS -#define ZDCUTILS +#ifndef HIEVENTUTILS_ZDCUTILS_H +#define HIEVENTUTILS_ZDCUTILS_H #include <functional> #include <vector> @@ -20,13 +20,14 @@ namespace ZDC int m_side; int m_type; int m_mod; - BySideTypeMod(int side, int type=0, int mod=-1) : m_side(side),m_type(type),m_mod(mod) {} + BySideTypeMod(int side, int type=0, int mod=-1) : m_side(side),m_type(type),m_mod(mod) {} bool operator() (const xAOD::ZdcModule* in_side) - {return ( - (in_side->side()==m_side||m_side==0) && - in_side->type()==m_type && - (in_side->zdcModule()==m_mod || m_mod==-1) - );} + { + return ( + (in_side->side()==m_side||m_side==0) && + in_side->type()==m_type && + (in_side->zdcModule()==m_mod || m_mod==-1)); + } }; BySideTypeMod sideA(1); @@ -36,8 +37,8 @@ namespace ZDC BySideTypeMod sideA_HadPix(1,1,1); BySideTypeMod sideC_HadPix(-1,1,1); - float getAmplitudeSum(const xAOD::ZdcModuleContainer* in, std::function<bool (const xAOD::ZdcModule*)> incFunction); - float getAmplitudeSumG0(const xAOD::ZdcModuleContainer* in, std::function<bool (const xAOD::ZdcModule*)> incFunction); + float getAmplitudeSum(const xAOD::ZdcModuleContainer* in, std::function<bool (const xAOD::ZdcModule*)> incFunction, std::string suffix=""); + float getAmplitudeSumG0(const xAOD::ZdcModuleContainer* in, std::function<bool (const xAOD::ZdcModule*)> incFunction, std::string suffix=""); float getAmplitudeSumG1(const xAOD::ZdcModuleContainer* in, std::function<bool (const xAOD::ZdcModule*)> incFunction); } #endif //ZDCUTILS diff --git a/PhysicsAnalysis/HeavyIonPhys/HIEventUtils/Root/HIEventSelectionTool.cxx b/PhysicsAnalysis/HeavyIonPhys/HIEventUtils/Root/HIEventSelectionTool.cxx new file mode 100644 index 0000000000000000000000000000000000000000..4630127c327a927f67ca9b6762893f15369875b9 --- /dev/null +++ b/PhysicsAnalysis/HeavyIonPhys/HIEventUtils/Root/HIEventSelectionTool.cxx @@ -0,0 +1,197 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +#include "HIEventUtils/HIEventSelectionTool.h" +#include "HIEventUtils/HIVertexSelectionTool.h" +#include "xAODForward/ForwardEventInfoContainer.h" +#include "xAODTracking/VertexContainer.h" +//#include "HIPileupTool/HIPileupTool.h" +#include "HIEventUtils/HIPileupTool.h" + +#include <iomanip> +#include <iostream> + +#ifndef ROOTCORE +#include "GaudiKernel/IJobOptionsSvc.h" +#endif + +namespace HI +{ + + const std::string HIEventSelectionTool::m_VERTEX_CNAME="PrimaryVertices"; + const std::string HIEventSelectionTool::m_MBTS_CNAME="MBTSContainer"; + const std::string HIEventSelectionTool::m_FWD_CNAME="MBTSForwardEventInfo"; + const std::string HIEventSelectionTool::m_ZDC_CNAME="ZdcModules"; + const std::string HIEventSelectionTool::m_SHAPE_CNAME="CaloSums"; //HIEventShape + + HIEventSelectionTool::HIEventSelectionTool(const std::string& name) : asg::AsgTool(name), + m_name(name), + m_accept("HIEventSelection"), + m_vertexSelectionTool(""), + m_hiPileupTool("") + { + // MBTS timing cut + declareProperty("TimeCut",m_timeCut,"maximum DeltaT cut for MBTS timing cut"); + // Vertex + declareProperty("VertexSumPtCut",m_vtx_min_sumPt,"Minimum sum pT from good tracks for a good vertex"); + declareProperty("VertexNtrkCut",m_vtx_min_nTrk,"Minimum number good tracks for a good vertex"); + declareProperty("RejectPileup",m_reject_pileup,"If true, cut on events w/ pileup applied"); + declareProperty("ExclusiveMode",m_exclusive_mode,"returns at first failure (for speed), doesn't evaluate subsequent cuts"); + declareProperty("VertexSelectionTool",m_vertexSelectionTool); + declareProperty("PileupTool",m_hiPileupTool); + + ATH_MSG_DEBUG("Creating HIEventSelectionTool named" << m_name); + } + + HIEventSelectionTool::~HIEventSelectionTool() + { + ATH_MSG_DEBUG(Form("Deleting HIEventSelectionTool named %s",m_name.c_str())); + } + + StatusCode HIEventSelectionTool::initialize() + { + if (m_timeCut > 0.) { + m_checkTime = true; + ATH_MSG_INFO( "Maximum delta t = " << m_timeCut ); + m_accept.addCut("goodMBTSTime","good MBTS timing"); + } + + m_accept.addCut("hasPrimaryVertex","has at least one primary vertex"); + + m_accept.addCut("pileupVeto","reject events with topological features indicating pileup"); + + if (m_vertexSelectionTool.empty()) + { +#ifdef ROOTCORE + HI::HIVertexSelectionTool* vxSelTool = new HIVertexSelectionTool("HIVxSel"); + ATH_CHECK( vxSelTool->initialize() ); + m_vertexSelectionTool = ToolHandle<HI::IHIVertexSelectionTool>(vxSelTool); +#endif + } + ATH_CHECK( m_vertexSelectionTool.retrieve() ); + + if (m_hiPileupTool.empty()) + { +#ifdef ROOTCORE + HI::HIPileupTool* m_hipileuptool = new HIPileupTool("HIpileup"); + ATH_CHECK( m_hipileuptool->initialize() ); + m_hiPileupTool = ToolHandle<HI::IHIPileupTool>(m_hipileuptool); +#endif + } + ATH_CHECK( m_hiPileupTool.retrieve() ); + + return StatusCode::SUCCESS; + } + + StatusCode HIEventSelectionTool::finalize() +{ + + ATH_MSG_INFO( "Finalizing event selection tool." ); + return StatusCode::SUCCESS; + +} + +const asg::AcceptInfo& HIEventSelectionTool::getAcceptInfo() const + { + asg::AcceptData acceptData ( &m_accept ); + if(m_checkTime){ + checkMBTSTime( acceptData ); + } + checkVertex( acceptData ); + return m_accept; + } + + //R.Longo - 14/10/2019 - From checkMBTSTime to checkMBTSTime( asg::AcceptData& acceptData ) + void HIEventSelectionTool::checkMBTSTime( asg::AcceptData& acceptData ) const + { + const xAOD::ForwardEventInfoContainer* forwardEventInfoContainer = 0; + if(evtStore()->retrieve(forwardEventInfoContainer,m_FWD_CNAME).isFailure()) + { + ATH_MSG_ERROR("Could not retrieve ForwardEventInfo object w/ name " << m_FWD_CNAME); + return; + } + + acceptData.setCutResult("goodMBTSTime",false); + const xAOD::ForwardEventInfo* forwardEventInfo = forwardEventInfoContainer->at(0); + int countA = forwardEventInfo->countA(); + int countC = forwardEventInfo->countC(); + float timeA = forwardEventInfo->timeA(); + float timeC = forwardEventInfo->timeC(); + + if (countA==0||countC==0) return; // if either time undefined, return false; + + float timeDiff = timeA - timeC; + + if ( (std::abs(timeDiff)<m_timeCut) ) acceptData.setCutResult("goodMBTSTime",true); + + return; + } + + + //R.Longo - 14/10/2019 - Introducting acceptData instead of m_accept + std::string HIEventSelectionTool::dumpSelection() const + { + asg::AcceptData acceptData ( &m_accept ); + std::stringstream ss; + for(unsigned int icut=0; icut < acceptData.getNCuts(); icut++) + { + std::string cname=acceptData.getCutName(icut); + ss << std::setw(15) << cname + << std::setw(10) << acceptData.getCutResult(cname) + << std::setw(40) << acceptData.getCutDescription(cname) + << std::endl; + } + return ss.str(); + } + +//R.Longo - 14/10/2019 - From checkVertex to checkVertex( asg::AcceptData& acceptData ) +void HIEventSelectionTool::checkVertex( asg::AcceptData& acceptData ) const + { + unsigned int numPrimaryVertices=getNPrimaryVertices(); + acceptData.setCutResult("hasPrimaryVertex", (numPrimaryVertices > 0) ); + + const xAOD::ZdcModuleContainer* zdcMod = 0; + if(evtStore()->retrieve(zdcMod,m_ZDC_CNAME).isFailure()) + { + ATH_MSG_ERROR("Could not retrieve ZdcModule object w/ name " << m_ZDC_CNAME); + return; + } + + const xAOD::HIEventShapeContainer* hiev = 0; + if(evtStore()->retrieve(hiev,m_SHAPE_CNAME).isFailure()) + { + ATH_MSG_ERROR("Could not retrieve HIEventShape object w/ name " << m_SHAPE_CNAME); + return; + } + + if (m_reject_pileup) acceptData.setCutResult("pileupVeto", m_hiPileupTool->is_pileup( *hiev, *zdcMod )); + else acceptData.setCutResult("pileupVeto", true ); + + + return; + } + + +unsigned int HIEventSelectionTool::getNPrimaryVertices() const + { + unsigned int nPriVx = 0; + + const xAOD::VertexContainer* pv_container = 0; + if(evtStore()->retrieve(pv_container,m_VERTEX_CNAME).isFailure()) + { + ATH_MSG_ERROR("Could not retrieve VertexContainer object w/ name " << m_VERTEX_CNAME); + return 0; + } + //if( pv_container->size() < 2) return 0; + + for(const auto vert: *pv_container) + { + if (m_vertexSelectionTool->accept(*vert)) nPriVx++; + } + + return nPriVx; + + } + +} // HI diff --git a/PhysicsAnalysis/HeavyIonPhys/HIEventUtils/Root/HIEventShapeIndex.cxx b/PhysicsAnalysis/HeavyIonPhys/HIEventUtils/Root/HIEventShapeIndex.cxx index 3419e43edf11dfb55aaaf6f8467146e8ab925437..971ac86492d9ba09940594882bb3ff648aaa497c 100644 --- a/PhysicsAnalysis/HeavyIonPhys/HIEventUtils/Root/HIEventShapeIndex.cxx +++ b/PhysicsAnalysis/HeavyIonPhys/HIEventUtils/Root/HIEventShapeIndex.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ #include "HIEventUtils/HIEventShapeIndex.h" @@ -8,264 +8,270 @@ #include <sstream> #include <iostream> #include <cmath> +#include <algorithm> +#include <iterator> HIEventShapeIndex::HIEventShapeIndex() : m_shape_container(nullptr), m_size(0) { } -HIEventShapeIndex::~HIEventShapeIndex() +HIEventShapeIndex::~HIEventShapeIndex() { } + unsigned int HIEventShapeIndex::setBinning(const xAOD::HIEventShapeContainer* shape) { - if(shape!=nullptr && shape!=m_shape_container) - { - //ATH_MSG_WARNING("Resetting binning on different HIEventShapeContainer"); - } - else if(shape==nullptr) - { - //ATH_MSG_ERROR("Bad HIEventShapePointer."); - return 0; - } - else if(getNumBins()==shape->size()) - { - //ATH_MSG_INFO("Binning already synched this with HIEventShapeContainer."); - return getNumBins(); - } - - //assume contiguous non-overlapping eta bins - unsigned int index=0; - for(; index<shape->size(); index++) - { - const xAOD::HIEventShape* s=shape->at(index); - int layer=s->layer(); - float eta_min=s->etaMin(); - float eta_max=s->etaMax(); - - auto mItr=m_edges.emplace_hint(m_edges.end(),layer,std::vector<range_index_t>()); - mItr->second.push_back(range_index_t(eta_min,eta_max,index)); - } - for(auto pp : m_edges) std::sort( pp.second.begin(),pp.second.end() ); - m_shape_container=shape; - m_size=index; - return index; + if(shape!=nullptr && shape!=m_shape_container) + { + //ATH_MSG_WARNING("Resetting binning on different HIEventShapeContainer"); + } + else if(shape==nullptr) + { + //ATH_MSG_ERROR("Bad HIEventShapePointer."); + return 0; + } + else if(getNumBins()==shape->size()) + { + //ATH_MSG_INFO("Binning already synched this with HIEventShapeContainer."); + return getNumBins(); + } + + //assume contiguous non-overlapping eta bins + unsigned int index=0; + for(; index<shape->size(); index++) + { + const xAOD::HIEventShape* s=shape->at(index); + int layer=s->layer(); + float eta_min=s->etaMin(); + float eta_max=s->etaMax(); + + auto mItr=m_edges.emplace_hint(m_edges.end(),layer,std::vector<range_index_t>()); + mItr->second.push_back(range_index_t(eta_min,eta_max,index)); + } + for(auto pp : m_edges) std::sort( pp.second.begin(),pp.second.end() ); + m_shape_container=shape; + m_size=index; + return index; } unsigned int HIEventShapeIndex::setBinning(const TH2* h2, bool asMask) { - if(h2==nullptr) - { - //ATH_MSG_ERROR("Bad histogram pointer"); - return 0; - } - - unsigned int count=0; - std::set<unsigned int> used_indices; - for(int ybin=1; ybin<h2->GetNbinsY(); ybin++) - { - auto mItr=m_edges.emplace_hint(m_edges.end(),ybin-1,std::vector<range_index_t>()); - for(int xbin=1; xbin<h2->GetNbinsX(); xbin++) - { - if(h2->GetBinContent(xbin,ybin) < 0) continue; - unsigned int v=h2->GetBinContent(xbin,ybin); - - if(asMask) v=count; - else - { - auto sItr=used_indices.find(v); - if(sItr==used_indices.end()) used_indices.insert(v); - else + if(h2==nullptr) + { + //ATH_MSG_ERROR("Bad histogram pointer"); + return 0; + } + + unsigned int count=0; + std::set<unsigned int> used_indices; + for(int ybin=1; ybin<h2->GetNbinsY(); ybin++) { - //ATH_MSG_ERROR("Could not set binning. initialization histogram has duplicate indices " << v); - //m_edges.clear(); - //return 0; - continue; + auto mItr=m_edges.emplace_hint(m_edges.end(),ybin-1,std::vector<range_index_t>()); + for(int xbin=1; xbin<h2->GetNbinsX(); xbin++) + { + if(h2->GetBinContent(xbin,ybin) < 0) continue; + unsigned int v=h2->GetBinContent(xbin,ybin); + + if(asMask) v=count; + else + { + auto sItr=used_indices.find(v); + if(sItr==used_indices.end()) used_indices.insert(v); + else + { + //ATH_MSG_ERROR("Could not set binning. initialization histogram has duplicate indices " << v); + //m_edges.clear(); + //return 0; + continue; + } + } + mItr->second.push_back(range_index_t(h2->GetXaxis()->GetBinLowEdge(xbin),h2->GetXaxis()->GetBinUpEdge(xbin),v)); + count++; + } } - } - mItr->second.push_back(range_index_t(h2->GetXaxis()->GetBinLowEdge(xbin),h2->GetXaxis()->GetBinUpEdge(xbin),v)); - count++; - } - } - m_size=count; - return count; + m_size=count; + return count; } unsigned int HIEventShapeIndex::setBinning(HIEventShapeIndex::BinningScheme scheme) { - unsigned int index=0; - if(scheme==TOWER) - { - for(unsigned int layer=0; layer < static_cast<int>(HI::TowerBins::numLayers()); layer++) - { - auto mItr=m_edges.emplace_hint(m_edges.end(),layer,std::vector<range_index_t>(HI::TowerBins::numEtaBins(),range_index_t())); - for(unsigned int eb=0; eb<HI::TowerBins::numEtaBins(); eb++,index++) - { - - mItr->second[eb].eta_min=HI::TowerBins::getBinLowEdgeEta(eb); - mItr->second[eb].eta_max=HI::TowerBins::getBinUpEdgeEta(eb); - mItr->second[eb].index=index; - } - } - } - else if(scheme==COMPACT) - { - float deta=HI::TowerBins::getBinSizeEta(); - for(int layer=0; layer < static_cast<int>(HI::TowerBins::numLayers()); layer++) - { - float emax=HICaloRange::getRange().getRangeMax(layer); - float emin=HICaloRange::getRange().getRangeMin(layer); - unsigned int num_eta_bins= static_cast<unsigned int>(std::round(std::abs((emax-emin)/deta))); - auto mItr=m_edges.emplace_hint(m_edges.end(),layer,std::vector<range_index_t>(2*num_eta_bins,range_index_t())); - for(unsigned int k=0; k<num_eta_bins; k++) - { - mItr->second[k].eta_min=roundToTenth(-emax+k*deta); - mItr->second[k].eta_max=roundToTenth(-emax+k*deta+deta); - mItr->second[k].index=roundToTenth(k+index); - mItr->second[k+num_eta_bins].eta_min=roundToTenth(emin+k*deta); - mItr->second[k+num_eta_bins].eta_max=roundToTenth(emin+k*deta+deta); - mItr->second[k+num_eta_bins].index=roundToTenth(k+num_eta_bins+index); - } - index+=2*num_eta_bins; - } - } - m_size=index; - return index; + unsigned int index=0; + if(scheme==TOWER) + { + for(unsigned int layer=0; layer < static_cast<int>(HI::TowerBins::numLayers()); layer++) + { + auto mItr=m_edges.emplace_hint(m_edges.end(),layer,std::vector<range_index_t>(HI::TowerBins::numEtaBins(),range_index_t())); + for(unsigned int eb=0; eb<HI::TowerBins::numEtaBins(); eb++,index++) + { + + mItr->second[eb].eta_min=HI::TowerBins::getBinLowEdgeEta(eb); + mItr->second[eb].eta_max=HI::TowerBins::getBinUpEdgeEta(eb); + mItr->second[eb].index=index; + } + } + } + else if(scheme==COMPACT) + { + float deta=HI::TowerBins::getBinSizeEta(); + for(int layer=0; layer < static_cast<int>(HI::TowerBins::numLayers()); layer++) + { + float emax=HICaloRange::getRange().getRangeMax(layer); + float emin=HICaloRange::getRange().getRangeMin(layer); + unsigned int num_eta_bins= static_cast<unsigned int>(std::round(std::abs((emax-emin)/deta))); + auto mItr=m_edges.emplace_hint(m_edges.end(),layer,std::vector<range_index_t>(2*num_eta_bins,range_index_t())); + for(unsigned int k=0; k<num_eta_bins; k++) + { + mItr->second[k].eta_min=roundToTenth(-emax+k*deta); + mItr->second[k].eta_max=roundToTenth(-emax+k*deta+deta); + mItr->second[k].index=roundToTenth(k+index); + mItr->second[k+num_eta_bins].eta_min=roundToTenth(emin+k*deta); + mItr->second[k+num_eta_bins].eta_max=roundToTenth(emin+k*deta+deta); + mItr->second[k+num_eta_bins].index=roundToTenth(k+num_eta_bins+index); + } + index+=2*num_eta_bins; + } + } + m_size=index; + return index; } unsigned int HIEventShapeIndex::getIndexFromBin(unsigned int ebin, int layer) const { - return getLayer(layer)->second.at(ebin).index; + return getLayer(layer)->second.at(ebin).index; } unsigned int HIEventShapeIndex::getIndex_Internal(float eta, int layer, bool etaIndex) const { - auto mItr=getLayer(layer); - const std::vector<range_index_t>& vec=mItr->second; - unsigned int vsize=vec.size(); - - if(vsize==0) - { - std::cerr << "Layer " << layer << " has no range in calorimeter" << std::endl; - throw std::range_error("Bad binning request"); - return 0; - } - - float eta_c=eta; - float abs_eta=std::abs(eta); - float rmin=HICaloRange::getRange().getRangeMin(layer); - float rmax=HICaloRange::getRange().getRangeMax(layer); - if(abs_eta < rmin) eta_c=rmin-std::copysign(1e-2,eta); - else if(abs_eta > rmax) eta_c=rmax-std::copysign(1e-2,eta); - - unsigned int pIndex=0; - for(; pIndex < vsize-1; pIndex++) - { - const range_index_t& p=vec.at(pIndex); - if(p(eta_c)) break; - } - return (etaIndex) ? pIndex : vec.at(pIndex).index; - + auto mItr=getLayer(layer); + const std::vector<range_index_t>& vec=mItr->second; + unsigned int vsize=vec.size(); + + if(vsize==0) + { + std::cerr << "Layer " << layer << " has no range in calorimeter" << std::endl; + throw std::range_error("Bad binning request"); + return 0; + } + + float eta_c=eta; + if(m_edges.size()>1) + { + float abs_eta=std::abs(eta); + float rmin=HICaloRange::getRange().getRangeMin(layer); + float rmax=HICaloRange::getRange().getRangeMax(layer); + if(abs_eta < rmin) eta_c=rmin-std::copysign(1e-2,eta); + else if(abs_eta > rmax) eta_c=rmax-std::copysign(1e-2,eta); + } + + unsigned int pIndex=0; + for(; pIndex < vsize-1; pIndex++) + { + const range_index_t& p=vec.at(pIndex); + if(p(eta_c)) break; + } + return (etaIndex) ? pIndex : vec.at(pIndex).index; + } unsigned int HIEventShapeIndex::getIndex(float eta, int layer) const { - return getIndex_Internal(eta,layer,false); + return getIndex_Internal(eta,layer,false); } unsigned int HIEventShapeIndex::getEtaBin(float eta, int layer) const { - return getIndex_Internal(eta,layer,true); + return getIndex_Internal(eta,layer,true); } xAOD::HIEventShape* HIEventShapeIndex::getShape(float eta, int layer, xAOD::HIEventShapeContainer* shape_container) const { - if(shape_container==nullptr) - { - //ATH_MSG_WARNING("No default HIEventShapeContainer to query. Returning nullptr_t."); - return nullptr; - } - unsigned int bin=getIndex(eta,layer); - //correct for round-off errors in cell eta values, just need to make sure they end up in the right bin - if( bin >= shape_container->size() ) bin=getIndex(eta-std::copysign(1e-2,eta),layer); + if(shape_container==nullptr) + { + //ATH_MSG_WARNING("No default HIEventShapeContainer to query. Returning nullptr_t."); + return nullptr; + } + unsigned int bin=getIndex(eta,layer); + //correct for round-off errors in cell eta values, just need to make sure they end up in the right bin + if( bin >= shape_container->size() ) bin=getIndex(eta-std::copysign(1e-2,eta),layer); - return shape_container->at(bin); + return shape_container->at(bin); } const xAOD::HIEventShape* HIEventShapeIndex::getShape(float eta, int layer, const xAOD::HIEventShapeContainer* shape_container) const { - if(shape_container==nullptr) - { - //ATH_MSG_WARNING("No default HIEventShapeContainer to query. Returning nullptr_t."); - return nullptr; - } - unsigned int bin=getIndex(eta,layer); - //correct for round-off errors in cell eta values, just need to make sure they end up in the right bin - if( bin >= shape_container->size() ) bin=getIndex(eta-std::copysign(1e-2,eta),layer); + if(shape_container==nullptr) + { + //ATH_MSG_WARNING("No default HIEventShapeContainer to query. Returning nullptr_t."); + return nullptr; + } + unsigned int bin=getIndex(eta,layer); + //correct for round-off errors in cell eta values, just need to make sure they end up in the right bin + if( bin >= shape_container->size() ) bin=getIndex(eta-std::copysign(1e-2,eta),layer); - return shape_container->at(bin); + return shape_container->at(bin); } std::map<int,std::vector<HIEventShapeIndex::range_index_t> >::const_iterator HIEventShapeIndex::getLayer(int layer) const { - auto mItr=m_edges.find(layer); - - if(mItr==m_edges.end()) - { - //ATH_MSG_ERROR("Layer " << layer << " has no binning specification"); - std::cerr << "Layer " << layer << " has no binning specification" << std::endl; - throw std::range_error("Bad binning request"); - } - return mItr; + auto mItr=m_edges.find(layer); + + if(mItr==m_edges.end()) + { + //ATH_MSG_ERROR("Layer " << layer << " has no binning specification"); + std::cerr << "Layer " << layer << " has no binning specification" << std::endl; + throw std::range_error("Bad binning request"); + } + return mItr; } void HIEventShapeIndex::initializeEventShapeContainer(xAOD::HIEventShapeContainer* shape_container, unsigned int num_harmonics) const { - if(shape_container==nullptr) - { - //ATH_MSG_WARNING("Bad pointer to HIEventShapeContainer. Cannot inititalize its elements."); - return; - } - if(getNumBins()==0) - { - //ATH_MSG_WARNING("Cannot initialize HIEventShapeContainer. Index has not been initialized."); - return; - - } - bool isEmpty=(shape_container->size()==0); - if(isEmpty) shape_container->resize(getNumBins()); - else if(shape_container->size()!=getNumBins()) - { - //ATH_MSG_WARNING("Cannot initialize HIEventShapeContainer. Number of elements incompatible w/ requested binning."); - return; - - } - - for(auto pp : m_edges) - { - for(auto ri : pp.second) - { - xAOD::HIEventShape* slice; - if(isEmpty) - { - slice=new xAOD::HIEventShape(); - //shape_container->push_back(slice); - shape_container->operator[](ri.index)=slice; - } - else slice=shape_container->at(ri.index); - - slice->setEtaMin(ri.eta_min); - slice->setEtaMax(ri.eta_max); - slice->setLayer(pp.first); - slice->etCos().assign(num_harmonics,0); - slice->etSin().assign(num_harmonics,0); - } - } + if(shape_container==nullptr) + { + //ATH_MSG_WARNING("Bad pointer to HIEventShapeContainer. Cannot inititalize its elements."); + return; + } + if(getNumBins()==0) + { + //ATH_MSG_WARNING("Cannot initialize HIEventShapeContainer. Index has not been initialized."); + return; + + } + bool isEmpty=(shape_container->size()==0); + if(isEmpty) shape_container->resize(getNumBins()); + else if(shape_container->size()!=getNumBins()) + { + //ATH_MSG_WARNING("Cannot initialize HIEventShapeContainer. Number of elements incompatible w/ requested binning."); + return; + + } + + for(auto pp : m_edges) + { + for(auto ri : pp.second) + { + xAOD::HIEventShape* slice; + if(isEmpty) + { + slice=new xAOD::HIEventShape(); + //shape_container->push_back(slice); + shape_container->operator[](ri.index)=slice; + } + else slice=shape_container->at(ri.index); + + slice->setEtaMin(ri.eta_min); + slice->setEtaMax(ri.eta_max); + slice->setLayer(pp.first); + slice->etCos().assign(num_harmonics,0); + slice->etSin().assign(num_harmonics,0); + } + } } // HIEventShapeIndex& HIEventShapeIndex::operator=(const HIEventShapeIndex& in) @@ -278,18 +284,18 @@ void HIEventShapeIndex::initializeEventShapeContainer(xAOD::HIEventShapeContaine std::string HIEventShapeIndex::print() const { - std::stringstream ss; - ss.precision(3); - for(auto pp : m_edges) - { - for(auto ri : pp.second) - { - ss << std::setw(10) << pp.first - << std::setw(10) << ri.eta_min - << std::setw(10) << ri.eta_max - << std::setw(10) << ri.index - << std::endl; - } - } - return ss.str(); + std::stringstream ss; + ss.precision(3); + for(auto pp : m_edges) + { + for(auto ri : pp.second) + { + ss << std::setw(10) << pp.first + << std::setw(10) << ri.eta_min + << std::setw(10) << ri.eta_max + << std::setw(10) << ri.index + << std::endl; + } + } + return ss.str(); } diff --git a/PhysicsAnalysis/HeavyIonPhys/HIEventUtils/Root/HIEventShapeMap.cxx b/PhysicsAnalysis/HeavyIonPhys/HIEventUtils/Root/HIEventShapeMap.cxx index 717afd89d05a127cf10fe82e47240b5415edfa45..3ac5b1f230b02e4736bf65ddf3a853decfb59fcc 100644 --- a/PhysicsAnalysis/HeavyIonPhys/HIEventUtils/Root/HIEventShapeMap.cxx +++ b/PhysicsAnalysis/HeavyIonPhys/HIEventUtils/Root/HIEventShapeMap.cxx @@ -11,7 +11,7 @@ HIEventShapeMap* HIEventShapeMap::getMap() { return &s_obj; } - + const HIEventShapeIndex* HIEventShapeMap::insert(std::string key, const HIEventShapeIndex& index, bool clobber) { std::map<std::string,HIEventShapeIndex>::iterator mItr=s_obj.m_map.find(key); diff --git a/PhysicsAnalysis/HeavyIonPhys/HIEventUtils/Root/HIPileupTool.cxx b/PhysicsAnalysis/HeavyIonPhys/HIEventUtils/Root/HIPileupTool.cxx new file mode 100644 index 0000000000000000000000000000000000000000..aefeeaa39d3e8d49f436085af321c5f611b98819 --- /dev/null +++ b/PhysicsAnalysis/HeavyIonPhys/HIEventUtils/Root/HIPileupTool.cxx @@ -0,0 +1,205 @@ +/* + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration +*/ + +// HIPileupTool.cxx + +#include "HIEventUtils/HIPileupTool.h" +#include "xAODForward/ZdcModule.h" +#include "xAODForward/ZdcModuleContainer.h" +#include "xAODForward/ZdcModuleAuxContainer.h" +#include "xAODTrigL1Calo/TriggerTowerContainer.h" + +#include <xAODHIEvent/HIEventShape.h> +#include <xAODHIEvent/HIEventShapeContainer.h> + +#include "TSystem.h" +#include "TH1D.h" +#include "TH2D.h" +#include "TFile.h" +#include <vector> +#include <exception> + +namespace HI + +{ + +HIPileupTool::HIPileupTool( const std::string& myname) : AsgTool(myname), + m_accept("HIPileup") + { + declareProperty("EtCutAndPurity", m_etCutAndPurity, "Et and purity for efficiency calculation"); + declareProperty("inpFilePath", m_fname, "Calibration file path"); + + m_setup = 0; +} + +HIPileupTool::~HIPileupTool() { + + if (m_setup) { + delete m_hEvents; delete m_hPileUp; + delete m_hCut; delete m_hEff; delete m_hPurity; + } +} + +StatusCode HIPileupTool::initialize() { + + ATH_MSG_VERBOSE( "Initialising tool " << name() ); + + m_accept.addCut("pileupVeto","for pileup rejection"); + + const char* fullInpFilePath; + if (!m_fname.empty()) fullInpFilePath = gSystem->ExpandPathName (m_fname.c_str()); + else fullInpFilePath = gSystem->ExpandPathName ("$ROOTCOREBIN/data/HIEventUtils/HIRun2PileUp_PbPb5p02_v2.root"); + if (gSystem->AccessPathName(fullInpFilePath)) throw std::invalid_argument(("File not found at \"" + (std::string)fullInpFilePath + "\"").c_str()); + + ATH_MSG_INFO(("Read pileup cuts from " + (std::string)fullInpFilePath).c_str()); + TFile* fIn = new TFile(fullInpFilePath); + + std::string hname; + hname = "hEvents"; if (!(fIn->GetListOfKeys()->Contains(hname.c_str()))) { + fIn->Close(); throw std::invalid_argument(("Expected histogram \"" + hname + "\" not found in \"" + m_fname + "\"").c_str());} + hname = "hPileUp"; if (!(fIn->GetListOfKeys()->Contains(hname.c_str()))) { + fIn->Close(); throw std::invalid_argument(("Expected histogram \"" + hname + "\" not found in \"" + m_fname + "\"").c_str());} + hname = "hCut"; if (!(fIn->GetListOfKeys()->Contains(hname.c_str()))) { + fIn->Close(); throw std::invalid_argument(("Expected histogram \"" + hname + "\" not found in \"" + m_fname + "\"").c_str());} + hname = "hEff"; if (!(fIn->GetListOfKeys()->Contains(hname.c_str()))) { + fIn->Close(); throw std::invalid_argument(("Expected histogram \"" + hname + "\" not found in \"" + m_fname + "\"").c_str());} + hname = "hPurity"; if (!(fIn->GetListOfKeys()->Contains(hname.c_str()))) { + fIn->Close(); throw std::invalid_argument(("Expected histogram \"" + hname + "\" not found in \"" + m_fname + "\"").c_str());} + + m_hEvents = (TH2D*)((TH2D*)fIn->Get("hEvents"))->Clone("hEvents_HIPileupTool"); m_hEvents->SetDirectory(0); + m_hPileUp = (TH2D*)((TH2D*)fIn->Get("hPileUp"))->Clone("hPileUp_HIPileupTool"); m_hPileUp->SetDirectory(0); + m_hCut = (TH1D*)((TH1D*)fIn->Get("hCut"))->Clone("hCut_HIPileupTool"); m_hCut->SetDirectory(0); + m_hEff = (TH1D*)((TH1D*)fIn->Get("hEff"))->Clone("hEff_HIPileupTool"); m_hEff->SetDirectory(0); + m_hPurity = (TH1D*)((TH1D*)fIn->Get("hPurity"))->Clone("hPurity_HIPileupTool"); m_hPurity->SetDirectory(0); + m_setup = 1; + + fIn->Close(); + + m_etThreshold = 6.0; + m_purityCut = -1.0; + if (!m_etCutAndPurity.empty()) { + if (m_etCutAndPurity.size()<2) ATH_MSG_WARNING("Cuts vector should have two elements. Will use default settings"); + else { + if (m_etCutAndPurity.at(1)<0 || m_etCutAndPurity.at(1)>1) ATH_MSG_WARNING("Purity cut should be between 0 and 1. Will use default settings"); + else { + m_etThreshold = m_etCutAndPurity.at(0); + m_purityCut = m_etCutAndPurity.at(1); + if (fabs(m_purityCut-1)<1e-6) m_purityCut -= 1e-3; + } + } + } + + if (m_purityCut<0) { + ATH_MSG_INFO("ET threshold for purity cut = NONE"); + ATH_MSG_INFO("Purity cut = DEFAULT"); + } + else { + ATH_MSG_INFO("ET threshold for purity cut = " << m_etThreshold << " TeV"); + ATH_MSG_INFO("Purity cut = " << m_purityCut ); + } + + for (int ibx=0;ibx<m_hPileUp->GetNbinsX();ibx++) { + if (m_hPileUp->GetXaxis()->GetBinCenter(ibx+1) < m_etThreshold) continue; + int NY = m_hPileUp->GetNbinsY(); + if (m_hPileUp->Integral(ibx+1,ibx+1,1,NY) == 0) {m_hCut->SetBinContent(ibx+1,0); continue;} + //Cut on 5.0 because efficiency is calculated only for FCal < 5 TeV + if (m_hPileUp->GetXaxis()->GetBinCenter(ibx+1)>5.0 && fabs(m_purityCut-1)<1e-6) {m_hCut->SetBinContent(ibx+1,0); continue;} + for (int iby=0;iby<NY;iby++) { + if (m_hPileUp->Integral(ibx+1,ibx+1,NY-iby,NY)/m_hPileUp->Integral(ibx+1,ibx+1,1,NY) < m_purityCut) continue; + m_hCut->SetBinContent(ibx+1,m_hPileUp->GetYaxis()->GetBinCenter(NY-iby)); break; + } + } + + for (int ibx=0;ibx<m_hEvents->GetNbinsX();ibx++) { + if (m_hEvents->GetXaxis()->GetBinCenter(ibx+1) < m_etThreshold) {m_hEff->SetBinContent(ibx+1,1-m_hEff->GetBinContent(ibx+1)); continue;} + double cut = m_hEvents->Integral(ibx+1,ibx+1,m_hEvents->GetYaxis()->FindBin(m_hCut->GetBinContent(ibx+1)), m_hEvents->GetNbinsY()); + double all = m_hEvents->Integral(ibx+1,ibx+1,1,m_hEvents->GetYaxis()->GetNbins()) - m_hPileUp->Integral(ibx+1,ibx+1,1,m_hPileUp->GetYaxis()->GetNbins()); + double pu_cut = m_hPileUp->Integral(ibx+1,ibx+1,m_hPileUp->GetYaxis()->FindBin(m_hCut->GetBinContent(ibx+1)), m_hPileUp->GetNbinsY()); + double pu_all = m_hPileUp->Integral(ibx+1,ibx+1,1,m_hPileUp->GetYaxis()->GetNbins()); + double eff = 1 - (cut - pu_cut)/all; if ((cut - pu_cut) < 0) eff=1; + double pty = pu_cut/pu_all; + if (all!=0) m_hEff->SetBinContent(ibx+1,eff); + if (pu_all!=0) m_hPurity->SetBinContent(ibx+1,pty); + } + + return StatusCode::SUCCESS; +} + +bool HIPileupTool::is_pileup(const xAOD::HIEventShapeContainer& evShCont, const xAOD::ZdcModuleContainer& ZdcCont) const { + + bool kPileup = false; + double FCal_Et = get_et(evShCont); + double nNeutrons; + nNeutrons = get_nNeutrons(ZdcCont); + if (nNeutrons > m_hCut->GetBinContent(m_hCut->FindBin(FCal_Et))) kPileup = true; + + return kPileup; +} + +double HIPileupTool::get_efficiency(const xAOD::HIEventShapeContainer& evShCont, double FCal_Et) const{ + + FCal_Et = get_et(evShCont); + return m_hEff->GetBinContent(m_hEff->FindBin(FCal_Et)); +} + +double HIPileupTool::get_purity(const xAOD::HIEventShapeContainer& evShCont, double& FCal_Et) { + + FCal_Et = get_et(evShCont); + return m_hPurity->GetBinContent(m_hPurity->FindBin(FCal_Et)); +} + + +double HIPileupTool::get_et(const xAOD::HIEventShapeContainer& evShCont) const{ + double Fcal_Et=0; + Fcal_Et = evShCont.at(5)->et()*1e-6; + return Fcal_Et; +} + +double HIPileupTool::get_nNeutrons(const xAOD::ZdcModuleContainer& ZdcCont) const{ + + bool isCalib=1; + double ZdcE=0; + for (const auto *zdcModule : ZdcCont) { + if (zdcModule->type()!=0) continue; + + if (!(zdcModule->isAvailable<float>("CalibEnergy"))) {isCalib = 0; continue;} + float modE = zdcModule->auxdecor<float>("CalibEnergy"); + ZdcE += modE; + } + if (!isCalib) throw std::invalid_argument("ZDC Module not Calibrated"); + + return ZdcE/m_npeak; +} + +void HIPileupTool::print() const { + AsgTool::print(); + if (m_purityCut<0) { + ATH_MSG_INFO("ET threshold for purity cut = NONE"); + ATH_MSG_INFO("Purity cut = DEFAULT"); + } + else { + ATH_MSG_INFO("ET threshold for purity cut = " << m_etThreshold << " TeV"); + ATH_MSG_INFO("Purity cut = " << m_purityCut ); + } +} + +void HIPileupTool::write(TFile* fOut) const { + + fOut->cd(0); + m_hEvents->Write(); + m_hPileUp->Write(); + m_hCut->Write(); + m_hEff->Write(); + m_hPurity->Write(); +} +//R.Longo 13-10-2019 - Replacing PATCore/TAccept (inherited from 21.0 HI-equalization) +const asg::AcceptInfo& HIPileupTool::getAcceptInfo(const xAOD::HIEventShapeContainer& evShCont, const xAOD::ZdcModuleContainer& ZdcCont) const +{ + asg::AcceptData(&m_accept).clear(); + bool pileup_dec = !is_pileup(evShCont, ZdcCont); + asg::AcceptData(&m_accept).setCutResult("pileupVeto", pileup_dec); + return m_accept; +} + +} // HI diff --git a/PhysicsAnalysis/HeavyIonPhys/HIEventUtils/Root/HITowerWeightTool.cxx b/PhysicsAnalysis/HeavyIonPhys/HIEventUtils/Root/HITowerWeightTool.cxx new file mode 100644 index 0000000000000000000000000000000000000000..1159f05437de616cf56207a48263a842429b9773 --- /dev/null +++ b/PhysicsAnalysis/HeavyIonPhys/HIEventUtils/Root/HITowerWeightTool.cxx @@ -0,0 +1,169 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +#include "HIEventUtils/HITowerWeightTool.h" +#include "PathResolver/PathResolver.h" +#include "xAODEventInfo/EventInfo.h" +#include <TH3F.h> +#include <TFile.h> +#include <sstream> +#include <iostream> +#include <iomanip> + +HITowerWeightTool::HITowerWeightTool(const std::string& n) : asg::AsgTool(n), + m_init(false), + m_h3W(nullptr), + m_h3Eta(nullptr), + m_h3Phi(nullptr), + m_h3Mag(nullptr), + m_h3EtaPhiResponse(nullptr), + m_h3EtaPhiOffset(nullptr), + m_runNumber(0), + m_runIndex(0) + +{ + declareProperty("ApplyCorrection",m_applycorrection=true,"If false unit weigts are applied"); + declareProperty("InputFile",m_inputFile="cluster.geo.HIJING_2018.root","File containing cluster geometric moments."); + declareProperty("ConfigDir",m_configDir="HIJetCorrection/","Directory containing configuration file."); +} + + +float HITowerWeightTool::getWeight(float eta, float phi, int sample) const +{ + return m_h3W->GetBinContent(m_h3W->FindBin(eta,phi,sample)); +} +float HITowerWeightTool::getWeightEta(float eta, float phi, int sample) const +{ + return m_h3Eta->GetBinContent(m_h3Eta->FindBin(eta,phi,sample)); +} +float HITowerWeightTool::getWeightPhi(float eta, float phi, int sample) const +{ + return m_h3Phi->GetBinContent(m_h3Phi->FindBin(eta,phi,sample)); +} +float HITowerWeightTool::getWeightMag(float eta, float phi, int sample) const +{ + return m_h3Mag->GetBinContent(m_h3Mag->FindBin(eta,phi,sample)); +} + +float HITowerWeightTool::getEtaPhiResponse(float eta, float phi) const +{ + if(m_runIndex==0) return 1; + + int eb=m_h3EtaPhiResponse->GetXaxis()->FindBin(eta); + int pb=m_h3EtaPhiResponse->GetYaxis()->FindBin(phi); + float rv=m_h3EtaPhiResponse->GetBinContent(eb,pb,m_runIndex); + return rv; +} + +float HITowerWeightTool::getEtaPhiOffset(float eta, float phi) const +{ + if(m_runIndex==0) return 0; + int eb=m_h3EtaPhiOffset->GetXaxis()->FindBin(eta); + int pb=m_h3EtaPhiOffset->GetYaxis()->FindBin(phi); + return m_h3EtaPhiOffset->GetBinContent(eb,pb,m_runIndex)*std::cosh(eta); +} + +StatusCode HITowerWeightTool::configureEvent() +{ + if (!m_applycorrection){ + m_runIndex=0; + ATH_MSG_DEBUG("Using unit weights and doing no eta-phi correction."); + return StatusCode::SUCCESS; + } + + const xAOD::EventInfo* ei=nullptr; + if(evtStore()->retrieve(ei,"EventInfo").isFailure()) + { + ATH_MSG_ERROR("Could not retrieve EventInfo"); + return StatusCode::FAILURE; + } + unsigned int run_number=ei->runNumber(); + + if(m_runNumber!=run_number) + { + auto itr=m_runMap.find(run_number); + if(itr==m_runMap.end()) + { + m_runIndex=0; + ATH_MSG_WARNING("No calibration avaliable for " << run_number << ". Doing no eta-phi correction."); + } + else m_runIndex=itr->second; + m_runNumber=run_number; + } + return StatusCode::SUCCESS; +} + +StatusCode HITowerWeightTool::initialize() +{ + if(m_init) return StatusCode::SUCCESS; + std::string local_path=m_configDir+m_inputFile; + std::string full_path=PathResolverFindCalibFile(local_path); + ATH_MSG_INFO("Reading input file "<< m_inputFile << " from " << full_path); + TFile* f=TFile::Open(full_path.c_str()); + if(f==nullptr) + { + ATH_MSG_FATAL("Cannot read config file " << full_path ); + return StatusCode::FAILURE; + } + + m_h3W=(TH3F*)f->GetObjectChecked("h3_w","TH3F"); + if(m_h3W==nullptr) + { + ATH_MSG_FATAL("Cannot find TH3F m_h3W in config file " << full_path ); + return StatusCode::FAILURE; + } + + m_h3Eta=(TH3F*)f->GetObjectChecked("h3_eta","TH3F"); + if(m_h3Eta==nullptr) + { + ATH_MSG_FATAL("Cannot find TH3F m_h3Eta in config file " << full_path ); + return StatusCode::FAILURE; + } + + m_h3Phi=(TH3F*)f->GetObjectChecked("h3_phi","TH3F"); + if(m_h3Phi==nullptr) + { + ATH_MSG_FATAL("Cannot find TH3F m_h3Phi in config file " << full_path ); + return StatusCode::FAILURE; + } + + m_h3Mag=(TH3F*)f->GetObjectChecked("h3_R","TH3F"); + if(m_h3Mag==nullptr) + { + ATH_MSG_FATAL("Cannot find TH3F m_h3Mag in config file " << full_path ); + return StatusCode::FAILURE; + } + + m_h3W->SetDirectory(0); + m_h3Eta->SetDirectory(0); + m_h3Phi->SetDirectory(0); + m_h3Mag->SetDirectory(0); + + m_h3EtaPhiResponse=(TH3F*)f->GetObjectChecked("h3_eta_phi_response","TH3F"); + if(m_h3EtaPhiResponse==nullptr) + { + ATH_MSG_FATAL("Cannot find TH3F h3_eta_phi_response in config file " << full_path ); + return StatusCode::FAILURE; + } + m_h3EtaPhiResponse->SetDirectory(0); + m_h3EtaPhiOffset=(TH3F*)f->GetObjectChecked("h3_eta_phi_offset","TH3F"); + if(m_h3EtaPhiOffset==nullptr) + { + ATH_MSG_FATAL("Cannot find TH3F h3_eta_phi_offset in config file " << full_path ); + return StatusCode::FAILURE; + } + m_h3EtaPhiOffset->SetDirectory(0); + + TH1I* h1_run_index=(TH1I*)f->GetObjectChecked("h1_run_index","TH1I"); + if(h1_run_index==nullptr) + { + ATH_MSG_FATAL("Cannot find TH3F h1_run_index in config file " << full_path ); + return StatusCode::FAILURE; + } + for(int xbin=1; xbin<h1_run_index->GetNbinsX(); xbin++) m_runMap.emplace_hint(m_runMap.end(),std::make_pair(h1_run_index->GetBinContent(xbin),xbin)); + f->Close(); + m_init=true; + return StatusCode::SUCCESS; + +} diff --git a/PhysicsAnalysis/HeavyIonPhys/HIEventUtils/Root/HIVertexSelectionTool.cxx b/PhysicsAnalysis/HeavyIonPhys/HIEventUtils/Root/HIVertexSelectionTool.cxx new file mode 100644 index 0000000000000000000000000000000000000000..8297d7ae16f523ae7af0fa2fdfaf169d45b66d22 --- /dev/null +++ b/PhysicsAnalysis/HeavyIonPhys/HIEventUtils/Root/HIVertexSelectionTool.cxx @@ -0,0 +1,124 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + + +#include "HIEventUtils/HIVertexSelectionTool.h" +#include "xAODTracking/TrackParticleContainer.h" +#include "AsgTools/Check.h" + +using std::string; + +HI::HIVertexSelectionTool::HIVertexSelectionTool( const string& name ) + : asg::AsgTool( name ) + , m_accept( "HIVertexSelection" ) +#ifndef XAOD_STANDALONE + // we don't want to give the tool a name in rootcore + , m_trkSelTool( "InDet::InDetTrackSelectionTool", this ) +#endif // XAOD_STANDALONE +{ + declareProperty( "RequirePrimary", m_requirePrimary, "Require the vertex to have type PriVtx"); + declareProperty( "MaxAbsZ", m_maxAbsZ, "Maximum absolute value of the vertex z position"); + declareProperty( "TrackSelectionTool", m_trkSelTool, "Track selection tool" ); + declareProperty( "MinNTrk", m_minNtrk, "Minimum number of associated tracks passing selection" ); + declareProperty( "MinRmsPt", m_minRmsPt, "Minimum RMS pt [MeV] of associated tracks passing selection" ); +} + +HI::HIVertexSelectionTool::~HIVertexSelectionTool() = default; + +StatusCode HI::HIVertexSelectionTool::initialize() +{ + ATH_MSG_INFO( "Initializing vertex selection tool." ); + ATH_CHECK( asg::AsgTool::initialize() ); + + + if (m_requirePrimary) { + ATH_MSG_INFO( "Requiring vertex to be a primary vertex" ); + m_accept.addCut( "type", "Whether the vertex satisfies the requirement to be a primary vertex" ); + } + else { + ATH_MSG_INFO( "NOT requiring vertex to be a primary vertex" ); + } + + if (m_maxAbsZ > 0.) { + ATH_MSG_INFO( "Maximum |z| = " << m_maxAbsZ << " mm" ); + m_accept.addCut( "z", "Whether the vertex's |z| is in an allowed range" ); + } + + if (m_minNtrk >= 0) { + m_checkTracks = true; + ATH_MSG_INFO( "Minimum Ntrk = " << m_minNtrk ); + m_accept.addCut( "ntrk", "Whether the vertex has the minimum number of tracks" ); + } + if (m_minRmsPt >= 0.) { + m_checkTracks = true; + ATH_MSG_INFO( "Minimum RMS track pt = " << m_minRmsPt << " MeV" ); + m_accept.addCut( "pt", "Whether the vertex's tracks RMS pt is sufficient" ); + } + + + return StatusCode::SUCCESS; +} + +StatusCode HI::HIVertexSelectionTool::finalize() +{ + ATH_MSG_INFO( "Finalizing vertex selection tool." ); + return StatusCode::SUCCESS; +} + +//R.Longo 13-10-2019 - Replacing PATCore/TAccept (inherited from 21.0 HI-equalization) +const asg::AcceptInfo& HI::HIVertexSelectionTool::getAcceptInfo() const +{ + // return the current TAccept object by reference. This allows users to avoid copying it. + return m_accept; +} + +asg::AcceptData HI::HIVertexSelectionTool::accept( const xAOD::IParticle* ) const +{ + asg::AcceptData acceptData (&m_accept); + ATH_MSG_ERROR( "Vertex selection tool should not be passed an IParticle." ); + throw std::invalid_argument( "Vertex selection tool given an IParticle." ); + return acceptData; +} + +asg::AcceptData HI::HIVertexSelectionTool::accept( const xAOD::Vertex& vtx ) const +{ + asg::AcceptData acceptData (&m_accept); + + if (!m_requirePrimary || vtx.vertexType() == xAOD::VxType::PriVtx) { + acceptData.setCutResult( "type", true ); + } + if (m_maxAbsZ < 0. || std::fabs( vtx.z() ) < m_maxAbsZ) { + acceptData.setCutResult( "z", true ); + } + if (m_checkTracks) { + bool countTracks = m_minNtrk >= 0; + bool countPt = m_minRmsPt >= 0.; + int nPassed = 0; // cumulative total number of tracks passed + double sumPtSq = 0.; // cumulative total of pt^2 of tracks passed + for ( const auto track : vtx.trackParticleLinks() ) { + if ( !track.isValid() ) continue; + if ( !m_trkSelTool->accept( **track, &vtx ) ) continue; + + if (countTracks) { + nPassed++; + if (nPassed >= m_minNtrk) { + acceptData.setCutResult( "ntrk", true ); + countTracks = false; // stop bothering to count + } + } + if (countPt) { + auto pt = (*track)->pt(); + sumPtSq += pt*pt; + if (sumPtSq >= m_minRmsPt*m_minRmsPt) { + acceptData.setCutResult( "pt", true); + countPt = false; // stop evaluating pt + } + } + + if (!countTracks && !countPt) break; // don't run through tracks we don't need to check + } // end loop over tracks + } + + return acceptData; +} diff --git a/PhysicsAnalysis/HeavyIonPhys/HIEventUtils/Root/ZdcRecTool.cxx b/PhysicsAnalysis/HeavyIonPhys/HIEventUtils/Root/ZdcRecTool.cxx new file mode 100644 index 0000000000000000000000000000000000000000..f27de98610f0bc1a27b2167828341a0f324eb07b --- /dev/null +++ b/PhysicsAnalysis/HeavyIonPhys/HIEventUtils/Root/ZdcRecTool.cxx @@ -0,0 +1,245 @@ +/* + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration +*/ + +#include "HIEventUtils/ZdcRecTool.h" +#include "TGraph.h" +#include "TEnv.h" +#include "TSystem.h" + +namespace ZDC +{ + + ZdcRecTool::ZdcRecTool(const std::string& name) : asg::AsgTool(name), + m_name(name), + m_init(false) + { + declareProperty("ZdcModuleContainerName",m_zdcModuleContainerName="ZdcModules","Location of ZDC processed data"); + declareProperty("ZdcRecConfigPath",m_zdcRecConfigPath="$ROOTCOREDIR/data/HIEventUtils/","ZDC Rec config file path"); + + ATH_MSG_DEBUG("Creating ZdcRecoTool named " << m_name); + ATH_MSG_INFO("ZDC config file path " << m_zdcRecConfigPath); + + } + + ZdcRecTool::~ZdcRecTool() + { + ATH_MSG_DEBUG("Deleting ZdcRecoTool named " << m_name); + } + + StatusCode ZdcRecTool::initializeTool() + { + m_init = true; + m_tf1SincInterp = new TF1("SincInterp",SincInterp,-5.,160.,8); + m_tf1SincInterp->SetNpx(300); + m_tf1FermiExpFit = new TF1("FermiExpFit",FermiExpFit,-5.,160.,7); + m_tf1FermiExpFit->SetNpx(300); + + char* path = gSystem->ExpandPathName(m_zdcRecConfigPath.c_str()); + ATH_MSG_INFO("Resolved file path " << path); + + TString zdcConf(path); + zdcConf += "/ZdcRecConfig.conf"; + + TEnv env(zdcConf); + + ATH_MSG_INFO("ZdcC calibration LG " << env.GetValue("ZdcCCalibrationLG","1.;1.;1.;1.")); + + return StatusCode::SUCCESS; + + } + + StatusCode ZdcRecTool::recoZdcModule(const xAOD::ZdcModule& module) + { + ATH_MSG_DEBUG("Processing ZDC module S/T/M/C = " + << module.side() << " " + << module.type() << " " + << module.zdcModule() << " " + << module.channel() + ); + const std::vector<unsigned short>* adc0; + const std::vector<unsigned short>* adc1; + + if (module.type()==0 && module.zdcModule()==0) // flip delay/non-delay for EM big tube + { + adc0 = &(*(module.TTg0d1Link()))->adc(); + adc1 = &(*(module.TTg1d1Link()))->adc(); + } + else + { + adc0 = &(*(module.TTg0d0Link()))->adc(); + adc1 = &(*(module.TTg1d0Link()))->adc(); + } + + float amp{}; + float time; + float qual; + + const float deltaT = 12.5; + + sigprocMaxFinder(*adc0,deltaT,amp,time,qual); + module.auxdecor<float>("amplitudeG0_mf")=amp; + module.auxdecor<float>("timeG0_mf")=time; + + sigprocMaxFinder(*adc1,deltaT,amp,time,qual); + module.auxdecor<float>("amplitudeG1_mf")=amp; + module.auxdecor<float>("timeG1_mf")=time; + + if (module.type()==0) + { + sigprocPeakFitter(*adc0,deltaT,amp,time,qual); + module.auxdecor<float>("amplitudeG0_pf")=amp; + module.auxdecor<float>("timeG0_pf")=time; + + sigprocSincInterp(*adc0,deltaT,amp,time,qual); + module.auxdecor<float>("amplitudeG0_si")=amp; + module.auxdecor<float>("timeG0_si")=time; + } + + return StatusCode::SUCCESS; +} + +StatusCode ZdcRecTool::recoZdcModules(const xAOD::ZdcModuleContainer& moduleContainer) +{ + if (!m_eventReady) + { + ATH_MSG_INFO("Event not ready for ZDC reco!"); + return StatusCode::FAILURE; + } + + for (const auto zdcModule : moduleContainer) + { + ATH_CHECK(recoZdcModule(*zdcModule)); + } + return StatusCode::SUCCESS; +} + +StatusCode ZdcRecTool::reprocessZdc() +{ + if (!m_init) + { + ATH_MSG_INFO("Tool not initialized!"); + return StatusCode::FAILURE; + } + m_eventReady = false; + ATH_CHECK(evtStore()->retrieve(m_zdcModules,m_zdcModuleContainerName)); + m_eventReady = true; + + ATH_CHECK(recoZdcModules(*m_zdcModules)); + + return StatusCode::SUCCESS; +} + +bool ZdcRecTool::sigprocMaxFinder(const std::vector<unsigned short>& adc, float deltaT, float& amp, float& time, float& qual) +{ + size_t nsamp = adc.size(); + float presamp = adc.at(0); + unsigned short max_adc = 0; + int max_index = -1; + for (size_t i = 0;i<nsamp;i++) + { + if (adc[i]>max_adc) + { + max_adc = adc[i]; + max_index = i; + } + } + amp = max_adc - presamp; + time = max_index*deltaT; + qual = 1.; + + if(max_index==-1) + { + qual=0.; + return false; + } + + return true; +} + +bool ZdcRecTool::sigprocPeakFitter(const std::vector<unsigned short>& adc, float deltaT, float& amp, float& time, float& qual) +{ + TGraph g; + size_t nsamp = adc.size(); + float presamp = adc.at(0); + unsigned short max_adc = 0; + for (size_t i = 0;i<nsamp;i++) + { + if (adc.at(i)>max_adc) + { + max_adc = adc.at(i); + } + g.SetPoint(i,i*deltaT,adc.at(i)-presamp); + } + double timeScale = deltaT/12.5; + m_tf1FermiExpFit->SetParameters(max_adc-presamp,30*timeScale, 2.5*timeScale, 25*timeScale); + m_tf1FermiExpFit->SetParLimits(0,0,1024); + m_tf1FermiExpFit->SetParLimits(1,10*timeScale,50*timeScale); + m_tf1FermiExpFit->FixParameter(2,2.5*timeScale); + m_tf1FermiExpFit->SetParLimits(3,10*timeScale,40*timeScale); + g.Fit("FermiExpFit","QWR",""); + amp = m_tf1FermiExpFit->GetMaximum(); + time = m_tf1FermiExpFit->GetMaximumX(); + qual = 1.; + return true; +} + +bool ZdcRecTool::sigprocSincInterp(const std::vector<unsigned short>& adc, float deltaT, float& amp, float& time, float& qual) +{ + size_t nsamp = adc.size(); + float presamp = adc.at(0); + m_tf1SincInterp->SetParameter(0,deltaT); + for (size_t i = 0;i<nsamp;i++) + { + m_tf1SincInterp->SetParameter(i+1,adc.at(i)-presamp); + } + amp = m_tf1SincInterp->GetMaximum(); + time = m_tf1SincInterp->GetMaximumX(); + qual = 1.; + return true; +} + +double SincInterp(double* xvec, double* pvec) +{ + // pvec are the sample values + double ret = 0; + double T = pvec[0]; // deltaT + double t = xvec[0]; + for (int isamp = 0;isamp<7;isamp++) + { + double arg = (t - isamp*T)/T; + if (arg!=0.0) + { + ret += pvec[isamp+1] * std::sin(TMath::Pi()*arg)/(TMath::Pi()*arg); + } + } + return ret; +} + +double FermiExpFit(double* xvec, double* pvec) +{ + const float offsetScale = 3; + + double t = xvec[0]; + + double amp = pvec[0]; + double t0 = pvec[1]; + double tau1 = pvec[2]; + double tau2 = pvec[3]; + + double tauRatio = tau2/tau1; + double tauRatioMinunsOne = tauRatio - 1; + + double norm = ( std::exp(-offsetScale/tauRatio)*pow(1./tauRatioMinunsOne, 1./(1 + tauRatio))/ + ( 1 + pow(1./tauRatioMinunsOne, 1./(1 + 1/tauRatio))) ); + + double deltaT = t - (t0 - offsetScale*tau1); + if (deltaT < 0) deltaT = 0; + + double expTerm = std::exp(-deltaT/tau2); + double fermiTerm = 1./(1. + std::exp(-(t - t0)/tau1)); + + return amp*expTerm*fermiTerm/norm; +} + +} // namespace ZDC diff --git a/PhysicsAnalysis/HeavyIonPhys/HIEventUtils/Root/ZdcUtils.cxx b/PhysicsAnalysis/HeavyIonPhys/HIEventUtils/Root/ZdcUtils.cxx index 005828d7ab92b4bafd779fa7b633ab66732c0eb7..08c2dc82f5852919d4a2afbcd306c61e5d326ea9 100644 --- a/PhysicsAnalysis/HeavyIonPhys/HIEventUtils/Root/ZdcUtils.cxx +++ b/PhysicsAnalysis/HeavyIonPhys/HIEventUtils/Root/ZdcUtils.cxx @@ -1,28 +1,36 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ #include "HIEventUtils/ZdcUtils.h" namespace ZDC { - float getAmplitudeSumG0(const xAOD::ZdcModuleContainer* in, std::function<bool (const xAOD::ZdcModule*)> incFunction) + float getAmplitudeSumG0(const xAOD::ZdcModuleContainer* in, std::function<bool (const xAOD::ZdcModule*)> incFunction, std::string& suffix) { float amplitude = 0; + float mod_amp; for (const auto zm : *in) - { - if (incFunction(zm)) amplitude += zm->amplitudeG0(); - } + { + if (!incFunction(zm)) continue; + + if (suffix=="") + mod_amp = zm->amplitudeG0(); + else + mod_amp = zm->auxdecor<float>("amplitudeG0"+suffix); + + amplitude += mod_amp; + } return amplitude; } - float getAmplitudeSumG1(const xAOD::ZdcModuleContainer* in, std::function<bool (const xAOD::ZdcModule*)> incFunction) + float getAmplitudeSumG1(const xAOD::ZdcModuleContainer* in, std::function<bool (const xAOD::ZdcModule*)> incFunction, std::string/* suffix*/) { float amplitude = 0; for (const auto zm : *in) - { - if (incFunction(zm)) amplitude += zm->amplitudeG1(); - } + { + if (incFunction(zm)) amplitude += zm->amplitudeG1(); + } return amplitude; } @@ -30,11 +38,11 @@ namespace ZDC { float amplitude = 0; for (const auto zm : *in) - { - if (incFunction(zm)) amplitude += zm->amplitude(); - } + { + if (incFunction(zm)) amplitude += zm->amplitude(); + } return amplitude; } - + } diff --git a/PhysicsAnalysis/HeavyIonPhys/HIEventUtils/share/cluster.geo.root b/PhysicsAnalysis/HeavyIonPhys/HIEventUtils/share/cluster.geo.root new file mode 100644 index 0000000000000000000000000000000000000000..48c7903701234541c6e05b02368a983decd07708 Binary files /dev/null and b/PhysicsAnalysis/HeavyIonPhys/HIEventUtils/share/cluster.geo.root differ diff --git a/PhysicsAnalysis/HeavyIonPhys/HIEventUtils/src/components/HIEventUtils_entries.cxx b/PhysicsAnalysis/HeavyIonPhys/HIEventUtils/src/components/HIEventUtils_entries.cxx index 48691e8858bee359990241450eefd86ce89c2f6e..dabd16d614e01a126cfcfdf93c2a233f504b4b3b 100644 --- a/PhysicsAnalysis/HeavyIonPhys/HIEventUtils/src/components/HIEventUtils_entries.cxx +++ b/PhysicsAnalysis/HeavyIonPhys/HIEventUtils/src/components/HIEventUtils_entries.cxx @@ -1,5 +1,11 @@ #include "HIEventUtils/HIEventShapeSummaryTool.h" - +#include "HIEventUtils/HIVertexSelectionTool.h" +#include "HIEventUtils/HIEventSelectionTool.h" +#include "HIEventUtils/HITowerWeightTool.h" +#include "HIEventUtils/ZdcRecTool.h" DECLARE_COMPONENT( HIEventShapeSummaryTool ) - +DECLARE_COMPONENT( HITowerWeightTool ) +DECLARE_COMPONENT( HI::HIVertexSelectionTool ) +DECLARE_COMPONENT( HI::HIEventSelectionTool ) +DECLARE_COMPONENT( ZDC::ZdcRecTool ) diff --git a/PhysicsAnalysis/HeavyIonPhys/HIEventUtils/util/run_evtselection_tool_test.cxx b/PhysicsAnalysis/HeavyIonPhys/HIEventUtils/util/run_evtselection_tool_test.cxx new file mode 100644 index 0000000000000000000000000000000000000000..44279687d21bc2675d586dbe677fa745e663feb3 --- /dev/null +++ b/PhysicsAnalysis/HeavyIonPhys/HIEventUtils/util/run_evtselection_tool_test.cxx @@ -0,0 +1,104 @@ +/* + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration +*/ + +#ifdef XAOD_STANDALONE +#include <memory> +#include <string> +#include "xAODRootAccess/Init.h" +#include "xAODRootAccess/TEvent.h" +#include "AsgTools/Check.h" +#include "CxxUtils/make_unique.h" +#include "HIEventUtils/HIVertexSelectionTool.h" +#include "HIEventUtils/HIEventSelectionTool.h" +#include "xAODTracking/VertexContainer.h" +#include "InDetTrackSelectionTool/InDetTrackSelectionTool.h" +#include "TError.h" +#include "TFile.h" + +using std::string; +using std::unique_ptr; +using CxxUtils::make_unique; + +int main(int argc, char* argv[]) +{ + string appName = argv[0]; + if( !xAOD::Init(appName.data()).isSuccess() ) { + Error( appName.data(), "Could not call xAOD::Init()" ); + return 1; + } + + string fileName; + // Check if we received a file name: + if( argc < 2 ) { + fileName = getenv("ROOTCORE_TEST_FILE"); + if (fileName.empty()) { + Error( appName.data(), "No file name received!" ); + Error( appName.data(), " Usage: %s [xAOD file name]", appName.data() ); + return 1; + } + } else { + fileName = argv[ 1 ]; + } + + unique_ptr<TFile> fin( TFile::Open( fileName.data(), "READ" ) ); + + auto event = make_unique<xAOD::TEvent>( fin.get(), xAOD::TEvent::kClassAccess ); + Long64_t entries = event->getEntries(); + Info( appName.data(), "Number of events in file: %llu", entries ); + + auto eventSelTool = make_unique< HI::HIEventSelectionTool >("EventSelectionTool"); + + auto vertexSelTool = make_unique< HI::HIVertexSelectionTool >("vertexSelectionTool"); + + auto vtxTrkTool = make_unique<InDet::InDetTrackSelectionTool>("vtxTrkTool", "HILoose"); + ToolHandle< InDet::IInDetTrackSelectionTool > vtxTrkToolHandle = vtxTrkTool.get(); + ASG_CHECK_SA( appName, vtxTrkTool->initialize() ); + ASG_CHECK_SA( appName, vertexSelTool->setProperty( "TrackSelectionTool", vtxTrkToolHandle ) ); + + ToolHandle< HI::IHIVertexSelectionTool > vertexSelToolHandle = vertexSelTool.get(); + + ASG_CHECK_SA( appName, vertexSelTool->initialize() ); + ASG_CHECK_SA( appName, eventSelTool->setProperty( "VertexSelectionTool", vertexSelToolHandle ) ); + //ASG_CHECK_SA( appName, eventSelTool->setProperty( "TimeCut", 5 ) ); + + ASG_CHECK_SA( appName, eventSelTool->initialize() ); + + Long64_t nVtxPass = 0; + Long64_t nVtxFail = 0; + Long64_t nEvtPass = 0; + Long64_t nEvtFail = 0; + Long64_t nEvtTotal = 0; + Long64_t nVtxTotal = 0; + + for (Long64_t i_evt=0; i_evt<entries; ++i_evt) { + event->getEntry( i_evt ); + + if( eventSelTool->accept()) {nEvtPass++; nEvtTotal++; } + else { nEvtFail++; nEvtTotal++; } + + const xAOD::VertexContainer* vertices = nullptr; + if ( !event->retrieve( vertices, "PrimaryVertices" ).isSuccess() ) { + Error( appName.data(), "Could not retrieve PrimaryVertices" ); + return 1; + } + + for (const auto* vtx : *vertices) { + if (vertexSelTool->accept( *vtx )) { nVtxPass++; nVtxTotal++; } + else { nVtxFail++; nVtxTotal++; } + } + + } + Info( appName.data(), "%llu evt passed.", nEvtPass ); + Info( appName.data(), "%llu evt failed.", nEvtFail ); + Info( appName.data(), "%llu evt Total.", nEvtTotal ); + Info( appName.data(), "%llu vtx passed.", nVtxPass ); + Info( appName.data(), "%llu vtx failed.", nVtxFail ); + Info( appName.data(), "%llu vtx Total.", nVtxTotal ); + + ASG_CHECK_SA( appName, eventSelTool->finalize() ); + ASG_CHECK_SA( appName, vertexSelTool->finalize() ); + ASG_CHECK_SA( appName, vtxTrkTool->finalize() ); + return 0; +} +#endif // XAOD_STANDALONE diff --git a/PhysicsAnalysis/HeavyIonPhys/HIEventUtils/util/run_vertex_tool_test.cxx b/PhysicsAnalysis/HeavyIonPhys/HIEventUtils/util/run_vertex_tool_test.cxx new file mode 100644 index 0000000000000000000000000000000000000000..dd74fa66ee80a97696709a027852d0f7587c45c0 --- /dev/null +++ b/PhysicsAnalysis/HeavyIonPhys/HIEventUtils/util/run_vertex_tool_test.cxx @@ -0,0 +1,85 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +#ifdef XAOD_STANDALONE +#include <memory> +#include <string> +#include "xAODRootAccess/Init.h" +#include "xAODRootAccess/TEvent.h" +#include "AsgTools/Check.h" +#include "CxxUtils/make_unique.h" +#include "HIEventUtils/HIVertexSelectionTool.h" +#include "xAODTracking/VertexContainer.h" +#include "InDetTrackSelectionTool/InDetTrackSelectionTool.h" +#include "TError.h" +#include "TFile.h" + +using std::string; +using std::unique_ptr; +using CxxUtils::make_unique; + +int main(int argc, char* argv[]) +{ + string appName = argv[0]; + if( !xAOD::Init(appName.data()).isSuccess() ) { + Error( appName.data(), "Could not call xAOD::Init()" ); + return 1; + } + + string fileName; + // Check if we received a file name: + if( argc < 2 ) { + fileName = getenv("ROOTCORE_TEST_FILE"); + if (fileName.empty()) { + Error( appName.data(), "No file name received!" ); + Error( appName.data(), " Usage: %s [xAOD file name]", appName.data() ); + return 1; + } + } else { + fileName = argv[ 1 ]; + } + + unique_ptr<TFile> fin( TFile::Open( fileName.data(), "READ" ) ); + + auto event = make_unique<xAOD::TEvent>( fin.get(), xAOD::TEvent::kClassAccess ); + Long64_t entries = event->getEntries(); + Info( appName.data(), "Number of events in file: %llu", entries ); + + auto vertexSelTool = make_unique< HI::HIVertexSelectionTool >("vertexSelectionTool"); + ASG_CHECK_SA( appName, vertexSelTool->setProperty( "MinNTrk", 10 ) ); + ASG_CHECK_SA( appName, vertexSelTool->setProperty( "MinRmsPt", 10000. ) ); + + auto vtxTrkTool = make_unique<InDet::InDetTrackSelectionTool>("vtxTrkTool", "HILoose"); + ToolHandle< InDet::IInDetTrackSelectionTool > vtxTrkToolHandle = vtxTrkTool.get(); + ASG_CHECK_SA( appName, vtxTrkTool->initialize() ); + ASG_CHECK_SA( appName, vertexSelTool->setProperty( "TrackSelectionTool", vtxTrkToolHandle ) ); + + ASG_CHECK_SA( appName, vertexSelTool->initialize() ); + + + Long64_t nVtxPass = 0; + Long64_t nVtxFail = 0; + for (Long64_t i_evt=0; i_evt<entries; ++i_evt) { + event->getEntry( i_evt ); + + const xAOD::VertexContainer* vertices = nullptr; + if ( !event->retrieve( vertices, "PrimaryVertices" ).isSuccess() ) { + Error( appName.data(), "Could not retrieve PrimaryVertices" ); + return 1; + } + + for (const auto* vtx : *vertices) { + if (vertexSelTool->accept( *vtx )) nVtxPass++; + else nVtxFail++; + } + + } + Info( appName.data(), "%llu passed.", nVtxPass ); + Info( appName.data(), "%llu failed.", nVtxFail ); + + ASG_CHECK_SA( appName, vertexSelTool->finalize() ); + ASG_CHECK_SA( appName, vtxTrkTool->finalize() ); + return 0; +} +#endif // XAOD_STANDALONE diff --git a/PhysicsAnalysis/Interfaces/FTagAnalysisInterfaces/CMakeLists.txt b/PhysicsAnalysis/Interfaces/FTagAnalysisInterfaces/CMakeLists.txt new file mode 100644 index 0000000000000000000000000000000000000000..f66377acc4698afa16361d8be73dfd72ba3e78bd --- /dev/null +++ b/PhysicsAnalysis/Interfaces/FTagAnalysisInterfaces/CMakeLists.txt @@ -0,0 +1,25 @@ +# The name of the package: +atlas_subdir( FTagAnalysisInterfaces ) + +# The dependencies of the package: +atlas_depends_on_subdirs( + PUBLIC + Control/AthToolSupport/AsgTools + Event/xAOD/xAODBTagging + Event/xAOD/xAODJet + PhysicsAnalysis/AnalysisCommon/PATCore + PhysicsAnalysis/AnalysisCommon/PATInterfaces + PhysicsAnalysis/JetTagging/JetTagPerformanceCalibration/CalibrationDataInterface + PhysicsAnalysis/JetTagging/JetTagPerformanceCalibration/xAODBTaggingEfficiency ) + +# Component(s) in the package: +atlas_add_library( FTagAnalysisInterfacesLib + FTagAnalysisInterfaces/*.h + INTERFACE + PUBLIC_HEADERS FTagAnalysisInterfaces + LINK_LIBRARIES AsgTools xAODBTagging xAODJet PATCoreLib CalibrationDataInterfaceLib ) + +atlas_add_dictionary( FTagAnalysisInterfacesDict + FTagAnalysisInterfaces/FTagAnalysisInterfacesDict.h + FTagAnalysisInterfaces/selection.xml + LINK_LIBRARIES FTagAnalysisInterfacesLib ) diff --git a/PhysicsAnalysis/Interfaces/FTagAnalysisInterfaces/FTagAnalysisInterfaces/FTagAnalysisInterfacesDict.h b/PhysicsAnalysis/Interfaces/FTagAnalysisInterfaces/FTagAnalysisInterfaces/FTagAnalysisInterfacesDict.h new file mode 100644 index 0000000000000000000000000000000000000000..82af707e72e1ff200b8e202825c581992107b215 --- /dev/null +++ b/PhysicsAnalysis/Interfaces/FTagAnalysisInterfaces/FTagAnalysisInterfaces/FTagAnalysisInterfacesDict.h @@ -0,0 +1,19 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + + +#ifndef FTAGANALYSISINTERFACES_FTAGANALYSISINTERFACESDICT_H +#define FTAGANALYSISINTERFACES_FTAGANALYSISINTERFACESDICT_H + +#if defined(__GCCXML__) and not defined(EIGEN_DONT_VECTORIZE) +#define EIGEN_DONT_VECTORIZE +#endif + +// Includes for the dictionary generation: + +#include "FTagAnalysisInterfaces/IBTaggingEfficiencyTool.h" +#include "FTagAnalysisInterfaces/IBTaggingSelectionTool.h" +#include "FTagAnalysisInterfaces/IBTaggingTruthTaggingTool.h" + +#endif // FTAGANALYSISINTERFACES_FTAGANALYSISINTERFACESDICT_H diff --git a/PhysicsAnalysis/JetTagging/JetTagPerformanceCalibration/xAODBTaggingEfficiency/xAODBTaggingEfficiency/IBTaggingEfficiencyTool.h b/PhysicsAnalysis/Interfaces/FTagAnalysisInterfaces/FTagAnalysisInterfaces/IBTaggingEfficiencyTool.h similarity index 60% rename from PhysicsAnalysis/JetTagging/JetTagPerformanceCalibration/xAODBTaggingEfficiency/xAODBTaggingEfficiency/IBTaggingEfficiencyTool.h rename to PhysicsAnalysis/Interfaces/FTagAnalysisInterfaces/FTagAnalysisInterfaces/IBTaggingEfficiencyTool.h index ae8f2c6fad24a362a27735a23b505df8ce7b6662..106f523b0decde966b92e42d989ea5c7eff10688 100644 --- a/PhysicsAnalysis/JetTagging/JetTagPerformanceCalibration/xAODBTaggingEfficiency/xAODBTaggingEfficiency/IBTaggingEfficiencyTool.h +++ b/PhysicsAnalysis/Interfaces/FTagAnalysisInterfaces/FTagAnalysisInterfaces/IBTaggingEfficiencyTool.h @@ -1,7 +1,7 @@ // Dear emacs, this is -*- c++ -*- /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration */ /////////////////////////////////////////////////////////////////// @@ -12,6 +12,7 @@ #define CPIBTAGGINGEFFICIENCYTOOL_H #include "AsgTools/IAsgTool.h" +#include "PATInterfaces/ISystematicsTool.h" #include "PATInterfaces/CorrectionCode.h" #include "PATInterfaces/SystematicCode.h" #include "PATInterfaces/SystematicSet.h" @@ -22,9 +23,10 @@ #include <string> #include <set> +#include "CalibrationDataInterface/CalibrationDataVariables.h" #include "CalibrationDataInterface/CalibrationDataInterfaceROOT.h" -class IBTaggingEfficiencyTool : virtual public asg::IAsgTool { +class IBTaggingEfficiencyTool : virtual public CP::ISystematicsTool { /// Declare the interface that the class provides ASG_TOOL_INTERFACE( IBTagEfficiencyTool ) @@ -33,39 +35,44 @@ class IBTaggingEfficiencyTool : virtual public asg::IAsgTool { virtual CP::CorrectionCode getScaleFactor( const xAOD::Jet & jet, - float & sf) const =0 ; + float & sf) const =0 ; virtual CP::CorrectionCode getEfficiency( const xAOD::Jet & jet, - float & eff) const=0; - + float & eff) const=0; + virtual CP::CorrectionCode getInefficiency( const xAOD::Jet & jet, - float & eff) const=0; - + float & eff) const=0; + virtual CP::CorrectionCode getInefficiencyScaleFactor( const xAOD::Jet & jet, - float & sf) const=0; - + float & sf) const=0; + virtual CP::CorrectionCode getMCEfficiency( const xAOD::Jet & jet, - float & eff) const=0; + float & eff) const=0; + + + virtual CP::CorrectionCode getScaleFactor( int flavour, const Analysis::CalibrationDataVariables& v, + float & sf) const=0; + + virtual CP::CorrectionCode getMCEfficiency( int flavour, const Analysis::CalibrationDataVariables& v, + float & eff) const=0; + + virtual CP::CorrectionCode getInefficiencyScaleFactor( int flavour, const Analysis::CalibrationDataVariables& v, + float & sf) const=0; + // utility methods virtual const std::map<CP::SystematicVariation, std::vector<std::string> > listSystematics() const = 0; - // + // virtual std::string getTaggerName() const = 0; // virtual std::string getOperatingPoint() const = 0; // virtual std::string getJetAuthor() const = 0; - - virtual CP::SystematicCode applySystematicVariation(const CP::SystematicSet & set) = 0; - // - virtual CP::SystematicSet affectingSystematics() const = 0; - // - virtual CP::SystematicSet recommendedSystematics() const = 0; - // - virtual bool isAffectedBySystematic(const CP::SystematicVariation & systematic) const = 0; - + + // select an efficiency map for use in MC/MC and inefficiency scale factors, based on user specified selection of efficiency maps virtual bool setMapIndex(const std::string& flavour, unsigned int index) = 0; - // virtual bool setMapIndex(const std::string& flavour, const std::string & type) = 0; + // select an efficiency map for use in MC/MC and inefficiency scale factors, based on configuration file that contains DSID to effmap specification + virtual bool setMapIndex(unsigned int dsid) = 0; // this merely passes on the request to the underlying CDI object (listSystematics() cannot be used here, as corresponding CP::SystematicVariation objects may not exist) virtual std::map<std::string, std::vector<std::string> > listScaleFactorSystematics(bool named = false) const = 0; diff --git a/PhysicsAnalysis/JetTagging/JetTagPerformanceCalibration/xAODBTaggingEfficiency/xAODBTaggingEfficiency/IBTaggingSelectionTool.h b/PhysicsAnalysis/Interfaces/FTagAnalysisInterfaces/FTagAnalysisInterfaces/IBTaggingSelectionTool.h similarity index 53% rename from PhysicsAnalysis/JetTagging/JetTagPerformanceCalibration/xAODBTaggingEfficiency/xAODBTaggingEfficiency/IBTaggingSelectionTool.h rename to PhysicsAnalysis/Interfaces/FTagAnalysisInterfaces/FTagAnalysisInterfaces/IBTaggingSelectionTool.h index 4a6c529c0eb31446b5866954989bcecb944801bd..4a2962e9912563c1402f153ccd3e30d85a2a4ea3 100644 --- a/PhysicsAnalysis/JetTagging/JetTagPerformanceCalibration/xAODBTaggingEfficiency/xAODBTaggingEfficiency/IBTaggingSelectionTool.h +++ b/PhysicsAnalysis/Interfaces/FTagAnalysisInterfaces/FTagAnalysisInterfaces/IBTaggingSelectionTool.h @@ -1,7 +1,7 @@ // Dear emacs, this is -*- c++ -*- /* - Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration */ /////////////////////////////////////////////////////////////////// @@ -13,8 +13,8 @@ #include "AsgTools/IAsgTool.h" #include "xAODJet/Jet.h" +#include "PATInterfaces/CorrectionCode.h" #include "PATCore/AcceptData.h" -#include "PATCore/AcceptInfo.h" #include <string> class IBTaggingSelectionTool : virtual public asg::IAsgTool { @@ -24,20 +24,23 @@ class IBTaggingSelectionTool : virtual public asg::IAsgTool { public: - virtual const asg::AcceptInfo& getAcceptInfo() const = 0; /// Get the decision using a generic IParticle pointer virtual asg::AcceptData accept( const xAOD::IParticle* p ) const = 0; virtual asg::AcceptData accept( const xAOD::Jet& j ) const = 0; - /// Get the decision using thet jet's pt and mv2c20 weight values - virtual asg::AcceptData accept(double /* jet pt */, double /* jet eta */, double /* mv2c20 weight */ ) const = 0; - virtual asg::AcceptData accept(double /* jet pt */, double /* jet eta */, double /* mv2c20 weight */, double /* mv2c20 weight */ ) const = 0; - /// Decide in which quantile of the MV2c20 weight distribution the jet belongs + /// Get the decision using thet jet's pt and weight values (number of weight values depends on which tagger is used) + virtual asg::AcceptData accept(double /* jet pt */, double /* jet eta */, double /* tag_weight */ ) const = 0; + virtual asg::AcceptData accept(double /* jet pt */, double /* jet eta */, double /* mv2cl100 weight */, double /* mv2c100 weight */ ) const = 0; + virtual asg::AcceptData accept(double /* jet pt */, double /* jet eta */, double /* dl1pb */, double /* dl1pc */ , double /* dl1pu */) const = 0; + + /// Decide in which quantile of the tagger weight distribution the jet belongs /// The return value represents the bin index of the quantile distribution virtual int getQuantile( const xAOD::IParticle* ) const = 0; virtual int getQuantile( const xAOD::Jet& ) const = 0; virtual int getQuantile( double, double, double ) const = 0; - virtual double getCutValue() const = 0; + virtual CP::CorrectionCode getCutValue(double /* jet pt */, double & cutval, bool useVetoWP=false) const = 0; + virtual CP::CorrectionCode getTaggerWeight( const xAOD::Jet& jet, double & weight , bool useVetoWP=false) const = 0; + virtual CP::CorrectionCode getTaggerWeight( double /* dl1pb */, double /* dl1pc */ , double /* dl1pu */ , double & weight,bool useVetoWP=false) const = 0; }; #endif // CPIBTAGGINGSELECTIONTOOL_H diff --git a/PhysicsAnalysis/Interfaces/FTagAnalysisInterfaces/FTagAnalysisInterfaces/IBTaggingTruthTaggingTool.h b/PhysicsAnalysis/Interfaces/FTagAnalysisInterfaces/FTagAnalysisInterfaces/IBTaggingTruthTaggingTool.h new file mode 100644 index 0000000000000000000000000000000000000000..17e30dcc30f49719c7ba0551bb34df1511292aec --- /dev/null +++ b/PhysicsAnalysis/Interfaces/FTagAnalysisInterfaces/FTagAnalysisInterfaces/IBTaggingTruthTaggingTool.h @@ -0,0 +1,43 @@ +// Dear emacs, this is -*- c++ -*- +/////////////////////////////////////////////////////////////////// +// IBTaggingTruthTaggingTool.h, (c) ATLAS Detector software +/////////////////////////////////////////////////////////////////// + +#ifndef CPIBTAGGINGTRUTHTAGGINGTOOL_H +#define CPIBTAGGINGTRUTHTAGGINGTOOL_H + +#include "AsgTools/IAsgTool.h" +#include "PATInterfaces/ISystematicsTool.h" +#include "PATInterfaces/CorrectionCode.h" +#include "PATInterfaces/SystematicCode.h" +#include "PATInterfaces/SystematicSet.h" + +#include <string> +#include <vector> + +#include "CalibrationDataInterface/CalibrationDataVariables.h" +#include "xAODBTaggingEfficiency/TruthTagResults.h" + +// xAOD jet +#include "xAODJet/JetContainer.h" +#include "xAODJet/Jet.h" + +#include "PATInterfaces/CorrectionCode.h" +#include "PATInterfaces/SystematicCode.h" +#include "PATInterfaces/SystematicSet.h" + +class IBTaggingTruthTaggingTool : virtual public CP::ISystematicsTool { + + /// Declare the interface that the class provides + ASG_TOOL_INTERFACE( IBTagTruthTaggingTool ) + + public: + + virtual StatusCode setEffMapIndex(const std::string& flavour, unsigned int index)=0 ; + + virtual StatusCode CalculateResults( std::vector<double>& pt, std::vector<double>& eta, std::vector<int>& flav, std::vector<double>& tagw, Analysis::TruthTagResults& results,int rand_seed=-1)=0 ; + virtual StatusCode CalculateResults( const xAOD::JetContainer& jets, Analysis::TruthTagResults& results,int rand_seed=-1)=0; + + +}; +#endif // CPIBTAGGINGTRUTHTAGGINGTOOL_H diff --git a/PhysicsAnalysis/Interfaces/FTagAnalysisInterfaces/FTagAnalysisInterfaces/selection.xml b/PhysicsAnalysis/Interfaces/FTagAnalysisInterfaces/FTagAnalysisInterfaces/selection.xml new file mode 100644 index 0000000000000000000000000000000000000000..0ca83586057e2ac71082c4616505608f9d868646 --- /dev/null +++ b/PhysicsAnalysis/Interfaces/FTagAnalysisInterfaces/FTagAnalysisInterfaces/selection.xml @@ -0,0 +1,6 @@ +<lcgdict> + <!-- Requested dictionary generation --> + <class name="IBTaggingEfficiencyTool" /> + <class name="IBTaggingSelectionTool" /> + <class name="IBTaggingTruthTaggingTool" /> +</lcgdict> diff --git a/PhysicsAnalysis/Interfaces/JetAnalysisInterfaces/CMakeLists.txt b/PhysicsAnalysis/Interfaces/JetAnalysisInterfaces/CMakeLists.txt new file mode 100644 index 0000000000000000000000000000000000000000..c79c2eeeafc863e3b5a97fd5e6f8004d37cf981d --- /dev/null +++ b/PhysicsAnalysis/Interfaces/JetAnalysisInterfaces/CMakeLists.txt @@ -0,0 +1,21 @@ +# The name of the package: +atlas_subdir( JetAnalysisInterfaces ) + +# The dependencies of the package: +atlas_depends_on_subdirs( + PUBLIC + Control/AthToolSupport/AsgTools + Event/xAOD/xAODJet + PhysicsAnalysis/AnalysisCommon/PATCore ) + +# Component(s) in the package: +atlas_add_library( JetAnalysisInterfacesLib + JetAnalysisInterfaces/*.h + INTERFACE + PUBLIC_HEADERS JetAnalysisInterfaces + LINK_LIBRARIES AsgTools xAODJet PATCoreLib PATInterfaces ) + +atlas_add_dictionary( JetAnalysisInterfacesDict + JetAnalysisInterfaces/JetAnalysisInterfacesDict.h + JetAnalysisInterfaces/selection.xml + LINK_LIBRARIES JetAnalysisInterfacesLib ) diff --git a/PhysicsAnalysis/Interfaces/JetAnalysisInterfaces/JetAnalysisInterfaces/IJetJvtEfficiency.h b/PhysicsAnalysis/Interfaces/JetAnalysisInterfaces/JetAnalysisInterfaces/IJetJvtEfficiency.h new file mode 100644 index 0000000000000000000000000000000000000000..cc12cce119faacc7e6eba9d3b39abcd97e023570 --- /dev/null +++ b/PhysicsAnalysis/Interfaces/JetAnalysisInterfaces/JetAnalysisInterfaces/IJetJvtEfficiency.h @@ -0,0 +1,75 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +#ifndef JETANALYSISINTERFACES_IJETJVTEFFICIENCY_H_ +#define JETANALYSISINTERFACES_IJETJVTEFFICIENCY_H_ + +// EDM include(s): +#include "xAODJet/JetContainer.h" + +// Local include(s): +#include "PATInterfaces/CorrectionCode.h" +#include "PATInterfaces/ISystematicsTool.h" + +// STL include(s): +#include <string> +#include <vector> +#include <map> + +namespace CP { + +const static SystematicVariation JvtEfficiencyUp("JET_JvtEfficiency__1up"); +const static SystematicVariation JvtEfficiencyDown("JET_JvtEfficiency__1down"); +const static SystematicVariation fJvtEfficiencyUp("JET_fJvtEfficiency__1up"); +const static SystematicVariation fJvtEfficiencyDown("JET_fJvtEfficiency__1down"); +const static SystematicVariation MVfJvtEfficiencyUp("JET_MVfJvtEfficiency__1up"); +const static SystematicVariation MVfJvtEfficiencyDown("JET_MVfJvtEfficiency__1down"); + +class IJetJvtEfficiency : public virtual CP::ISystematicsTool { + + //Declare the interface that the class provides + ASG_TOOL_INTERFACE( CP::IJetJvtEfficiency ) + +public: + + virtual ~IJetJvtEfficiency() {} + + //Fills sf with the Jvt efficiency scale factor. If the jet is out of the defined jet pt + //range, or if the jet fails passesJvtCut, a value of 1 is returned. + virtual CorrectionCode getEfficiencyScaleFactor(const xAOD::Jet& jet,float& sf ) = 0; + + //Fills sf with the Jvt inefficiency scale factor. If the jet is out of the defined jet pt + //range, or if the jet fails passesJvtCut, a value of 1 is returned. + virtual CorrectionCode getInefficiencyScaleFactor(const xAOD::Jet& jet,float& sf ) = 0; + + //Returns the Jvt scale factor as a decoration on the jet. + virtual CorrectionCode applyEfficiencyScaleFactor( const xAOD::Jet& jet ) = 0; + + //Returns the Jvt scale factor as a decoration on the jet. + virtual CorrectionCode applyInefficiencyScaleFactor( const xAOD::Jet& jet ) = 0; + + //Returns the jvt scale factors as decorations on the input jets and fills in the combined scale factor into sf + virtual CorrectionCode applyAllEfficiencyScaleFactor(const xAOD::IParticleContainer *jets,float& sf) = 0; + + //Checks if the jet passes the jvt cut threshold. + //Uses maximum validity range by default, but there is a configurable parameter + virtual bool passesJvtCut(const xAOD::Jet& jet) = 0; + + //Checks if the jet lies in the pt and eta range where Jvt is valid. + virtual bool isInRange(const xAOD::Jet& jet) = 0; + + //returns actual jvtthreshold + virtual float getJvtThresh() const = 0; + + //returns user-defined max pt if applicable (by default is the same as the max pt range of the histograms) + virtual float getUserPtMax() const = 0; + + //Applies truth matching decoration to determine appropriate scale factor type -- call before extracting SFs + virtual StatusCode tagTruth(const xAOD::IParticleContainer *jets,const xAOD::IParticleContainer *truthJets) = 0; + +}; // class IJetJvtEfficiencyTool + +} // namespace CP + +#endif /* JETANALYSISINTERFACES_IJETJVTEFFICIENCY_H_ */ diff --git a/PhysicsAnalysis/Interfaces/JetAnalysisInterfaces/JetAnalysisInterfaces/IJetSelectorTool.h b/PhysicsAnalysis/Interfaces/JetAnalysisInterfaces/JetAnalysisInterfaces/IJetSelectorTool.h new file mode 100644 index 0000000000000000000000000000000000000000..139f0bf2f2d557a4af7ab840feaad5f4a87987de --- /dev/null +++ b/PhysicsAnalysis/Interfaces/JetAnalysisInterfaces/JetAnalysisInterfaces/IJetSelectorTool.h @@ -0,0 +1,27 @@ +// for editors : this file is -*- C++ -*- + +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +#ifndef JetAnalysisInterfaces_IJetSelectorTool_H_ +#define JetAnalysisInterfaces_IJetSelectorTool_H_ + +#include "AsgTools/IAsgTool.h" + +#include "xAODJet/Jet.h" + +#include "PATCore/AcceptData.h" + + +class IJetSelectorTool : virtual public asg::IAsgTool { + ASG_TOOL_INTERFACE(IJetSelectorTool) + + public: + + virtual asg::AcceptData& tag(const xAOD::Jet& jet) const = 0; + + +}; + +#endif diff --git a/PhysicsAnalysis/Interfaces/JetAnalysisInterfaces/JetAnalysisInterfaces/JetAnalysisInterfacesDict.h b/PhysicsAnalysis/Interfaces/JetAnalysisInterfaces/JetAnalysisInterfaces/JetAnalysisInterfacesDict.h new file mode 100644 index 0000000000000000000000000000000000000000..5bd4acf1a7653ea2707ad3c22acc88379d8abb28 --- /dev/null +++ b/PhysicsAnalysis/Interfaces/JetAnalysisInterfaces/JetAnalysisInterfaces/JetAnalysisInterfacesDict.h @@ -0,0 +1,16 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +#ifndef JETANALYSISINTERFACES_JETANALYSISINTERFACESDICT_H +#define JETANALYSISINTERFACES_JETANALYSISINTERFACESDICT_H + +#if defined(__GCCXML__) and not defined(EIGEN_DONT_VECTORIZE) +#define EIGEN_DONT_VECTORIZE +#endif // __GCCXML__ + +// Includes for the dictionary generation: +#include "JetAnalysisInterfaces/IJetSelectorTool.h" +#include "JetAnalysisInterfaces/IJetJvtEfficiency.h" + +#endif // JETANALYSISINTERFACES_JETANALYSISINTERFACESDICT_H diff --git a/PhysicsAnalysis/Interfaces/JetAnalysisInterfaces/JetAnalysisInterfaces/selection.xml b/PhysicsAnalysis/Interfaces/JetAnalysisInterfaces/JetAnalysisInterfaces/selection.xml new file mode 100644 index 0000000000000000000000000000000000000000..0a98caef59b578a1c65329b83c1d6c35e3993f75 --- /dev/null +++ b/PhysicsAnalysis/Interfaces/JetAnalysisInterfaces/JetAnalysisInterfaces/selection.xml @@ -0,0 +1,14 @@ +<lcgdict> + <!-- Requested dictionary generation --> + <class name="IJetSelectorTool" /> + <class name="IJetJvtEfficiency" /> + + <!-- Suppress unwanted dictionaries generated by ROOT 6 --> + <exclusion> + <class name="SG::IConstAuxStore"/> + <class name="DataLink<SG::IConstAuxStore>"/> + <class name="xAOD::IParticle"/> + <class name="DataVector<xAOD::IParticle>"/> + <class name="ElementLink<DataVector<xAOD::IParticle> >"/> + </exclusion> +</lcgdict> diff --git a/PhysicsAnalysis/JetMissingEtID/JetMissingEtTagTools/JetMissingEtTagTools/JetMissingEtTagTool.h b/PhysicsAnalysis/JetMissingEtID/JetMissingEtTagTools/JetMissingEtTagTools/JetMissingEtTagTool.h index 95df2a5beda6a9ddd3c1f8dc915cefa7a6b74c41..3439d350d43ce576955ac692f904917ad785f559 100755 --- a/PhysicsAnalysis/JetMissingEtID/JetMissingEtTagTools/JetMissingEtTagTools/JetMissingEtTagTool.h +++ b/PhysicsAnalysis/JetMissingEtID/JetMissingEtTagTools/JetMissingEtTagTools/JetMissingEtTagTool.h @@ -17,7 +17,7 @@ Purpose : build the JetMissingEt Tag objects - ParticleJetTagCollection.h and Mi #include "TagEvent/TagFragmentCollection.h" #include "AthenaPoolUtilities/AthenaAttributeSpecification.h" #include "xAODJet/JetContainer.h" -#include "xAODBTaggingEfficiency/IBTaggingSelectionTool.h" +#include "FTagAnalysisInterfaces/IBTaggingSelectionTool.h" #include <map> diff --git a/PhysicsAnalysis/JetTagging/JetTagPerformanceCalibration/CalibrationDataInterface/CMakeLists.txt b/PhysicsAnalysis/JetTagging/JetTagPerformanceCalibration/CalibrationDataInterface/CMakeLists.txt index 58ab3edba012bc63c6f157949c89e404a01e0f3d..009586c9f91b3be403ab54fcc58067fd98e55fd4 100644 --- a/PhysicsAnalysis/JetTagging/JetTagPerformanceCalibration/CalibrationDataInterface/CMakeLists.txt +++ b/PhysicsAnalysis/JetTagging/JetTagPerformanceCalibration/CalibrationDataInterface/CMakeLists.txt @@ -13,18 +13,29 @@ atlas_depends_on_subdirs( PUBLIC # External dependencies: find_package( ROOT COMPONENTS Cint Core Tree MathCore Hist RIO pthread MathMore Minuit Minuit2 Matrix Physics HistPainter Rint ) +find_package( Boost ) # header-only so no libraries needed + # Component(s) in the package: atlas_add_root_dictionary( CalibrationDataInterfaceLib CalibrationDataInterfaceLibDictSource - ROOT_HEADERS CalibrationDataInterface/CalibrationDataContainer.h CalibrationDataInterface/CalibrationDataVariables.h CalibrationDataInterface/CalibrationDataInterfaceBase.h CalibrationDataInterface/CalibrationDataInterfaceROOT.h CalibrationDataInterface/CalibrationDataEigenVariations.h CalibrationDataInterface/CalibrationDataBackend.h CalibrationDataInterface/CalibrationDataUtilities.h Root/LinkDef.h - EXTERNAL_PACKAGES ROOT ) + ROOT_HEADERS + CalibrationDataInterface/CalibrationDataContainer.h + CalibrationDataInterface/CalibrationDataVariables.h + CalibrationDataInterface/CalibrationDataInterfaceBase.h + CalibrationDataInterface/CalibrationDataInterfaceROOT.h + CalibrationDataInterface/CalibrationDataEigenVariations.h + CalibrationDataInterface/CalibrationDataBackend.h + CalibrationDataInterface/CalibrationDataUtilities.h + CalibrationDataInterface/CalibrationDataInternals.h Root/LinkDef.h + EXTERNAL_PACKAGES ROOT Boost ) atlas_add_library( CalibrationDataInterfaceLib Root/*.cxx ${CalibrationDataInterfaceLibDictSource} PUBLIC_HEADERS CalibrationDataInterface - INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} - LINK_LIBRARIES ${ROOT_LIBRARIES} ) + + INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} ${Boost_INCLUDE_DIRS} + LINK_LIBRARIES ${ROOT_LIBRARIES} ${Boost_LIBRARIES} ) # Install files from the package: atlas_install_joboptions( share/*.py ) diff --git a/PhysicsAnalysis/JetTagging/JetTagPerformanceCalibration/CalibrationDataInterface/CalibrationDataInterface/CalibrationDataContainer.h b/PhysicsAnalysis/JetTagging/JetTagPerformanceCalibration/CalibrationDataInterface/CalibrationDataInterface/CalibrationDataContainer.h index 72bb2193ce762cb95f38c4601df36e796192c72c..1b922479b4f8d784871fe3abfab466e072e9e763 100644 --- a/PhysicsAnalysis/JetTagging/JetTagPerformanceCalibration/CalibrationDataInterface/CalibrationDataInterface/CalibrationDataContainer.h +++ b/PhysicsAnalysis/JetTagging/JetTagPerformanceCalibration/CalibrationDataInterface/CalibrationDataInterface/CalibrationDataContainer.h @@ -87,6 +87,9 @@ namespace Analysis { /** @brief retrieve the 'hadronisation reference' entered for this calibration, if any */ std::string getHadronisation() const; + /** @brief retrieve the (semicolon-separated) set of uncertainties that are recommended for removal from the eigenvector decomposition */ + std::string getExcludedUncertainties() const; + /** retrieve the calibration result. @param x user-supplied (kinematic or other) variables @@ -140,6 +143,11 @@ namespace Analysis { /** @brief insert the given text as the 'hadronisation reference' for this calibration */ void setHadronisation(const std::string& text); + /** insert the set of uncertainties that are recommended for removal from the eigenvector decomposition. + @param text semicolon-separated list of uncertainties + */ + void setExcludedUncertainties(const std::string& text); + /** @brief insert the relevant object for the requested source of 'uncertainty' */ void setUncertainty(const std::string& unc, TObject* obj); diff --git a/PhysicsAnalysis/JetTagging/JetTagPerformanceCalibration/CalibrationDataInterface/CalibrationDataInterface/CalibrationDataEigenVariations.h b/PhysicsAnalysis/JetTagging/JetTagPerformanceCalibration/CalibrationDataInterface/CalibrationDataInterface/CalibrationDataEigenVariations.h index cc000a7fa9cfce133b2bedbea3e8295f9e3f1c2c..c2eb5e166a586c1c497779d48004f24de5a09618 100644 --- a/PhysicsAnalysis/JetTagging/JetTagPerformanceCalibration/CalibrationDataInterface/CalibrationDataInterface/CalibrationDataEigenVariations.h +++ b/PhysicsAnalysis/JetTagging/JetTagPerformanceCalibration/CalibrationDataInterface/CalibrationDataInterface/CalibrationDataEigenVariations.h @@ -28,7 +28,8 @@ namespace Analysis typedef std::set<size_t> IndexSet; typedef std::set<IndexSet> IndexSuperSet; - CalibrationDataEigenVariations(const CalibrationDataHistogramContainer* cnt); + /** normal constructor. The second argument, if true, will attempt to retrieve a 'recommended' set of uncertainties to be excluded from EV decomposition */ + CalibrationDataEigenVariations(const CalibrationDataHistogramContainer* cnt, bool excludeRecommendedUncertaintySet = false); ~CalibrationDataEigenVariations(); /** exclude the source of uncertainty indicated by name from eigenvector calculations */ @@ -102,6 +103,9 @@ namespace Analysis /** eigenvector variations */ std::vector<std::pair<TH1*, TH1*> > m_eigen; + /** indicate whether statistical uncertainties are stored as variations */ + bool m_statVariations; + // /** @ data members needed for eigenvector method **/ // /** the map stores the int which is needed to access the other vector<> objects **/ // mutable std::map<std::string, unsigned int> m_eigenvectorMethod_index; diff --git a/PhysicsAnalysis/JetTagging/JetTagPerformanceCalibration/CalibrationDataInterface/CalibrationDataInterface/CalibrationDataInterfaceROOT.h b/PhysicsAnalysis/JetTagging/JetTagPerformanceCalibration/CalibrationDataInterface/CalibrationDataInterface/CalibrationDataInterfaceROOT.h index 7ba8ef3e40d4acf8a7bde3ade11fb404ab018407..215d1e03076b70be74e9f8ccce7b15cfe574b549 100644 --- a/PhysicsAnalysis/JetTagging/JetTagPerformanceCalibration/CalibrationDataInterface/CalibrationDataInterface/CalibrationDataInterfaceROOT.h +++ b/PhysicsAnalysis/JetTagging/JetTagPerformanceCalibration/CalibrationDataInterface/CalibrationDataInterface/CalibrationDataInterfaceROOT.h @@ -96,9 +96,14 @@ namespace Analysis const std::vector<std::string>& jetAliases, const std::map<std::string, std::string>& SFNames, const std::map<std::string, std::vector<std::string> >& EffNames, - const std::vector<std::string>& excludeFromEV, + const std::map<std::string, std::vector<std::string> >& excludeFromEV, const std::map<std::string, Analysis::EVReductionStrategy> EVReductions, - bool useEV = true, bool useMCMCSF = true, bool useTopologyRescaling = false); + + bool useEV = true, + bool useMCMCSF = true, + bool useTopologyRescaling = false, + bool useRecommendedEVExclusions = false, + bool verbose = true); /** default constructor for PROOF object retrieval */ CalibrationDataInterfaceROOT(); @@ -381,7 +386,7 @@ namespace Analysis /** @brief utility function taking care of object retrieval */ // CalibrationDataContainer* retrieveContainer(const std::string& name, bool isSF); - CalibrationDataContainer* retrieveContainer(const std::string& dir, const std::string& cntname, bool isSF); + CalibrationDataContainer* retrieveContainer(const std::string& dir, const std::string& cntname, bool isSF, bool doPrint = true); /** @brief utility function taking care of eigenvector objects retrieval */ // const CalibrationDataEigenVariations* retrieveCalibrationDataEV(const CalibrationDataContainer* calibrationDataContainer) const; @@ -407,7 +412,13 @@ namespace Analysis std::map<std::string, Analysis::EVReductionStrategy> m_EVReductions; /** store the uncertainties which should be excluded from building the full covariance matrix **/ - std::vector<std::string> m_excludeFromCovMatrix; + std::map<std::string, std::vector<std::string> > m_excludeFromCovMatrix; + + /** if true, exclude pre-recommended lists of uncertainties from the covariance matrix building, in addition to the above user specified lists **/ + bool m_useRecommendedEVExclusions; + + /** if true, allow also for some informational (and not only error/warning) messages **/ + bool m_verbose; // ------------------------------------------------------------------------------------------ diff --git a/PhysicsAnalysis/JetTagging/JetTagPerformanceCalibration/CalibrationDataInterface/CalibrationDataInterface/CalibrationDataInternals.h b/PhysicsAnalysis/JetTagging/JetTagPerformanceCalibration/CalibrationDataInterface/CalibrationDataInterface/CalibrationDataInternals.h new file mode 100644 index 0000000000000000000000000000000000000000..b057529a26bce0cd28f921f242804c1f7c6e0589 --- /dev/null +++ b/PhysicsAnalysis/JetTagging/JetTagPerformanceCalibration/CalibrationDataInterface/CalibrationDataInterface/CalibrationDataInternals.h @@ -0,0 +1,26 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +////////////////////////////////////////////////////////////////////// +// CalibrationDataInternals.h, (c) ATLAS Detector software +////////////////////////////////////////////////////////////////////// + +#ifndef ANALYSISCALIBRATIONDATAINTERNALS_H +#define ANALYSISCALIBRATIONDATAINTERNALS_H + +#include <vector> +#include <string> + +namespace Analysis { + + // It's somewhat cumbersome to have a nested namespace here... this is because a mere Analysis::split() could clash with other code + namespace CalibrationDataInterface { + + /** local utility function: split string into a vector of substrings separated by a specified separator, and with whitespace in the results trimmed */ + std::vector<std::string> split(const std::string& str, const char token = ';'); + + } +} + +#endif diff --git a/PhysicsAnalysis/JetTagging/JetTagPerformanceCalibration/CalibrationDataInterface/Root/CalibrationDataContainer.cxx b/PhysicsAnalysis/JetTagging/JetTagPerformanceCalibration/CalibrationDataInterface/Root/CalibrationDataContainer.cxx index 05357b1289b2e310ef22e9d7edf4a6e1bf87427b..5688046d1392ce14befae3cfd57653cd1ad062f6 100644 --- a/PhysicsAnalysis/JetTagging/JetTagPerformanceCalibration/CalibrationDataInterface/Root/CalibrationDataContainer.cxx +++ b/PhysicsAnalysis/JetTagging/JetTagPerformanceCalibration/CalibrationDataInterface/Root/CalibrationDataContainer.cxx @@ -171,7 +171,7 @@ CalibrationDataContainer::getUncertainties(const CalibrationDataVariables& x, while (TPair* pair = (TPair*) it()) { std::string spec(pair->Key()->GetName()); // ignore these specific entries - if (spec == "comment" || spec == "result" || spec == "statistics" || spec == "MChadronisation") continue; + if (spec == "comment" || spec == "result" || spec == "statistics" || spec == "MChadronisation" || spec == "excluded_set") continue; code = getUncertainty(spec, x, result, pair->Value()); // we should never be finding any errors if (code == Analysis::kError) { @@ -213,6 +213,20 @@ CalibrationDataContainer::getHadronisation() const return std::string(s->GetName()); } +//________________________________________________________________________________ +std::string +CalibrationDataContainer::getExcludedUncertainties() const +{ + // Retrieve the (semicolon-separated) set of uncertainties that are recommended for removal from the eigenvector decomposition (if any) + const static std::string null(""); + + TObject* obj = GetValue("excluded_set"); + if (! obj) return null; + TObjString* s = dynamic_cast<TObjString*>(obj); + if (! s ) return null; + return std::string(s->GetName()); +} + //________________________________________________________________________________ void CalibrationDataContainer::setUncertainty(const std::string& unc, TObject* obj) @@ -262,6 +276,18 @@ CalibrationDataContainer::setHadronisation(const std::string& text) Add(new TObjString("MChadronisation"), new TObjString(text.c_str())); } +//________________________________________________________________________________ +void +CalibrationDataContainer::setExcludedUncertainties(const std::string& text) +{ + // Insert (or replace) the (semicolon-separated) list of uncertainties that are recommended to be excluded from the eigenvector decomposition + // + // text: the (semicolon-separated) list of uncertainties in string form (will be converted to TObjString) + + if (TPair* p = (TPair*) FindObject("excluded_set")) DeleteEntry(p->Key()); + Add(new TObjString("excluded_set"), new TObjString(text.c_str())); +} + //________________________________________________________________________________ int CalibrationDataContainer::typeFromString(const std::string& key) const diff --git a/PhysicsAnalysis/JetTagging/JetTagPerformanceCalibration/CalibrationDataInterface/Root/CalibrationDataEigenVariations.cxx b/PhysicsAnalysis/JetTagging/JetTagPerformanceCalibration/CalibrationDataInterface/Root/CalibrationDataEigenVariations.cxx index eb18dce299e21928e8a4e4abe4d3e765e599290c..31375312c8240a29323360ea85055ddead9ff2c8 100644 --- a/PhysicsAnalysis/JetTagging/JetTagPerformanceCalibration/CalibrationDataInterface/Root/CalibrationDataEigenVariations.cxx +++ b/PhysicsAnalysis/JetTagging/JetTagPerformanceCalibration/CalibrationDataInterface/Root/CalibrationDataEigenVariations.cxx @@ -8,13 +8,16 @@ #include "CalibrationDataInterface/CalibrationDataContainer.h" #include "CalibrationDataInterface/CalibrationDataEigenVariations.h" +#include "CalibrationDataInterface/CalibrationDataInternals.h" #include <iomanip> #include <iostream> #include <limits> #include <set> #include <algorithm> +#include <string> #include <cmath> + #include "TH1.h" #include "TVectorT.h" #include "TDecompSVD.h" @@ -22,6 +25,7 @@ #include "TROOT.h" using Analysis::CalibrationDataEigenVariations; +using Analysis::CalibrationDataInterface::split; using std::string; using std::map; using std::vector; @@ -35,7 +39,10 @@ namespace { // But in order to avoid unnecessary overhead, the actual dimensionality of the histograms is accounted for. // Construct the (diagonal) covariance matrix for the statistical uncertainties on the "ref" results - TMatrixDSym getStatCovarianceMatrix(const TH1* hist) { + // Note that when statistical uncertainties are stored as variations, they are already accounted for and hence should not be duplicated; hence they are dummy here + // (this is not very nice, in that the result of this function will technically be wrong, + // but the statistical uncertainty covariance matrix is anyway not separately visible to the outside world) + TMatrixDSym getStatCovarianceMatrix(const TH1* hist, bool zero) { Int_t nbinx = hist->GetNbinsX()+2, nbiny = hist->GetNbinsY()+2, nbinz = hist->GetNbinsZ()+2; Int_t rows = nbinx; if (hist->GetDimension() > 1) rows *= nbiny; @@ -51,7 +58,7 @@ namespace { for (Int_t biny = 1; biny < nbiny-1; ++biny) for (Int_t binz = 1; binz < nbinz-1; ++binz) { Int_t bin = hist->GetBin(binx, biny, binz); - double err = hist->GetBinError(bin); + double err = zero ? 0 : hist->GetBinError(bin); stat(bin, bin) = err*err; } return stat; @@ -193,9 +200,23 @@ ClassImp(CalibrationDataEigenVariations) #endif //________________________________________________________________________________ -CalibrationDataEigenVariations::CalibrationDataEigenVariations(const CalibrationDataHistogramContainer* cnt) : - m_cnt(cnt), m_initialized(false), m_namedExtrapolation(-1) +CalibrationDataEigenVariations::CalibrationDataEigenVariations(const CalibrationDataHistogramContainer* cnt, + bool excludeRecommendedUncertaintySet) : +m_cnt(cnt), m_initialized(false), m_namedExtrapolation(-1), m_statVariations(false) { + // if specified, add items recommended for exclusion from EV decomposition by the calibration group to the 'named uncertainties' list + if (excludeRecommendedUncertaintySet) { + std::vector<std::string> to_exclude = split(m_cnt->getExcludedUncertainties()); + for (auto name : to_exclude) excludeNamedUncertainty(name); + if (to_exclude.size() == 0) { + std::cerr << "CalibrationDataEigenVariations warning: exclusion of pre-set uncertainties list requested but no (or empty) list found" << std::endl; + } + } + // also flag if statistical uncertainties stored as variations (this typically happens as a result of smoothing / pruning of SF results) + vector<string> uncs = m_cnt->listUncertainties(); + for (auto name : uncs) { + if (name.find("stat_np") != string::npos) m_statVariations = true; + } } //________________________________________________________________________________ @@ -232,13 +253,14 @@ CalibrationDataEigenVariations::excludeNamedUncertainty(const std::string& name) << " initialization already done" << std::endl; else if (name == "comment" || name == "result" || name == "systematics" || name == "statistics" || name == "combined" || name == "extrapolation" || - name == "MCreference" || name == "MChadronisation" || name == "ReducedSets") + name == "MCreference" || name == "MChadronisation" || name == "ReducedSets" || name == "excluded_set") std::cerr << "CalibrationDataEigenVariations::excludeNamedUncertainty error:" << " name " << name << " not allowed" << std::endl; else if (! m_cnt->GetValue(name.c_str())) std::cerr << "CalibrationDataEigenVariations::excludeNamedUncertainty error:" << " uncertainty named " << name << " not found" << std::endl; - else { + // only really add if the entry is not yet in the list + else if (m_namedIndices.find(name) == m_namedIndices.end()) { m_named.push_back(std::pair<TH1*, TH1*>(0, 0)); m_namedIndices[name] = m_named.size()-1; } @@ -271,7 +293,9 @@ CalibrationDataEigenVariations::getEigenCovarianceMatrix() const // First, treat the statistics separately. // Account for the possibility that this is handled as a (non-trivial) covariance matrix TMatrixDSym* sCov = dynamic_cast<TMatrixDSym*>(m_cnt->GetValue("statistics")); - TMatrixDSym cov = (sCov) ? *sCov : getStatCovarianceMatrix(result); + // Alternatively, statistical uncertainties may be accounted for as variations (i.e., much like systematic uncertainties). + // In that case, we create a null matrix here and add the statistical contributions along with the systematic ones. + TMatrixDSym cov = (sCov) ? *sCov : getStatCovarianceMatrix(result, m_statVariations); // Then loop through the list of (other) uncertainties std::vector<string> uncs = m_cnt->listUncertainties(); @@ -281,7 +305,7 @@ CalibrationDataEigenVariations::getEigenCovarianceMatrix() const uncs[t] == "combined" || uncs[t] == "statistics" || uncs[t] == "systematics" || uncs[t] == "MCreference" || uncs[t] == "MChadronisation" || uncs[t] == "extrapolation" || - uncs[t] == "ReducedSets") continue; + uncs[t] == "ReducedSets" || uncs[t] == "excluded_set") continue; // entries that can be excluded if desired if (m_namedIndices.find(uncs[t]) != m_namedIndices.end()) continue; @@ -304,17 +328,16 @@ CalibrationDataEigenVariations::getEigenCovarianceMatrixFromVariations() const TMatrixD jac = getJacobianReductionMatrix(); int nbins = jac.GetNcols(); TMatrixDSym cov(nbins); + auto variation = std::make_unique<double[]>(nbins); for (std::vector<std::pair<TH1*, TH1*> >::const_iterator it = m_eigen.begin(); it != m_eigen.end(); ++it) { - double *variation = new double[nbins]; TH1* resultVariedUp = it->first; for (unsigned int u = 0; u < (unsigned int) nbins; ++u) variation[u] = resultVariedUp->GetBinContent(u) - result->GetBinContent(u); for (int u = 0; u < nbins; ++u) for (int v = 0; v < nbins; ++v) cov(u, v) += variation[u]*variation[v]; - delete[] variation; } return cov; @@ -729,7 +752,7 @@ CalibrationDataEigenVariations::initialize(double min_variance) final_set.insert(current_set); ++current_set; } - if (final_set.size() > 0) std::cout << "Removing " << final_set.size() + if (final_set.size() > 0) std::cout << "CalibrationDataEigenVariations: Removing " << final_set.size() << " eigenvector variations leading to sub-tolerance effects, retaining " << m_eigen.size()-final_set.size() << " variations" << std::endl; removeVariations(final_set); @@ -745,7 +768,10 @@ CalibrationDataEigenVariations::removeVariations(const IndexSet &set) std::vector<std::pair<TH1*, TH1*> > new_eigen; for (size_t index = 0; index < m_eigen.size(); ++index) - if (set.count(index) == 0) new_eigen.push_back(m_eigen[index]); + { + if (set.count(index) == 0) new_eigen.push_back(m_eigen[index]); + else { delete m_eigen[index].first; delete m_eigen[index].second; } + } m_eigen = new_eigen; } diff --git a/PhysicsAnalysis/JetTagging/JetTagPerformanceCalibration/CalibrationDataInterface/Root/CalibrationDataInterfaceROOT.cxx b/PhysicsAnalysis/JetTagging/JetTagPerformanceCalibration/CalibrationDataInterface/Root/CalibrationDataInterfaceROOT.cxx index ae31b6fbf8978bd85ce86d6f1738f7c9228df25d..e541ff01dcebd2c2ca7dce1be60486adda47f529 100644 --- a/PhysicsAnalysis/JetTagging/JetTagPerformanceCalibration/CalibrationDataInterface/Root/CalibrationDataInterfaceROOT.cxx +++ b/PhysicsAnalysis/JetTagging/JetTagPerformanceCalibration/CalibrationDataInterface/Root/CalibrationDataInterfaceROOT.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration */ ////////////////////////////////////////////////////////////////////////////////////////////// @@ -239,7 +239,15 @@ correctly accounting for bin-to-bin correlations. For detailed usage of b-tagging results (e.g. in profile likelihood fits) this is recommended (default: false) excludeFromCovMatrix: semicolon-separated list of uncertainties to be excluded from the eigenvector - decomposition. + decomposition, for all flavours. + excludeFromBCovMatrix: semicolon-separated list of uncertainties to be excluded from the eigenvector + decomposition for b jets + excludeFromCCovMatrix: semicolon-separated list of uncertainties to be excluded from the eigenvector + decomposition for c jets + excludeFromTCovMatrix: semicolon-separated list of uncertainties to be excluded from the eigenvector + decomposition for tau "jets" + excludeFromLightCovMatrix: semicolon-separated list of uncertainties to be excluded from the eigenvector + decomposition for light-flavour jets </pre> </li> </ul> @@ -252,6 +260,8 @@ End_Html */ #include "CalibrationDataInterface/CalibrationDataContainer.h" #include "CalibrationDataInterface/CalibrationDataEigenVariations.h" +#include "CalibrationDataInterface/CalibrationDataInternals.h" +#include <boost/algorithm/string.hpp> #include "TMath.h" #include "TEnv.h" @@ -271,30 +281,17 @@ using std::endl; using Analysis::CalibrationDataContainer; using Analysis::UncertaintyResult; using Analysis::CalibrationDataEigenVariations; +using Analysis::CalibrationDataInterface::split; +using boost::trim; #ifndef __CINT__ ClassImp(Analysis::CalibrationDataInterfaceROOT) #endif -// local utility function: trim leading and trailing whitespace in the configuration .env file - -namespace { - std::string trim(const std::string& str, - const std::string& whitespace = " \t") { - const auto strBegin = str.find_first_not_of(whitespace); - if (strBegin == std::string::npos) - return ""; // no content - - const auto strEnd = str.find_last_not_of(whitespace); - const auto strRange = strEnd - strBegin + 1; - - return str.substr(strBegin, strRange); - } -} - //________________________________________________________________________________ -Analysis::CalibrationDataInterfaceROOT::CalibrationDataInterfaceROOT(const string& taggerName, string configname, string pathname) -: m_runEigenVectorMethod(false), m_absEtaStrategy(GiveUp), m_otherStrategy(Flag) +Analysis::CalibrationDataInterfaceROOT::CalibrationDataInterfaceROOT(const string& taggerName, string configname, string pathname) : + m_runEigenVectorMethod(false), m_useRecommendedEVExclusions(false), m_verbose(true), + m_absEtaStrategy(GiveUp), m_otherStrategy(Flag) { // Normal constructor. // @@ -308,8 +305,8 @@ Analysis::CalibrationDataInterfaceROOT::CalibrationDataInterfaceROOT(const strin // ROOT file containing the calibrations TString filename = env.GetValue("File", "BTaggingPerformanceCalibrations.root"); - m_filenameEff = trim(string(env.GetValue("FileEff", ""))); - m_filenameSF = trim(string(env.GetValue("FileSF", ""))); + m_filenameEff = string(env.GetValue("FileEff", "")); trim(m_filenameEff); + m_filenameSF = string(env.GetValue("FileSF", "")); trim(m_filenameSF); if (m_filenameEff == "") { m_filenameEff = pathname + filename.Data(); } @@ -317,11 +314,13 @@ Analysis::CalibrationDataInterfaceROOT::CalibrationDataInterfaceROOT(const strin m_filenameSF = pathname + filename.Data(); } - cout << "=== CalibrationDataInterfaceROOT::CalibrationDataInterfaceROOT ===" << endl; - cout << " Config name : " << configname << endl; - cout << " taggerName : " << taggerName << endl; - cout << " Efficiency file name : " << m_filenameEff << endl - << " SF file name : " << m_filenameSF << endl; + if (m_verbose) { + cout << "=== CalibrationDataInterfaceROOT::CalibrationDataInterfaceROOT ===" << endl; + cout << " Config name : " << configname << endl; + cout << " taggerName : " << taggerName << endl; + cout << " Efficiency file name : " << m_filenameEff << endl + << " SF file name : " << m_filenameSF << endl; + } m_fileEff = TFile::Open(m_filenameEff.c_str(), "READ"); if (m_filenameEff == m_filenameSF) @@ -329,89 +328,36 @@ Analysis::CalibrationDataInterfaceROOT::CalibrationDataInterfaceROOT(const strin else m_fileSF = TFile::Open(m_filenameSF.c_str(), "READ"); - TObjString* s; - m_fileSF->GetObject("VersionInfo/BuildNumber", s); - if (s) cout << " CDI file build number: " << s->GetName() << endl; - cout << endl; - - // Calibration names for the efficiencies + if (m_verbose) { + TObjString* s; + m_fileSF->GetObject("VersionInfo/BuildNumber", s); + if (s) cout << " CDI file build number: " << s->GetName() << endl; + cout << endl; + } + + std::string flavours[] = { "B", "C", "T", "Light" }; string testPrefix(taggerName); testPrefix += "."; - string test(testPrefix); test += "EfficiencyCalibrationBName"; - string calibrationBName(trim(string(env.GetValue(test.c_str(), "default")))); - test = testPrefix; test += "EfficiencyCalibrationCName"; - string calibrationCName(trim(string(env.GetValue(test.c_str(), "default")))); - test = testPrefix; test += "EfficiencyCalibrationTName"; - string calibrationTName(trim(string(env.GetValue(test.c_str(), "default")))); - test = testPrefix; test += "EfficiencyCalibrationLightName"; - string calibrationLightName(trim(string(env.GetValue(test.c_str(), "default")))); // Since TEnv doesn't allow for straight retrieval of vectors of strings, expect // semicolon-separated entries (semicolon because ROOT considers this as a "special" // token anyway in object names). string::size_type end; - std::vector<string> calibrationBNames; - if (calibrationBName.size() > 0) { - do { - end = calibrationBName.find(";"); - calibrationBNames.push_back(trim(calibrationBName.substr(0,end))); - if (end != string::npos) calibrationBName = calibrationBName.substr(end+1); - } while (end != string::npos); - } - - std::vector<string> calibrationCNames; - if (calibrationCName.size() > 0) { - do { - end = calibrationCName.find(";"); - calibrationCNames.push_back(trim(calibrationCName.substr(0,end))); - if (end != string::npos) calibrationCName = calibrationCName.substr(end+1); - } while (end != string::npos); - } - - std::vector<string> calibrationTNames; - if (calibrationTName.size() > 0) { - do { - end = calibrationTName.find(";"); - calibrationTNames.push_back(trim(calibrationTName.substr(0,end))); - if (end != string::npos) calibrationTName = calibrationTName.substr(end+1); - } while (end != string::npos); - } - - std::vector<string> calibrationLightNames; - if (calibrationLightName.size() > 0) { - do { - end = calibrationLightName.find(";"); - calibrationLightNames.push_back(trim(calibrationLightName.substr(0,end))); - if (end != string::npos) calibrationLightName = calibrationLightName.substr(end+1); - } while (end != string::npos); - } - - - // insert the calibration names into a common object + // Calibration names for the efficiencies std::map<string, std::vector<string> > effNames; - effNames["B"] = calibrationBNames; - effNames["C"] = calibrationCNames; - effNames["T"] = calibrationTNames; - effNames["Light"] = calibrationLightNames; + for (auto const& flavour : flavours) { + string test(testPrefix); test += "EfficiencyCalibration"; test += flavour; test += "Name"; + effNames[flavour] = split(string(env.GetValue(test.c_str(), "default"))); + } setEffCalibrationNames(effNames); // Calibration names for the efficiency scale factors - test = testPrefix; test += "ScaleFactorCalibrationBName"; - calibrationBName = trim(string(env.GetValue(test.c_str(), "default"))); - test = testPrefix; test += "ScaleFactorCalibrationCName"; - calibrationCName = trim(string(env.GetValue(test.c_str(), "default"))); - test = testPrefix; test += "ScaleFactorCalibrationTName"; - calibrationTName = trim(string(env.GetValue(test.c_str(), "default"))); - test = testPrefix; test += "ScaleFactorCalibrationLightName"; - calibrationLightName = trim(string(env.GetValue(test.c_str(), "default"))); - - // insert the calibration names into a common object - std::map<string, string> names; - names["B"] = calibrationBName; - names["C"] = calibrationCName; - names["T"] = calibrationTName; - names["Light"] = calibrationLightName; - setSFCalibrationNames(names); + std::map<string, string> SFNames; + for (auto const& flavour : flavours) { + string test(testPrefix); test += "ScaleFactorCalibration"; test += flavour; test += "Name"; + SFNames[flavour] = string(env.GetValue(test.c_str(), "default")); trim(SFNames[flavour]); + } + setSFCalibrationNames(SFNames); // Since TEnv doesn't allow for straight retrieval of vectors of strings, expect // semicolon-separated entries (semicolon because ROOT considers this as a "special" @@ -427,53 +373,69 @@ Analysis::CalibrationDataInterfaceROOT::CalibrationDataInterfaceROOT(const strin // NB: TEnv imposes a maximum string length of 1024 characters -- is this a problem? string::size_type arrow = alias.find("->"); if (arrow == string::npos) continue; - m_aliases[trim(alias.substr(0,arrow))] = trim(alias.substr(arrow+2)); + string target = alias.substr(0,arrow); trim(target); + m_aliases[target] = alias.substr(arrow+2); trim(m_aliases[target]); if (end != string::npos) AL = AL.substr(end+1); } while (end != string::npos); } //run egenvector method or not? - test="runEigenVectorMethod"; + string test="runEigenVectorMethod"; m_runEigenVectorMethod=(bool)env.GetValue(test.c_str(),0); if (m_runEigenVectorMethod) { // Retrieve the list of systematic uncertainties not to be considered when building up - // the full covariance matrix used for the eigenvector method + // the full covariance matrix used for the eigenvector method. + // We do this in two steps: first, for backward compatibility reasons, a flavour-independent list is scanned. + // Second, flavour-specific lists are scanned. test = "excludeFromCovMatrix"; - string uncList(env.GetValue(test.c_str(), "")); - string::size_type end2; - if (uncList.size() > 0) { - do { - end2 = uncList.find(";"); - m_excludeFromCovMatrix.push_back(trim(uncList.substr(0,end2))); - if (end2 != string::npos) uncList = uncList.substr(end2+1); - } while (end2 != string::npos); + std::vector<std::string> to_exclude = split(env.GetValue(test.c_str(), "")); + // Copy the resulting list to all flavours + for (auto const& flavour : flavours) { + m_excludeFromCovMatrix[flavour] = to_exclude; } - cout << " List of uncertainties to exclude:"; - if (m_excludeFromCovMatrix.size() == 0) cout << " (none)"; - cout << endl; - for (unsigned int i = 0; i < m_excludeFromCovMatrix.size(); ++i) { - cout << "\t"<< m_excludeFromCovMatrix[i] << endl; + for (auto const& flavour : flavours) { + test = "excludeFrom"; test += flavour; test += "CovMatrix"; + to_exclude = split(env.GetValue(test.c_str(), "")); + // Append to the existing list + m_excludeFromCovMatrix[flavour].insert(m_excludeFromCovMatrix[flavour].end(), to_exclude.begin(), to_exclude.end()); + } + + unsigned int n_excluded = 0; + for (auto const& flavour : flavours) { + n_excluded += m_excludeFromCovMatrix[flavour].size(); + } + if (m_verbose) { + cout << " List of uncertainties to exclude:"; + if (n_excluded == 0) cout << " none"; + for (auto const& flavour : flavours) { + if (m_excludeFromCovMatrix[flavour].size() > 0) { + cout << "\n\t" << flavour << ":\t"; + for (unsigned int i = 0; i < m_excludeFromCovMatrix[flavour].size(); ++i) { + cout << m_excludeFromCovMatrix[flavour][i]; + if (i+1 != m_excludeFromCovMatrix[flavour].size()) cout << "; "; + } + cout << endl; + } + } + cout << endl; } + // The following determines whether also pre-determined (recommended) lists of uncertainties are to be excluded from EV decomposition. + // These lists are stored with the CalibrationDataContainers, which have not been instantiated yet (so we cannot show them at this point). + m_useRecommendedEVExclusions = (bool) env.GetValue("ExcludeRecommendedFromEigenVectorTreatment", false); + // determine also the eigenvector reduction strategies std::map<string, EVReductionStrategy> mappings; - std::map<string, string> reductions; - test = testPrefix; test += "EigenvectorReductionB"; - reductions["B"] = trim(string(env.GetValue(test.c_str(), "Loose"))); - test = testPrefix; test += "EigenvectorReductionC"; - reductions["C"] = trim(string(env.GetValue(test.c_str(), "Loose"))); - test = testPrefix; test += "EigenvectorReductionLight"; - reductions["Light"] = trim(string(env.GetValue(test.c_str(), "Loose"))); mappings["Loose"] = Loose; mappings["Medium"] = Medium; mappings["Tight"] = Tight; - for (auto const &flavour : reductions) { - m_EVReductions[flavour.first] = mappings.find(flavour.second) == mappings.end() ? mappings["Loose"] : mappings.find(flavour.second)->second; + for (auto const& flavour : flavours) { + test = testPrefix; test += "EigenvectorReduction"; test += flavour; + std::string reduction = string(env.GetValue(test.c_str(), "Loose")); trim(reduction); + m_EVReductions[flavour] = mappings.find(reduction) == mappings.end() ? mappings["Loose"] : mappings.find(reduction)->second; } - // copy the strategy for c jets over to tau "jets" - m_EVReductions["T"] = m_EVReductions["C"]; } // determine |eta| validity range @@ -481,7 +443,7 @@ Analysis::CalibrationDataInterfaceROOT::CalibrationDataInterfaceROOT(const strin if (m_maxAbsEta < 0) m_maxAbsEta = 2.5; // set validation / protection strategy in case an out-of-bounds eta value is specified - string strategy = trim(string(env.GetValue("OutOfBoundsEta", "GiveUp"))); + string strategy = string(env.GetValue("OutOfBoundsEta", "GiveUp")); trim(strategy); if (strategy == "GiveUp") m_absEtaStrategy = GiveUp; else if (strategy == "Flag") m_absEtaStrategy = Flag; else if (strategy == "Ignore") m_absEtaStrategy = Ignore; @@ -491,7 +453,7 @@ Analysis::CalibrationDataInterfaceROOT::CalibrationDataInterfaceROOT(const strin } // set validation / protection strategy in case out-of-bounds variables are specified - strategy = trim(string(env.GetValue("OutOfBoundsOther", "Flag"))); + strategy = string(env.GetValue("OutOfBoundsOther", "Flag")); trim(strategy); if (strategy == "GiveUp") m_otherStrategy = GiveUp; else if (strategy == "GiveUpExtrapolated") m_otherStrategy = GiveUpExtrapolated; else if (strategy == "Flag") m_otherStrategy = Flag; @@ -509,7 +471,7 @@ Analysis::CalibrationDataInterfaceROOT::CalibrationDataInterfaceROOT(const strin // MC/MC (topology) scale factors: making this user-steerable is intended to be *temporary* only m_useTopologyRescaling = (bool) env.GetValue("useTopologySF", 0); - cout << "======= end of CalibrationDataInterfaceROOT instantiation ========" << endl; + if (m_verbose) cout << "======= end of CalibrationDataInterfaceROOT instantiation ========" << endl; } @@ -519,11 +481,14 @@ Analysis::CalibrationDataInterfaceROOT::CalibrationDataInterfaceROOT(const std:: const std::vector<std::string>& jetAliases, const std::map<std::string, std::string>& SFNames, const std::map<std::string, std::vector<std::string> >& EffNames, - const std::vector<std::string>& excludeFromEV, + const std::map<std::string, std::vector<std::string> >& excludeFromEV, const std::map<std::string, EVReductionStrategy> EVReductions, - bool useEV, bool useMCMCSF, bool useTopologyRescaling) : + bool useEV, bool useMCMCSF, bool useTopologyRescaling, + bool useRecommendedEEVExclusions, bool verbose) : m_filenameSF(fileSF), m_filenameEff(""), - m_runEigenVectorMethod(useEV), m_EVReductions(EVReductions), m_useMCMCSF(useMCMCSF), m_useTopologyRescaling(useTopologyRescaling), + m_runEigenVectorMethod(useEV), m_EVReductions(EVReductions), + m_useRecommendedEVExclusions(useRecommendedEEVExclusions), m_verbose(verbose), + m_useMCMCSF(useMCMCSF), m_useTopologyRescaling(useTopologyRescaling), m_maxAbsEta(2.5), m_absEtaStrategy(GiveUp), m_otherStrategy(Flag), m_maxTagWeight(10.0) { @@ -544,8 +509,9 @@ Analysis::CalibrationDataInterfaceROOT::CalibrationDataInterfaceROOT(const std:: // name of the scale factor calibration object // EffNames: map specifying for each of the calibration flavours ("B", "C", "T", "Light") the // names of the possibly relevant efficiency calibration objects - // excludeFromEV: list of systematic uncertainties to be excluded from the Eigenvector variation - // treatment (this is used only if Eigenvector variations are used to begin with) + // excludeFromEV: map specifying for each of the calibration flavours ("B", "C", "T", "Light") the + // systematic uncertainties to be excluded from the Eigenvector variation treatment + // (this is used only if Eigenvector variations are used to begin with) // EVReductions: Eigenvector variation reduction strategies for "B", "C", "Light" jets (again, // this is only relevant if Eigenvector variations are used to begin with) // useEV: switch specifying if Eigenvector variations will be used or not @@ -554,11 +520,13 @@ Analysis::CalibrationDataInterfaceROOT::CalibrationDataInterfaceROOT(const std:: // Note: at present, the means to change the strategies and maximum values initialized above do not exist // when using this constructor - cout << "=== CalibrationDataInterfaceROOT::CalibrationDataInterfaceROOT ===" << endl; - cout << " taggerName : " << taggerName.c_str() << endl; - if (fileEff) cout << " Efficiency file name : " << fileEff << endl; - cout << " SF file name : " << fileSF << endl - << endl; + if (m_verbose) { + cout << "=== CalibrationDataInterfaceROOT::CalibrationDataInterfaceROOT ===" << endl; + cout << " taggerName : " << taggerName.c_str() << endl; + if (fileEff) cout << " Efficiency file name : " << fileEff << endl; + cout << " SF file name : " << fileSF << endl + << endl; + } m_taggerName = taggerName; @@ -569,11 +537,13 @@ Analysis::CalibrationDataInterfaceROOT::CalibrationDataInterfaceROOT(const std:: } else m_fileEff = m_fileSF; - TObjString* s; - m_fileSF->GetObject("VersionInfo/BuildNumber", s); - if (s) cout << " CDI file build number: " << s->GetName() << endl; - cout << endl; - + if (m_verbose) { + TObjString* s; + m_fileSF->GetObject("VersionInfo/BuildNumber", s); + if (s) cout << " CDI file build number: " << s->GetName() << endl; + cout << endl; + } + for (unsigned int i = 0; i < jetAliases.size(); ++i) { // Each alias specification uses an arrow ("->"). Forget about entries // not properly following this specification. @@ -588,14 +558,29 @@ Analysis::CalibrationDataInterfaceROOT::CalibrationDataInterfaceROOT(const std:: if (m_runEigenVectorMethod) { m_excludeFromCovMatrix = excludeFromEV; - cout << " List of uncertainties to exclude:"; - if (m_excludeFromCovMatrix.size() == 0) cout << " (none)"; - cout << endl; - for (unsigned int i = 0; i < m_excludeFromCovMatrix.size(); ++i) { - cout << "\t"<< m_excludeFromCovMatrix[i] << endl; + std::string flavours[] = { "B", "C", "T", "Light" }; + unsigned int n_excluded = 0; + for (auto const& flavour : flavours) { + n_excluded += m_excludeFromCovMatrix[flavour].size(); + } + if (m_verbose) { + cout << " List of uncertainties to exclude:"; + if (n_excluded == 0) cout << " none"; + for (auto const& flavour : flavours) { + if (m_excludeFromCovMatrix[flavour].size() > 0) { + cout << "\n\t" << flavour << ":\t"; + for (unsigned int i = 0; i < m_excludeFromCovMatrix[flavour].size(); ++i) { + cout << m_excludeFromCovMatrix[flavour][i]; + if (i+1 != m_excludeFromCovMatrix[flavour].size()) cout << "; "; + } + cout << endl; + } + } + cout << endl; } } - cout << "======= end of CalibrationDataInterfaceROOT instantiation ========" << endl; + + if (m_verbose) cout << "======= end of CalibrationDataInterfaceROOT instantiation ========" << endl; } //________________________________________________________________________________ @@ -654,8 +639,14 @@ Analysis::CalibrationDataInterfaceROOT::~CalibrationDataInterfaceROOT() } } + for (std::map<std::string, HadronisationReferenceHelper*>::iterator it = m_refMap.begin(); + it != m_refMap.end(); ++it) { + if(it->second) + { delete it->second; it->second=nullptr; } + } + // Print summary output on out-of-bounds issues - if (m_absEtaStrategy == Flag) { + if (m_absEtaStrategy == Flag && m_verbose) { bool found = false; cout << "\t\tCalibrationDataInterfaceROOT |eta| out-of-bounds summary:" << endl; for (unsigned int index = 0; index < m_mainCounters.size(); ++index) @@ -665,7 +656,7 @@ Analysis::CalibrationDataInterfaceROOT::~CalibrationDataInterfaceROOT() } if (!found) cout << "\t\t\tNo issues found" << endl; } - if (m_otherStrategy == Flag) { + if (m_otherStrategy == Flag && m_verbose) { bool found = false; cout << "\t\tCalibrationDataInterfaceROOT object out-of-bounds summary:" << endl; for (unsigned int index = 0; index < m_mainCounters.size(); ++index) @@ -718,7 +709,7 @@ Analysis::CalibrationDataInterfaceROOT::retrieveCalibrationIndex (const std::str string flavour = (label == "N/A") ? "Light" : label; string dirname = m_taggerName + "/" + getAlias(author) + "/" + OP + "/" + flavour; string cntname = getContainername(flavour, isSF, mapIndex); - const_cast<Analysis::CalibrationDataInterfaceROOT*>(this)->retrieveContainer(dirname, cntname, isSF); + const_cast<Analysis::CalibrationDataInterfaceROOT*>(this)->retrieveContainer(dirname, cntname, isSF, m_verbose); it = m_objectIndices.find(name); if (it == m_objectIndices.end()) return false; } @@ -817,8 +808,8 @@ Analysis::CalibrationDataInterfaceROOT::getScaleFactor (const CalibrationDataVar if (!m_runEigenVectorMethod && (unc == SFEigen || unc == SFNamed)) { - cerr << " ERROR. Trying to call eigenvector method but initialization not switched on in b-tagging .env config file." << endl; - cerr << " Please correct your .env config file first. Nominal uncertainties used. " << endl; + cerr << " ERROR. Trying to call eigenvector method but initialization not switched on in b-tagging configuration." << endl; + cerr << " Please correct your configuration first. Nominal uncertainties used. " << endl; } if (unc == SFEigen || unc == SFNamed) { const CalibrationDataEigenVariations* eigenVariation=m_eigenVariationsMap[container]; @@ -1244,7 +1235,7 @@ Analysis::CalibrationDataInterfaceROOT::getInefficiencyScaleFactor(const Calibra if (effStatus == Analysis::kError) return effStatus; double eff = std::min(effResult.first, 1.); - double efferr = effResult.second; + // double efferr = effResult.second; // not needed as (per the code change indicated below) we are not doing anything with MC statistical uncertainties double sf = sfResult.first; double sferr = sfResult.second; @@ -1261,7 +1252,10 @@ Analysis::CalibrationDataInterfaceROOT::getInefficiencyScaleFactor(const Calibra result.second = valDown; return sfStatus; } - err = pow((1. - sf) / (1. - eff) * efferr, 2) + pow(eff*sferr, 2); + // When using eigenvector (or named) variations (as above), only scale factor variations are considered. + // For the sake of consistency, it has been decided (see https://its.cern.ch/jira/browse/AFT-350) to remove them also when EV variations aren't used + //err = pow((1. - sf) / (1. - eff) * efferr, 2) + pow(eff*sferr, 2); + err = pow(eff*sferr, 2); if (err > 0.) err = 1./(1. - eff) * TMath::Sqrt(err); // cout << "btag Calib Ineff err=" << err << endl; @@ -1595,7 +1589,7 @@ Analysis::CalibrationDataInterfaceROOT::getWeightScaleFactor (const CalibrationD else if (m_otherStrategy == Flag) if (effStatus == Analysis::kRange) const_cast<CalibrationDataInterfaceROOT*>(this)->increaseCounter(indexEff); // since we need to divide by this quantity, check that it is well-defined - if (!(fracMCnew > 0.)) { + if (!(fracMCnew > 0.) and m_useTopologyRescaling) {// but we only care if using topology rescaling cerr << "getWeightScaleFactor: error: null fracMCnew would lead to invalid operation" << endl; return Analysis::kError; } @@ -1626,7 +1620,7 @@ Analysis::CalibrationDataInterfaceROOT::getWeightScaleFactor (const CalibrationD return Analysis::kError; } // the 'extrapolation' uncertainty (always a named one) needs a somewhat special treatment - bool extrapolate = (unc==SFNamed) ? eigenVariation->isExtrapolationVariation(numVariation) : false; + bool extrapolate = ( unc == SFNamed ) ? eigenVariation->isExtrapolationVariation(numVariation) : false; double valueUp; double valueDown; @@ -1686,10 +1680,19 @@ Analysis::CalibrationDataInterfaceROOT::getWeightScaleFactor (const CalibrationD if (unc == Total || unc == Systematic) { if (container->getSystUncertainty(variables, uncertaintyResult) == Analysis::kError) { cerr << "getWeightScaleFactor: error retrieving Scale factor parameter systematic uncertainty!" - << endl; + << endl; return Analysis::kError; } - } + } else if (unc == Extrapolation) { + // this uncertainty is special, since it is not normally to be combined into the overall systematic uncertainty + if (container->getUncertainty("extrapolation", variables, uncertaintyResult) == Analysis::kError) + cerr << "getWeightScaleFactor: error retrieving Scale factor parameter extrapolation uncertainty!" << endl; + } else if (unc == TauExtrapolation) { + // also this uncertainty is special, since it it singles out an uncertainty relevant only for tau "jets", + // and some care has to be taken not to duplicate or omit uncertainties + if (container->getUncertainty("extrapolation from charm", variables, uncertaintyResult) == Analysis::kError) + cerr << "getWeightScaleFactor: error retrieving Scale factor parameter extrapolation uncertainty!" << endl; + } double uncertainty = combinedUncertainty(stat, uncertaintyResult); @@ -2341,7 +2344,7 @@ Analysis::CalibrationDataInterfaceROOT::initialize(const string& jetauthor, cons //________________________________________________________________________________ CalibrationDataContainer* -Analysis::CalibrationDataInterfaceROOT::retrieveContainer(const string& dir, const string& cntname, bool isSF) +Analysis::CalibrationDataInterfaceROOT::retrieveContainer(const string& dir, const string& cntname, bool isSF, bool doPrint) { // Attempt to retrieve the given container from file. Note that also the corresponding // "hadronisation" reference is retrieved (if possible and not yet done). @@ -2351,6 +2354,9 @@ Analysis::CalibrationDataInterfaceROOT::retrieveContainer(const string& dir, con // isSF: set to false (true) if the object is to be retrieved from the MC efficiencies // file (the calibration scale factor file). Note that it is assumed that scale // factor objects will always be retrieved from the calibration scale factor file. + // doPrint: if true, print out some basic information about the successfully retrieved container + // (note that this is typically steered by the m_verbose setting; + // only for the retrieval of the maps used for MC/MC SF calculations, this printout is always switched off) // construct the full object name string name = dir + "/" + cntname; @@ -2370,10 +2376,17 @@ Analysis::CalibrationDataInterfaceROOT::retrieveContainer(const string& dir, con if (!isSF && !cnt && m_fileSF != m_fileEff) m_fileSF->GetObject(name.c_str(), cnt); m_objects.push_back(cnt); if (!cnt) { - cout << "btag Calib: retrieveContainer: failed to retrieve container named " << name.c_str() << " from file" << endl; + cerr << "btag Calib: retrieveContainer: failed to retrieve container named " << name.c_str() << " from file" << endl; return 0; } + // For successfully retrieved containers, also print some more information (implemented on user request) + if (doPrint) { + cout << "CalibrationDataInterface: retrieved container " << name << " (with comment: '" << cnt->getComment() + << "' and hadronisation setting '" << cnt->getHadronisation() << "')" << endl; + } + + // If the requested object is a MC efficiency container, make sure to retrieve the corresponding // calibration scale factor container first (a feature first thought to be necessary, erroneously, // but left in since this ordering should not hurt in any case). @@ -2389,7 +2402,7 @@ Analysis::CalibrationDataInterfaceROOT::retrieveContainer(const string& dir, con delete mapEff; } else { string SFCalibName = getContainername(getBasename(dir), true); - if (m_objectIndices.find(SFCalibName) == m_objectIndices.end()) retrieveContainer(dir, SFCalibName, true); + if (m_objectIndices.find(SFCalibName) == m_objectIndices.end()) retrieveContainer(dir, SFCalibName, true, doPrint); } } @@ -2411,45 +2424,45 @@ Analysis::CalibrationDataInterfaceROOT::retrieveContainer(const string& dir, con string refname(dir + "/" + ref); std::map<string, unsigned int>::const_iterator it = m_objectIndices.find(refname); // If the reference cannot be found, assume that it hasn't yet been retrieved so attempt it now. - if (it == m_objectIndices.end()) { - retrieveContainer(dir, ref, isSF); it = m_objectIndices.find(refname); + if (it == m_objectIndices.end()) { + // Omit the printout of container information here (the idea being that showing MC/MC SF information would confuse rather than help) + retrieveContainer(dir, ref, isSF, false); it = m_objectIndices.find(refname); } m_hadronisationReference[idx] = it->second; } } else if (m_useMCMCSF) - cout << "btag Calib: retrieveContainer: MC hadronisation reference map not found -- this should not happen!" << endl; + cerr << "btag Calib: retrieveContainer: MC hadronisation reference map not found -- this should not happen!" << endl; } if (m_hadronisationReference[idx] == -1 || ! m_objects[m_hadronisationReference[idx]]) // Not being able to construct the MC/MC scale factors will lead to a potential bias. // However, this is not considered sufficiently severe that we will flag it as an error. if (m_useMCMCSF) - cout << "btag Calib: retrieveContainer: warning: unable to apply MC/MC scale factors for container " + cerr << "btag Calib: retrieveContainer: warning: unable to apply MC/MC scale factors for container " << name << " with hadronisation reference = '" << spec << "'" << endl; - // Initialize the Eigenvector variation object corresponding to this object, if applicable. Note that the - // dual use of "isSF" (both referring to the file and to the object, see above) requires another protection here. + // Initialize the Eigenvector variation object corresponding to this object, if applicable. Notes: + // - the dual use of "isSF" (both referring to the file and to the object, see above) requires another protection here + // - the constructor's second argument is used to determine whether to exclude a pre-determined set of uncertainties from the EV decomposition if (m_runEigenVectorMethod && isSF && name.find("_SF") != string::npos) { const CalibrationDataHistogramContainer* histoContainer=dynamic_cast<const CalibrationDataHistogramContainer*>(cnt); if (histoContainer==0) { cerr << "Could not cast Container to a HistogramContainer. " << endl; return 0; } - CalibrationDataEigenVariations* newEigenVariation=new CalibrationDataEigenVariations(histoContainer); + CalibrationDataEigenVariations* newEigenVariation=new CalibrationDataEigenVariations(histoContainer, m_useRecommendedEVExclusions); - std::vector<std::string>::const_iterator listBegin=m_excludeFromCovMatrix.begin(); - std::vector<std::string>::const_iterator listEnd=m_excludeFromCovMatrix.end(); - - for (std::vector<std::string>::const_iterator listIter=listBegin;listIter!=listEnd;++listIter) { - newEigenVariation->excludeNamedUncertainty(*listIter); - } - - newEigenVariation->initialize(); // At this point we may also want to reduce the number of eigenvector variations. // The choices are stored with the container object; but first we need to know what flavour we are dealing with. string flavour = dir.substr(dir.find_last_of("/")+1); + + for (auto entry : m_excludeFromCovMatrix[flavour]) { + newEigenVariation->excludeNamedUncertainty(entry); + } + + newEigenVariation->initialize(); int to_retain = histoContainer->getEigenvectorReduction(m_EVReductions[flavour]); if (to_retain > -1) { - cout << "btag Calib: reducing number of eigenvector variations for flavour " << flavour << " to " << to_retain << endl; + if (m_verbose) cout << "btag Calib: reducing number of eigenvector variations for flavour " << flavour << " to " << to_retain << endl; // The merged variations will end up as the first entry in the specified list, i.e., as the last of the variations to be "retained" newEigenVariation->mergeVariationsFrom(size_t(to_retain-1)); } else if (m_EVReductions[flavour] != Loose) diff --git a/PhysicsAnalysis/JetTagging/JetTagPerformanceCalibration/CalibrationDataInterface/Root/CalibrationDataInternals.cxx b/PhysicsAnalysis/JetTagging/JetTagPerformanceCalibration/CalibrationDataInterface/Root/CalibrationDataInternals.cxx new file mode 100644 index 0000000000000000000000000000000000000000..4d3dbeb901b17e06eec568cedf1c66bc216c60b3 --- /dev/null +++ b/PhysicsAnalysis/JetTagging/JetTagPerformanceCalibration/CalibrationDataInterface/Root/CalibrationDataInternals.cxx @@ -0,0 +1,19 @@ +#include <boost/algorithm/string.hpp> + +#include "CalibrationDataInterface/CalibrationDataInternals.h" + +namespace Analysis { + namespace CalibrationDataInterface { + + // local utility function: split string into a vector of substrings separated by a specified separator + std::vector<std::string> split(const std::string& str, const char token) { + std::vector<std::string> result; + boost::split(result, str, [&token] (char c) { return c == token ;}); + for (std::string& element : result) { + boost::trim(element); + } + return result; + } + + } +} diff --git a/PhysicsAnalysis/JetTagging/JetTagPerformanceCalibration/CalibrationDataInterface/Root/LinkDef.h b/PhysicsAnalysis/JetTagging/JetTagPerformanceCalibration/CalibrationDataInterface/Root/LinkDef.h old mode 100755 new mode 100644 index 6842aedfe2faf45337567076b9e149ea86486ed4..5324dd345f25dde217198782598b570456ff1010 --- a/PhysicsAnalysis/JetTagging/JetTagPerformanceCalibration/CalibrationDataInterface/Root/LinkDef.h +++ b/PhysicsAnalysis/JetTagging/JetTagPerformanceCalibration/CalibrationDataInterface/Root/LinkDef.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration */ #include "CalibrationDataInterface/CalibrationDataVariables.h" @@ -17,12 +17,12 @@ #pragma link off all functions; #pragma link C++ nestedclass; - + #pragma link C++ namespace Analysis; #pragma link C++ class Analysis::CalibrationDataInterfaceBase; -#pragma link C++ class Analysis::CalibrationDataInterfaceROOT+; -#pragma link C++ class Analysis::CalibrationDataInterfaceROOT::HadronisationReferenceHelper+; +#pragma link C++ class Analysis::CalibrationDataInterfaceROOT+; +#pragma link C++ class Analysis::CalibrationDataInterfaceROOT::HadronisationReferenceHelper+; #pragma link C++ class Analysis::CalibrationDataVariables; #pragma link C++ class Analysis::CalibrationDataEigenVariations; diff --git a/PhysicsAnalysis/JetTagging/JetTagPerformanceCalibration/CalibrationDataInterface/scripts/showCalibration.C b/PhysicsAnalysis/JetTagging/JetTagPerformanceCalibration/CalibrationDataInterface/scripts/showCalibration.C index 7e08b20056bdcc37348a7414312869857e883a61..f7b2c89420a41ed4954e3e48c6ac25c9d23ac49b 100644 --- a/PhysicsAnalysis/JetTagging/JetTagPerformanceCalibration/CalibrationDataInterface/scripts/showCalibration.C +++ b/PhysicsAnalysis/JetTagging/JetTagPerformanceCalibration/CalibrationDataInterface/scripts/showCalibration.C @@ -2,235 +2,237 @@ Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration */ -// -// File : showCalibration.C -// Author : Frank Filthaut -// Purpose : inspect the container objects in the calibration ROOT file - -// Either load the library before running ".x showCalibration.C+" (i.e. compiled), -// then you'll need the include. Or run ".x showCalibration.C" and call -// gSystem->Load("libCalibrationDataInterface.so"); in here - but then the #include -// is in the way: CINT *replaces* elements from the dictionary when loading -// the #include :-( - -// This macro has been developed within the RootCore build environment: -// root -l $ROOTCOREDIR/scripts/load_packages.C+ -// .L showCalibration.C+ -// showCalibration() -// NB see below for the arguments to the call - -#include <iostream> -#include <iomanip> -#include <vector> -#include <string> -#include <cmath> -#include "TFile.h" -#include "TH1.h" -#include "TH2.h" -#include "TString.h" - -using std::cout; -using std::endl; -using std::setw; -using std::vector; -using std::string; - -#ifndef __CINT__ -# include "CalibrationDataInterface/CalibrationDataContainer.h" -#endif - -using Analysis::CalibrationDataContainer; -using Analysis::CalibrationDataFunctionContainer; -using Analysis::CalibrationDataHistogramContainer; - -void showCalibration(TString fileName, - TString pathName, - TString uncertainty = "list", - bool plot = false) { - -#ifdef __CINT__ - gSystem->Load("libCalibrationDataInterface.so"); -#endif - - if (uncertainty == "help") { - cout << "usage: showCalibration(fileName, pathName, uncertainty)" << endl; - cout << "where" << endl; - cout << " fileName: name of the CDI ROOT file" << endl; - cout << " pathName: name of the calibration object's path name within the ROOT file (see e.g. output from checkCalibrationFile())" << endl; - cout << " uncertainty: uncertainty to be shown in addition to statistical uncertainty (use \"list\" to obtain a list; use \"total\" to sum stat and syst uncertainties)" << endl; - return; - } - - TFile* f = TFile::Open(fileName.Data(), "READ"); - f->cd(); - - CalibrationDataHistogramContainer* c; - f->GetObject(pathName.Data(), c); - if (c) { - // Object found; now go about showing its properties - // Special case: uncertainty == "list": show a list of (meaningful) uncertainties - if (uncertainty == "list") { - vector<string> uncs = c->listUncertainties(); - for (unsigned int i = 0; i < uncs.size(); ++i) - if (uncs[i] != "comment" && uncs[i] != "statistics" && uncs[i] != "MCreference") - cout << uncs[i] << endl; - } else if (uncertainty == "comment") { - cout << c->getComment() << endl; - } else if (uncertainty == "hadronisation") { - cout << c->getHadronisation() << endl; - } else { - bool doTotal = uncertainty == "total"; - bool doExtrap = uncertainty == "extrapolation"; - if (doTotal) cout << "NB: printing total uncertainties" << endl; - TH1* hunc = dynamic_cast<TH1*>(c->GetValue(doTotal ? "systematics" : uncertainty.Data())); - if (hunc) { - TH1* href = (uncertainty == "result") ? hunc : dynamic_cast<TH1*>(c->GetValue("result")); - href->SetStats(kFALSE); - Int_t ndim = href->GetDimension(); - if (ndim == 1) { - if (plot) { - href->SetLineWidth(2); - href->SetLineColor(kBlack); href->SetMarkerColor(kBlack); - href->Draw("PE"); - } - // printout to screen - cout << setw(15) << href->GetXaxis()->GetTitle() << setw(11) << "value" << setw(10) << "stat unc"; - if (hunc != href) cout << " " << uncertainty.Data(); - cout << "\n-----------------------------------------------------------------" << endl; - Int_t firstbin = hunc->GetXaxis()->FindFixBin(href->GetXaxis()->GetBinCenter(1)); - for (Int_t bin = 0; bin < hunc->GetNbinsX(); ++bin) { - // determine the bin number in the reference ("result") histogram - Int_t binref = bin - (firstbin-1); - if (binref < 0) binref = 0; - else if (binref >= href->GetNbinsX()) binref = href->GetNbinsX()-1; - double uncstat = href->GetBinError(binref+1); - cout << " [" << setw(6) << hunc->GetBinLowEdge(bin+1) << "," << setw(6) << hunc->GetBinLowEdge(bin+2) << "]" - << " " << setw(8) << href->GetBinContent(binref+1) << " " << setw(8) << uncstat; - if (hunc != href) { - double unc = hunc->GetBinContent(bin+1); - if (doTotal) unc = std::sqrt(unc*unc + uncstat*uncstat); - cout << " " << setw(8) << unc; - } - cout << endl; - } - if (plot && hunc != href) { - TH1* hclone = dynamic_cast<TH1*>(href->Clone((uncertainty+"_clone").Data())); - for (Int_t bin = 1; bin < hclone->GetNbinsX(); ++bin) - hclone->SetBinError(bin, hunc->GetBinContent(bin)); - hclone->SetFillColor(kGreen+3); - hclone->Draw("E3 SAME"); - // then redraw the original histogram - href->Draw("PE SAME"); - } - } else if (ndim == 2) { - // this is the more likely case... many histograms are stored as 2D ones, but with only one bin in the Y dimension. - // In these cases, project onto the X axis so as to be able to draw properly. - if (href->GetNbinsX() == 1) { - if (hunc->GetNbinsX() != 1) { - cout << "inconsistent X binning used between results and " << uncertainty << " histograms!" << endl; - f->Close(); - return; - } - if (((! doExtrap) && href->GetNbinsY() != hunc->GetNbinsY()) || - (doExtrap && href->GetNbinsY() > hunc->GetNbinsY())) { - cout << "inconsistent Y binning used between results and " << uncertainty << " histograms!" << endl; - f->Close(); - return; - } - TH1D* hpr = dynamic_cast<TH1D*>(dynamic_cast<TH2*>(hunc)->ProjectionY((uncertainty+"_projY").Data())); - // printout to screen - cout << setw(15) << href->GetYaxis()->GetTitle() << setw(11) << "value" << setw(10) << "stat unc"; - if (hunc != href) cout << " " << uncertainty.Data(); - cout << "\n-----------------------------------------------------------------" << endl; - Int_t firstbin = hunc->GetYaxis()->FindFixBin(href->GetYaxis()->GetBinCenter(1)); - for (Int_t bin = 0; bin < hpr->GetNbinsX(); ++bin) { - // determine the bin number in the reference ("result") histogram - Int_t binref = bin - (firstbin-1); - if (binref < 0) binref = 0; - else if (binref >= href->GetNbinsY()) binref = href->GetNbinsY()-1; - double uncstat = href->GetBinError(binref+1); - cout << " [" << setw(6) << hpr->GetBinLowEdge(bin+1) << "," << setw(6) << hpr->GetBinLowEdge(bin+2) << "]" - << " " << setw(8) << href->GetBinContent(1, binref+1) << " " << setw(8) << uncstat; - if (hunc != href) { - double unc = hunc->GetBinContent(1, bin+1); - if (doTotal) unc = std::sqrt(unc*unc + uncstat*uncstat); - cout << " " << setw(8) << unc; - } - cout << endl; - } - // if (plot) { - // hpr->SetLineWidth(2); - // hpr->SetLineColor(kBlack); hpr->SetMarkerColor(kBlack); - // hpr->Draw("EP"); - // if (hunc != href) { - // TH1* hclone = dynamic_cast<TH1*>(hpr->Clone((uncertainty+"_clone").Data())); - // for (Int_t bin = 1; bin < hclone->GetNbinsX(); ++bin) - // hclone->SetBinError(bin, hunc->GetBinContent(1, bin)); - // hclone->SetFillColor(kGreen+3); - // hclone->Draw("E3 SAME"); - // // then redraw the original histogram - // hpr->Draw("PE SAME"); - // } - // } - } else { - cout << setw(15) << href->GetXaxis()->GetTitle() << setw(16) << href->GetYaxis()->GetTitle() << setw(11) << "value" << setw(10) << "stat unc"; - if (hunc != href) cout << " " << uncertainty.Data(); - cout << "\n---------------------------------------------------------------------------------" << endl; - Int_t firstbinx = hunc->GetXaxis()->FindFixBin(href->GetXaxis()->GetBinCenter(1)); - Int_t firstbiny = hunc->GetYaxis()->FindFixBin(href->GetYaxis()->GetBinCenter(1)); - for (Int_t binx = 0; binx < hunc->GetNbinsX(); ++binx) { - // determine the bin number in the reference ("result") histogram - Int_t binrefx = binx - (firstbinx-1); - if (binrefx < 0) binrefx = 0; - else if (binrefx >= href->GetNbinsX()) binrefx = href->GetNbinsX()-1; - for (Int_t biny = 0; biny < hunc->GetNbinsY(); ++biny) { - // determine the bin number in the reference ("result") histogram - Int_t binrefy = biny - (firstbiny-1); - if (binrefy < 0) binrefy = 0; - else if (binrefy >= href->GetNbinsY()) binrefy = href->GetNbinsY()-1; - Int_t bin = hunc->GetBin(binx+1, biny+1), binref = href->GetBin(binrefx+1, binrefy+1); - double uncstat = href->GetBinError(binref); - cout << " [" << setw(6) << hunc->GetXaxis()->GetBinLowEdge(binx+1) << "," << setw(6) << hunc->GetXaxis()->GetBinLowEdge(binx+2) - << "],[" << setw(6) << hunc->GetYaxis()->GetBinLowEdge(biny+1) << "," << setw(6) << hunc->GetYaxis()->GetBinLowEdge(biny+2) << "]," - << " " << setw(8) << href->GetBinContent(binref) << " " << setw(8) << uncstat; - if (hunc != href) { - double unc = hunc->GetBinContent(bin); - if (doTotal) unc = std::sqrt(unc*unc + uncstat*uncstat); - cout << " " << setw(8) << unc; - } - cout << endl; - } - } - if (plot) href->Draw("LEGO"); - } - } else { - // this is the case for continuous tagging - cout << setw(15) << href->GetXaxis()->GetTitle() << setw(16) << href->GetYaxis()->GetTitle() << setw(16) << href->GetZaxis()->GetTitle() - << setw(11) << "value" << setw(10) << "stat unc"; - if (hunc != href) cout << " " << uncertainty.Data(); - cout << "\n---------------------------------------------------------------------------------" << endl; - for (Int_t binx = 0; binx < href->GetNbinsX(); ++binx) - for (Int_t biny = 0; biny < href->GetNbinsY(); ++biny) - for (Int_t binz = 0; binz < href->GetNbinsZ(); ++binz) { - Int_t bin = href->GetBin(binx+1, biny+1, binz+1); - double uncstat = href->GetBinError(bin); - cout << " [" << setw(6) << href->GetXaxis()->GetBinLowEdge(binx+1) << "," << setw(6) << href->GetXaxis()->GetBinLowEdge(binx+2) - << "],[" << setw(6) << href->GetYaxis()->GetBinLowEdge(biny+1) << "," << setw(6) << href->GetYaxis()->GetBinLowEdge(biny+2) - << "],[" << setw(6) << href->GetZaxis()->GetBinLowEdge(binz+1) << "," << setw(6) << href->GetZaxis()->GetBinLowEdge(binz+2) - << "] " << setw(8) << href->GetBinContent(bin) << " " << setw(8) << uncstat; - if (hunc != href) { - double unc = hunc->GetBinContent(bin); - if (doTotal) unc = std::sqrt(unc*unc + uncstat*uncstat); - cout << " " << setw(8) << unc; - } - cout << endl; - } - // if (plot) href->Draw("LEGO"); - } - } else - cout << "error: specified uncertainty (" << uncertainty << ") cannot be found" << endl; - } - } else - cout << "error: calibration object (" << pathName.Data() << ") cannot be found or is not a histogram container" << endl; - f->Close(); -} +// +// File : showCalibration.C +// Author : Frank Filthaut +// Purpose : inspect the container objects in the calibration ROOT file + +// Either load the library before running ".x showCalibration.C+" (i.e. compiled), +// then you'll need the include. Or run ".x showCalibration.C" and call +// gSystem->Load("libCalibrationDataInterface.so"); in here - but then the #include +// is in the way: CINT *replaces* elements from the dictionary when loading +// the #include :-( + +// This macro has been developed within the RootCore build environment: +// root -l $ROOTCOREDIR/scripts/load_packages.C+ +// .L showCalibration.C+ +// showCalibration() +// NB see below for the arguments to the call + +#include <iostream> +#include <iomanip> +#include <vector> +#include <string> +#include <cmath> +#include "TFile.h" +#include "TH1.h" +#include "TH2.h" +#include "TString.h" + +using std::cout; +using std::endl; +using std::setw; +using std::vector; +using std::string; + +#ifndef __CINT__ +# include "CalibrationDataInterface/CalibrationDataContainer.h" +#endif + +using Analysis::CalibrationDataContainer; +using Analysis::CalibrationDataFunctionContainer; +using Analysis::CalibrationDataHistogramContainer; + +void showCalibration(TString fileName, + TString pathName, + TString uncertainty = "list", + bool plot = false) { + +#ifdef __CINT__ + gSystem->Load("libCalibrationDataInterface.so"); +#endif + + if (uncertainty == "help") { + cout << "usage: showCalibration(fileName, pathName, uncertainty)" << endl; + cout << "where" << endl; + cout << " fileName: name of the CDI ROOT file" << endl; + cout << " pathName: name of the calibration object's path name within the ROOT file (see e.g. output from checkCalibrationFile())" << endl; + cout << " uncertainty: uncertainty to be shown in addition to statistical uncertainty (use \"list\" to obtain a list; use \"total\" to sum stat and syst uncertainties)" << endl; + return; + } + + TFile* f = TFile::Open(fileName.Data(), "READ"); + f->cd(); + + CalibrationDataHistogramContainer* c; + f->GetObject(pathName.Data(), c); + if (c) { + // Object found; now go about showing its properties + // Special case: uncertainty == "list": show a list of (meaningful) uncertainties + if (uncertainty == "list") { + vector<string> uncs = c->listUncertainties(); + for (unsigned int i = 0; i < uncs.size(); ++i) + if (uncs[i] != "comment" && uncs[i] != "statistics" && uncs[i] != "MCreference") + cout << uncs[i] << endl; + } else if (uncertainty == "comment") { + cout << c->getComment() << endl; + } else if (uncertainty == "MChadronisation") { + cout << c->getHadronisation() << endl; + } else if (uncertainty == "excluded_set") { + cout << c->getExcludedUncertainties() << endl; + } else { + bool doTotal = uncertainty == "total"; + bool doExtrap = uncertainty == "extrapolation"; + if (doTotal) cout << "NB: printing total uncertainties" << endl; + TH1* hunc = dynamic_cast<TH1*>(c->GetValue(doTotal ? "systematics" : uncertainty.Data())); + if (hunc) { + TH1* href = (uncertainty == "result") ? hunc : dynamic_cast<TH1*>(c->GetValue("result")); + href->SetStats(kFALSE); + Int_t ndim = href->GetDimension(); + if (ndim == 1) { + if (plot) { + href->SetLineWidth(2); + href->SetLineColor(kBlack); href->SetMarkerColor(kBlack); + href->Draw("PE"); + } + // printout to screen + cout << setw(15) << href->GetXaxis()->GetTitle() << setw(11) << "value" << setw(10) << "stat unc"; + if (hunc != href) cout << " " << uncertainty.Data(); + cout << "\n-----------------------------------------------------------------" << endl; + Int_t firstbin = hunc->GetXaxis()->FindFixBin(href->GetXaxis()->GetBinCenter(1)); + for (Int_t bin = 0; bin < hunc->GetNbinsX(); ++bin) { + // determine the bin number in the reference ("result") histogram + Int_t binref = bin - (firstbin-1); + if (binref < 0) binref = 0; + else if (binref >= href->GetNbinsX()) binref = href->GetNbinsX()-1; + double uncstat = href->GetBinError(binref+1); + cout << " [" << setw(6) << hunc->GetBinLowEdge(bin+1) << "," << setw(6) << hunc->GetBinLowEdge(bin+2) << "]" + << " " << setw(8) << href->GetBinContent(binref+1) << " " << setw(8) << uncstat; + if (hunc != href) { + double unc = hunc->GetBinContent(bin+1); + if (doTotal) unc = std::sqrt(unc*unc + uncstat*uncstat); + cout << " " << setw(8) << unc; + } + cout << endl; + } + if (plot && hunc != href) { + TH1* hclone = dynamic_cast<TH1*>(href->Clone((uncertainty+"_clone").Data())); + for (Int_t bin = 1; bin < hclone->GetNbinsX(); ++bin) + hclone->SetBinError(bin, hunc->GetBinContent(bin)); + hclone->SetFillColor(kGreen+3); + hclone->Draw("E3 SAME"); + // then redraw the original histogram + href->Draw("PE SAME"); + } + } else if (ndim == 2) { + // this is the more likely case... many histograms are stored as 2D ones, but with only one bin in the Y dimension. + // In these cases, project onto the X axis so as to be able to draw properly. + if (href->GetNbinsX() == 1) { + if (hunc->GetNbinsX() != 1) { + cout << "inconsistent X binning used between results and " << uncertainty << " histograms!" << endl; + f->Close(); + return; + } + if (((! doExtrap) && href->GetNbinsY() != hunc->GetNbinsY()) || + (doExtrap && href->GetNbinsY() > hunc->GetNbinsY())) { + cout << "inconsistent Y binning used between results and " << uncertainty << " histograms!" << endl; + f->Close(); + return; + } + TH1D* hpr = dynamic_cast<TH1D*>(dynamic_cast<TH2*>(hunc)->ProjectionY((uncertainty+"_projY").Data())); + // printout to screen + cout << setw(15) << href->GetYaxis()->GetTitle() << setw(11) << "value" << setw(10) << "stat unc"; + if (hunc != href) cout << " " << uncertainty.Data(); + cout << "\n-----------------------------------------------------------------" << endl; + Int_t firstbin = hunc->GetYaxis()->FindFixBin(href->GetYaxis()->GetBinCenter(1)); + for (Int_t bin = 0; bin < hpr->GetNbinsX(); ++bin) { + // determine the bin number in the reference ("result") histogram + Int_t binref = bin - (firstbin-1); + if (binref < 0) binref = 0; + else if (binref >= href->GetNbinsY()) binref = href->GetNbinsY()-1; + double uncstat = href->GetBinError(binref+1); + cout << " [" << setw(6) << hpr->GetBinLowEdge(bin+1) << "," << setw(6) << hpr->GetBinLowEdge(bin+2) << "]" + << " " << setw(8) << href->GetBinContent(1, binref+1) << " " << setw(8) << uncstat; + if (hunc != href) { + double unc = hunc->GetBinContent(1, bin+1); + if (doTotal) unc = std::sqrt(unc*unc + uncstat*uncstat); + cout << " " << setw(8) << unc; + } + cout << endl; + } + // if (plot) { + // hpr->SetLineWidth(2); + // hpr->SetLineColor(kBlack); hpr->SetMarkerColor(kBlack); + // hpr->Draw("EP"); + // if (hunc != href) { + // TH1* hclone = dynamic_cast<TH1*>(hpr->Clone((uncertainty+"_clone").Data())); + // for (Int_t bin = 1; bin < hclone->GetNbinsX(); ++bin) + // hclone->SetBinError(bin, hunc->GetBinContent(1, bin)); + // hclone->SetFillColor(kGreen+3); + // hclone->Draw("E3 SAME"); + // // then redraw the original histogram + // hpr->Draw("PE SAME"); + // } + // } + } else { + cout << setw(15) << href->GetXaxis()->GetTitle() << setw(16) << href->GetYaxis()->GetTitle() << setw(11) << "value" << setw(10) << "stat unc"; + if (hunc != href) cout << " " << uncertainty.Data(); + cout << "\n---------------------------------------------------------------------------------" << endl; + Int_t firstbinx = hunc->GetXaxis()->FindFixBin(href->GetXaxis()->GetBinCenter(1)); + Int_t firstbiny = hunc->GetYaxis()->FindFixBin(href->GetYaxis()->GetBinCenter(1)); + for (Int_t binx = 0; binx < hunc->GetNbinsX(); ++binx) { + // determine the bin number in the reference ("result") histogram + Int_t binrefx = binx - (firstbinx-1); + if (binrefx < 0) binrefx = 0; + else if (binrefx >= href->GetNbinsX()) binrefx = href->GetNbinsX()-1; + for (Int_t biny = 0; biny < hunc->GetNbinsY(); ++biny) { + // determine the bin number in the reference ("result") histogram + Int_t binrefy = biny - (firstbiny-1); + if (binrefy < 0) binrefy = 0; + else if (binrefy >= href->GetNbinsY()) binrefy = href->GetNbinsY()-1; + Int_t bin = hunc->GetBin(binx+1, biny+1), binref = href->GetBin(binrefx+1, binrefy+1); + double uncstat = href->GetBinError(binref); + cout << " [" << setw(6) << hunc->GetXaxis()->GetBinLowEdge(binx+1) << "," << setw(6) << hunc->GetXaxis()->GetBinLowEdge(binx+2) + << "],[" << setw(6) << hunc->GetYaxis()->GetBinLowEdge(biny+1) << "," << setw(6) << hunc->GetYaxis()->GetBinLowEdge(biny+2) << "]," + << " " << setw(8) << href->GetBinContent(binref) << " " << setw(8) << uncstat; + if (hunc != href) { + double unc = hunc->GetBinContent(bin); + if (doTotal) unc = std::sqrt(unc*unc + uncstat*uncstat); + cout << " " << setw(8) << unc; + } + cout << endl; + } + } + if (plot) href->Draw("LEGO"); + } + } else { + // this is the case for continuous tagging + cout << setw(15) << href->GetXaxis()->GetTitle() << setw(16) << href->GetYaxis()->GetTitle() << setw(16) << href->GetZaxis()->GetTitle() + << setw(11) << "value" << setw(10) << "stat unc"; + if (hunc != href) cout << " " << uncertainty.Data(); + cout << "\n---------------------------------------------------------------------------------" << endl; + for (Int_t binx = 0; binx < href->GetNbinsX(); ++binx) + for (Int_t biny = 0; biny < href->GetNbinsY(); ++biny) + for (Int_t binz = 0; binz < href->GetNbinsZ(); ++binz) { + Int_t bin = href->GetBin(binx+1, biny+1, binz+1); + double uncstat = href->GetBinError(bin); + cout << " [" << setw(6) << href->GetXaxis()->GetBinLowEdge(binx+1) << "," << setw(6) << href->GetXaxis()->GetBinLowEdge(binx+2) + << "],[" << setw(6) << href->GetYaxis()->GetBinLowEdge(biny+1) << "," << setw(6) << href->GetYaxis()->GetBinLowEdge(biny+2) + << "],[" << setw(6) << href->GetZaxis()->GetBinLowEdge(binz+1) << "," << setw(6) << href->GetZaxis()->GetBinLowEdge(binz+2) + << "] " << setw(8) << href->GetBinContent(bin) << " " << setw(8) << uncstat; + if (hunc != href) { + double unc = hunc->GetBinContent(bin); + if (doTotal) unc = std::sqrt(unc*unc + uncstat*uncstat); + cout << " " << setw(8) << unc; + } + cout << endl; + } + // if (plot) href->Draw("LEGO"); + } + } else + cout << "error: specified uncertainty (" << uncertainty << ") cannot be found" << endl; + } + } else + cout << "error: calibration object (" << pathName.Data() << ") cannot be found or is not a histogram container" << endl; + f->Close(); +} diff --git a/PhysicsAnalysis/JetTagging/JetTagPerformanceCalibration/xAODBTaggingEfficiency/CMakeLists.txt b/PhysicsAnalysis/JetTagging/JetTagPerformanceCalibration/xAODBTaggingEfficiency/CMakeLists.txt index 9196d45ce5827a31d1fd52a50bc87ca6aabc4285..5f8a10073498c226da2a90dd0e4af992b6e8ceaf 100644 --- a/PhysicsAnalysis/JetTagging/JetTagPerformanceCalibration/xAODBTaggingEfficiency/CMakeLists.txt +++ b/PhysicsAnalysis/JetTagging/JetTagPerformanceCalibration/xAODBTaggingEfficiency/CMakeLists.txt @@ -22,6 +22,7 @@ atlas_depends_on_subdirs( Event/xAOD/xAODJet PhysicsAnalysis/AnalysisCommon/PATCore PhysicsAnalysis/AnalysisCommon/PATInterfaces + PhysicsAnalysis/Interfaces/FTagAnalysisInterfaces PhysicsAnalysis/JetTagging/JetTagPerformanceCalibration/CalibrationDataInterface PRIVATE Tools/PathResolver diff --git a/PhysicsAnalysis/JetTagging/JetTagPerformanceCalibration/xAODBTaggingEfficiency/Root/BTaggingEfficiencyTool.cxx b/PhysicsAnalysis/JetTagging/JetTagPerformanceCalibration/xAODBTaggingEfficiency/Root/BTaggingEfficiencyTool.cxx index b16a5725fc5fcc2773f65507909d0fd8d0bb8b9c..09e35d185560173d128a72c85b799d3490b6b3c1 100644 --- a/PhysicsAnalysis/JetTagging/JetTagPerformanceCalibration/xAODBTaggingEfficiency/Root/BTaggingEfficiencyTool.cxx +++ b/PhysicsAnalysis/JetTagging/JetTagPerformanceCalibration/xAODBTaggingEfficiency/Root/BTaggingEfficiencyTool.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration */ #include "xAODBTaggingEfficiency/BTaggingEfficiencyTool.h" @@ -65,18 +65,22 @@ namespace { return label; } - int ExclusiveConeHadronFlavourLabel (const xAOD::Jet& jet) { + int ExclusiveConeHadronFlavourLabel (const xAOD::Jet& jet, bool doExtended = false) { // default label means "invalid" int label = -1; // We don't check the return value, as we would not be able to handle it gracefully anyway - jet.getAttribute("HadronConeExclTruthLabelID",label); + if (doExtended) { + jet.getAttribute("HadronConeExclExtendedTruthLabelID",label); + } else { + jet.getAttribute("HadronConeExclTruthLabelID",label); + } return label; } - int jetFlavourLabel (const xAOD::Jet& jet, bool doConeLabelling, bool doOldLabelling) { + int jetFlavourLabel (const xAOD::Jet& jet, bool doConeLabelling, bool doOldLabelling, bool doExtended) { if (doConeLabelling) - return (doOldLabelling) ? ConeFinalPartonFlavourLabel(jet) : ExclusiveConeHadronFlavourLabel(jet); + return (doOldLabelling) ? ConeFinalPartonFlavourLabel(jet) : ExclusiveConeHadronFlavourLabel(jet, doExtended); else return GAFinalHadronFlavourLabel(jet); } @@ -94,31 +98,61 @@ namespace { return str.substr(strBegin, strRange); } + + // local utility function: split string into a vector of substrings separated by a specified separator + std::vector<std::string> split(const std::string& str, char token = ';') { + std::vector<std::string> result; + if (str.size() > 0) { + std::string::size_type end; + std::string tmp(str); + do { + end = tmp.find(token); + std::string entry = trim(tmp.substr(0,end)); + if (entry.size() > 0) result.push_back(entry); + if (end != std::string::npos) tmp = tmp.substr(end+1); + } while (end != std::string::npos); + } + return result; + } } -BTaggingEfficiencyTool::BTaggingEfficiencyTool( const std::string & name) : asg::AsgTool( name ) { - declareProperty("TaggerName", m_taggerName="", "tagging algorithm name as specified in CDI file"); - declareProperty("OperatingPoint", m_OP="", "operating point as specified in CDI file"); - declareProperty("JetAuthor", m_jetAuthor="", "jet collection & JVF/JVT specification in CDI file"); - declareProperty("ScaleFactorFileName", m_SFFile = "", "name of the official scale factor calibration CDI file (uses PathResolver)"); - declareProperty("UseDevelopmentFile", m_useDevFile = false, "specify whether or not to use the (PathResolver) area for temporary scale factor calibration CDI files"); - declareProperty("EfficiencyFileName", m_EffFile = "", "name of optional user-provided MC efficiency CDI file"); - declareProperty("ScaleFactorBCalibration", m_SFBName = "default", "name of b-jet scale factor calibration object"); - declareProperty("ScaleFactorCCalibration", m_SFCName = "default", "name of c-jet scale factor calibration object"); - declareProperty("ScaleFactorTCalibration", m_SFTName = "default", "name of tau-jet scale factor calibration object"); - declareProperty("ScaleFactorLightCalibration", m_SFLightName = "default", "name of light-flavour jet scale factor calibration object"); - declareProperty("EigenvectorReductionB", m_EVReductionB = "Loose", "b-jet scale factor Eigenvector reduction strategy; choose between 'Loose', 'Medium', 'Tight'"); - declareProperty("EigenvectorReductionC", m_EVReductionC = "Loose", "c-jet scale factor Eigenvector reduction strategy; choose between 'Loose', 'Medium', 'Tight'"); - declareProperty("EigenvectorReductionLight", m_EVReductionLight = "Loose","light-flavour jet scale factor Eigenvector reduction strategy; choose between 'Loose', 'Medium', 'Tight'"); - declareProperty("EfficiencyBCalibrations", m_EffBName = "default", "(semicolon-separated) name(s) of b-jet efficiency object(s)"); - declareProperty("EfficiencyCCalibrations", m_EffCName = "default", "(semicolon-separated) name(s) of c-jet efficiency object(s)"); - declareProperty("EfficiencyTCalibrations", m_EffTName = "default", "(semicolon-separated) name(s) of tau-jet efficiency object(s)"); - declareProperty("EfficiencyLightCalibrations", m_EffLightName = "default", "(semicolon-separated) name(s) of light-flavour-jet efficiency object(s)"); - declareProperty("ExcludeFromEigenVectorTreatment", m_excludeFromEV = "", "(semicolon-separated) names of uncertainties to be excluded from eigenvector decomposition (if used)"); - // declareProperty("ExcludeJESFromEVTreatment", m_excludeJESFromEV = true, "specify whether or not to exclude JES uncertainties from eigenvector decomposition (if used)"); - declareProperty("SystematicsStrategy", m_systStrategy = "SFEigen", "name of systematics model; presently choose between 'SFEigen' and 'Envelope'"); - declareProperty("ConeFlavourLabel", m_coneFlavourLabel = true, "specify whether or not to use the cone-based flavour labelling instead of the default ghost association based labelling"); - declareProperty("OldConeFlavourLabel", m_oldConeFlavourLabel = false, "when using cone-based flavour labelling, specify whether or not to use the (deprecated) Run-1 legacy labelling"); +BTaggingEfficiencyTool::BTaggingEfficiencyTool( const std::string & name) : asg::AsgTool( name ), m_selectionTool("") { + declareProperty("TaggerName", m_taggerName="", "tagging algorithm name as specified in CDI file"); + declareProperty("OperatingPoint", m_OP="", "operating point as specified in CDI file"); + declareProperty("JetAuthor", m_jetAuthor="", "jet collection & JVF/JVT specification in CDI file"); + declareProperty("JetAuthor", m_jetAuthor="", "jet collection & JVF/JVT specification in CDI file"); + declareProperty("MinPt", m_minPt=-1, "minimum jet pT cut"); + declareProperty("ScaleFactorFileName", m_SFFile = "", "name of the official scale factor calibration CDI file (uses PathResolver)"); + declareProperty("UseDevelopmentFile", m_useDevFile = false, "specify whether or not to use the (PathResolver) area for temporary scale factor calibration CDI files"); + declareProperty("EfficiencyFileName", m_EffFile = "", "name of optional user-provided MC efficiency CDI file"); + declareProperty("EfficiencyConfig", m_EffConfigFile = "", "name of config file specifying which efficiency map to use with a given samples DSID"); + declareProperty("ScaleFactorBCalibration", m_SFNames["B"] = "default", "name of b-jet scale factor calibration object"); + declareProperty("ScaleFactorCCalibration", m_SFNames["C"] = "default", "name of c-jet scale factor calibration object"); + declareProperty("ScaleFactorTCalibration", m_SFNames["T"] = "default", "name of tau-jet scale factor calibration object"); + declareProperty("ScaleFactorLightCalibration", m_SFNames["Light"] = "default","name of light-flavour jet scale factor calibration object"); + declareProperty("EigenvectorReductionB", m_EVReduction["B"] = "Loose", "b-jet scale factor Eigenvector reduction strategy; choose between 'Loose', 'Medium', 'Tight'"); + declareProperty("EigenvectorReductionC", m_EVReduction["C"] = "Loose", "c-jet scale factor Eigenvector reduction strategy; choose between 'Loose', 'Medium', 'Tight'"); + declareProperty("EigenvectorReductionLight", m_EVReduction["Light"] = "Loose", "light-flavour jet scale factor Eigenvector reduction strategy; choose between 'Loose', 'Medium', 'Tight'"); + declareProperty("EfficiencyBCalibrations", m_EffNames["B"] = "default", "(semicolon-separated) name(s) of b-jet efficiency object(s)"); + declareProperty("EfficiencyCCalibrations", m_EffNames["C"] = "default", "(semicolon-separated) name(s) of c-jet efficiency object(s)"); + declareProperty("EfficiencyTCalibrations", m_EffNames["T"] = "default", "(semicolon-separated) name(s) of tau-jet efficiency object(s)"); + declareProperty("EfficiencyLightCalibrations", m_EffNames["Light"] = "default", "(semicolon-separated) name(s) of light-flavour-jet efficiency object(s)"); + declareProperty("UncertaintyBSuffix", m_uncertaintySuffixes["B"] = "","optional suffix for b-jet uncertainty naming"); + declareProperty("UncertaintyCSuffix", m_uncertaintySuffixes["C"] = "","optional suffix for c-jet uncertainty naming"); + declareProperty("UncertaintyTSuffix", m_uncertaintySuffixes["T"] = "","optional suffix for tau-jet uncertainty naming"); + declareProperty("UncertaintyLightSuffix", m_uncertaintySuffixes["Light"] = "","optional suffix for light-flavour-jet uncertainty naming"); + declareProperty("ExcludeFromEigenVectorTreatment", m_excludeFromEV = "", "(semicolon-separated) names of uncertainties to be excluded from all eigenvector decompositions (if used)"); + declareProperty("ExcludeFromEigenVectorBTreatment", m_excludeFlvFromEV["B"] = "", "(semicolon-separated) names of uncertainties to be excluded from b-jet eigenvector decomposition (if used)"); + declareProperty("ExcludeFromEigenVectorCTreatment", m_excludeFlvFromEV["C"] = "", "(semicolon-separated) names of uncertainties to be excluded from c-jet eigenvector decomposition (if used)"); + declareProperty("ExcludeFromEigenVectorLightTreatment",m_excludeFlvFromEV["Light"] = "", "(semicolon-separated) names of uncertainties to be excluded from light-flavour-jet eigenvector decomposition (if used)"); + declareProperty("ExcludeRecommendedFromEigenVectorTreatment", m_useRecommendedEVExclusions = false, "specify whether or not to add recommended lists to the user specified eigenvector decomposition exclusion lists"); + // declareProperty("ExcludeJESFromEVTreatment", m_excludeJESFromEV = true, "specify whether or not to exclude JES uncertainties from eigenvector decomposition (if used)"); + declareProperty("SystematicsStrategy", m_systStrategy = "SFEigen", "name of systematics model; presently choose between 'SFEigen' and 'Envelope'"); + declareProperty("ConeFlavourLabel", m_coneFlavourLabel = true, "specify whether or not to use the cone-based flavour labelling instead of the default ghost association based labelling"); + declareProperty("ExtendedFlavourLabel", m_extFlavourLabel = false, "specify whether or not to use an 'extended' flavour labelling (allowing for multiple HF hadrons or perhaps partons)"); + declareProperty("OldConeFlavourLabel", m_oldConeFlavourLabel = false, "when using cone-based flavour labelling, specify whether or not to use the (deprecated) Run-1 legacy labelling"); + declareProperty("IgnoreOutOfValidityRange", m_ignoreOutOfValidityRange = false, "ignore out-of-extrapolation-range errors as returned by the underlying tool"); + declareProperty("VerboseCDITool", m_verboseCDITool = true, "specify whether or not to retain 'normal' printout from the underlying tool"); // initialise some variables needed for caching // TODO : add configuration of the mapIndices - rather than just using the default of 0 //m_mapIndices["Light"] = m_mapIndices["T"] = m_mapIndices["C"] = m_mapIndices["B"] = 0; @@ -126,6 +160,9 @@ BTaggingEfficiencyTool::BTaggingEfficiencyTool( const std::string & name) : asg: // m_getTagWeight = 0; m_applySyst = false; m_isContinuous = false; + + // declare the selection tool to be private (not absolutely sure this is needed?) + m_selectionTool.declarePropertyFor(this, "BTaggingSelectionTool", "selection tool to be used internally"); } BTaggingEfficiencyTool::~BTaggingEfficiencyTool() { @@ -150,9 +187,45 @@ BTaggingEfficiencyTool::~BTaggingEfficiencyTool() { // } StatusCode BTaggingEfficiencyTool::initialize() { + + ATH_MSG_INFO( " Hello BTaggingEfficiencyTool user... initializing"); ATH_MSG_INFO( " TaggerName = " << m_taggerName); ATH_MSG_INFO( " OP = " << m_OP); + + //if a configuration file was provided for efficiency maps, overwrite the efficiency map selection with the one provided in the first line of the config + if(m_EffConfigFile!=""){ + m_EffConfigFile = PathResolverFindCalibFile(m_EffConfigFile); + std::ifstream eff_config_file(m_EffConfigFile); + + std::string str; + std::getline(eff_config_file, str); + + + m_EffNames["B"] = str; + m_EffNames["C"] = str; + m_EffNames["T"] = str; + m_EffNames["Light"] = str; + + while (std::getline(eff_config_file, str)) + { + std::vector<std::string> dsid_and_effmap = split(str,':'); + + unsigned int dsid = std::stoul( dsid_and_effmap[0] ); + unsigned int map_index = std::stoul( dsid_and_effmap[1] ); + m_DSID_to_MapIndex[dsid] = map_index; + } + + } + + + + + ATH_MSG_INFO( " b-jet SF/eff calibration = " << m_SFNames["B"] << " / " << m_EffNames["B"]); + ATH_MSG_INFO( " c-jet SF/eff calibration = " << m_SFNames["C"] << " / " << m_EffNames["C"]); + ATH_MSG_INFO( " tau-jet SF/eff calibration = " << m_SFNames["T"] << " / " << m_EffNames["T"]); + ATH_MSG_INFO( " light-jet SF/eff calibration = " << m_SFNames["Light"] << " / " << m_EffNames["Light"]); + if (m_OP == "Continuous") { // continuous tagging is special in two respects: // 1 the tag weight needs to be retrieved @@ -167,72 +240,49 @@ StatusCode BTaggingEfficiencyTool::initialize() { // } } ATH_MSG_INFO( " JetAuthor = " << m_jetAuthor); - // "pack" the scale factor calibration names - std::map<std::string, std::string> SFNames; - SFNames["B"] = trim(m_SFBName); - SFNames["C"] = trim(m_SFCName); - SFNames["T"] = trim(m_SFTName); - SFNames["Light"] = trim(m_SFLightName); + + std::string flavours[] = { "B", "C", "Light", "T" }; + // "pack" the efficiency map names for each flavour. Note that multiple, semicolon separated, entries may exist; so this needs to be decoded first + std::map<std::string, std::vector<std::string> > EffNames; + for (auto const& flavour : flavours) { + EffNames[flavour] = split(m_EffNames[flavour]); + } + // Strategies for eigenvector reductions (only relevant if eigenvector variations are used, of course). // For now, we will assume that the strategy for tau "jets" is identical to that for c jets. std::map<std::string, Analysis::EVReductionStrategy> EVRedStrategies, mappings; mappings["Loose"] = Analysis::Loose; mappings["Medium"] = Analysis::Medium; mappings["Tight"] = Analysis::Tight; - EVRedStrategies["B"] = mappings.find(trim(m_EVReductionB)) == mappings.end() ? mappings["Loose"] : mappings.find(trim(m_EVReductionB))->second; - EVRedStrategies["C"] = mappings.find(trim(m_EVReductionC)) == mappings.end() ? mappings["Loose"] : mappings.find(trim(m_EVReductionC))->second; - EVRedStrategies["T"] = EVRedStrategies["C"]; - EVRedStrategies["Light"] = mappings.find(trim(m_EVReductionLight)) == mappings.end() ? mappings["Loose"] : mappings.find(trim(m_EVReductionLight))->second; - // "pack" the efficiency map names. Note that multiple, semicolon separated, entries may exist; so this needs to be decoded first - std::map<std::string, std::vector<std::string> > EffNames; - std::vector<std::string> effBNames; - std::string::size_type end; - if (m_EffBName.size() > 0) { - do { - end = m_EffBName.find(";"); - effBNames.push_back(trim(m_EffBName.substr(0,end))); - if (end != std::string::npos) m_EffBName = m_EffBName.substr(end+1); - } while (end != std::string::npos); - } - EffNames["B"] = effBNames; - std::vector<std::string> effCNames; - if (m_EffCName.size() > 0) { - do { - end = m_EffCName.find(";"); - effCNames.push_back(trim(m_EffCName.substr(0,end))); - if (end != std::string::npos) m_EffCName = m_EffCName.substr(end+1); - } while (end != std::string::npos); - } - EffNames["C"] = effCNames; - std::vector<std::string> effTNames; - if (m_EffTName.size() > 0) { - do { - end = m_EffTName.find(";"); - effTNames.push_back(trim(m_EffTName.substr(0,end))); - if (end != std::string::npos) m_EffTName = m_EffTName.substr(end+1); - } while (end != std::string::npos); - } - EffNames["T"] = effTNames; - std::vector<std::string> effLightNames; - if (m_EffLightName.size() > 0) { - do { - end = m_EffLightName.find(";"); - effLightNames.push_back(trim(m_EffLightName.substr(0,end))); - if (end != std::string::npos) m_EffLightName = m_EffLightName.substr(end+1); - } while (end != std::string::npos); + + std::string EVflavours[] = { "B", "C", "Light" }; + for (auto const& flavour : EVflavours) { + EVRedStrategies[flavour] = mappings.find(trim(m_EVReduction[flavour])) == mappings.end() ? mappings["Loose"] : mappings[trim(m_EVReduction[flavour])]; } - EffNames["Light"] = effLightNames; + EVRedStrategies["T"] = EVRedStrategies["C"]; // specify which systematic variations are to be excluded from the eigenvector decomposition - std::vector<std::string> excludeFromEVCov; - if (m_excludeFromEV.size() > 0) { - do { - end = m_excludeFromEV.find(";"); - std::string entry = trim(m_excludeFromEV.substr(0,end)); - if (entry != "") excludeFromEVCov.push_back(entry); - if (end != std::string::npos) m_excludeFromEV = m_excludeFromEV.substr(end+1); - } while (end != std::string::npos); + std::map<std::string, std::vector<std::string> > excludeFromEVCov; + + // First, look for uncertainties to be excluded for all flavours + std::vector<std::string> to_exclude = split(m_excludeFromEV); + // use this as a starting point for all flavours (here B, C, Light) + for (auto const& flavour : EVflavours) { + excludeFromEVCov[flavour] = to_exclude; + } + // Subsequently process per-flavour lists + for (auto const& flavour : EVflavours) { + to_exclude = split(m_excludeFlvFromEV[flavour]); + // Append to the existing list + excludeFromEVCov[flavour].insert(excludeFromEVCov[flavour].end(), to_exclude.begin(), to_exclude.end()); } + // For the SFEigen strategy, tau "jets" are treated differently from other flavours. + // First, copy the charm-jet calibration settings + excludeFromEVCov["T"] = excludeFromEVCov["C"]; + // Then ensure that the charm -> tau extrapolation uncertainty is added. + // Technically the additional condition should never be necessary, as existing entries should not apply to tau "jets"; so this is mostly to protect users against a duplicate specification + if (m_systStrategy != "Envelope" && std::find(excludeFromEVCov["T"].begin(), excludeFromEVCov["T"].end(), "extrapolation from charm") == excludeFromEVCov["T"].end()) + excludeFromEVCov["T"].push_back("extrapolation from charm"); // Use the PathResolver to find the full pathname (behind the scenes this can also be used to download the file), // if the file cannot be found directly. @@ -264,11 +314,15 @@ StatusCode BTaggingEfficiencyTool::initialize() { m_SFFile.c_str(), // full pathname of the SF calibration file: always needed (m_EffFile == "") ? 0 : m_EffFile.c_str(), // full pathname of optional efficiency file jetAliases, // since we configure the jet "collection name" by hand, we don't need this - SFNames, // names of the scale factor calibrations to be used + m_SFNames, // names of the scale factor calibrations to be used EffNames, // names of the efficiency calibrations to be used (can be multiple per flavour) excludeFromEVCov, // names of systematic uncertainties to be excluded from the EV decomposition EVRedStrategies, // strategies for eigenvector reductions - m_systStrategy != "Envelope"); // assume that eigenvector variations will be used unless the "Envelope" model is used + m_systStrategy != "Envelope", // assume that eigenvector variations will be used unless the "Envelope" model is used + true, // use MC/MC scale factors + false, // do not use topology rescaling (only relevant for pseudo-continuous tagging) + m_useRecommendedEVExclusions, // if true, add pre-set lists of uncertainties to be excluded from EV decomposition + m_verboseCDITool); // if false, suppress any non-error/warning messages setMapIndex("Light",0); setMapIndex("C",0); @@ -276,11 +330,22 @@ StatusCode BTaggingEfficiencyTool::initialize() { setMapIndex("T",0); ATH_MSG_INFO( "Using systematics model " << m_systStrategy); + if (m_systStrategy != "Envelope" && m_useRecommendedEVExclusions) ATH_MSG_INFO( "excluding pre-set uncertainties from eigenvector decomposition"); + + // We have a double loop over flavours here.. not nice but this is to ensure that the suffixes are always well determined before using them. + // Note that (in the SFEigen model) suffixes are attached to eigenvector variations only (the idea being that named uncertainties, if used, are likely to be correlated). + std::vector<std::string> suffixes; + for (int i = 0; i < 4; ++i) { + std::string flav = flavours[i]; if (flav == "T") flav = "C"; + // add an underscore to any specified suffix (if specified and if not already starting with a suffix) + std::string test = trim(m_uncertaintySuffixes[flav]); + if (test.length() > 0 && test[0] != '_') test.insert(0,"_"); + suffixes.push_back(test); + } // If the tool has not already been initialised and m_OP and m_jetAuthor have been set - ie via the properties "OperatingPoint" and "JetAuthor" // then autmatically set things up to use these by default // All this must happen before registerSystematics otherwise that won't work - std::string flavours[4] = { "Light", "C", "B", "T"}; for (int i = 0; i < 4; ++i) { unsigned int flavourID = getFlavourID(flavours[i]); // std::map<unsigned int, unsigned int>::const_iterator @@ -290,6 +355,7 @@ StatusCode BTaggingEfficiencyTool::initialize() { return StatusCode::FAILURE; } int id = mapIter->second; + // Implement the different strategies for dealing with uncertainties here. if (m_systStrategy == "SFEigen") { // @@ -301,22 +367,34 @@ StatusCode BTaggingEfficiencyTool::initialize() { int idRef = m_SFIndices.find(flavourIDRef)->second; // First, handle any named variations std::vector<std::string> systematics = m_CDI->listScaleFactorUncertainties(idRef,true); - // "Cosmetic" fix: the outside world wants to see "FT_EFF_" prefixes but internally these don't always exist. - // We cannot fix this generically but we can at least do so for the "extrapolation" uncertainty. - // Also replace any spaces with underscores (this is to make ROOT browsing happy) - for (unsigned int i = 0, n = systematics.size(); i < n; ++i) { + // Replace any spaces with underscores (this is to make ROOT browsing happy). + // Also, remove the "extrapolation" uncertainty from the list (it will be added later under Extrapolation rather than SFNamed). + bool hasExtrapolation = false; + for (unsigned int i = 0; i < systematics.size(); ++i) { if (systematics[i] == "extrapolation") { - systematics[i] = "FT_EFF_extrapolation"; + hasExtrapolation = true; + systematics.erase(systematics.begin() + i--); // don't forget to decrement i } else { std::replace_if(systematics[i].begin(), systematics[i].end(), [] (char c) { return c == ' '; }, '_'); + // We don't add suffixes here but only for EV variations (see JIRA: AFT-343) + // systematics[i].append(suffixes[i]); } } if (!addSystematics(systematics, flavourID, SFNamed)) { ATH_MSG_ERROR("SFEigen model: error adding named systematics for flavour " << getLabel(flavourIDRef) << ", invalid initialization"); return StatusCode::FAILURE; } + // Add here the extrapolation uncertainty (if it exists -- which ought to be the case). + // "Cosmetic" fix: the outside world wants to see "FT_EFF_" prefixes. On the other hand, like for the above named uncertainties, we don't add suffixes here + if (hasExtrapolation) { + std::vector<std::string> extrapSyst; extrapSyst.push_back(std::string("FT_EFF_extrapolation")); + if (! addSystematics(extrapSyst, flavourID, Extrapolation)) { + ATH_MSG_ERROR("SFEigen model: error adding extrapolation uncertainty for flavour " << getLabel(flavourIDRef) << ", invalid initialization"); + return StatusCode::FAILURE; + } + } // And then the eigenvector variations - std::vector<std::string> eigenSysts = makeEigenSyst(getLabel(flavourIDRef),m_CDI->getNumVariations(idRef, SFEigen)); + std::vector<std::string> eigenSysts = makeEigenSyst(getLabel(flavourIDRef),m_CDI->getNumVariations(idRef, SFEigen), suffixes[i]); if (!addSystematics(eigenSysts, flavourID, SFEigen)) { ATH_MSG_ERROR("SFEigen model: error adding eigenvector systematics for flavour " << getLabel(flavourIDRef) << ", invalid initialization"); return StatusCode::FAILURE; @@ -328,7 +406,8 @@ StatusCode BTaggingEfficiencyTool::initialize() { // And from this list extract only this particular uncertainty (if it exists) const std::string s_tau_extrap = "extrapolation from charm"; if (std::find(all_systematics.begin(), all_systematics.end(), s_tau_extrap) != all_systematics.end()) { - std::string entry = "FT_EFF_extrapolation_from_charm"; + // Again, we don't add the suffix here (per JIRA: AFT-343) + std::string entry = "FT_EFF_extrapolation_from_charm"; // entry.append(suffixes[i]); std::vector<std::string> extrapSyst; extrapSyst.push_back(entry); if (! addSystematics(extrapSyst, flavourID, TauExtrapolation)) { ATH_MSG_ERROR("SFEigen model: error adding charm->tau systematics for flavour " << getLabel(flavourID) << ", invalid initialization"); @@ -357,16 +436,16 @@ StatusCode BTaggingEfficiencyTool::initialize() { << ", invalid initialization"); return StatusCode::FAILURE; } - std::vector<std::string> totalSyst; totalSyst.push_back("FT_EFF_" + getLabel(flavourIDRef) + "_" + s_total); + std::vector<std::string> totalSyst; totalSyst.push_back("FT_EFF_" + getLabel(flavourIDRef) + "_" + s_total + suffixes[i]); if (! addSystematics(totalSyst, flavourID, Total)) { ATH_MSG_ERROR("Envelope model: error adding systematics uncertainty for flavour " << getLabel(flavourIDRef) << ", invalid initialization"); return StatusCode::FAILURE; } - // Second, handle the extrapolation variations; these are shared between flavours + // Second, handle the extrapolation variations; these are shared between flavours (unless different suffixes are specified) const std::string s_extrap = "extrapolation"; if (std::find(all_ref_systematics.begin(), all_ref_systematics.end(), s_extrap) != all_ref_systematics.end()) { - std::vector<std::string> extrapSyst; extrapSyst.push_back("FT_EFF_" + s_extrap); + std::vector<std::string> extrapSyst; extrapSyst.push_back("FT_EFF_" + s_extrap + suffixes[i]); if (! addSystematics(extrapSyst, flavourID, Extrapolation)) { ATH_MSG_ERROR("Envelope model: error adding extrapolation uncertainty for flavour " << getLabel(flavourIDRef) << ", invalid initialization"); @@ -380,7 +459,7 @@ StatusCode BTaggingEfficiencyTool::initialize() { // And from this list extract only this particular uncertainty (if it exists) const std::string s_tau_extrap = "extrapolation from charm"; if (std::find(all_systematics.begin(), all_systematics.end(), s_tau_extrap) != all_systematics.end()) { - std::vector<std::string> extrapSyst; extrapSyst.push_back("FT_EFF_extrapolation_from_charm"); + std::vector<std::string> extrapSyst; extrapSyst.push_back("FT_EFF_extrapolation_from_charm" + suffixes[i]); if (! addSystematics(extrapSyst, flavourID, TauExtrapolation)) { ATH_MSG_ERROR("Envelope model: error adding charm->tau systematics for flavour " << getLabel(flavourID) << ", invalid initialization"); return StatusCode::FAILURE; @@ -400,6 +479,23 @@ StatusCode BTaggingEfficiencyTool::initialize() { if( registry.registerSystematics(*this) != SystematicCode::Ok) return StatusCode::FAILURE; + // Finally, also initialise the selection tool, if needed (for now this is the case only for DL1 tag weight computations, + // so we do this only when DL1 is specified) + if (m_taggerName.find("DL1") != std::string::npos) { + m_selectionTool.setTypeAndName("BTaggingSelectionTool/" + name() + "_selection"); + ATH_CHECK( m_selectionTool.setProperty("FlvTagCutDefinitionsFileName", m_SFFile) ); + ATH_CHECK( m_selectionTool.setProperty("TaggerName", m_taggerName) ); + ATH_CHECK( m_selectionTool.setProperty("OperatingPoint", m_OP) ); + ATH_CHECK( m_selectionTool.setProperty("JetAuthor", m_jetAuthor) ); + ATH_CHECK( m_selectionTool.setProperty("MinPt", m_minPt) ); + ATH_CHECK( m_selectionTool.retrieve() ); + } + + // if the user decides to ignore these errors, at least make her/him aware of this + if (m_ignoreOutOfValidityRange) { + ATH_MSG_INFO("!!!!! You have chosen to disable out-of-validity return codes -- contact the Flavour Tagging group if such jets comprise a substantial part of the phase space in your analysis !!!!!"); + } + m_initialised = true; return StatusCode::SUCCESS; } @@ -413,7 +509,7 @@ BTaggingEfficiencyTool::getScaleFactor( const xAOD::Jet & jet, float & sf) const } // get the btag label - int flavour = jetFlavourLabel(jet, m_coneFlavourLabel, m_oldConeFlavourLabel); + int flavour = jetFlavourLabel(jet, m_coneFlavourLabel, m_oldConeFlavourLabel, m_extFlavourLabel); Analysis::CalibrationDataVariables vars; if (! fillVariables(jet, vars)) { @@ -480,7 +576,7 @@ BTaggingEfficiencyTool::getScaleFactor( int flavour, const Analysis::Calibration ATH_MSG_ERROR("BTaggingEfficiencyTool::getScaleFactor call to underlying code returned a kError!"); return CorrectionCode::Error; case Analysis::kExtrapolatedRange: - return CorrectionCode::OutOfValidityRange; + return m_ignoreOutOfValidityRange ? CorrectionCode::Ok : CorrectionCode::OutOfValidityRange; case Analysis::kSuccess: default: return CorrectionCode::Ok; @@ -493,7 +589,7 @@ BTaggingEfficiencyTool::getEfficiency( const xAOD::Jet & jet, float & eff) const if (! m_initialised) return CorrectionCode::Error; // get the btag label - int flavour = jetFlavourLabel(jet, m_coneFlavourLabel, m_oldConeFlavourLabel); + int flavour = jetFlavourLabel(jet, m_coneFlavourLabel, m_oldConeFlavourLabel, m_extFlavourLabel); Analysis::CalibrationDataVariables vars; if (! fillVariables(jet, vars)) { @@ -556,7 +652,7 @@ BTaggingEfficiencyTool::getEfficiency( int flavour, const Analysis::CalibrationD ATH_MSG_ERROR("BTaggingEfficiencyTool::getEfficiency call to underlying code returned a kError!"); return CorrectionCode::Error; case Analysis::kExtrapolatedRange: - return CorrectionCode::OutOfValidityRange; + return m_ignoreOutOfValidityRange ? CorrectionCode::Ok : CorrectionCode::OutOfValidityRange; case Analysis::kSuccess: default: return CorrectionCode::Ok; @@ -569,7 +665,7 @@ BTaggingEfficiencyTool::getInefficiency( const xAOD::Jet & jet, float & eff) con if (! m_initialised) return CorrectionCode::Error; // get the btag label - int flavour = jetFlavourLabel(jet, m_coneFlavourLabel, m_oldConeFlavourLabel); + int flavour = jetFlavourLabel(jet, m_coneFlavourLabel, m_oldConeFlavourLabel, m_extFlavourLabel); Analysis::CalibrationDataVariables vars; if (! fillVariables(jet, vars)) { @@ -632,7 +728,7 @@ BTaggingEfficiencyTool::getInefficiency( int flavour, const Analysis::Calibratio ATH_MSG_ERROR("BTaggingEfficiencyTool::getInefficiency call to underlying code returned a kError!"); return CorrectionCode::Error; case Analysis::kExtrapolatedRange: - return CorrectionCode::OutOfValidityRange; + return m_ignoreOutOfValidityRange ? CorrectionCode::Ok : CorrectionCode::OutOfValidityRange; case Analysis::kSuccess: default: return CorrectionCode::Ok; @@ -645,7 +741,7 @@ BTaggingEfficiencyTool::getInefficiencyScaleFactor( const xAOD::Jet & jet, float if (! m_initialised) return CorrectionCode::Error; // get the btag label - int flavour = jetFlavourLabel(jet, m_coneFlavourLabel, m_oldConeFlavourLabel); + int flavour = jetFlavourLabel(jet, m_coneFlavourLabel, m_oldConeFlavourLabel, m_extFlavourLabel); Analysis::CalibrationDataVariables vars; if (! fillVariables(jet, vars)) { @@ -708,7 +804,7 @@ BTaggingEfficiencyTool::getInefficiencyScaleFactor( int flavour, const Analysis: ATH_MSG_ERROR("BTaggingEfficiencyTool::getInefficiencyScaleFactor call to underlying code returned a kError!"); return CorrectionCode::Error; case Analysis::kExtrapolatedRange: - return CorrectionCode::OutOfValidityRange; + return m_ignoreOutOfValidityRange ? CorrectionCode::Ok : CorrectionCode::OutOfValidityRange; case Analysis::kSuccess: default: return CorrectionCode::Ok; @@ -721,7 +817,7 @@ BTaggingEfficiencyTool::getMCEfficiency( const xAOD::Jet & jet, float & eff) con if (! m_initialised) return CorrectionCode::Error; // get the btag label - int flavour = jetFlavourLabel(jet, m_coneFlavourLabel, m_oldConeFlavourLabel); + int flavour = jetFlavourLabel(jet, m_coneFlavourLabel, m_oldConeFlavourLabel, m_extFlavourLabel); Analysis::CalibrationDataVariables vars; if (! fillVariables(jet, vars)) { @@ -762,7 +858,7 @@ BTaggingEfficiencyTool::getMCEfficiency( int flavour, const Analysis::Calibratio ATH_MSG_ERROR("BTaggingEfficiencyTool::getMCEfficiency call to underlying code returned a kError!"); return CorrectionCode::Error; case Analysis::kExtrapolatedRange: - return CorrectionCode::OutOfValidityRange; + return m_ignoreOutOfValidityRange ? CorrectionCode::Ok : CorrectionCode::OutOfValidityRange; case Analysis::kSuccess: default: return CorrectionCode::Ok; @@ -892,7 +988,12 @@ BTaggingEfficiencyTool::fillVariables( const xAOD::Jet & jet, CalibrationDataVar const xAOD::BTagging* tagInfo = jet.btagging(); if (!tagInfo) return false; // x.jetTagWeight = (tagInfo->*m_getTagWeight)(); - return tagInfo->MVx_discriminant(m_taggerName, x.jetTagWeight); + // For now, we defer the tag weight computation to the selection tool only in the case of DL1* (this is likely to be revisited) + if (m_taggerName.find("DL1") != std::string::npos) { + return (m_selectionTool->getTaggerWeight(jet, x.jetTagWeight) == CP::CorrectionCode::Ok); + } else { + return tagInfo->MVx_discriminant(m_taggerName, x.jetTagWeight); + } } return true; } @@ -937,15 +1038,35 @@ BTaggingEfficiencyTool::setMapIndex(const std::string& label, unsigned int index } return false; } +bool BTaggingEfficiencyTool::setMapIndex(unsigned int dsid){ + + if(m_DSID_to_MapIndex.find(dsid) == m_DSID_to_MapIndex.end() ){ + ATH_MSG_WARNING("setMapIndex DSID " << dsid << "not found in config file"); + + }else{ + unsigned int map_index = m_DSID_to_MapIndex[dsid]; + + bool set_b = setMapIndex("B",map_index); + bool set_c = setMapIndex("C",map_index); + bool set_light = setMapIndex("Light",map_index); + bool set_t = setMapIndex("T",map_index); + + return set_b && set_c && set_light && set_t; + } + + + return false; + +} // private method to generate the list of eigenvector variations // internally these are not named, they are just numbered // but the systematics framework needs names -std::vector<std::string> BTaggingEfficiencyTool::makeEigenSyst(const std::string & flav, int number) { +std::vector<std::string> BTaggingEfficiencyTool::makeEigenSyst(const std::string & flav, int number, const std::string& suffix) { std::vector<std::string> systStrings; for(int i=0;i<number;++i) { std::ostringstream ost; - ost << flav << "_" << i; + ost << flav << "_" << i << suffix; std::string basename="FT_EFF_Eigen_"+ost.str(); systStrings.push_back(basename); } @@ -1010,8 +1131,8 @@ bool BTaggingEfficiencyTool::addSystematics(const std::vector<std::string> & sys SystInfo info = iter->second; // make a copy std::map<unsigned int, unsigned int>::const_iterator indIter = info.indexMap.find(flavourID); if (indIter != info.indexMap.end()) { - ATH_MSG_ERROR("addSystematics : flavourID is already in the map! " << flavourID); - return false; + ATH_MSG_ERROR("addSystematics : flavourID " << flavourID << " is already in the map for uncertainty '" << systName << "', ignoring"); + continue; } else { info.indexMap[flavourID] = i; m_systematicsInfo[up] = info; diff --git a/PhysicsAnalysis/JetTagging/JetTagPerformanceCalibration/xAODBTaggingEfficiency/Root/BTaggingSelectionTool.cxx b/PhysicsAnalysis/JetTagging/JetTagPerformanceCalibration/xAODBTaggingEfficiency/Root/BTaggingSelectionTool.cxx index 1fe5e41825a8a4c359ea687a727a553c5a0b8aac..ef4fdd408f9f4125ef24a1b2c57561c375778e05 100644 --- a/PhysicsAnalysis/JetTagging/JetTagPerformanceCalibration/xAODBTaggingEfficiency/Root/BTaggingSelectionTool.cxx +++ b/PhysicsAnalysis/JetTagging/JetTagPerformanceCalibration/xAODBTaggingEfficiency/Root/BTaggingSelectionTool.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration */ #include "xAODBTaggingEfficiency/BTaggingSelectionTool.h" @@ -12,8 +12,11 @@ #include "PathResolver/PathResolver.h" #include "TFile.h" +#include "TObjArray.h" +#include "TObjString.h" #include <algorithm> +#include <string> using std::string; @@ -36,16 +39,17 @@ using Analysis::None; using xAOD::IParticle; BTaggingSelectionTool::BTaggingSelectionTool( const std::string & name) - : asg::AsgTool( name ), m_accept( "JetSelection" ), m_spline(nullptr), m_constcut(nullptr) + : asg::AsgTool( name ), m_acceptinfo( "JetSelection" ) { m_initialised = false; declareProperty( "MaxEta", m_maxEta = 2.5 ); - declareProperty( "MinPt", m_minPt = 20000 /*MeV*/); - declareProperty( "MaxRangePt", m_maxRangePt = 1000000 /*MeV*/); + declareProperty( "MinPt", m_minPt = -1 /*MeV*/); + declareProperty( "MaxRangePt", m_maxRangePt = 3000000 /*MeV*/); declareProperty( "FlvTagCutDefinitionsFileName", m_CutFileName = "", "name of the files containing official cut definitions (uses PathResolver)"); declareProperty( "TaggerName", m_taggerName="", "tagging algorithm name"); declareProperty( "OperatingPoint", m_OP="", "operating point"); declareProperty( "JetAuthor", m_jetAuthor="", "jet collection"); + declareProperty( "ErrorOnTagWeightFailure", m_ErrorOnTagWeightFailure=true, "optionally ignore cases where the tagweight cannot be retrived. default behaviour is to give an error, switching to false will turn it into a warning"); } StatusCode BTaggingSelectionTool::initialize() { @@ -63,104 +67,278 @@ StatusCode BTaggingSelectionTool::initialize() { return StatusCode::FAILURE; } - // The tool supports only Akt4TopoEM, Akt4PV0Track and Akt2PV0Track jets, and VR track jets (AntiKtVR30Rmax4Rmin02TrackJets) - if ("MV2c20"!=m_taggerName&& - "MV2c10"!=m_taggerName&& - "MV2cl100_MV2c100"!=m_taggerName){ - ATH_MSG_ERROR( "BTaggingSelectionTool doesn't support tagger: "+m_taggerName ); + m_useVeto = false; + if( m_OP.find("Veto") != string::npos ){ + m_useVeto = true; + //op string should follow the format nominal_WP_Veto_vetotagger_vetoWP + //for example, FixedCutBEff_77_Veto_DL1_CTag_Loose + TString vetotaggerstring = m_OP; + TObjArray* wptokens = vetotaggerstring.Tokenize("_"); + if( wptokens->GetEntries() != 6 ){ + ATH_MSG_ERROR( "BTaggingSelectionTool improperly formatted WP defintion: "+m_OP ); + return StatusCode::FAILURE; + } + m_OP = (std::string)(((TObjString *)(wptokens->At(0)))->String()); + m_OP = m_OP+"_"+(std::string)(((TObjString *)(wptokens->At(1)))->String()); + + m_taggerName_Veto = (std::string)(((TObjString *)(wptokens->At(3)))->String()); + m_OP_Veto = (std::string)(((TObjString *)(wptokens->At(4)))->String()); + m_OP_Veto = m_OP_Veto+"_"+(std::string)(((TObjString *)(wptokens->At(5)))->String()); + } + + // check the CDI file for the selected tagger and jet collection + TString check_CDI = m_taggerName; + if(!m_inf->Get(check_CDI)){ + ATH_MSG_ERROR( "Tagger: "+m_taggerName+" not found in this CDI file: "+m_CutFileName); return StatusCode::FAILURE; } - if ("AntiKt4EMTopoJets" != m_jetAuthor && - "AntiKt2PV0TrackJets"!= m_jetAuthor && - "AntiKt4PV0TrackJets"!= m_jetAuthor && - "AntiKtVR30Rmax4Rmin02TrackJets" !=m_jetAuthor - ){ - ATH_MSG_ERROR( "BTaggingSelectionTool doesn't support jet collection: "+m_jetAuthor ); + check_CDI = m_taggerName+"/"+m_jetAuthor; + if(!m_inf->Get(check_CDI)){ + ATH_MSG_ERROR( "Tagger: "+m_taggerName+" and Jet Collection : "+m_jetAuthor+" not found in this CDI file: "+m_CutFileName); return StatusCode::FAILURE; } + // Change the minPt cut if the user didn't touch it - if (20000==m_minPt){// is it still the default value - if ("AntiKt2PV0TrackJets"== m_jetAuthor || "AntiKtVR30Rmax4Rmin02TrackJets"== m_jetAuthor) m_minPt=10000 ; - if ("AntiKt4PV0TrackJets"== m_jetAuthor) m_minPt= 7000 ; - } - // Change the maxRangePt cut if the user didn't touch it - if (1000000==m_maxRangePt){// is it still the default value - if ("AntiKt2PV0TrackJets"== m_jetAuthor || "AntiKtVR30Rmax4Rmin02TrackJets"== m_jetAuthor) m_maxRangePt= 400000; - if ("AntiKt4PV0TrackJets"== m_jetAuthor) m_maxRangePt= 500000; + if (m_minPt < 0) { + ATH_MSG_ERROR( "Tagger: "+m_taggerName+" and Jet Collection : "+m_jetAuthor+" do not have a minimum jet pT cut set."); + return StatusCode::FAILURE; } // Operating point reading - TString cutname = m_OP; + TString cutname = m_OP; + if ("Continuous"==cutname(0,10)){ // For continuous tagging load all flat-cut WPs //100% efficiency => MVXWP=-infinity m_continuouscuts[0] = -1.e4; cutname = m_taggerName+"/"+m_jetAuthor+"/FixedCutBEff_85/cutvalue"; - m_constcut = (TVector*) m_inf->Get(cutname); - if (m_constcut!=nullptr) m_continuouscuts[1] = m_constcut[0](0); + m_tagger.constcut = (TVector*) m_inf->Get(cutname); + if (m_tagger.constcut!=nullptr) m_continuouscuts[1] = m_tagger.constcut[0](0); else ATH_MSG_ERROR( "Continuous tagging is trying to use an unvalid operating point: FixedCutBEff_85" ); cutname = m_taggerName+"/"+m_jetAuthor+"/FixedCutBEff_77/cutvalue"; - m_constcut = (TVector*) m_inf->Get(cutname); - if (m_constcut!=nullptr) m_continuouscuts[2] = m_constcut[0](0); + m_tagger.constcut = (TVector*) m_inf->Get(cutname); + if (m_tagger.constcut!=nullptr) m_continuouscuts[2] = m_tagger.constcut[0](0); else ATH_MSG_ERROR( "Continuous tagging is trying to use an unvalid operating point: FixedCutBEff_77" ); cutname = m_taggerName+"/"+m_jetAuthor+"/FixedCutBEff_70/cutvalue"; - m_constcut = (TVector*) m_inf->Get(cutname); - if (m_constcut!=nullptr) m_continuouscuts[3] = m_constcut[0](0); + m_tagger.constcut = (TVector*) m_inf->Get(cutname); + if (m_tagger.constcut!=nullptr) m_continuouscuts[3] = m_tagger.constcut[0](0); else ATH_MSG_ERROR( "Continuous tagging is trying to use an unvalid operating point: FixedCutBEff_70" ); cutname = m_taggerName+"/"+m_jetAuthor+"/FixedCutBEff_60/cutvalue"; - m_constcut = (TVector*) m_inf->Get(cutname); - if (m_constcut!=nullptr) m_continuouscuts[4] = m_constcut[0](0); + m_tagger.constcut = (TVector*) m_inf->Get(cutname); + if (m_tagger.constcut!=nullptr) m_continuouscuts[4] = m_tagger.constcut[0](0); else ATH_MSG_ERROR( "Continuous tagging is trying to use an unvalid operating point: FixedCutBEff_60" ); //0% efficiency => MVXWP=+infinity m_continuouscuts[5]= +1.e4; + + if(m_taggerName.find("DL1") != string::npos){ + //this call will extract the c-fraction value and set it in m_tagger + //which is needed in case the user calls getTaggerWeight to compute the DL1 score + ExtractTaggerProperties(m_tagger,m_taggerName , "FixedCutBEff_60"); + } } else { // Else load only one WP - if ("2DFixedCut"==cutname(0,10)){ - cutname = m_taggerName+"/"+m_jetAuthor+"/"+m_OP+"/cutvalue"; - m_constcut = (TVector*) m_inf->Get(cutname); - if (m_constcut == nullptr) ATH_MSG_ERROR( "Invalid operating point" ); - } - else if ("FlatBEff"==cutname(0,8)){ - cutname = m_taggerName+"/"+m_jetAuthor+"/"+m_OP+"/cutprofile"; - m_spline = (TSpline3*) m_inf->Get(cutname); - if (m_spline == nullptr) ATH_MSG_ERROR( "Invalid operating point" ); + ExtractTaggerProperties(m_tagger,m_taggerName , m_OP); + if(m_useVeto){ExtractTaggerProperties(m_vetoTagger,m_taggerName_Veto , m_OP_Veto);} + } + m_inf->Close(); + + m_acceptinfo.addCut( "Eta", "Selection of jets according to their pseudorapidity" ); + m_acceptinfo.addCut( "Pt", "Selection of jets according to their transverse momentum" ); + m_acceptinfo.addCut( "WorkingPoint", "Working point for flavour-tagging of jets according to their b-tagging weight" ); + + return StatusCode::SUCCESS; +} + +void BTaggingSelectionTool::ExtractTaggerProperties(taggerproperties &tagger, std::string taggerName, std::string OP){ + + TString cutname = OP; + + if ("FlatBEff"==cutname(0,8) || "HybBEff"==cutname(0,7) ){ + cutname = taggerName+"/"+m_jetAuthor+"/"+OP+"/cutprofile"; + tagger.spline = (TSpline3*) m_inf->Get(cutname); + if (tagger.spline == nullptr) ATH_MSG_ERROR( "Invalid operating point" ); + tagger.constcut = nullptr; + } + else { + cutname = taggerName+"/"+m_jetAuthor+"/"+OP+"/cutvalue"; + tagger.constcut = (TVector*) m_inf->Get(cutname); + if (tagger.constcut == nullptr) ATH_MSG_ERROR( "Invalid operating point" ); + tagger.spline = nullptr; + } + + //retrive the "fraction" used in the DL1 log likelihood from the CDI, if its not there, use the hard coded values + // (backwards compatibility) + if(taggerName.find("DL1") != string::npos){ + + TString fraction_data_name = taggerName+"/"+m_jetAuthor+"/"+OP+"/fraction"; + TVector *fraction_data = (TVector*) m_inf->Get(fraction_data_name); + + if(fraction_data!=nullptr){ + tagger.fraction = fraction_data[0](0); + }else{ + if("DL1" ==taggerName){ tagger.fraction = 0.08; } + if("DL1mu" ==taggerName){ tagger.fraction = 0.08; } + if("DL1rnn" ==taggerName){ tagger.fraction = 0.03; } + + if(OP == "CTag_Loose" && "DL1" == taggerName ){ tagger.fraction = 0.25; } + if(OP == "CTag_Tight" && "DL1" == taggerName ){ tagger.fraction = 0.18; } + if(OP == "CTag_Loose" && "DL1rnn" == taggerName ){ tagger.fraction = 0.08; } + if(OP == "CTag_Tight" && "DL1rnn" == taggerName ){ tagger.fraction = 0.02; } } - else { - cutname = m_taggerName+"/"+m_jetAuthor+"/"+m_OP+"/cutvalue"; - m_constcut = (TVector*) m_inf->Get(cutname); - if (m_constcut == nullptr) ATH_MSG_ERROR( "Invalid operating point" ); + delete fraction_data; + } +} + +CorrectionCode BTaggingSelectionTool::getTaggerWeight( const xAOD::Jet& jet, double & tagweight, bool useVetoWP) const{ + + taggerproperties localtagger; + std::string taggerName; + std::string OP; + + if(useVetoWP && m_useVeto){ + localtagger = m_vetoTagger; + taggerName = m_taggerName_Veto; + OP = m_OP_Veto; + }else{ + localtagger = m_tagger; + taggerName = m_taggerName; + OP = m_OP; + } + + tagweight = -100.; + + if ( "MV2cl100_MV2c100"==taggerName ){ + + ATH_MSG_ERROR("Cannot retrive weight for 2D taggers!"); + + return CorrectionCode::Error; + } + + else if ( taggerName.find("MV2") != string::npos ){ + + + const xAOD::BTagging* btag = jet.btagging(); + + if ((!btag) || (!btag->MVx_discriminant(taggerName, tagweight))){ + if(m_ErrorOnTagWeightFailure){ + ATH_MSG_ERROR("Failed to retrieve "+taggerName+" weight!"); + return CorrectionCode::Error; + }else{ + ATH_MSG_WARNING("Failed to retrieve "+taggerName+" weight!"); + return CorrectionCode::Ok; + } } + ATH_MSG_VERBOSE( taggerName << " " << tagweight ); + return CorrectionCode::Ok; } - m_inf->Close(); + else if(taggerName.find("DL1") != string::npos){ - m_accept.addCut( "Eta", "Selection of jets according to their pseudorapidity" ); - m_accept.addCut( "Pt", "Selection of jets according to their transverse momentum" ); - m_accept.addCut( "WorkingPoint", "Working point for flavour-tagging of jets according to their b-tagging weight" ); + double dl1_pb(-10.); + double dl1_pc(-10.); + double dl1_pu(-10.); + + const xAOD::BTagging* btag = jet.btagging(); + + if ((!btag)){ + ATH_MSG_ERROR("Failed to retrieve the BTagging information"); + } + + if ( (!btag->pb(taggerName, dl1_pb )) + || (!btag->pc(taggerName, dl1_pc )) + || (!btag->pu(taggerName, dl1_pu )) ){ + + if(m_ErrorOnTagWeightFailure){ + ATH_MSG_ERROR("Failed to retrieve "+taggerName+" weight!"); + return CorrectionCode::Error; + }else{ + ATH_MSG_WARNING("Failed to retrieve "+taggerName+" weight!"); + return CorrectionCode::Ok; + } + } + ATH_MSG_VERBOSE( "pb " << dl1_pb ); + ATH_MSG_VERBOSE( "pc " << dl1_pc ); + ATH_MSG_VERBOSE( "pu " << dl1_pu ); + + return getTaggerWeight(dl1_pb, dl1_pc, dl1_pu, tagweight, useVetoWP); + + } + + //if we got here the tagger name is not configured properly + ATH_MSG_ERROR("BTaggingSelectionTool doesn't support tagger: "+m_taggerName); + return CorrectionCode::Error; - return StatusCode::SUCCESS; } -const asg::AcceptInfo& BTaggingSelectionTool::getAcceptInfo() const { - return m_accept; + +CorrectionCode BTaggingSelectionTool::getTaggerWeight( double pb, double pc, double pu , double & tagweight, bool useVetoWP) const { + + taggerproperties localtagger; + std::string taggerName; + std::string OP; + + if(useVetoWP && m_useVeto){ + localtagger = m_vetoTagger; + taggerName = m_taggerName_Veto; + OP = m_OP_Veto; + }else{ + localtagger = m_tagger; + taggerName = m_taggerName; + OP = m_OP; + } + + + tagweight = -100.; + if( taggerName.find("DL1") != string::npos ){ + + bool valid_input = (!std::isnan(pu) && pb>0 && pc>0 && pu>0); + + if (!valid_input){ + if(m_ErrorOnTagWeightFailure){ + ATH_MSG_ERROR("Invalid inputs for "+taggerName+" pb " << pb << " pc " << pc << " pu " << pu << " "); + return CorrectionCode::Error; + }else{ + ATH_MSG_WARNING("Invalid inputs for "+taggerName+" pb " << pb << " pc " << pc << " pu " << pu << " "); + return CorrectionCode::Ok; + } + } + + if(OP.find("CTag") != string::npos){ + tagweight = log( pc/(localtagger.fraction*pb+(1.-localtagger.fraction)*pu) ); + }else{ + tagweight = log( pb/(localtagger.fraction*pc+(1.-localtagger.fraction)*pu) ); + } + + return CorrectionCode::Ok; + } + + //if we got here the tagger name is not configured properly + ATH_MSG_ERROR("this call to getTaggerWeight only works for DL1 taggers"); + return CorrectionCode::Error; + } + + asg::AcceptData BTaggingSelectionTool::accept( const xAOD::IParticle* p ) const { + // Reset the result: + asg::AcceptData acceptData(&m_acceptinfo); + // Check if this is a jet: if( p->type() != xAOD::Type::Jet ) { ATH_MSG_ERROR( "accept(...) Function received a non-jet" ); - return asg::AcceptData (&m_accept); + return acceptData; } // Cast it to a jet: const xAOD::Jet* jet = dynamic_cast< const xAOD::Jet* >( p ); if( ! jet ) { ATH_MSG_FATAL( "accept(...) Failed to cast particle to jet" ); - return asg::AcceptData (&m_accept); + return acceptData; } // Let the specific function do the work: @@ -168,17 +346,17 @@ asg::AcceptData BTaggingSelectionTool::accept( const xAOD::IParticle* p ) const } asg::AcceptData BTaggingSelectionTool::accept( const xAOD::Jet& jet ) const { - asg::AcceptData acceptData (&m_accept); + asg::AcceptData acceptData(&m_acceptinfo); if (! m_initialised) { ATH_MSG_ERROR("BTaggingSelectionTool has not been initialised"); return acceptData; } - if ("AntiKt2PV0TrackJets"== m_jetAuthor || - "AntiKt4PV0TrackJets"== m_jetAuthor || - "AntiKtVR30Rmax4Rmin02TrackJets"== m_jetAuthor - ){ + if ( "AntiKt2PV0TrackJets"== m_jetAuthor || + "AntiKt4PV0TrackJets"== m_jetAuthor || + m_jetAuthor.find("AntiKtVR30Rmax4Rmin02TrackJets") != string::npos + ) { // We want at least 2 tracks in a track jet acceptData.setCutResult( "NConstituents", jet.numConstituents() >= 2 ); } @@ -188,63 +366,79 @@ asg::AcceptData BTaggingSelectionTool::accept( const xAOD::Jet& jet ) const { // Retrieve the tagger weight which was assigned to the jet TString cutname = m_OP; - if ("2D"!=cutname(0,2)){ - double weight_mv2(-10.); - const xAOD::BTagging* btag = jet.btagging(); - if ((!btag) || (!btag->MVx_discriminant(m_taggerName, weight_mv2))){ - ATH_MSG_ERROR("Failed to retrieve "+m_taggerName+" weight!"); - } - ATH_MSG_VERBOSE( "MV2c20 " << weight_mv2 ); - acceptData |= accept(pT, eta, weight_mv2); - } - else { + + //the MV2 c-tagger is a special case, its a 2D cut on two MV2 based taggers + if(m_taggerName=="MV2cl100_MV2c100"){ + double weight_mv2c100(-10.); double weight_mv2cl100(-10.); const xAOD::BTagging* btag = jet.btagging(); + if ((!btag)){ ATH_MSG_ERROR("Failed to retrieve the BTagging information"); } + if ( (!btag->MVx_discriminant("MV2cl100", weight_mv2cl100 ))|| (!btag->MVx_discriminant("MV2c100", weight_mv2c100 )) ){ - ATH_MSG_ERROR("Failed to retrieve the BTagging "+m_taggerName+" weight!"); + if(m_ErrorOnTagWeightFailure){ + ATH_MSG_ERROR("Failed to retrieve the BTagging "+m_taggerName+" weight!"); + }else{ + ATH_MSG_WARNING("Failed to retrieve the BTagging "+m_taggerName+" weight!"); + } + return acceptData; } ATH_MSG_VERBOSE( "MV2cl100 " << weight_mv2cl100 ); ATH_MSG_VERBOSE( "MV2c100 " << weight_mv2c100 ); - acceptData |= accept(pT, eta, weight_mv2cl100, weight_mv2c100 ); + return accept(pT, eta, weight_mv2cl100, weight_mv2c100 ); + + }else if(m_taggerName.find("DL1") != string::npos || m_taggerName.find("MV2") != string::npos){ + + + //for all other taggers, use the same method + double tagger_weight(-100); + + if( getTaggerWeight( jet ,tagger_weight)!=CorrectionCode::Ok){ + return acceptData; + }; + + if(m_useVeto){ + double taggerweightVeto(-100); + if( getTaggerWeight( jet , taggerweightVeto, true)!=CorrectionCode::Ok){ + return acceptData; + }; + return accept(pT, eta, tagger_weight,taggerweightVeto); + } + + return accept(pT, eta, tagger_weight); } - return acceptData; + + //if we got here the tagger name is not configured properly + ATH_MSG_ERROR("BTaggingSelectionTool doesn't support tagger: "+m_taggerName); + return acceptData; + } -asg::AcceptData BTaggingSelectionTool::accept(double pT, double eta, double weight_mv2) const +asg::AcceptData BTaggingSelectionTool::accept(double pT, double eta, double tag_weight) const { - asg::AcceptData acceptData (&m_accept); + asg::AcceptData acceptData(&m_acceptinfo); if (! m_initialised) { ATH_MSG_ERROR("BTaggingSelectionTool has not been initialised"); return acceptData; } - // flat cut for out of range pTs - if (pT>m_maxRangePt) - pT = m_maxRangePt-500; // 500 MeV below the maximum authorized range - eta = std::fabs(eta); if (! checkRange(pT, eta, acceptData)) return acceptData; - // After initialization, either m_spline or m_constcut should be non-zero + // After initialization, either m_tagger.spline or m_tagger.constcut should be non-zero // Else, the initialization was incorrect and should be revisited double cutvalue(DBL_MAX); - if (m_spline != nullptr && m_constcut == nullptr) { - cutvalue = m_spline->Eval(pT/1000.); - } - else if (m_constcut != nullptr && m_spline == nullptr) { - cutvalue = m_constcut[0](0); - } - else ATH_MSG_ERROR( "Bad cut configuration!" ); - ATH_MSG_VERBOSE( "Cut value " << cutvalue ); + if( getCutValue(pT, cutvalue )!=CorrectionCode::Ok ){ + return acceptData; + }; - if ( weight_mv2 < cutvalue ){ + if ( tag_weight < cutvalue ){ return acceptData; } acceptData.setCutResult( "WorkingPoint", true ); @@ -257,36 +451,55 @@ asg::AcceptData BTaggingSelectionTool::accept(double pT, double eta, double weig asg::AcceptData BTaggingSelectionTool::accept(double pT, double eta, double weight_mv2cl100, double weight_mv2c100) const { - asg::AcceptData acceptData (&m_accept); + asg::AcceptData acceptData(&m_acceptinfo); if (! m_initialised) { ATH_MSG_ERROR("BTaggingSelectionTool has not been initialised"); return acceptData; } - // flat cut for out of range pTs - if (pT>m_maxRangePt) - pT = m_maxRangePt-500; // 500 MeV below the maximum authorized range - eta = std::fabs(eta); if (! checkRange(pT, eta, acceptData)) return acceptData; - // After initialization, either m_spline or m_constcut should be non-zero + // After initialization, either m_tagger.spline or m_tagger.constcut should be non-zero // Else, the initialization was incorrect and should be revisited double cutvalueA(DBL_MAX); double cutvalueB(DBL_MAX); - if (m_constcut != nullptr && m_spline == nullptr) { - cutvalueA = m_constcut[0](0); - cutvalueB = m_constcut[0](1); - } - else ATH_MSG_ERROR( "Bad cut configuration!" ); - ATH_MSG_VERBOSE( "Cut values " << cutvalueA << " " << cutvalueB ); - if ( !( weight_mv2cl100 > cutvalueA && weight_mv2c100 < cutvalueB ) ){ + + if(m_useVeto){ + + double nominal_taggerWeight = weight_mv2cl100; + double veto_taggerWeight = weight_mv2c100; + + if( getCutValue(pT, cutvalueA)!=CorrectionCode::Ok){ + return acceptData; + }; + if( getCutValue(pT, cutvalueB, true)!=CorrectionCode::Ok){ + return acceptData; + }; + + if( ! ( nominal_taggerWeight > cutvalueA && veto_taggerWeight <= cutvalueB ) ){ + return acceptData; + } + + }else if(m_tagger.constcut != nullptr && m_tagger.spline == nullptr) { + cutvalueA = m_tagger.constcut[0](0); + cutvalueB = m_tagger.constcut[0](1); + + ATH_MSG_VERBOSE( "Cut values " << cutvalueA << " " << cutvalueB ); + + if ( !( weight_mv2cl100 > cutvalueA && weight_mv2c100 < cutvalueB ) ){ + return acceptData; + } + } + else{ + ATH_MSG_ERROR( "Bad cut configuration!" ); return acceptData; } + acceptData.setCutResult( "WorkingPoint", true ); // IF we arrived here, the jet is tagged // Return the result: @@ -294,7 +507,44 @@ asg::AcceptData BTaggingSelectionTool::accept(double pT, double eta, double weig } +asg::AcceptData BTaggingSelectionTool::accept(double pT, double eta, double pb, double pc, double pu) const + { + asg::AcceptData acceptData(&m_acceptinfo); + + if (! m_initialised) { + ATH_MSG_ERROR("BTaggingSelectionTool has not been initialised"); + return acceptData; + } + + eta = std::fabs(eta); + + if (! checkRange(pT, eta, acceptData)) + return acceptData; + + // After initialization, either m_tagger.spline or m_tagger.constcut should be non-zero + // Else, the initialization was incorrect and should be revisited + double cutvalue(DBL_MAX); + + if( getCutValue(pT, cutvalue)!=CorrectionCode::Ok){ + return acceptData; + }; + + double tagger_weight(-100); + + if( getTaggerWeight(pb, pc, pu, tagger_weight)!=CorrectionCode::Ok){ + return acceptData; + } + + if ( tagger_weight < cutvalue ){ + return acceptData; + } + + //if you made it here, the jet is tagged + acceptData.setCutResult( "WorkingPoint", true ); + + return acceptData; + } int BTaggingSelectionTool::getQuantile( const xAOD::IParticle* p ) const { // Check if this is a jet: @@ -316,19 +566,20 @@ int BTaggingSelectionTool::getQuantile( const xAOD::IParticle* p ) const { int BTaggingSelectionTool::getQuantile( const xAOD::Jet& jet ) const{ double pT = jet.pt(); - double eta = jet.eta(); + double eta = std::fabs( jet.eta() ); // Retrieve the tagger weight which was assigned to the jet double weight_mv2(-10.); - if (!jet.btagging()->MVx_discriminant(m_taggerName, weight_mv2)){ - ATH_MSG_ERROR("Failed to retrieve "+m_taggerName+" weight!"); + if (getTaggerWeight(jet, weight_mv2)==CorrectionCode::Error){ + ATH_MSG_WARNING("getQuantile: Failed to retrieve "+m_taggerName+" weight!"); + return -1; } - ATH_MSG_VERBOSE( "MV2c20 " << weight_mv2 ); + ATH_MSG_VERBOSE( m_taggerName << " " << weight_mv2 ); return getQuantile(pT, eta, weight_mv2 ); } -int BTaggingSelectionTool::getQuantile(double pT, double eta, double weight_mv2 ) const +int BTaggingSelectionTool::getQuantile(double pT, double eta, double weight_mv2) const { if (! m_initialised) { ATH_MSG_ERROR("BTaggingSelectionTool has not been initialised"); @@ -346,7 +597,7 @@ int BTaggingSelectionTool::getQuantile(double pT, double eta, double weight_mv2 int bin_index(-1); - asg::AcceptData acceptData (&m_accept); + asg::AcceptData acceptData(&m_acceptinfo); if (! checkRange(pT, eta, acceptData)) return bin_index; // If in b-tagging acceptance, cont.tagging @@ -362,8 +613,7 @@ int BTaggingSelectionTool::getQuantile(double pT, double eta, double weight_mv2 return bin_index; } -bool BTaggingSelectionTool::checkRange(double pT, double eta, - asg::AcceptData& acceptData) const +bool BTaggingSelectionTool::checkRange(double pT, double eta, asg::AcceptData& acceptData) const { // Do the |eta| cut: if( eta > m_maxEta ) { @@ -381,13 +631,39 @@ bool BTaggingSelectionTool::checkRange(double pT, double eta, return true; } -double BTaggingSelectionTool::getCutValue() const +CorrectionCode BTaggingSelectionTool::getCutValue(double pT, double & cutval,bool useVetoWP) const { - if (m_constcut != nullptr && m_spline == nullptr) { - return m_constcut[0](0); - } - else{ - std::cout << "not using fixed cut flavour tagging!" << std::endl; - return -1000; + cutval = DBL_MAX; + + taggerproperties localtagger; + + if(useVetoWP && m_useVeto){ + localtagger = m_vetoTagger; + }else{ + localtagger = m_tagger; } + + // flat cut for out of range pTs + if (pT>m_maxRangePt) + pT = m_maxRangePt; + + if (localtagger.spline != nullptr && localtagger.constcut == nullptr) { + pT = pT/1000.0; + double maxsplinept = localtagger.spline->GetXmax(); + if (pT>maxsplinept){ pT = maxsplinept; } + cutval = localtagger.spline->Eval(pT); + } + + else if (localtagger.constcut != nullptr && localtagger.spline == nullptr) { + cutval = localtagger.constcut[0](0); + } + else{ + ATH_MSG_ERROR( "Bad cut configuration!" ); + return CorrectionCode::Error; + } + + + ATH_MSG_VERBOSE( "Cut value " << cutval ); + + return CorrectionCode::Ok; } diff --git a/PhysicsAnalysis/JetTagging/JetTagPerformanceCalibration/xAODBTaggingEfficiency/src/ToolTester.h b/PhysicsAnalysis/JetTagging/JetTagPerformanceCalibration/xAODBTaggingEfficiency/src/ToolTester.h index edfbc14754a7e37a718548a8dba5716726bc27cb..3a187bbcf893b457d536890ff7d5664d2da31bea 100644 --- a/PhysicsAnalysis/JetTagging/JetTagPerformanceCalibration/xAODBTaggingEfficiency/src/ToolTester.h +++ b/PhysicsAnalysis/JetTagging/JetTagPerformanceCalibration/xAODBTaggingEfficiency/src/ToolTester.h @@ -8,7 +8,7 @@ #include "AthenaBaseComps/AthAlgorithm.h" #include "GaudiKernel/ToolHandle.h" -#include "xAODBTaggingEfficiency/IBTaggingEfficiencyTool.h" +#include "FTagAnalysisInterfaces/IBTaggingEfficiencyTool.h" class BTagToolTester : public AthAlgorithm { public: diff --git a/PhysicsAnalysis/JetTagging/JetTagPerformanceCalibration/xAODBTaggingEfficiency/xAODBTaggingEfficiency/BTaggingEfficiencyTool.h b/PhysicsAnalysis/JetTagging/JetTagPerformanceCalibration/xAODBTaggingEfficiency/xAODBTaggingEfficiency/BTaggingEfficiencyTool.h index b64ed218e424209884b8700b9573ca57c2dd552c..0a1e9b595d4447bceef93e04fa6cf8cc53e33569 100644 --- a/PhysicsAnalysis/JetTagging/JetTagPerformanceCalibration/xAODBTaggingEfficiency/xAODBTaggingEfficiency/BTaggingEfficiencyTool.h +++ b/PhysicsAnalysis/JetTagging/JetTagPerformanceCalibration/xAODBTaggingEfficiency/xAODBTaggingEfficiency/BTaggingEfficiencyTool.h @@ -1,7 +1,7 @@ // Dear emacs, this is -*- c++ -*- /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration */ /////////////////////////////////////////////////////////////////// @@ -11,32 +11,36 @@ #ifndef CPBTAGGINGEFFICIENCYTOOL_H #define CPBTAGGINGEFFICIENCYTOOL_H -#include "xAODBTaggingEfficiency/IBTaggingEfficiencyTool.h" +#include "FTagAnalysisInterfaces/IBTaggingEfficiencyTool.h" +#include "FTagAnalysisInterfaces/IBTaggingSelectionTool.h" +#include "PATInterfaces/ISystematicsTool.h" #include "xAODBTagging/BTagging.h" -#include "AsgTools/AsgTool.h" +#include <fstream> #include <string> #include <set> #include <vector> #include <map> //#include <memory> +#include "AsgTools/AsgTool.h" +#include "AsgTools/AnaToolHandle.h" + #include "CalibrationDataInterface/CalibrationDataVariables.h" #include "CalibrationDataInterface/CalibrationDataInterfaceROOT.h" -#include "PATInterfaces/ISystematicsTool.h" class BTaggingEfficiencyTool: public asg::AsgTool, - public virtual IBTaggingEfficiencyTool, - public virtual CP::ISystematicsTool { + public virtual IBTaggingEfficiencyTool +{ // typedef double (xAOD::BTagging::* tagWeight_member_t)() const; /// Create a proper constructor for Athena ASG_TOOL_CLASS2( BTaggingEfficiencyTool , IBTaggingEfficiencyTool, ISystematicsTool ) - + public: - - + + /// Create a constructor for standalone usage BTaggingEfficiencyTool( const std::string& name ); @@ -45,7 +49,7 @@ class BTaggingEfficiencyTool: public asg::AsgTool, // For now, disable the generation of a default copy constructor (since it would not be constructed correctly) // BTaggingEfficiencyTool(const BTaggingEfficiencyTool& other) = delete; - + // /// Silly copy constructor for the benefit of dictionary generation // BTaggingEfficiencyTool(const BTaggingEfficiencyTool& other); @@ -56,31 +60,31 @@ class BTaggingEfficiencyTool: public asg::AsgTool, The tagger and operating point under consideration are part of the configuration and hence aren't function arguments. */ CP::CorrectionCode getScaleFactor( const xAOD::Jet & jet, - float & sf) const; + float & sf) const; /** Computes the data efficiency for the given jet. The tagger and operating point under consideration are part of the configuration and hence aren't function arguments. */ CP::CorrectionCode getEfficiency( const xAOD::Jet & jet, float & eff) const; - + /** Computes the data inefficiency for the given jet. The tagger and operating point under consideration are part of the configuration and hence aren't function arguments. */ CP::CorrectionCode getInefficiency( const xAOD::Jet & jet, - float & eff) const; + float & eff) const; /** Computes the data/MC inefficiency scale factor for the given jet. The tagger and operating point under consideration are part of the configuration and hence aren't function arguments. */ CP::CorrectionCode getInefficiencyScaleFactor( const xAOD::Jet & jet, - float & sf) const; + float & sf) const; /** Computes the MC efficiency for the given jet. The tagger and operating point under consideration are part of the configuration and hence aren't function arguments. */ CP::CorrectionCode getMCEfficiency( const xAOD::Jet & jet, - float & eff) const; + float & eff) const; /// @name Methods equivalent to those above but not relying on the xAOD format /// @{ @@ -89,39 +93,39 @@ class BTaggingEfficiencyTool: public asg::AsgTool, The tagger and operating point under consideration are part of the configuration and hence aren't function arguments. */ CP::CorrectionCode getScaleFactor( int flavour, const Analysis::CalibrationDataVariables& v, - float & sf) const; + float & sf) const; /** Computes the data efficiency for the jet, given its kinematics, (possibly) tagger weight and truth flavour. The tagger and operating point under consideration are part of the configuration and hence aren't function arguments. */ CP::CorrectionCode getEfficiency( int flavour, const Analysis::CalibrationDataVariables& v, - float & eff) const; + float & eff) const; /** Computes the data inefficiency for the jet, given its kinematics, (possibly) tagger weight and truth flavour. The tagger and operating point under consideration are part of the configuration and hence aren't function arguments. */ CP::CorrectionCode getInefficiency( int flavour, const Analysis::CalibrationDataVariables& v, - float & eff) const; + float & eff) const; /** Computes the data/MC inefficiency scale factor for the jet, given its kinematics, (possibly) tagger weight and truth flavour. The tagger and operating point under consideration are part of the configuration and hence aren't function arguments. */ CP::CorrectionCode getInefficiencyScaleFactor( int flavour, const Analysis::CalibrationDataVariables& v, float & sf) const; - + /** Computes the MC efficiency for the jet, given its kinematics, (possibly) tagger weight and truth flavour. The tagger and operating point under consideration are part of the configuration and hence aren't function arguments. */ CP::CorrectionCode getMCEfficiency( int flavour, const Analysis::CalibrationDataVariables& v, - float & eff) const; + float & eff) const; /// @} - + /// @name Other methods implementing the IBTagEfficiencyTool interface /// @{ /** Initialise the tool. - * + * * This is the stage at which all of the configuration is done and the underlying @c CalibrationDataInferfaceROOT object is instantiated. * The properties that can be set are documented in the * <a href="https://twiki.cern.ch/twiki/bin/view/AtlasProtected/BTaggingCalibrationDataInterface#xAOD_interface">xAOD interface</a> section @@ -160,6 +164,7 @@ class BTaggingEfficiencyTool: public asg::AsgTool, * documentation for more detail on the meaning of the map index */ bool setMapIndex(const std::string& flavour, unsigned int index); + bool setMapIndex(unsigned int dsid); // bool setMapIndex(const std::string& flavour, const std::string & type); /// @} @@ -170,13 +175,13 @@ class BTaggingEfficiencyTool: public asg::AsgTool, /// Retrieve the name of the tagger (as specified in the calibration file) std::string getTaggerName() const { return m_taggerName;} - + /// Retrieve the operating point (as specified in the calibration file) std::string getOperatingPoint() const { return m_OP;} - + /// Retrieve the jet collection name (as specified in the calibration file) for which this tool was setup std::string getJetAuthor() const { return m_jetAuthor;} - + // /// Returns false if the tool isn't initialised yet (it has to be initialised before processing jets) // bool isInitialized() const { return m_initialised;} @@ -206,8 +211,8 @@ private: bool addSystematics(const std::vector<std::string> & systematicNames,unsigned int flavourID, Analysis::Uncertainty uncType); /// generate names for the eigenvector variations for the given jet flavour - std::vector<std::string> makeEigenSyst(const std::string & flav, int number); - + std::vector<std::string> makeEigenSyst(const std::string & flav, int number, const std::string& suffix); + /// helper function for retrieving object indices bool getIndices(unsigned int flavour, unsigned int & sf, unsigned int & ef) const; @@ -266,58 +271,60 @@ private: /// @name core configuration properties (set at initalization time and not modified afterwards) /// @{ + /// we need access to a BTaggingSelectionTool, at least for DL1 weight computation + asg::AnaToolHandle<IBTaggingSelectionTool> m_selectionTool; + /// name of the data/MC efficiency scale factor calibration file (may be changed by the @c PathResolver) std::string m_SFFile; /// name of the optional MC efficiency file (may be changed by the @c PathResolver) std::string m_EffFile; - /// name of the data/MC scale factor calibration for b jets - std::string m_SFBName; - /// name of the data/MC scale factor calibration for charm jets - std::string m_SFCName; - /// name of the data/MC scale factor calibration for tau jets - std::string m_SFTName; - /// name of the data/MC scale factor calibration for light-flavour jets - std::string m_SFLightName; - /// specification of the eigenvector reduction strategy for b jets (if eigenvectors are used) - std::string m_EVReductionB; - /// specification of the eigenvector reduction strategy for c jets (if eigenvectors are used) - std::string m_EVReductionC; - /// specification of the eigenvector reduction strategy for light-flavour jets (if eigenvectors are used) - std::string m_EVReductionLight; - /// semicolon-separated list of MC efficiency parametrisation names for b jets - std::string m_EffBName; - /// semicolon-separated list of MC efficiency parametrisation names for charm jets - std::string m_EffCName; - /// semicolon-separated list of MC efficiency parametrisation names for tau jets - std::string m_EffTName; - /// semicolon-separated list of MC efficiency parametrisation names for light-flavour jets - std::string m_EffLightName; - /// semicolon-separated list of uncertainties to be excluded from the eigenvector variation procedure + std::string m_EffConfigFile; + /// names of the data/MC scale factor calibrations + std::map<std::string, std::string> m_SFNames; + /// specification of the eigenvector reduction strategy (if eigenvectors are used) + std::map<std::string, std::string> m_EVReduction; + /// semicolon-separated lists of MC efficiency parametrisation names + std::map<std::string, std::string> m_EffNames; + /// semicolon-separated list of uncertainties to be excluded from the eigenvector variation procedure for all flavours std::string m_excludeFromEV; + /// semicolon-separated list of uncertainties to be excluded from the eigenvector variation procedure for b, c, and light-flavour jets + std::map<std::string, std::string> m_excludeFlvFromEV; + /// optional (per-flavour) suffix that can be used to decorrelate uncertainties (between flavours, or -in case of a result from different runs- between periods) + std::map<std::string, std::string> m_uncertaintySuffixes; /// tagger name std::string m_taggerName; /// operating point std::string m_OP; /// jet collection name std::string m_jetAuthor; - /// systematics model to be used (current choices are "SFEigen" and "Envelope") + /// minimum jet pT + float m_minPt; + /// systematics model to be used (current choices are "SFEigen", "SFEigenRefined", and "Envelope") std::string m_systStrategy; /// if true, attempt to retrieve the data/MC efficiency scale factor calibration files from the @PathResolver development area bool m_useDevFile; /// if true, use cone-based labelling (as opposed to ghost association) bool m_coneFlavourLabel; + /// if true, use an 'extended' labelling (allowing for multiple HF hadrons -or perhaps partons- in the jet) + bool m_extFlavourLabel; /// when using cone-based labelling (see above), if true, use the "traditional" (parton-based) labelling instead of the current default (hadron-based, exclusive) bool m_oldConeFlavourLabel; // bool m_excludeJESFromEV; + /// if true, extract pre-set lists of uncertainties to be recommended from the EV decomposition (in addition to user specified ones) + bool m_useRecommendedEVExclusions; + /// if true, ignore out-of-extrapolation range errors (i.e., return CorrectionCode::Ok if these are encountered) + bool m_ignoreOutOfValidityRange; + /// if false, suppress any non-error/warning printout from the underlying tool + bool m_verboseCDITool; /// @} - + /// @name Cached variables /// @{ /// flag to indicate tool is initialized correctly when set bool m_initialised; - + bool m_applySyst; SystInfo m_applyThisSyst; @@ -336,7 +343,10 @@ private: std::map<unsigned int, unsigned int> m_SFIndices; /// actual information identifying efficiency calibration objects std::map<unsigned int, unsigned int> m_EffIndices; - + + + //cache for efficiency map config file that maps from a sample DSID to the correct efficiency map + std::map<unsigned int, unsigned int> m_DSID_to_MapIndex; /// @} }; diff --git a/PhysicsAnalysis/JetTagging/JetTagPerformanceCalibration/xAODBTaggingEfficiency/xAODBTaggingEfficiency/BTaggingSelectionTool.h b/PhysicsAnalysis/JetTagging/JetTagPerformanceCalibration/xAODBTaggingEfficiency/xAODBTaggingEfficiency/BTaggingSelectionTool.h index f64e69f1ee6a803bbefb04134d4002d63742c86a..3f9fc8f3eb5cc163af40af8c51512e50da72b3a8 100644 --- a/PhysicsAnalysis/JetTagging/JetTagPerformanceCalibration/xAODBTaggingEfficiency/xAODBTaggingEfficiency/BTaggingSelectionTool.h +++ b/PhysicsAnalysis/JetTagging/JetTagPerformanceCalibration/xAODBTaggingEfficiency/xAODBTaggingEfficiency/BTaggingSelectionTool.h @@ -1,7 +1,8 @@ + // Dear emacs, this is -*- c++ -*- /* - Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration */ /////////////////////////////////////////////////////////////////// @@ -17,7 +18,7 @@ #ifndef CPBTAGGINGSELECTIONTOOL_H #define CPBTAGGINGSELECTIONTOOL_H -#include "xAODBTaggingEfficiency/IBTaggingSelectionTool.h" +#include "FTagAnalysisInterfaces/IBTaggingSelectionTool.h" #include "xAODBTagging/BTagging.h" #include "AsgTools/AsgTool.h" @@ -31,61 +32,86 @@ #include <vector> #include <map> -class BTaggingSelectionTool: public asg::AsgTool, +class BTaggingSelectionTool: public asg::AsgTool, public virtual IBTaggingSelectionTool, public virtual IAsgSelectionTool { typedef double (xAOD::BTagging::* tagWeight_member_t)() const; /// Create a proper constructor for Athena ASG_TOOL_CLASS2( BTaggingSelectionTool , IAsgSelectionTool, IBTaggingSelectionTool ) - - public: + + public: /// Create a constructor for standalone usage BTaggingSelectionTool( const std::string& name ); - virtual StatusCode initialize() override; - /// Get an object describing the "selection steps" of the tool - virtual const asg::AcceptInfo& getAcceptInfo() const override; - + StatusCode initialize() override; + /// Get the decision using a generic IParticle pointer virtual asg::AcceptData accept( const xAOD::IParticle* p ) const override; virtual asg::AcceptData accept( const xAOD::Jet& jet ) const override; /// Get the decision using thet jet's pt and mv2c20 weight values - virtual asg::AcceptData accept(double /* jet pt */, double /* jet eta */, double /* mv2c20 weight */ ) const override; - virtual asg::AcceptData accept(double /* jet pt */, double /* jet eta */, double /* mv2c00 weight */, double /* mv2c100 weight */ ) const override; + virtual asg::AcceptData accept(double /* jet pt */, double /* jet eta */, double /* tag_weight */ ) const override; + virtual asg::AcceptData accept(double /* jet pt */, double /* jet eta */, double /* mv2cl100 weight */, double /* mv2c100 weight */ ) const override; + virtual asg::AcceptData accept(double /* jet pt */, double /* jet eta */, double /* dl1pb */, double /* dl1pc */ , double /* dl1pu */) const override; /// Decide in which quantile of the MV2c20 weight distribution the jet belongs (continuous tagging) /// The return value represents the bin index of the quantile distribution - virtual int getQuantile( const xAOD::IParticle* ) const override; - virtual int getQuantile( const xAOD::Jet& ) const override; - virtual int getQuantile( double /* jet pt */, double /* jet eta */, double /* mv2c20 weight */ ) const override; + virtual int getQuantile( const xAOD::IParticle*) const override; + virtual int getQuantile( const xAOD::Jet&) const override; + virtual int getQuantile( double /* jet pt */, double /* jet eta */, double /* mv2c20 weight */) const override; - virtual double getCutValue() const override; // Only for 1D flat cut + virtual CP::CorrectionCode getCutValue(double /* jet pt */, double & cutval, bool useVetoWP = false) const override; + virtual CP::CorrectionCode getTaggerWeight( const xAOD::Jet& jet, double & weight ,bool useVetoWP = false) const override; + virtual CP::CorrectionCode getTaggerWeight( double /* dl1pb */, double /* dl1pc */ , double /* dl1pu */ , double & weight,bool useVetoWP = false) const override; + const asg::AcceptInfo& getAcceptInfo( ) const override {return m_acceptinfo;} private: /// Helper function that decides whether a jet belongs to the correct jet selection for b-tagging - virtual bool checkRange( double pT, double eta, - asg::AcceptData& acceptData) const; + virtual bool checkRange( double /* jet pt */, double /* jet eta */, asg::AcceptData& ) const; + //fill the spline or vector that store the cut values for a particular working point + void InitializeTaggerVariables(std::string taggerName,std::string OP, TSpline3 *spline, TVector *constcut, double &fraction); bool m_initialised; - /// Object used to store selection information. - asg::AcceptInfo m_accept; - + bool m_ErrorOnTagWeightFailure; + + /// Object used to store the last decision + asg::AcceptInfo m_acceptinfo; + double m_maxEta; double m_minPt; double m_maxRangePt; + std::string m_CutFileName; std::string m_taggerName; std::string m_OP; std::string m_jetAuthor; TFile *m_inf; - TSpline3 *m_spline; - TVector *m_constcut; double m_continuouscuts[6]; + //optional "Veto" working point defined in the working point name + //the user can specify for example: + //tool->setProperty("TaggerName", "MV2c10"); + //tool->setProperty("OperatingPoint", "FixedCutBEff_77-Veto-DL1-FixedCutBEff_60"); + //and the tool->accept() methods will require the jet to pass MV2c10 FixedCutBEff_77 but fail DL1 FixedCutBEff_60 + bool m_useVeto; + std::string m_taggerName_Veto; + std::string m_OP_Veto; + + struct taggerproperties{ + double fraction; + TSpline3* spline; + TVector* constcut; + }; + + taggerproperties m_tagger; + taggerproperties m_vetoTagger; + + //get from the CDI file the taggers cut object(that holds the definition of cut values) + //and flaovur fraction (for DL1 tagger) and store them in the right taggerproperties struct + void ExtractTaggerProperties(taggerproperties& tagger, std::string taggerName, std::string OP); + }; #endif // CPBTAGGINGSELECTIONTOOL_H - diff --git a/PhysicsAnalysis/JetTagging/JetTagPerformanceCalibration/xAODBTaggingEfficiency/xAODBTaggingEfficiency/selection.xml b/PhysicsAnalysis/JetTagging/JetTagPerformanceCalibration/xAODBTaggingEfficiency/xAODBTaggingEfficiency/selection.xml index 386eceae6c3f10930f85ec05bee327e557bb3536..071e1453f681170bfd4b8d5b17bdcf69c27ba87a 100644 --- a/PhysicsAnalysis/JetTagging/JetTagPerformanceCalibration/xAODBTaggingEfficiency/xAODBTaggingEfficiency/selection.xml +++ b/PhysicsAnalysis/JetTagging/JetTagPerformanceCalibration/xAODBTaggingEfficiency/xAODBTaggingEfficiency/selection.xml @@ -1,7 +1,5 @@ <!-- $Id: selection.xml 742367 2016-04-23 09:53:26Z krasznaa $ --> <lcgdict> - <class name="IBTaggingEfficiencyTool" /> - <class name="IBTaggingSelectionTool" /> <class name="BTaggingEfficiencyTool" /> <class name="BTaggingSelectionTool" /> </lcgdict> diff --git a/PhysicsAnalysis/JetTagging/JetTagPerformanceCalibration/xAODBTaggingEfficiency/xAODBTaggingEfficiency/xAODBTaggingEfficiencyDict.h b/PhysicsAnalysis/JetTagging/JetTagPerformanceCalibration/xAODBTaggingEfficiency/xAODBTaggingEfficiency/xAODBTaggingEfficiencyDict.h index 60d0002fdfb0dd5873301510a4274bcf421d14e8..3caca03f85580c68d5e8881336a357d1651492aa 100644 --- a/PhysicsAnalysis/JetTagging/JetTagPerformanceCalibration/xAODBTaggingEfficiency/xAODBTaggingEfficiency/xAODBTaggingEfficiencyDict.h +++ b/PhysicsAnalysis/JetTagging/JetTagPerformanceCalibration/xAODBTaggingEfficiency/xAODBTaggingEfficiency/xAODBTaggingEfficiencyDict.h @@ -11,8 +11,6 @@ #define EIGEN_DONT_VECTORIZE #endif -#include "xAODBTaggingEfficiency/IBTaggingEfficiencyTool.h" -#include "xAODBTaggingEfficiency/IBTaggingSelectionTool.h" #include "xAODBTaggingEfficiency/BTaggingEfficiencyTool.h" #include "xAODBTaggingEfficiency/BTaggingSelectionTool.h" diff --git a/PhysicsAnalysis/RingerSelectorTools/RingerSelectorTools/RingerSelectorToolsDict.h b/PhysicsAnalysis/RingerSelectorTools/RingerSelectorTools/RingerSelectorToolsDict.h index 41f8f5d52f77af2a614f765191124c4656b61258..c9a2dd5f95b90c68993c7659b998db1c9476dfb9 100644 --- a/PhysicsAnalysis/RingerSelectorTools/RingerSelectorTools/RingerSelectorToolsDict.h +++ b/PhysicsAnalysis/RingerSelectorTools/RingerSelectorTools/RingerSelectorToolsDict.h @@ -115,7 +115,6 @@ struct dict { #ifdef G__DICTIONARY // ROOT6 dictionary compilation -#if ROOT_VERSION_CODE >= ROOT_VERSION(6,0,0) // MN: pull in the Ringer enums and variables for ROOT6 on dictionary library loading #include "TInterpreter.h" namespace Ringer { @@ -128,6 +127,5 @@ namespace Ringer { } declareHeader; } #endif -#endif #endif // RINGERSELECTORTOOLS_RINGERSELECTORTOOLSDICT_H diff --git a/PhysicsAnalysis/RingerSelectorTools/cmt/precompile.RootCore b/PhysicsAnalysis/RingerSelectorTools/cmt/precompile.RootCore deleted file mode 100755 index f953b1a4dfe85e3cac243e645d63daab7a7c620e..0000000000000000000000000000000000000000 --- a/PhysicsAnalysis/RingerSelectorTools/cmt/precompile.RootCore +++ /dev/null @@ -1,47 +0,0 @@ -#!/bin/sh - -MAKEFILE=Makefile.RootCore -VERSIONFILE=version.cmt -ROOTCORE_REDIRECT_BASE=MoreFilesForYou-RootCore- - -# Check if root version is greater than 6.00/00 -#ROOT_VERSION_TEXT=`root-config --version` -#ROOT_VERSION_TEXT=${ROOT_VERSION_TEXT//./} -#ROOT_VERSION_TEXT=${ROOT_VERSION_TEXT//\//} -#if test "$ROOT_VERSION_TEXT" -gt "60000" -#then -# ROOT_GE_6_00=-DROOT_GE_6_00 -#else -# ROOT_GE_6_00= -#fi - -if ! test -f $VERSIONFILE; then - echo "$(git branch -a | grep --color=never "remotes/tags/RingerSelectorTools-.*" | tail -n 1)" >> $VERSIONFILE -fi - -# Change our Makefile to add dependent information: -if ! test -f $VERSIONFILE; then - echo "$(git branch -a | grep --color=never "remotes/tags/RingerSelectorTools-.*" | tail -n 1)" >> $VERSIONFILE -fi - -$ROOTCOREDIR/scripts/set_field.sh $MAKEFILE \ - PACKAGE_CXXFLAGS "-DASGTOOL_STANDALONE -DPACKAGE_VERSION=\\\\\"`cat $VERSIONFILE`\\\\\"" - -# Create RootCore file redirection for sources (done only to keep multifolder -# architeture) -cd ../Root/ -for dir in * -do - if test -d $dir - then - for file in `find $dir -type f -not -path "*/.*/*" -exec echo "{}" \;` - do - ROOTCORE_REDIRECT_FILE=`echo "${ROOTCORE_REDIRECT_BASE}${file//\//-}"` - if test ! -e $ROOTCORE_REDIRECT_FILE - then - ln -s $file $ROOTCORE_REDIRECT_FILE - fi - done - fi -done -cd - >> /dev/null diff --git a/Projects/AnalysisBase/externals.txt b/Projects/AnalysisBase/externals.txt index d300ad05a4d284515ccf3574aa868f33039ac457..4cd49083bd4f7a6331ba77e7d6c2ccb9f0516873 100644 --- a/Projects/AnalysisBase/externals.txt +++ b/Projects/AnalysisBase/externals.txt @@ -6,4 +6,4 @@ # forbidden. # The version of atlas/atlasexternals to use: -AnalysisBaseExternalsVersion = 2.0.64 +AnalysisBaseExternalsVersion = 2.0.65 diff --git a/Projects/AthDataQuality/externals.txt b/Projects/AthDataQuality/externals.txt index bdbd63ce4faa103863b05e15d738b3d5a386e3f8..476a4654143299cac2eab31e444bb277004df532 100644 --- a/Projects/AthDataQuality/externals.txt +++ b/Projects/AthDataQuality/externals.txt @@ -5,4 +5,4 @@ # an "origin/" prefix before it. For tags however this is explicitly # forbidden. -AtlasExternalsVersion = 2.0.64 +AtlasExternalsVersion = 2.0.65 diff --git a/Projects/AthGeneration/externals.txt b/Projects/AthGeneration/externals.txt index a58d71643d9709e68ff3fdcfcc6b3feeb247102b..2dabe38db588cee1aadad550373df15b3ae53035 100644 --- a/Projects/AthGeneration/externals.txt +++ b/Projects/AthGeneration/externals.txt @@ -6,7 +6,7 @@ # forbidden. # The version of atlas/atlasexternals to use: -AthGenerationExternalsVersion = 2.0.64 +AthGenerationExternalsVersion = 2.0.65 # The version of atlas/Gaudi to use: GaudiVersion = v33r1.001 diff --git a/Projects/AthSimulation/externals.txt b/Projects/AthSimulation/externals.txt index 0c6b2b299d53a4174d0e19b3a3aa461947a70f4a..22ba04f7a411f79610b1be8d44b043b89bc8e3e0 100644 --- a/Projects/AthSimulation/externals.txt +++ b/Projects/AthSimulation/externals.txt @@ -6,7 +6,7 @@ # forbidden. # The version of atlas/atlasexternals to use: -AthSimulationExternalsVersion = 2.0.64 +AthSimulationExternalsVersion = 2.0.65 # The version of atlas/Gaudi to use: GaudiVersion = v33r1.001 diff --git a/Projects/Athena/externals.txt b/Projects/Athena/externals.txt index 7d1d60777ba281d1c60b9398469a76b3fdfb0875..0f87b8b7d00b0905365b3cea18d2ac19e8fd85db 100644 --- a/Projects/Athena/externals.txt +++ b/Projects/Athena/externals.txt @@ -6,7 +6,7 @@ # forbidden. # The version of atlas/atlasexternals to use: -AthenaExternalsVersion = 2.0.64 +AthenaExternalsVersion = 2.0.65 # The version of atlas/Gaudi to use: GaudiVersion = v33r1.001 diff --git a/Projects/VP1Light/externals.txt b/Projects/VP1Light/externals.txt index a46e62265b39578ae6a9be2e03d54dec073bb28d..765bc91747d6f95d5024de8c19dcbc01af6f0992 100644 --- a/Projects/VP1Light/externals.txt +++ b/Projects/VP1Light/externals.txt @@ -6,4 +6,4 @@ # forbidden. # The version of atlas/atlasexternals to use: -VP1LightExternalsVersion = 2.0.64 +VP1LightExternalsVersion = 2.0.65 diff --git a/Reconstruction/HeavyIonRec/HIGlobal/HIGlobal/HIEventShapeFillerTool.h b/Reconstruction/HeavyIonRec/HIGlobal/HIGlobal/HIEventShapeFillerTool.h index 000087eecd61ac826d46026799094f17c59d7df3..88167ae4fbe1eba330db4351cfd7099e3194778c 100644 --- a/Reconstruction/HeavyIonRec/HIGlobal/HIGlobal/HIEventShapeFillerTool.h +++ b/Reconstruction/HeavyIonRec/HIGlobal/HIGlobal/HIEventShapeFillerTool.h @@ -1,42 +1,57 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ #ifndef HIGLOBAL_HIEVENTSHAPEFILLERTOOL_H #define HIGLOBAL_HIEVENTSHAPEFILLERTOOL_H #include "AsgTools/AsgTool.h" +#include "GaudiKernel/ToolHandle.h" #include "HIGlobal/IHIEventShapeFiller.h" #include "xAODHIEvent/HIEventShapeContainer.h" +#include "xAODCaloEvent/CaloClusterContainer.h" #include "HIEventUtils/HIEventShapeIndex.h" +#include "HIEventUtils/HITowerWeightTool.h" #include <NavFourMom/INavigable4MomentumCollection.h> -class CaloCellContainer; +#include "StoreGate/ReadHandleKey.h" +#include "StoreGate/WriteHandleKey.h" +class CaloCellContainer; class HIEventShapeFillerTool : public asg::AsgTool, virtual public IHIEventShapeFiller { ASG_TOOL_CLASS(HIEventShapeFillerTool,IHIEventShapeFiller) - + public: HIEventShapeFillerTool(const std::string& myname); - - virtual StatusCode InitializeCollection (xAOD::HIEventShapeContainer *evtShape_ ); - virtual StatusCode FillCollectionFromTowers (const std::string &tower_container_key ); - virtual StatusCode FillCollectionFromCells (const std::string &cell_container_key ); - virtual StatusCode FillCollectionFromTowerContainer(const INavigable4MomentumCollection* navInColl); - virtual StatusCode FillCollectionFromCellContainer(const CaloCellContainer* CellContainer); + virtual StatusCode initializeCollection (xAOD::HIEventShapeContainer *evtShape_ ); + virtual StatusCode fillCollectionFromTowers (const SG::ReadHandleKey<xAOD::CaloClusterContainer> &tower_container_key ); + virtual StatusCode fillCollectionFromCells (const SG::ReadHandleKey<CaloCellContainer> &cell_container_key ); - virtual const xAOD::HIEventShapeContainer* GetHIEventShapeContainer() {return m_evtShape;} - virtual StatusCode SetNumOrders(int Norders); + virtual StatusCode fillCollectionFromTowerContainer(const INavigable4MomentumCollection* navInColl); + virtual StatusCode fillCollectionFromCellContainer(const CaloCellContainer* CellContainer); + + virtual const xAOD::HIEventShapeContainer* getHIEventShapeContainer() const { return m_evtShape; } + virtual StatusCode setNumOrders(int Norders); + + virtual StatusCode fillCollectionFromClusterContainer(const xAOD::CaloClusterContainer* theClusters); private: - xAOD::HIEventShapeContainer *m_evtShape ; - int m_NumOrders;// The number of flow harmonics to store in the Q-vectors + xAOD::HIEventShapeContainer *m_evtShape; + + // The number of flow harmonics to store in the Q-vectors + Gaudi::Property< int > m_numOrders { this, "OrderOfFlowHarmonics", 7, "The number of Orders of harmonic flow to store in the EventShape" } ; + const HIEventShapeIndex* m_index; - void UpdateShape(xAOD::HIEventShapeContainer* shape, const HIEventShapeIndex* index, const CaloCell* theCell, float geoWeight, float eta0, float phi0, bool isNeg=false) const; + + void updateShape(xAOD::HIEventShapeContainer* shape, const HIEventShapeIndex* index, const CaloCell* theCell, float geoWeight, float eta0, float phi0, bool isNeg=false) const; + + ToolHandle<IHITowerWeightTool> m_towerWeightTool { this, "TowerWeightTool", "HITowerWeightTool", "Handle to Tower Weight Tool"}; + + Gaudi::Property< bool > m_useClusters { this, "UseClusters", false, "use Clusters boolean switch" } ; + }; #endif - diff --git a/Reconstruction/HeavyIonRec/HIGlobal/HIGlobal/HIEventShapeMaker.h b/Reconstruction/HeavyIonRec/HIGlobal/HIGlobal/HIEventShapeMaker.h index c2eeb2dd9008cf94b1819b1cf64969ed659da95b..11e48900b44399371047d6ed1549af7ce843a543 100644 --- a/Reconstruction/HeavyIonRec/HIGlobal/HIGlobal/HIEventShapeMaker.h +++ b/Reconstruction/HeavyIonRec/HIGlobal/HIGlobal/HIEventShapeMaker.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ #ifndef __HIEVENTSHAPEMAKER_H__ @@ -8,12 +8,20 @@ #include "AthenaBaseComps/AthAlgorithm.h" #include "xAODHIEvent/HIEventShapeContainer.h" +#include "xAODHIEvent/HIEventShapeAuxContainer.h" +#include "xAODCaloEvent/CaloClusterContainer.h" #include <string> #include "GaudiKernel/ToolHandle.h" +#include "GaudiKernel/Property.h" #include "IHIEventShapeFiller.h" #include "HIEventUtils/HIEventShapeSummaryTool.h" +#include "StoreGate/ReadHandleKey.h" +#include "StoreGate/WriteHandleKey.h" + +class CaloCellContainer; + class HIEventShapeMaker : public AthAlgorithm { public: @@ -29,15 +37,21 @@ public: virtual StatusCode finalize(); private: - std::string m_tower_container_key;//TowerContainer key - std::string m_cell_container_key ;//CaloCellContainer key - std::string m_output_key ;//Name of output container key - bool m_use_calo_cell ;//use cells instead of towers to fill the EventShape - int m_NumOrders ;//The number of Orders of harmonic flow to store in the EventShape - std::string m_summary_key; - - ToolHandle<IHIEventShapeFiller> m_HIEventShapeFillerTool; - ToolHandle<IHIEventShapeSummaryTool> m_summary_tool; + SG::ReadHandleKey<xAOD::CaloClusterContainer> m_towerContainerKey { this, "InputTowerKey" , "CombinedTower" , "InputTowerKey"}; //TowerContainer key + SG::ReadHandleKey<CaloCellContainer> m_cellContainerKey { this, "InputCellKey" , "AllCalo" , "InputCellKey" }; //CaloCellContainer key + SG::ReadHandleKey<xAOD::HIEventShapeContainer> m_readExistingKey { this, "ReadExistingKey", "HIEventShapeContainer", "Read key to retrieve the shape if m_summary_only is true"}; + SG::WriteHandleKey<xAOD::HIEventShapeContainer> m_outputKey { this, "OutputContainerKey" , "HIEventShapeContainer", "Output Container Key"}; //Name of output container key + SG::WriteHandleKey<xAOD::HIEventShapeContainer> m_summaryKey { this, "SummaryContainerKey" , "", "SummaryContainerKey" }; + + //use cells instead of towers to fill the EventShape + Gaudi::Property< bool > m_useCaloCell { this, "UseCaloCell", false, "Use cells instead of towers to fill the EventShape" } ; + //The number of Orders of harmonic flow to store in the EventShape + Gaudi::Property< int > m_numOrders { this, "OrderOfFlowHarmonics", 7, "The number of Orders of harmonic flow to store in the EventShape" } ; + Gaudi::Property< bool > m_summaryOnly { this, "SummaryOnly", false, "Summary Only boolean switch" } ; + + ToolHandle<IHIEventShapeFiller> m_HIEventShapeFillerTool { this, "HIEventShapeFillerTool", "HIEventShapeFillerTool", "HIEventShapeFillerTool" }; + ToolHandle<IHIEventShapeSummaryTool> m_summaryTool { this, "SummaryTool", "HIEventShapeSummaryTool", "Handle to IHIEventShapeSummaryTool" }; + void PrintHIEventShapeContainer(const xAOD::HIEventShapeContainer *Container); }; diff --git a/Reconstruction/HeavyIonRec/HIGlobal/HIGlobal/IHIEventShapeFiller.h b/Reconstruction/HeavyIonRec/HIGlobal/HIGlobal/IHIEventShapeFiller.h index 3a274603d9a078a732a2264104fb02c86eea9b81..4fd72b18a886a6bb65f587c598d1b4ba3d578a88 100644 --- a/Reconstruction/HeavyIonRec/HIGlobal/HIGlobal/IHIEventShapeFiller.h +++ b/Reconstruction/HeavyIonRec/HIGlobal/HIGlobal/IHIEventShapeFiller.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ #ifndef __INTERFACE_HIEVENTSHAPEMODIFIER_H__ @@ -7,30 +7,38 @@ #include "AsgTools/IAsgTool.h" #include "xAODHIEvent/HIEventShapeContainer.h" +#include "xAODCaloEvent/CaloClusterContainer.h" #include <string> -//class INavigable4MomentumCollection; -//class CaloCellContainer; #include <NavFourMom/INavigable4MomentumCollection.h> #include <CaloEvent/CaloCellContainer.h> -class IHIEventShapeFiller : virtual public asg::IAsgTool +#include "StoreGate/ReadHandleKey.h" +#include "StoreGate/WriteHandleKey.h" + +#include <iostream> +#include <iomanip> + +class CaloCellContainer; + +class IHIEventShapeFiller : virtual public asg::IAsgTool { ASG_TOOL_INTERFACE(IHIEventShapeFiller) public: virtual ~IHIEventShapeFiller() {}; - virtual StatusCode InitializeCollection (xAOD::HIEventShapeContainer *evtShape_ )=0; - virtual StatusCode FillCollectionFromTowers (const std::string &m_tower_container_key )=0; - virtual StatusCode FillCollectionFromCells (const std::string &m_cell_container_key )=0; + virtual StatusCode initializeCollection (xAOD::HIEventShapeContainer *evtShape_ )=0; + virtual StatusCode fillCollectionFromTowers (const SG::ReadHandleKey<xAOD::CaloClusterContainer> &m_tower_container_key )=0; + virtual StatusCode fillCollectionFromCells (const SG::ReadHandleKey<CaloCellContainer> &m_cell_container_key )=0; + + virtual const xAOD::HIEventShapeContainer* getHIEventShapeContainer() const =0; + virtual StatusCode setNumOrders(int NumOrders)=0; - virtual const xAOD::HIEventShapeContainer* GetHIEventShapeContainer()=0; - virtual StatusCode SetNumOrders(int NumOrders)=0; + inline std::string getContainerName() const { return m_outputContainerName; }; + inline void setContainerName(std::string cname) { m_outputContainerName=cname; }; - inline std::string GetContainerName() const {return m_output_container_name;}; - inline void SetContainerName(std::string cname) {m_output_container_name=cname;}; private : - std::string m_output_container_name; + std::string m_outputContainerName; }; diff --git a/Reconstruction/HeavyIonRec/HIGlobal/share/HIGlobal_jobOptions.py b/Reconstruction/HeavyIonRec/HIGlobal/share/HIGlobal_jobOptions.py index d13041957e2036a24fd0640af9860efe90445deb..e57b5f5e6de9fbbd65b9f7b7de66f9df92607a53 100755 --- a/Reconstruction/HeavyIonRec/HIGlobal/share/HIGlobal_jobOptions.py +++ b/Reconstruction/HeavyIonRec/HIGlobal/share/HIGlobal_jobOptions.py @@ -11,6 +11,7 @@ shape_key=jobproperties.HIGlobalFlags.EventShapeKey() from HIGlobal.HIGlobalConf import HIEventShapeMaker from HIGlobal.HIGlobalConf import HIEventShapeFillerTool theAlg=HIEventShapeMaker() +theAlg.ReadExistingKey=shape_key theAlg.OutputContainerKey=shape_key theAlg.HIEventShapeFillerTool=HIEventShapeFillerTool() theAlg.OrderOfFlowHarmonics=jobproperties.HIGlobalFlags.NumFlowHarmonics() @@ -47,4 +48,3 @@ if jobproperties.HIGlobalFlags.DoSummary() : theAlg.SummaryContainerKey=summary_key jobproperties.HIGlobalFlags.HIGlobalItemList+=["xAOD::HIEventShapeContainer#"+summary_key] jobproperties.HIGlobalFlags.HIGlobalItemList+=["xAOD::HIEventShapeAuxContainer#"+summary_key+"Aux."] - diff --git a/Reconstruction/HeavyIonRec/HIGlobal/share/joboptions_Test_HIEventShapeMaker.py b/Reconstruction/HeavyIonRec/HIGlobal/share/joboptions_Test_HIEventShapeMaker.py old mode 100644 new mode 100755 diff --git a/Reconstruction/HeavyIonRec/HIGlobal/src/HIEventShapeFillerTool.cxx b/Reconstruction/HeavyIonRec/HIGlobal/src/HIEventShapeFillerTool.cxx index 1edcc9f8c2b910e0728f4f31b84e21ae4b567fec..226f59b3aae88193b75b5c149aa812e6621f56d0 100644 --- a/Reconstruction/HeavyIonRec/HIGlobal/src/HIEventShapeFillerTool.cxx +++ b/Reconstruction/HeavyIonRec/HIGlobal/src/HIEventShapeFillerTool.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ #include "HIGlobal/HIEventShapeFillerTool.h" @@ -9,23 +9,24 @@ #include <xAODHIEvent/HIEventShape.h> #include "HIEventUtils/HIEventShapeMap.h" +#include <iostream> +#include <iomanip> + HIEventShapeFillerTool::HIEventShapeFillerTool(const std::string& myname) : asg::AsgTool(myname), m_evtShape(nullptr), - m_NumOrders(7), m_index(nullptr) { - } -StatusCode HIEventShapeFillerTool::SetNumOrders(int Norders) +StatusCode HIEventShapeFillerTool::setNumOrders(int Norders) { - m_NumOrders=Norders; + m_numOrders=Norders; return StatusCode::SUCCESS; } -StatusCode HIEventShapeFillerTool::InitializeCollection(xAOD::HIEventShapeContainer *evtShape_) -{ +StatusCode HIEventShapeFillerTool::initializeCollection(xAOD::HIEventShapeContainer *evtShape_) +{ //change m_evtShape to m_evtShape m_evtShape=evtShape_; @@ -34,26 +35,32 @@ StatusCode HIEventShapeFillerTool::InitializeCollection(xAOD::HIEventShapeContai { HIEventShapeIndex index; index.setBinning(HIEventShapeIndex::COMPACT); - m_index=HIEventShapeMap::getMap()->insert(GetContainerName(),index); + m_index=HIEventShapeMap::getMap()->insert(getContainerName(),index); } //fix this to have proper name passing - //use tool to initialize event shape object - m_index->initializeEventShapeContainer(m_evtShape,m_NumOrders); - + if(!m_useClusters) m_index->initializeEventShapeContainer(m_evtShape,m_numOrders); return StatusCode::SUCCESS; } -StatusCode HIEventShapeFillerTool::FillCollectionFromTowers(const std::string &tower_container_key) +StatusCode HIEventShapeFillerTool::fillCollectionFromTowers(const SG::ReadHandleKey<xAOD::CaloClusterContainer> &tower_container_key) { //retrieve the tower container from store - const INavigable4MomentumCollection* navInColl = 0; - CHECK(evtStore()->retrieve(navInColl,tower_container_key)); - return FillCollectionFromTowerContainer(navInColl); + if(m_useClusters) + { + SG::ReadHandle<xAOD::CaloClusterContainer> readHandleCaloClus ( tower_container_key ); + const xAOD::CaloClusterContainer* clusters=nullptr; + clusters = readHandleCaloClus.get(); + return fillCollectionFromClusterContainer(clusters); + } + SG::ReadHandle<INavigable4MomentumCollection> readHandleINav ( tower_container_key.key() ); + const INavigable4MomentumCollection* navInColl = 0; + navInColl = readHandleINav.get(); + return fillCollectionFromTowerContainer(navInColl); } -StatusCode HIEventShapeFillerTool::FillCollectionFromTowerContainer(const INavigable4MomentumCollection* navInColl) +StatusCode HIEventShapeFillerTool::fillCollectionFromTowerContainer(const INavigable4MomentumCollection* navInColl) { //loop on towers for(INavigable4MomentumCollection::const_iterator towerItr=navInColl->begin(); @@ -71,36 +78,102 @@ StatusCode HIEventShapeFillerTool::FillCollectionFromTowerContainer(const INavig if ( cellToken.size() == 0 ) continue; for(NavigationToken<CaloCell,double,CaloCellIDFcn>::const_iterator cellItr = cellToken.begin(); - cellItr != cellToken.end(); cellItr++ ) UpdateShape(m_evtShape,m_index,*cellItr,cellToken.getParameter(*cellItr),eta0,phi0); + cellItr != cellToken.end(); cellItr++ ) updateShape(m_evtShape,m_index,*cellItr,cellToken.getParameter(*cellItr),eta0,phi0); }//end tower loop return StatusCode::SUCCESS; } +StatusCode HIEventShapeFillerTool::fillCollectionFromClusterContainer(const xAOD::CaloClusterContainer* theClusters) +{ + constexpr float area_slice=HI::TowerBins::getBinArea()*HI::TowerBins::numPhiBins(); + m_evtShape->reserve(HI::TowerBins::numEtaBins()); + for(unsigned int eb=0; eb< HI::TowerBins::numEtaBins(); eb++) + { + xAOD::HIEventShape* e=new xAOD::HIEventShape(); + m_evtShape->push_back(e); + e->setLayer(0); + e->setEtaMin(HI::TowerBins::getBinLowEdgeEta(eb)); + e->setEtaMax(HI::TowerBins::getBinUpEdgeEta(eb)); + e->etCos().assign(m_numOrders,0); + e->etSin().assign(m_numOrders,0); + e->setArea(area_slice); + e->setNCells(HI::TowerBins::numPhiBins()); + } + + std::unique_ptr<std::vector<float> > weight_vector(new std::vector<float>()); + weight_vector->reserve(theClusters->size()); + SG::AuxElement::Decorator< float > decorator("HIEtaPhiWeight"); - -StatusCode HIEventShapeFillerTool::FillCollectionFromCells(const std::string &cell_container_key) + constexpr float area_cluster=HI::TowerBins::getBinArea(); + + if(m_towerWeightTool) CHECK(m_towerWeightTool->configureEvent()); + + for(auto cl : *theClusters) + { + double ET=cl->e()/std::cosh(cl->eta0()); + double phi=cl->phi0(); + double eta=cl->eta0(); + unsigned int eb=HI::TowerBins::findBinEta(eta); + xAOD::HIEventShape* slice=m_evtShape->at(eb); + float weight=1; + if(m_towerWeightTool) + { + float recip=m_towerWeightTool->getEtaPhiResponse(eta,phi); + if(recip!=0.) weight=1./recip; + } + weight_vector->push_back(weight); + decorator(*cl)=weight; + + //update members + slice->setEt(slice->et()+weight*ET); + slice->setRho(slice->rho() + weight*ET/area_cluster); + + for(unsigned int i=0; i<static_cast<unsigned int>(m_numOrders); i++) + { + float nn=i+1; + float tmp_cos = slice->etCos().at(i); + slice->etCos()[i] = tmp_cos + weight*ET*std::cos(nn*phi); + float tmp_sin = slice->etSin().at(i); + slice->etSin()[i] = tmp_sin + weight*ET*std::sin(nn*phi); + } + } + ATH_MSG_DEBUG("DUMPING HIEVENTSHAPE"); + for(auto es : *m_evtShape) + { + ATH_MSG_DEBUG ( std::setw(10) << es->etaMin() + << std::setw(10) << es->etaMax() + << std::setw(15) << es->et()*1e-3 ); + + for(unsigned int i=0; i<static_cast<unsigned int>(m_numOrders); i++) + { + ATH_MSG_DEBUG( std::setw(40) << i + << std::setw(15) << es->etCos().at(i) + << std::setw(15) << es->etSin().at(i) ); + } + + } + return StatusCode::SUCCESS; +} + +StatusCode HIEventShapeFillerTool::fillCollectionFromCells(const SG::ReadHandleKey<CaloCellContainer> &cell_container_key) { - ATH_MSG_DEBUG("INSIDE FillCollectionFromCells"); + ATH_MSG_INFO("INSIDE FillCollectionFromCells"); //retrieve the cell container from store - const CaloCellContainer* CellContainer = 0; - if(evtStore()->retrieve(CellContainer,cell_container_key).isFailure()) - { - ATH_MSG_ERROR(" Could not retrieve CaloCell container with key "<< cell_container_key); - return StatusCode::FAILURE; - } - return FillCollectionFromCellContainer(CellContainer); + SG::ReadHandle<CaloCellContainer> read_handle_caloCell ( cell_container_key ); + const CaloCellContainer* CellContainer = read_handle_caloCell.get(); + return fillCollectionFromCellContainer(CellContainer); } -StatusCode HIEventShapeFillerTool::FillCollectionFromCellContainer(const CaloCellContainer* CellContainer) +StatusCode HIEventShapeFillerTool::fillCollectionFromCellContainer(const CaloCellContainer* CellContainer) { - ATH_MSG_DEBUG("INSIDE FillCollectionFromCellContainer"); + ATH_MSG_INFO("INSIDE FillCollectionFromCellContainer"); //loop on Cells - for(const auto cellItr : *CellContainer) UpdateShape(m_evtShape,m_index,cellItr,1.,cellItr->eta(),cellItr->phi()); + for(const auto cellItr : *CellContainer) updateShape(m_evtShape,m_index,cellItr,1.,cellItr->eta(),cellItr->phi()); return StatusCode::SUCCESS; -} +} -void HIEventShapeFillerTool::UpdateShape(xAOD::HIEventShapeContainer* shape, const HIEventShapeIndex* index, const CaloCell* theCell, float geoWeight, float eta0, float phi0, bool isNeg) const +void HIEventShapeFillerTool::updateShape(xAOD::HIEventShapeContainer* shape, const HIEventShapeIndex* index, const CaloCell* theCell, float geoWeight, float eta0, float phi0, bool isNeg) const { float sgn=(isNeg) ? -1 : 1; @@ -125,9 +198,8 @@ void HIEventShapeFillerTool::UpdateShape(xAOD::HIEventShapeContainer* shape, con float ih_f=ih+1; float tmp_cos = slice->etCos().at(ih); slice->etCos()[ih] = tmp_cos + cell_et*cos(ih_f*phi0)*geoWeight; - + float tmp_sin = slice->etSin().at(ih); slice->etSin()[ih] = tmp_sin + cell_et*sin(ih_f*phi0)*geoWeight; } -} - +} diff --git a/Reconstruction/HeavyIonRec/HIGlobal/src/HIEventShapeMaker.cxx b/Reconstruction/HeavyIonRec/HIGlobal/src/HIEventShapeMaker.cxx index bc868bb79def6f4147ce37b808a75ff8cbfc726e..b58a7376410aaf1f92db4d4bd10501dcbcbe54e1 100644 --- a/Reconstruction/HeavyIonRec/HIGlobal/src/HIEventShapeMaker.cxx +++ b/Reconstruction/HeavyIonRec/HIGlobal/src/HIEventShapeMaker.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ #include <HIGlobal/HIEventShapeMaker.h> @@ -8,68 +8,75 @@ #include <xAODHIEvent/HIEventShapeAuxContainer.h> #include <GaudiKernel/ServiceHandle.h> +#include "StoreGate/ReadHandle.h" +#include "StoreGate/WriteHandle.h" - -HIEventShapeMaker::HIEventShapeMaker(const std::string& name, ISvcLocator* pSvcLocator) : AthAlgorithm(name,pSvcLocator), - m_HIEventShapeFillerTool(this), - m_summary_tool(this) +HIEventShapeMaker::HIEventShapeMaker(const std::string& name, ISvcLocator* pSvcLocator) : AthAlgorithm(name,pSvcLocator)//, { - declareProperty("InputTowerKey" ,m_tower_container_key="CombinedTower" ); - declareProperty("InputCellKey" ,m_cell_container_key ="AllCalo" ); - declareProperty("UseCaloCell" ,m_use_calo_cell = false ); - declareProperty("OutputContainerKey" ,m_output_key ="HIEventShapeContainer" ); - declareProperty("HIEventShapeFillerTool",m_HIEventShapeFillerTool ); - declareProperty("OrderOfFlowHarmonics" ,m_NumOrders =7 ); - declareProperty("SummaryTool" ,m_summary_tool ); - declareProperty("SummaryContainerKey" ,m_summary_key="" ); } - StatusCode HIEventShapeMaker::initialize() { - ATH_MSG_DEBUG("Inside HIEventShapeMaker::initialize()"); + ATH_MSG_INFO("Inside HIEventShapeMaker::initialize()"); + + //First we initialize keys - after initialization they are frozen + ATH_CHECK( m_towerContainerKey.initialize(!m_useCaloCell) ); + ATH_CHECK( m_cellContainerKey.initialize(m_useCaloCell) ); + ATH_CHECK( m_outputKey.initialize(!m_summaryOnly) ); + ATH_CHECK( m_readExistingKey.initialize(m_summaryOnly) ); + ATH_CHECK( m_summaryKey.initialize(!m_summaryKey.key().empty()) ); //Create the HIEventShapeFillerTool - //m_HIEventShapeFillerTool.setTypeAndName("HIEventShapeFillerTool/EvtShapeModifierTool");//Now this is done in the job-options - CHECK(m_HIEventShapeFillerTool.retrieve()); - m_HIEventShapeFillerTool->SetContainerName(m_output_key); - //should be configured so that tool and alg never have different # orders - //print warning if this is the case - CHECK(m_HIEventShapeFillerTool->SetNumOrders(m_NumOrders)); - if(m_summary_key.compare("")!=0) CHECK(m_summary_tool->initialize()); + if(!m_summaryOnly) + { + ATH_CHECK(m_HIEventShapeFillerTool.retrieve()); + m_HIEventShapeFillerTool->setContainerName(m_outputKey.key()); + //should be configured so that tool and alg never have different # orders + //print warning if this is the case + ATH_CHECK(m_HIEventShapeFillerTool->setNumOrders(m_numOrders)); + } + if( m_summaryKey.key().compare("") != 0 ) ATH_CHECK(m_summaryTool->initialize()); return StatusCode::SUCCESS; } - - StatusCode HIEventShapeMaker::execute() { - ATH_MSG_DEBUG("Inside HIEventShapeMaker::execute()"); - - //Create HIEventShape Collection and ask tool to initialize it - xAOD::HIEventShapeContainer* evtShape=new xAOD::HIEventShapeContainer; - xAOD::HIEventShapeAuxContainer *evtShapeAux = new xAOD::HIEventShapeAuxContainer; - evtShape->setStore( evtShapeAux ); - ATH_MSG_DEBUG("Making HIEventShapeContainer with key " << m_output_key); - - CHECK(evtStore()->record(evtShape,m_output_key)); - CHECK(evtStore()->record(evtShapeAux,m_output_key+std::string("Aux."))); - CHECK(m_HIEventShapeFillerTool->InitializeCollection(evtShape)); + ATH_MSG_INFO("Inside HIEventShapeMaker::execute()"); + + const xAOD::HIEventShapeContainer* evtShape_const=nullptr; + if( m_summaryOnly ){ + SG::ReadHandle<xAOD::HIEventShapeContainer> readHandleEvtShape ( m_readExistingKey ); + if (!readHandleEvtShape.isValid()) { + ATH_MSG_FATAL( "Could not find HI event shape! (" << m_readExistingKey.key() << ")." ); + return(StatusCode::FAILURE); + } + evtShape_const = readHandleEvtShape.cptr(); + } + else + { + ATH_MSG_INFO("Making HIEventShapeContainer with key " << m_outputKey.key()); + SG::WriteHandle<xAOD::HIEventShapeContainer> writeHandleEvtShape ( m_outputKey ); + ATH_CHECK( writeHandleEvtShape.record ( std::make_unique<xAOD::HIEventShapeContainer>(), + std::make_unique<xAOD::HIEventShapeAuxContainer>())); + ATH_CHECK(m_HIEventShapeFillerTool->initializeCollection(writeHandleEvtShape.ptr())); + evtShape_const=writeHandleEvtShape.cptr(); + + ATH_MSG_INFO("Calling filler tool with m_useCaloCell= " << m_useCaloCell); + if(m_useCaloCell) ATH_CHECK(m_HIEventShapeFillerTool->fillCollectionFromCells ( m_cellContainerKey )); + else ATH_CHECK(m_HIEventShapeFillerTool->fillCollectionFromTowers( m_towerContainerKey )); + } - ATH_MSG_DEBUG("Calling filler tool with m_use_calo_cell= " << m_use_calo_cell); - if(m_use_calo_cell) CHECK(m_HIEventShapeFillerTool->FillCollectionFromCells (m_cell_container_key )); - else CHECK(m_HIEventShapeFillerTool->FillCollectionFromTowers(m_tower_container_key)); + //PrintHIEventShapeContainer( evtShape_const ); - if(m_summary_key.compare("")!=0) + if(!m_summaryKey.key().empty()) { - xAOD::HIEventShapeContainer* es_summary=new xAOD::HIEventShapeContainer; - xAOD::HIEventShapeAuxContainer *es_summary_aux = new xAOD::HIEventShapeAuxContainer; - es_summary->setStore( es_summary_aux ); - CHECK(evtStore()->record(es_summary,m_summary_key)); - CHECK(evtStore()->record(es_summary_aux,m_summary_key+std::string("Aux."))); - CHECK(m_summary_tool->summarize(evtShape,es_summary)); + SG::WriteHandle<xAOD::HIEventShapeContainer> write_handle_esSummary ( m_summaryKey ); + ATH_CHECK( write_handle_esSummary.record ( std::make_unique<xAOD::HIEventShapeContainer> (), + std::make_unique<xAOD::HIEventShapeAuxContainer>())); + if(m_summaryOnly) ATH_CHECK(m_summaryTool->summarize(evtShape_const,write_handle_esSummary.ptr())); + else ATH_CHECK(m_summaryTool->summarize(evtShape_const,write_handle_esSummary.ptr())); } return StatusCode::SUCCESS; } @@ -111,5 +118,3 @@ void HIEventShapeMaker::PrintHIEventShapeContainer(const xAOD::HIEventShapeConta for(int i=0;i<40;i++){std::cout<<"#";}; std::cout<<std::endl; } - - diff --git a/Reconstruction/HeavyIonRec/HIJetRec/CMakeLists.txt b/Reconstruction/HeavyIonRec/HIJetRec/CMakeLists.txt index e25818886e55c3abb6251d7cc8cc14c05847b328..5cc125d1bad19068b0652c33738aabe4193bb941 100644 --- a/Reconstruction/HeavyIonRec/HIJetRec/CMakeLists.txt +++ b/Reconstruction/HeavyIonRec/HIJetRec/CMakeLists.txt @@ -1,4 +1,4 @@ -# $Id: CMakeLists.txt 740786 2016-04-16 13:57:11Z krasznaa $ +# $Id: CMakeLists.txt 804522 2017-05-09 17:32:26Z angerami $ ################################################################################ # Package: HIJetRec ################################################################################ @@ -15,6 +15,7 @@ atlas_depends_on_subdirs( Event/xAOD/xAODCaloEvent Event/xAOD/xAODHIEvent Event/xAOD/xAODJet + Event/xAOD/xAODEventInfo PhysicsAnalysis/HeavyIonPhys/HIEventUtils Reconstruction/Jet/JetInterface Reconstruction/Jet/JetRec diff --git a/Reconstruction/HeavyIonRec/HIJetRec/HIJetRec/HIEventShapeJetIteration.h b/Reconstruction/HeavyIonRec/HIJetRec/HIJetRec/HIEventShapeJetIteration.h index c2c85bc60919dabaf138f68e678956d36fe6b524..279f01a366d4e9d2f67f454b4dffe0b87e8ea129 100644 --- a/Reconstruction/HeavyIonRec/HIJetRec/HIJetRec/HIEventShapeJetIteration.h +++ b/Reconstruction/HeavyIonRec/HIJetRec/HIJetRec/HIEventShapeJetIteration.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ #ifndef HIJETREC_HIEVENTSHAPEJETITERATION_H @@ -16,6 +16,8 @@ #include "HIJetRec/IHISubtractorTool.h" #include "HIJetRec/IHIUEModulatorTool.h" +#include "StoreGate/ReadHandleKey.h" +#include "StoreGate/WriteHandleKey.h" class HIEventShapeJetIteration : virtual public IJetExecuteTool, virtual public asg::AsgTool @@ -25,7 +27,9 @@ class HIEventShapeJetIteration : virtual public IJetExecuteTool, public: HIEventShapeJetIteration(std::string name); - + + virtual StatusCode initialize() override; + int execute() const; StatusCode makeClusterList(std::vector<const xAOD::CaloCluster*>& particleList, const xAOD::JetContainer* theJets, @@ -43,35 +47,33 @@ public: private: - ToolHandle<IHISubtractorTool> m_subtractor_tool; - ToolHandle<IHIUEModulatorTool> m_modulator_tool; + ToolHandle<IHISubtractorTool> m_subtractorTool { this, "Subtractor", "HIJetClusterSubtractorTool", "Handle to HIJetClusterSubtractorTool" }; + ToolHandle<IHIUEModulatorTool> m_modulatorTool { this, "Modulator" , "HIUEModulatorTool", "Handle to HIUEModulatorTool" }; /// \brief Name of input HIEventShapeContainer - std::string m_input_event_shape_key; - + SG::ReadHandleKey<xAOD::HIEventShapeContainer> m_inputEventShapeKey { this, "InputEventShapeKey", "HIEventShape", "HIEventShape"}; /// \brief Name of output HIEventShapeContainer - std::string m_output_event_shape_key; + SG::WriteHandleKey<xAOD::HIEventShapeContainer> m_outputEventShapeKey { this, "OutputEventShapeKey", "HIEventShape_iter", "HIEventShape_iter"}; /// \brief List of names of JetCollections, all jets in these collections are seeds - std::string m_calo_jet_seed_key; - std::string m_track_jet_seed_key; + SG::ReadHandleKey<xAOD::JetContainer> m_caloJetSeedKey { this, "CaloJetSeedContainerKey", "", "Names of seed collections"}; + SG::ReadHandleKey<xAOD::JetContainer> m_trackJetSeedKey { this, "TrackJetSeedContainerKey", "", "Names of seed collections"}; /// \brief Name of jet attribute providing link between jets and clusters - std::string m_association_key; - + Gaudi::Property< std::string > m_associationKey { this, "AssociationKey", "", "Name of jet attribute providing link between jets and clusters" }; /// \brief All clusters w/in this DR of jet are excluded from shape calc. - float m_exclude_DR; - + Gaudi::Property< float > m_excludeDR { this, "ExclusionRadius", 0.4, "Exclude all calo regions w/in this DR to jet" }; /// \brief If selected, the jet constituents define the associated clusters - bool m_exclude_constituents; + Gaudi::Property< bool > m_excludeConstituents { this, "ExcludeConstituents", false, "Only exclude constituents of jets" }; + + Gaudi::Property< bool > m_doRemodulation { this, "RemodulateUE", false, "Correct UE for incomplete cancellation of flow harmonics when iterating" }; + + Gaudi::Property< unsigned int > m_modulationScheme { this, "ModulationScheme", 0, "Scheme to build separate ES object for flow modulation" }; + + SG::WriteHandleKey<xAOD::HIEventShapeContainer> m_modulationKey { this, "ModulationEventShapeKey", "HIEventShape_itr_mod", "Modulation Event Shape Key"}; - mutable bool m_isInit; + Gaudi::Property< bool > m_shallowCopy { this, "ShallowCopy", true, "Use shallow copy for iterated event shape" }; - bool m_do_remodulation; - unsigned int m_modulation_scheme; - std::string m_modulation_key; - }; #endif - diff --git a/Reconstruction/HeavyIonRec/HIJetRec/HIJetRec/HIJetClusterIndexAssociationTool.h b/Reconstruction/HeavyIonRec/HIJetRec/HIJetRec/HIJetClusterIndexAssociationTool.h index 59a1134e78417857682913b4caa6844fd6e72719..2e3fa4b7aaa0a68262d4d2286873f8a1e185abd0 100644 --- a/Reconstruction/HeavyIonRec/HIJetRec/HIJetRec/HIJetClusterIndexAssociationTool.h +++ b/Reconstruction/HeavyIonRec/HIJetRec/HIJetRec/HIJetClusterIndexAssociationTool.h @@ -18,10 +18,10 @@ /// Necessary because you may want to know all clusters w/in DR < X rather than /// just the clusters that are constituents of the jet. /// Since HI-style clusters derive from towers they have a well-defined index -/// For each jet, this tool associates a set of clusters from a pre-determined +/// For each jet, this tool associates a set of clusters from a pre-determined /// indexing. /// -/// Given a DR value and an eta/phi position a set of indices of towers +/// Given a DR value and an eta/phi position a set of indices of towers /// w/in DR of that position can be calculated, and can be done in advance /// or at initialization time rather than in the event loop. /// The set of such indices for each eta/phi position (defined by tower grid) @@ -31,6 +31,9 @@ #include <string> #include "JetRec/JetModifierBase.h" +#include "StoreGate/ReadHandleKey.h" +#include "StoreGate/WriteHandleKey.h" + class HIJetClusterIndexAssociationTool : public JetModifierBase { @@ -39,25 +42,29 @@ class HIJetClusterIndexAssociationTool : public JetModifierBase public: HIJetClusterIndexAssociationTool(const std::string& t); - + + virtual StatusCode initialize() override; + StatusCode modify(xAOD::JetContainer& jets) const; int modifyJet(xAOD::Jet&) const {return 1;}; private: /// \brief name of IParticleContainer w/ particles to associate - std::string m_container_key; + SG::ReadHandleKey<xAOD::IParticleContainer> m_containerKey { this, "ContainerKey", "", "Name of IParticleContainer w/ particles to associat"}; /// \brief Name of jet attribute providing link between jets and clusters - std::string m_assoc_name; + Gaudi::Property< std::string > m_assocName { this, "AssociationName", "", "Name of jet attribute providing link between jets and clusters" }; // %% NOT YET IMPLEMENTED // index passing actually needs to be implemented - float m_DR; - bool m_apply_filter; - float m_E_min; - float m_pT_min; - + Gaudi::Property< float > m_DR { this, "DeltaR", 0.8, "Index passing actually needs to be implemented" }; + Gaudi::Property< bool > m_applyFilter { this, "ApplyFilter", false, "Apply filter boolean" }; + + Gaudi::Property< float > m_Emin { this, "FilterMinE", -999., "Filter minimum Energy" }; + Gaudi::Property< float > m_pTmin { this, "FilterMinPt", 0., "Filter minimum Pt" }; + + }; #endif diff --git a/Reconstruction/HeavyIonRec/HIJetRec/HIJetRec/HIJetClusterSubtractorTool.h b/Reconstruction/HeavyIonRec/HIJetRec/HIJetRec/HIJetClusterSubtractorTool.h index 31f764c2fa517e843c56babef84402ac1c47d997..f18bc467678cb546e22f9259a44d5033cc3a47c4 100644 --- a/Reconstruction/HeavyIonRec/HIJetRec/HIJetRec/HIJetClusterSubtractorTool.h +++ b/Reconstruction/HeavyIonRec/HIJetRec/HIJetRec/HIJetClusterSubtractorTool.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ // HIJetClusterSubtractorTool.h @@ -22,6 +22,7 @@ //////////////////////////////////////////////////////////////////////////////// #include "HIJetRec/HIJetSubtractorToolBase.h" +#include <map> #include "AsgTools/AsgTool.h" @@ -30,39 +31,42 @@ class TH3F; class HIJetClusterSubtractorTool : public HIJetSubtractorToolBase { ASG_TOOL_CLASS(HIJetClusterSubtractorTool, IHISubtractorTool); - + // FIX //needs lookup for static geometric factors! - + public: /// \brief Implements method defined in base /// First argument is reference to four vector that is updated to reflect /// the subtracted kinematics of the IParticle passed in the second arg /// Method expects cl_in to be a cluster HIJetClusterSubtractorTool(const std::string& myname); - virtual void Subtract(xAOD::IParticle::FourMom_t&, const xAOD::IParticle*, const xAOD::HIEventShapeContainer*, const HIEventShapeIndex*, const ToolHandle<IHIUEModulatorTool>&, const xAOD::HIEventShape* eshape) const override; - virtual void SubtractWithMoments(xAOD::CaloCluster*, const xAOD::HIEventShapeContainer*, const HIEventShapeIndex* index, const ToolHandle<IHIUEModulatorTool>&, const xAOD::HIEventShape* eshape ) const override; - virtual void UpdateUsingCluster(xAOD::HIEventShapeContainer* shape, const HIEventShapeIndex* index, const xAOD::CaloCluster* cl) const override; + virtual void subtract(xAOD::IParticle::FourMom_t&, const xAOD::IParticle*, const xAOD::HIEventShapeContainer*, const HIEventShapeIndex*, const ToolHandle<IHIUEModulatorTool>&, const xAOD::HIEventShape* eshape) const override; + virtual void subtractWithMoments(xAOD::CaloCluster*, const xAOD::HIEventShapeContainer*, const HIEventShapeIndex* index, const ToolHandle<IHIUEModulatorTool>&, const xAOD::HIEventShape* eshape ) const override; + virtual void updateUsingCluster(xAOD::HIEventShapeContainer* shape, const HIEventShapeIndex* index, const xAOD::CaloCluster* cl) const override; virtual StatusCode initialize() override; - + virtual StatusCode initializeTool(); -private: + private: bool m_init; - StatusCode initializeTool(); + float getWeight(float eta, float phi, int sample) const; float getWeightEta(float eta, float phi, int sample) const; float getWeightPhi(float eta, float phi, int sample) const; + void updateSlice(xAOD::HIEventShape* slice, float ET, float phi0, float area_cluster) const; - std::string m_input_file; - std::string m_config_dir; - TH3F* m_h3_w; - TH3F* m_h3_eta; - TH3F* m_h3_phi; - -}; + Gaudi::Property< std::string > m_inputFile { this, "InputFile", "cluster.geo.root", "File containing cluster geometric moments." }; -#endif + Gaudi::Property< std::string > m_configDir { this, "ConfigDir", "HIEventUtils/", "Directory containing configuration file." }; + TH3F* m_h3W; + TH3F* m_h3Eta; + TH3F* m_h3Phi; + Gaudi::Property< bool > m_useSamplings { this, "UseSamplings", true, "Boolean for samplings use" }; + +}; + +#endif diff --git a/Reconstruction/HeavyIonRec/HIJetRec/HIJetRec/HIJetConstituentSubtractionTool.h b/Reconstruction/HeavyIonRec/HIJetRec/HIJetRec/HIJetConstituentSubtractionTool.h index 3869232dfc60b1511b6dfd1b30592277986951e7..2e75c923d691bf5ac9d3064a4a5da822f5dabc36 100644 --- a/Reconstruction/HeavyIonRec/HIJetRec/HIJetRec/HIJetConstituentSubtractionTool.h +++ b/Reconstruction/HeavyIonRec/HIJetRec/HIJetRec/HIJetConstituentSubtractionTool.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ // HIJetConstituentSubtractionTool.h @@ -28,10 +28,16 @@ #include <string> #include "JetRec/JetModifierBase.h" +#include "HIJetRec/HIJetRecDefs.h" #include "HIJetRec/IHISubtractorTool.h" #include "HIJetRec/IHIUEModulatorTool.h" #include "AsgTools/ToolHandle.h" +#include "StoreGate/ReadHandleKey.h" +#include "StoreGate/WriteHandleKey.h" + +#include "xAODHIEvent/HIEventShapeContainer.h" +#include "xAODTracking/VertexContainer.h" class HIJetConstituentSubtractionTool : public JetModifierBase { @@ -39,9 +45,11 @@ class HIJetConstituentSubtractionTool : public JetModifierBase ASG_TOOL_CLASS0(HIJetConstituentSubtractionTool); public: - + HIJetConstituentSubtractionTool(const std::string& t); - + + virtual StatusCode initialize() override; + /// \brief Implementing abstract methods from base StatusCode modify(xAOD::JetContainer& jets) const; @@ -50,34 +58,44 @@ public: private: + // Migration to data handles /// \brief Name of HIEventShapeContainer - std::string m_event_shape_key; - std::string m_modulation_key; - /// \brief Subtracted jet kinematics are stored + SG::ReadHandleKey< xAOD::HIEventShapeContainer > m_eventShapeKey { this, "EventShapeKey", "", "The input HI Event Shape"}; + + SG::ReadHandleKey< xAOD::VertexContainer > m_vertexContainer { this, "VertexContainer", "PrimaryVertices", "Vertex container for primary vertices"}; + + //That looks useless. commented out for the moment + //std::string m_modulation_key; + /// \brief Subtracted jet kinematics are stored /// using this string like a signal state/moment /// Jet::setJetP4 ( std::string, JetFourMom_t) - std::string m_moment_name; + /// not a key - but we bring it + Gaudi::Property< std::string > m_momentName { this, "MomentName", HIJetRec::subtractedJetState(), "Subtracted Jet Kineamtics are stored using this string like a signal/state moment" } ; - /// \brief if this flag is set, the primary jet + /// \brief if this flag is set, the primary jet /// kinematics are also set to reflect this subtraction /// eventually do this w/ a signal state - bool m_moment_only; + Gaudi::Property< bool > m_momentOnly { this, "SetMomentOnly", true, + "If this flag is set, the primary jet kinematics are also set to reflect this subtraction eventually do this w/ a signal state" } ; /// \brief handle to IHISubtractorTool that determines the /// subtracted kinematics for each constituent - ToolHandle<IHISubtractorTool> m_subtractor_tool; - ToolHandle<IHIUEModulatorTool> m_modulator_tool; + ToolHandle<IHISubtractorTool> m_subtractorTool { this, "Subtractor", "HIJetClusterSubtractorTool", "" }; + ToolHandle<IHIUEModulatorTool> m_modulatorTool { this, "Modulator" , "HIUEModulatorTool ", "" }; + + Gaudi::Property< bool > m_originCorrection { this, "ApplyOriginCorrection", false, "Apply Origin Correction boolean switch"}; protected: /// \brief Protected set/get functions provide access to private data /// members in derived classes - inline std::string EventShapeKey() const {return m_event_shape_key;}; - inline std::string ModulationKey() const {return m_modulation_key;}; - inline std::string MomentName() const {return m_moment_name;}; - inline bool MomentOnly() const {return m_moment_only;}; - - inline void SetEventShapeKey(std::string key) {m_event_shape_key=key;}; - inline void SetMomentName(std::string key) {m_moment_name=key;}; - inline void SetMomentOnly(bool x) {m_moment_only=x;}; + inline SG::ReadHandleKey< xAOD::HIEventShapeContainer > EventShapeKey() { return m_eventShapeKey; }; + //That looks useless. commented out for the moment + //inline std::string ModulationKey() const {return m_modulation_key;}; + inline std::string momentName() const { return m_momentName; }; + inline bool momentOnly() const { return m_momentOnly; }; + + inline void setEventShapeKey( SG::ReadHandleKey< xAOD::HIEventShapeContainer > key ) { m_eventShapeKey=key; }; + inline void setMomentName(std::string key) { m_momentName=key; }; + inline void setMomentOnly(bool x) { m_momentOnly=x; }; }; diff --git a/Reconstruction/HeavyIonRec/HIJetRec/HIJetRec/HIJetDRAssociationTool.h b/Reconstruction/HeavyIonRec/HIJetRec/HIJetRec/HIJetDRAssociationTool.h index 2d31015378c1e45e9bacff7d08132375cb19fdb5..aa8703181ea9bf60e0b6b0cac46d792b80c9bf75 100644 --- a/Reconstruction/HeavyIonRec/HIJetRec/HIJetRec/HIJetDRAssociationTool.h +++ b/Reconstruction/HeavyIonRec/HIJetRec/HIJetRec/HIJetDRAssociationTool.h @@ -26,6 +26,9 @@ #include <string> #include "JetRec/JetModifierBase.h" +#include "StoreGate/ReadHandleKey.h" +#include "StoreGate/WriteHandleKey.h" + class HIJetDRAssociationTool : public JetModifierBase { @@ -34,34 +37,32 @@ class HIJetDRAssociationTool : public JetModifierBase public: HIJetDRAssociationTool(const std::string& t); - + + virtual StatusCode initialize() override; + /// \brief Implementing abstract methods from base StatusCode modify(xAOD::JetContainer& jets) const; - /// \brief Implementing abstract methods from base, not used int modifyJet(xAOD::Jet&) const {return 1;}; private: /// \brief name of IParticleContainer w/ particles to associate - std::string m_container_key; + SG::ReadHandleKey< xAOD::IParticleContainer > m_containerKey { this, "ContainerKey", "", "Name of IParticleContainer w/ particles to associate"}; /// \brief Name of jet attribute providing link between jets and IParticles - std::string m_assoc_name; + Gaudi::Property< std::string > m_assocName { this, "AssociationName", "" , "Name of jet attribute providing link between jets and IParticles" }; /// \brief DR cut defining association - float m_DR; - + Gaudi::Property< float > m_DR { this, "DeltaR", 0.8, "DR cut defining association" }; /// \brief Flag to enable kinematic requirements on associated IParticle - bool m_apply_filter; - + Gaudi::Property< bool > m_applyFilter { this, "ApplyFilter",false, "Flag to enable kinematic requirements on associated IParticle" }; /// \brief Minimum E requirement for associated IParticle, in addition to DR - float m_E_min; - + Gaudi::Property< float > m_Emin { this, "FilterMinE", -999., "Minimum E requirement for associated IParticle, in addition to DR" }; /// \brief Minimum pT requirement for associated IParticle, in addition to DR - float m_pT_min; - + Gaudi::Property< float > m_pTmin { this, "FilterMinPt", 0., "Minimum pT requirement for associated IParticle, in addition to DR" }; + }; #endif diff --git a/Reconstruction/HeavyIonRec/HIJetRec/HIJetRec/HIJetDiscriminatorTool.h b/Reconstruction/HeavyIonRec/HIJetRec/HIJetRec/HIJetDiscriminatorTool.h index 936abe00673e05338d2737c5671a42814c38ab69..1dca2b45eed082709de01fae0b7a94fe5853e1bf 100644 --- a/Reconstruction/HeavyIonRec/HIJetRec/HIJetRec/HIJetDiscriminatorTool.h +++ b/Reconstruction/HeavyIonRec/HIJetRec/HIJetRec/HIJetDiscriminatorTool.h @@ -33,9 +33,9 @@ class HIJetDiscriminatorTool : public JetModifierBase ASG_TOOL_CLASS0(HIJetDiscriminatorTool) public: - + HIJetDiscriminatorTool(const std::string& t); - + /// \brief Implementing abstract methods from base StatusCode modify(xAOD::JetContainer& jets) const; @@ -45,11 +45,12 @@ public: protected: /// \brief minimum cut applied to MaxOverMean moment - float m_MaxOverMean_cut; + Gaudi::Property< float > m_MaxOverMeanCut { this, "MaxOverMeanCut", 4., "Minimum cut applied to MaxOverMean moment" }; /// \brief minimum cut applied to MaxConstituentET moment - float m_ET_min_cut; - + Gaudi::Property< float > m_ETminCut { this, "MinimumETMaxCut", 3000., "Minimum cut applied to MaxConstituentET moment" }; + + }; #endif diff --git a/Reconstruction/HeavyIonRec/HIJetRec/HIJetRec/HIJetSubtractorToolBase.h b/Reconstruction/HeavyIonRec/HIJetRec/HIJetRec/HIJetSubtractorToolBase.h index f10d56a7f3543032f8a202cbb009c35eb87c6a74..9ea4928124fd49dcf070b23a33375cf7ab48cf33 100644 --- a/Reconstruction/HeavyIonRec/HIJetRec/HIJetRec/HIJetSubtractorToolBase.h +++ b/Reconstruction/HeavyIonRec/HIJetRec/HIJetRec/HIJetSubtractorToolBase.h @@ -27,26 +27,39 @@ public: HIJetSubtractorToolBase(const std::string& myname); virtual ~HIJetSubtractorToolBase(){}; - inline float MinEnergyForMoments() const {return m_E_min_moment;}; - inline float MinEnergySigForMoments() const {return m_E_sig_moment;}; + inline float minEnergyForMoments() const {return m_EminMoment;}; + inline float minEnergySigForMoments() const {return m_EsigMoment;}; inline bool usesCells() const {return m_useCells;}; + + + inline const xAOD::HIEventShapeContainer* getShape() const {return m_shape;}; + inline const HIEventShapeIndex* getIndex() const {return m_index;}; + inline const IHIUEModulatorTool* getModulator() const {return m_modulator;}; + inline void setShape(const xAOD::HIEventShapeContainer* s) {m_shape=s;}; + inline void setIndex(const HIEventShapeIndex* ind) {m_index=ind;}; + inline void setModulator(const IHIUEModulatorTool* mod) {m_modulator=mod;}; + + virtual StatusCode configureEvent(const xAOD::HIEventShapeContainer* shape, const HIEventShapeIndex* index, const IHIUEModulatorTool* modulator); + private: - /// %% FIX needs some cleanup - float m_E_min_moment; - float m_E_sig_moment; - bool m_update_clusters; - bool m_useCells; + Gaudi::Property< float > m_EminMoment { this, "MinimumEnergyForMoments", 50., "> E, cluster given tower coordinates" }; + Gaudi::Property< float > m_EsigMoment { this, "MinimumSignificanceForMoments", 0.1, "if E after subtr / E total < this cut, cluster given tower coordinates" }; + Gaudi::Property< bool > m_updateClusters { this, "UpdateClusters", false, "If true set cluster kinematics to reflect subtraction" }; + Gaudi::Property< bool > m_useCells { this, "UseCells", true, "Boolean switch for cells usage" }; + + const xAOD::HIEventShapeContainer* m_shape; + const HIEventShapeIndex* m_index; + const IHIUEModulatorTool* m_modulator; protected: - inline void SetMinEnergyForMoment(float min_E) {m_E_min_moment=min_E;}; - inline void SetUpdateClusters(bool up) {m_update_clusters=up;}; + inline void setMinEnergyForMoment(float min_E) { m_EminMoment=min_E; }; + inline void setUpdateClusters(bool up) { m_updateClusters=up; }; - inline bool UpdateClusters() const {return m_update_clusters;}; + inline bool UpdateClusters() const { return m_updateClusters; }; void setSubtractedEtaPhi(float E, float& eta, float& phi, float eta0, float phi0, float sig) const; - inline void setUseCells(bool v) {m_useCells=v;}; diff --git a/Reconstruction/HeavyIonRec/HIJetRec/HIJetRec/HIUEModulatorTool.h b/Reconstruction/HeavyIonRec/HIJetRec/HIJetRec/HIUEModulatorTool.h index c1d2585b86ae380ea575870e337dc3d5295610cd..4de9c34e08efffc00a93b5c67e47bf3182c914bc 100644 --- a/Reconstruction/HeavyIonRec/HIJetRec/HIJetRec/HIUEModulatorTool.h +++ b/Reconstruction/HeavyIonRec/HIJetRec/HIJetRec/HIUEModulatorTool.h @@ -8,6 +8,11 @@ #include "HIJetRec/IHIUEModulatorTool.h" #include "AsgTools/AsgTool.h" +#include "xAODHIEvent/HIEventShapeContainer.h" + +#include "StoreGate/ReadHandleKey.h" +#include "StoreGate/WriteHandleKey.h" + class HIUEModulatorTool : public asg::AsgTool, virtual public IHIUEModulatorTool { ASG_TOOL_CLASS(HIUEModulatorTool,IHIUEModulatorTool) @@ -18,23 +23,31 @@ public: virtual float getModulation(float phi, const xAOD::HIEventShape* shape = nullptr) const override; virtual StatusCode setEventShapeForModulation(const xAOD::HIEventShape* shape) override; virtual void setHarmonics(const std::vector<unsigned int>& v) override; - virtual StatusCode retrieveShape() override; + virtual StatusCode retrieveShape() const override; virtual StatusCode initialize() override; virtual StatusCode getShape(const xAOD::HIEventShape* & shape) const override; static float modulate(const std::vector<unsigned int>& nh_vector, const xAOD::HIEventShape* shape, float phi); - + private: StatusCode checkQVectorSize(const xAOD::HIEventShape* shape, unsigned int n) const; StatusCode checkCompatibility() const; - std::string m_shape_key; + + //Attempt to move to data handlers + //std::string m_shape_key; + //key attribute set to NULL to have consistency with previously set m_shape_key + SG::ReadHandleKey< xAOD::HIEventShapeContainer > m_shape_key { this, "EventShapeKey", "NULL", "The input HI Event Shape"}; + const xAOD::HIEventShape* m_shape; std::vector<unsigned int> m_nh_vector; - bool m_do_v2; - bool m_do_v3; - bool m_do_v4; + //bool m_do_v2; + Gaudi::Property< bool > m_do_v2 { this, "DoV2", true, "Do V2 modulation" }; + //bool m_do_v3; + Gaudi::Property< bool > m_do_v3 { this, "DoV3", true, "Do V3 modulation" }; + //bool m_do_v4; + Gaudi::Property< bool > m_do_v4 { this, "DoV4", true, "Do V4 modulation" }; }; #endif diff --git a/Reconstruction/HeavyIonRec/HIJetRec/HIJetRec/IHISubtractorTool.h b/Reconstruction/HeavyIonRec/HIJetRec/HIJetRec/IHISubtractorTool.h index 1cf1c9c3ec73e93aa2150b6c530201e8320f2426..ac01557cb356d8798b74f9847f1ef7eeb106e32c 100644 --- a/Reconstruction/HeavyIonRec/HIJetRec/HIJetRec/IHISubtractorTool.h +++ b/Reconstruction/HeavyIonRec/HIJetRec/HIJetRec/IHISubtractorTool.h @@ -8,10 +8,11 @@ #define HIJETREC_IHISUBTRACTORTOOL_H #include "AsgTools/IAsgTool.h" +#include "AsgTools/ToolHandle.h" #include "xAODBase/IParticle.h" #include "xAODHIEvent/HIEventShapeContainer.h" #include "xAODCaloEvent/CaloCluster.h" -#include "AsgTools/ToolHandle.h" + //////////////////////////////////////////////////////////////////////////////// /// @@ -36,17 +37,26 @@ class IHISubtractorTool : virtual public asg::IAsgTool { /// \brief Abstract method where particle itself is not modified /// IParticle::FourMom_t containing kinematics after subtraction is passed by reference - virtual void Subtract(xAOD::IParticle::FourMom_t&, const xAOD::IParticle*, const xAOD::HIEventShapeContainer*, const HIEventShapeIndex*, const ToolHandle<IHIUEModulatorTool>&, const xAOD::HIEventShape* shape ) const = 0; - virtual void SubtractWithMoments(xAOD::CaloCluster*, const xAOD::HIEventShapeContainer*, const HIEventShapeIndex* index, const ToolHandle<IHIUEModulatorTool>&, const xAOD::HIEventShape* shape ) const = 0; + + virtual void subtract(xAOD::IParticle::FourMom_t&, const xAOD::IParticle*, const xAOD::HIEventShapeContainer*, const HIEventShapeIndex*, const ToolHandle<IHIUEModulatorTool>&, const xAOD::HIEventShape* shape ) const = 0; + virtual void subtractWithMoments(xAOD::CaloCluster*, const xAOD::HIEventShapeContainer*, const HIEventShapeIndex* index, const ToolHandle<IHIUEModulatorTool>&, const xAOD::HIEventShape* shape ) const = 0; + /// \brief Method to update the shape based on a given cluster /// two sets of indices are passed by reference and updated by the method /// sets are queried to see if the cluster has already been used, e.g. by another jet seed /// checking/updating sets prevents double counting /// eta-bin set used to determine eta-averaged flow - virtual void UpdateUsingCluster(xAOD::HIEventShapeContainer* shape, const HIEventShapeIndex* index, const xAOD::CaloCluster* cl) const = 0; - virtual float MinEnergyForMoments() const = 0; - + virtual void updateUsingCluster(xAOD::HIEventShapeContainer* shape, const HIEventShapeIndex* index, const xAOD::CaloCluster* cl) const = 0; + virtual float minEnergyForMoments() const = 0; virtual bool usesCells() const = 0; + + virtual const xAOD::HIEventShapeContainer* getShape() const = 0; + virtual const HIEventShapeIndex* getIndex() const = 0; + virtual const IHIUEModulatorTool* getModulator() const = 0; + virtual void setShape(const xAOD::HIEventShapeContainer*) = 0; + virtual void setIndex(const HIEventShapeIndex*) = 0; + virtual void setModulator(const IHIUEModulatorTool*) = 0; + }; #endif diff --git a/Reconstruction/HeavyIonRec/HIJetRec/HIJetRec/IHIUEModulatorTool.h b/Reconstruction/HeavyIonRec/HIJetRec/HIJetRec/IHIUEModulatorTool.h index 5498a36ccd03db25f56e0efe88dab75bbb9d3a13..1b73a1c467bdaefe2fbc12d1a382477ada09a032 100644 --- a/Reconstruction/HeavyIonRec/HIJetRec/HIJetRec/IHIUEModulatorTool.h +++ b/Reconstruction/HeavyIonRec/HIJetRec/HIJetRec/IHIUEModulatorTool.h @@ -17,7 +17,7 @@ /// \author Aaron Angerami <angerami@cern.ch> /// \date Aug, 2015 /// -/// \brief Abstract interface for tools that can provide UE modulation given +/// \brief Abstract interface for tools that can provide UE modulation given /// an HIEventShape /// //////////////////////////////////////////////////////////////////////////////// @@ -35,10 +35,10 @@ class IHIUEModulatorTool : virtual public asg::IAsgTool { virtual void setHarmonics(const std::vector<unsigned int>&) = 0; - virtual StatusCode retrieveShape() = 0; + virtual StatusCode retrieveShape() const = 0; virtual StatusCode getShape(const xAOD::HIEventShape* & shape) const = 0; - - + + }; #endif diff --git a/Reconstruction/HeavyIonRec/HIJetRec/Root/HIClusterPseudoJetGetter.cxx b/Reconstruction/HeavyIonRec/HIJetRec/Root/HIClusterPseudoJetGetter.cxx index 120b579b7a322663b28cfc9f987803c532964ca4..d832aabcfb524aef6ee985d1a7fcfa35caaf6a25 100644 --- a/Reconstruction/HeavyIonRec/HIJetRec/Root/HIClusterPseudoJetGetter.cxx +++ b/Reconstruction/HeavyIonRec/HIJetRec/Root/HIClusterPseudoJetGetter.cxx @@ -1,27 +1,27 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ #include "HIJetRec/HIClusterPseudoJetGetter.h" HIClusterPseudoJetGetter::HIClusterPseudoJetGetter(const std::string &name) : PseudoJetGetter(name) { - + } /* -int HIClusterPseudoJetGetter::appendTo(PseudoJetVector& psjs, const LabelIndex* pli) const -{ +int HIClusterPseudoJetGetter::appendTo(PseudoJetVector& psjs, const LabelIndex* pli) const +{ bool doGhosts=bool(m_ghostscale)&!m_negEnergyAsGhosts; ATH_MSG_DEBUG("Entering appendTo(PseudoJetVector)..."); - if ( evtStore()->contains<xAOD::IParticleContainer>(m_incoll) ) + if ( evtStore()->contains<xAOD::IParticleContainer>(m_incoll) ) { ATH_MSG_DEBUG("Retrieving xAOD container " << m_incoll << ", ghost scale=" << m_ghostscale << ", isGhost=" << doGhosts); const xAOD::IParticleContainer* ppars = 0; ppars = evtStore()->retrieve<const xAOD::IParticleContainer>(m_incoll); - if ( ppars != 0 ) + if ( ppars != 0 ) { //for now direct copy/paste of PseudoJetGetter::append method with local mods //explicitly using IParticle instead of templated version @@ -32,12 +32,12 @@ int HIClusterPseudoJetGetter::appendTo(PseudoJetVector& psjs, const LabelIndex* else ATH_MSG_WARNING("Index-to-label map is not supplied."); if ( doGhosts ) labidx = -labidx; ATH_MSG_DEBUG( "Ghost scale = " << m_ghostscale << "; idx = " << labidx ); - + /// Loop over input, buid CUI and PseudoJets - for ( auto iinp=inputs.begin(); iinp!=inputs.end(); ++iinp ) + for ( auto iinp=inputs.begin(); iinp!=inputs.end(); ++iinp ) { auto ppar = *iinp; // IParticle pointer - if ( ppar == 0 || (m_skipNegativeEnergy && ppar->e() <= 0.0) ) + if ( ppar == 0 || (m_skipNegativeEnergy && ppar->e() <= 0.0) ) { if ( ppar == 0 ) ATH_MSG_DEBUG("NUll object!"); else ATH_MSG_VERBOSE("Skipping cluster with E = " << ppar->e()); @@ -47,7 +47,7 @@ int HIClusterPseudoJetGetter::appendTo(PseudoJetVector& psjs, const LabelIndex* // Take momentum from IParticle. fastjet::PseudoJet psj(ppar->p4()); // Form EM scale, use uncalibrated four-vector. - if ( m_emtopo ) + if ( m_emtopo ) { const xAOD::CaloCluster* pclu = dynamic_cast<const xAOD::CaloCluster*>(ppar); if ( pclu == 0 ) { @@ -76,14 +76,14 @@ int HIClusterPseudoJetGetter::appendTo(PseudoJetVector& psjs, const LabelIndex* << ", m: " << ppar->m() << "/" << ppar->p4().M() << "/" << psj.m() << ", eta: " << ppar->eta() << "/" << ppar->p4().Eta() << "/" << psj.eta() ); - if ( pli != 0 ) + if ( pli != 0 ) { jet::IConstituentUserInfo* pcui = this->buildCUI(ppar, labidx, pli); psj.set_user_info(pcui); if ( show ) ATH_MSG_VERBOSE("User info particle: " << pcui->particle()); } psjs.push_back(psj); - } // end loop over input + } // end loop over input if ( nskip ) ATH_MSG_DEBUG("Skipped constituent count: " << nskip); ATH_MSG_DEBUG("After append, PseudoJet count is " << psjs.size()); return 0; diff --git a/Reconstruction/HeavyIonRec/HIJetRec/Root/HIEventShapeJetIteration.cxx b/Reconstruction/HeavyIonRec/HIJetRec/Root/HIEventShapeJetIteration.cxx index b03baf151e9bf4bb4a0dbc60b3474408dd8fc686..1dcb08a83f76920d6c3096c37d54dd19d9696442 100644 --- a/Reconstruction/HeavyIonRec/HIJetRec/Root/HIEventShapeJetIteration.cxx +++ b/Reconstruction/HeavyIonRec/HIJetRec/Root/HIEventShapeJetIteration.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ #include "HIJetRec/HIEventShapeJetIteration.h" @@ -10,6 +10,8 @@ #include "HIEventUtils/HIEventShapeSummaryUtils.h" #include "xAODCore/ShallowCopy.h" +#include "StoreGate/ReadHandle.h" +#include "StoreGate/WriteHandle.h" namespace { @@ -27,41 +29,57 @@ namespace } //annonymous namespace -HIEventShapeJetIteration::HIEventShapeJetIteration(std::string name) : AsgTool(name), - m_isInit(false) +HIEventShapeJetIteration::HIEventShapeJetIteration(std::string name) : AsgTool(name) { - declareProperty("InputEventShapeKey",m_input_event_shape_key="HIEventShape"); - declareProperty("OutputEventShapeKey",m_output_event_shape_key="HIEventShape_iter"); - declareProperty("CaloJetSeedContainerKey",m_calo_jet_seed_key,"Names of seed collections"); - declareProperty("TrackJetSeedContainerKey",m_track_jet_seed_key,"Names of seed collections"); - declareProperty("ExclusionRadius",m_exclude_DR=0.4,"Exclude all calo regions w/in this DR to jet"); - declareProperty("ExcludeConstituents",m_exclude_constituents=false,"Only exclude constituents of jets"); - declareProperty("AssociationKey",m_association_key,"Name of jet attribute containing jet-cluster association"); - declareProperty("Subtractor",m_subtractor_tool); - declareProperty("Modulator",m_modulator_tool); - declareProperty("RemodulateUE",m_do_remodulation=false,"Correct UE for incomplete cancellation of flow harmonics when iterating"); - declareProperty("ModulationScheme",m_modulation_scheme=0,"Scheme to build separate ES object for flow modulation"); - declareProperty("ModulationEventShapeKey",m_modulation_key="HIEventShape_itr_mod"); +} + +StatusCode HIEventShapeJetIteration::initialize() +{ + ATH_MSG_VERBOSE("HIEventShapeJetIteration initialize"); + ATH_CHECK( m_inputEventShapeKey.initialize( !m_inputEventShapeKey.key().empty()) ); + ATH_CHECK( m_outputEventShapeKey.initialize( !m_outputEventShapeKey.key().empty()) ); + ATH_CHECK( m_caloJetSeedKey.initialize( SG::AllowEmpty ) ); + ATH_CHECK( m_trackJetSeedKey.initialize( SG::AllowEmpty ) ); + ATH_CHECK( m_modulationKey.initialize( m_modulationScheme )); + return StatusCode::SUCCESS; } int HIEventShapeJetIteration::execute() const { /// + ATH_MSG_INFO( "Starting HIEventShapeJetIteration execution" ); const xAOD::HIEventShapeContainer* input_shape=nullptr; xAOD::HIEventShapeContainer* output_shape=nullptr; getShapes(input_shape,output_shape,true).ignore(); + const HIEventShapeIndex* es_index = HIEventShapeMap::getIndex(m_inputEventShapeKey.key()); + //New implementation after moving away from mutable + if(es_index==nullptr) + { + ATH_MSG_INFO("No HIEventShapeIndex w/ name " << m_inputEventShapeKey.key() << " adding it to the map"); + HIEventShapeIndex* h = new HIEventShapeIndex(); + h->setBinning(input_shape); + es_index = HIEventShapeMap::insert( m_inputEventShapeKey.key(), *h ); + } + + const HIEventShapeIndex* other_index = HIEventShapeMap::getIndex(m_outputEventShapeKey.key()); + if(!other_index) HIEventShapeMap::insert( m_inputEventShapeKey.key(), *es_index ); + //End of new implementation - const HIEventShapeIndex* es_index=HIEventShapeMap::getIndex(m_input_event_shape_key); - const xAOD::JetContainer* theCaloJets=0; const xAOD::JetContainer* theTrackJets=0; - if(m_calo_jet_seed_key.compare("")!=0) ATH_CHECK(evtStore()->retrieve(theCaloJets,m_calo_jet_seed_key), 1); - if(m_track_jet_seed_key.compare("")!=0) ATH_CHECK(evtStore()->retrieve(theTrackJets,m_track_jet_seed_key), 1); + if(!m_caloJetSeedKey.empty()){ + SG::ReadHandle<xAOD::JetContainer> readHandleCaloJets ( m_caloJetSeedKey ); + theCaloJets = readHandleCaloJets.cptr(); + } + if(!m_trackJetSeedKey.empty()){ + SG::ReadHandle<xAOD::JetContainer> readHandleTrackJets ( m_trackJetSeedKey ); + theTrackJets = readHandleTrackJets.cptr(); + } - if(theTrackJets && m_exclude_constituents) + if(theTrackJets && m_excludeConstituents) { ATH_MSG_ERROR("Incompatible options. Cannot track jets and constituents together."); return 1; @@ -74,23 +92,31 @@ int HIEventShapeJetIteration::execute() const assoc_clusters.reserve(6400); if(theCaloJets) ATH_CHECK(makeClusterList(assoc_clusters,theCaloJets,used_indices,used_eta_bins), 1); if(theTrackJets) ATH_CHECK(makeClusterList(assoc_clusters,theTrackJets,used_indices,used_eta_bins), 1); - updateShape(output_shape,assoc_clusters,es_index); - + + ATH_MSG_INFO( "Checking Modulation Scheme" ); + //compute ES for modulation - if(m_modulation_scheme) + if(m_modulationScheme) { - xAOD::HIEventShapeContainer* modShape=new xAOD::HIEventShapeContainer; - xAOD::HIEventShapeAuxContainer *modShapeAux = new xAOD::HIEventShapeAuxContainer; - modShape->setStore( modShapeAux ); - ATH_CHECK( evtStore()->record(modShape,m_modulation_key), 1 ); - ATH_CHECK( evtStore()->record(modShapeAux,m_modulation_key+std::string("Aux.")), 1 ); - + SG::WriteHandle<xAOD::HIEventShapeContainer> write_handle_modShape ( m_modulationKey ); + ATH_MSG_DEBUG( "Key HIEventShapeJetIteration: " << m_modulationKey.key() ); + + auto modShape = std::make_unique<xAOD::HIEventShapeContainer> (); + auto modShapeAux = std::make_unique<xAOD::HIEventShapeAuxContainer> (); + modShape->setStore( modShapeAux.get() ); + xAOD::HIEventShape* ms=new xAOD::HIEventShape(); modShape->push_back(ms); - ATH_CHECK( fillModulatorShape(ms,output_shape,used_indices,m_modulation_scheme), 1 ); - if(m_do_remodulation) ATH_CHECK( remodulate(output_shape,ms,used_indices), 1 ); + ATH_CHECK( fillModulatorShape(ms, output_shape, used_eta_bins, m_modulationScheme), 1 ); + if(m_doRemodulation) ATH_CHECK( remodulate(output_shape, ms, used_indices), 1 ); + + if(write_handle_modShape.record ( std::move(modShape), std::move(modShapeAux)).isFailure() ){ + ATH_MSG_ERROR("Unable to write newHIEventShapeContainer for modulated shape with key: " << m_modulationKey.key()); + return 0; + } } + return 0; } @@ -103,15 +129,15 @@ StatusCode HIEventShapeJetIteration::makeClusterList(std::vector<const xAOD::Cal xAOD::IParticle::FourMom_t jet4mom=theJet->p4(); std::vector<const xAOD::IParticle*> assoc_clusters; //only use jet constituents - if(m_exclude_constituents) assoc_clusters=theJet->getConstituents().asIParticleVector(); + if(m_excludeConstituents) assoc_clusters=theJet->getConstituents().asIParticleVector(); else { - if(! (theJet->getAssociatedObjects<xAOD::IParticle>(m_association_key,assoc_clusters)) ) + if(! (theJet->getAssociatedObjects<xAOD::IParticle>(m_associationKey, assoc_clusters)) ) { - //this should only happen if SOME of the jets in the collection are missing the association - //technically possible, but should NOT happen - ATH_MSG_ERROR("Individual jet missing association " << m_association_key); - return StatusCode::FAILURE; + //this should only happen if SOME of the jets in the collection are missing the association + //technically possible, but should NOT happen + ATH_MSG_ERROR("Individual jet missing association " << m_associationKey); + return StatusCode::FAILURE; } } ATH_MSG_DEBUG( "Jet " << std::setw(10) << jet4mom.Pt()*1e-3 @@ -119,17 +145,17 @@ StatusCode HIEventShapeJetIteration::makeClusterList(std::vector<const xAOD::Cal << std::setw(10) << jet4mom.Phi() << std::setw(10) << jet4mom.E()*1e-3 << std::setw(25) << " has " << assoc_clusters.size() << " assoc. clusters"); - + for(auto pItr = assoc_clusters.begin(); pItr!=assoc_clusters.end(); pItr++) { - if( jet4mom.DeltaR( (*pItr)->p4() ) > m_exclude_DR ) continue; + if( jet4mom.DeltaR( (*pItr)->p4() ) > m_excludeDR ) continue; const xAOD::CaloCluster* cl_ptr=static_cast<const xAOD::CaloCluster*>(*pItr); unsigned int tower_index=HI::TowerBins::findEtaPhiBin(cl_ptr->eta0(),cl_ptr->phi0()); - + if(used_indices.insert(tower_index).second) { - particleList.push_back(cl_ptr); - used_eta_bins.insert(HI::TowerBins::findBinEta(cl_ptr->eta0())); + particleList.push_back(cl_ptr); + used_eta_bins.insert(HI::TowerBins::findBinEta(cl_ptr->eta0())); } } } @@ -147,7 +173,7 @@ StatusCode HIEventShapeJetIteration::makeClusterList(std::vector<const xAOD::Cal { std::set<unsigned int> used_indices; std::set<unsigned int> used_eta_bins; - for(auto theJets : theJets_vector) + for(auto theJets : theJets_vector) { ATH_CHECK(makeClusterList(particleList,theJets,used_indices,used_eta_bins)); } @@ -158,20 +184,23 @@ void HIEventShapeJetIteration::updateShape(xAOD::HIEventShapeContainer* output_s { if(es_index==nullptr) { - es_index=HIEventShapeMap::getIndex(m_input_event_shape_key); + ATH_MSG_INFO("Problem, null pointer"); + + es_index=HIEventShapeMap::getIndex(m_inputEventShapeKey.key()); if(es_index==nullptr) { - ATH_MSG_INFO("No HIEventShapeIndex w/ name " << m_input_event_shape_key << " adding it to the map"); HIEventShapeIndex* h=new HIEventShapeIndex(); h->setBinning(output_shape); - es_index=HIEventShapeMap::insert(m_input_event_shape_key,*h); - + es_index=HIEventShapeMap::insert(m_inputEventShapeKey.key(),*h); } } - for(auto pItr = assoc_clusters.begin(); pItr!=assoc_clusters.end(); pItr++) - m_subtractor_tool->UpdateUsingCluster(output_shape,es_index,(*pItr)); - if(!m_subtractor_tool->usesCells()) + for(auto pItr = assoc_clusters.begin(); pItr!=assoc_clusters.end(); pItr++) + { + m_subtractorTool->updateUsingCluster(output_shape,es_index,(*pItr)); + } + + if(!m_subtractorTool->usesCells()) { for(auto s : *output_shape) { @@ -195,14 +224,21 @@ StatusCode HIEventShapeJetIteration::fillModulatorShape(xAOD::HIEventShape* ms, if(scheme > 1) { const xAOD::HIEventShapeContainer* summary_container=0; - ATH_CHECK(evtStore()->retrieve(summary_container,"CaloSums")); + + SG::ReadHandle<xAOD::HIEventShapeContainer> read_handle_cont ( "CaloSums" ); + if (!read_handle_cont.isValid()) { + ATH_MSG_FATAL( "Could not find HI event shape! CaloSums" ); + return(StatusCode::FAILURE); + } + summary_container = read_handle_cont.cptr(); + const xAOD::HIEventShape* s_fcal=0; for(unsigned int i=0; i<summary_container->size(); i++) { const xAOD::HIEventShape* sh=(*summary_container)[i]; std::string summary; if(sh->isAvailable<std::string>("Summary")) summary=sh->auxdata<std::string>("Summary"); - if(summary.compare("FCal")==0) + if(summary.compare("FCal")==0) { s_fcal=sh; break; @@ -219,10 +255,10 @@ StatusCode HIEventShapeJetIteration::fillModulatorShape(xAOD::HIEventShape* ms, { float qx=ms->etCos().at(ih); float qy=ms->etSin().at(ih); - + float qx_fcal=s_fcal->etCos().at(ih); float qy_fcal=s_fcal->etSin().at(ih); - + ms->etCos()[ih]=(qx*qx_fcal+qy*qy_fcal)*et_fcal_recip; ms->etSin()[ih]=(qy*qx_fcal-qx*qy_fcal)*et_fcal_recip; } //end loop on harmonics @@ -236,13 +272,13 @@ StatusCode HIEventShapeJetIteration::remodulate(xAOD::HIEventShapeContainer* out { std::vector<float> mod_factors(HI::TowerBins::numEtaBins(),0); std::vector<float> mod_counts(HI::TowerBins::numEtaBins(),0); - + for(std::set<unsigned int>::const_iterator sItr=used_indices.begin(); sItr!=used_indices.end(); sItr++) { - unsigned int phi_bin=(*sItr) % HI::TowerBins::numEtaBins(); + unsigned int phi_bin=(*sItr) % HI::TowerBins::numPhiBins(); unsigned int eta_bin=(*sItr) / HI::TowerBins::numPhiBins(); mod_counts[eta_bin]++; - mod_factors[eta_bin]+=m_modulator_tool->getModulation(HI::TowerBins::getBinCenterPhi(phi_bin), ms); + mod_factors[eta_bin]+=(m_modulatorTool->getModulation(HI::TowerBins::getBinCenterPhi(phi_bin),ms)-1.); } double nphibins=HI::TowerBins::numPhiBins(); //now loop on shape and correct; @@ -251,47 +287,65 @@ StatusCode HIEventShapeJetIteration::remodulate(xAOD::HIEventShapeContainer* out xAOD::HIEventShape* s=output_shape->at(i); float eta0=0.5*(s->etaMin()+s->etaMax()); unsigned int eb=HI::TowerBins::findBinEta(eta0); - double cf=(nphibins-mod_counts[eb])/(nphibins-mod_factors[eb]); + double neff=nphibins-mod_counts[eb]; + double cf=neff/(neff-mod_factors[eb]); //check on value of cf; - if(cf < 0) cf =1; + if(cf < 0.) cf =1; if(cf > 2.) cf=2; - + s->setEt(s->et()*cf); s->setRho(s->rho()*cf); } + return StatusCode::SUCCESS; } StatusCode HIEventShapeJetIteration::getShapes(const xAOD::HIEventShapeContainer*& input_shape, xAOD::HIEventShapeContainer*& output_shape, bool record) const { - ATH_CHECK(evtStore()->retrieve(input_shape,m_input_event_shape_key)); - auto shape_copy=xAOD::shallowCopyContainer(*input_shape); - output_shape=shape_copy.first; + SG::ReadHandle<xAOD::HIEventShapeContainer> readHandleEvtShape ( m_inputEventShapeKey ); + SG::WriteHandle<xAOD::HIEventShapeContainer> writeHandleEvtShape ( m_outputEventShapeKey ); - if(record) - { - ATH_CHECK(evtStore()->record(output_shape,m_output_event_shape_key)); - ATH_CHECK(evtStore()->record(shape_copy.second,m_output_event_shape_key + "Aux.")); - } + input_shape = readHandleEvtShape.ptr(); - const HIEventShapeIndex* es_index=HIEventShapeMap::getIndex(m_input_event_shape_key); - if(es_index==nullptr) + if(m_shallowCopy) { - if(m_isInit) + auto shape_copy=xAOD::shallowCopyContainer(*input_shape); + auto unique_first_copy = xAOD::prepareElementForShallowCopy(shape_copy.first); + auto unique_second_copy = xAOD::prepareElementForShallowCopy(shape_copy.second); + output_shape=shape_copy.first; + if(record) { - ATH_MSG_ERROR("No HIEventShapeIndex w/ name " << m_input_event_shape_key); - return StatusCode::FAILURE; + ATH_MSG_DEBUG( "Write Handle current key is : " << m_outputEventShapeKey.key() ); + if(writeHandleEvtShape.record ( std::move(unique_first_copy), std::move(unique_second_copy)).isFailure() ){ + ATH_MSG_ERROR("Unable to write Shallow Copy containers for event shape with key: " << m_outputEventShapeKey.key()); + return(StatusCode::FAILURE); + } } - ATH_MSG_INFO("No HIEventShapeIndex w/ name " << m_input_event_shape_key << " adding it to the map"); - HIEventShapeIndex* h=new HIEventShapeIndex(); - h->setBinning(input_shape); - es_index=HIEventShapeMap::insert(m_input_event_shape_key,*h); - m_isInit=true; + } - if(!m_isInit) + else { - HIEventShapeMap::getMap()->insert(m_output_event_shape_key,*es_index); - m_isInit=true; + auto output_shapex=std::make_unique<xAOD::HIEventShapeContainer> (); + auto output_Aux=std::make_unique<xAOD::HIEventShapeAuxContainer> (); + output_shapex->setStore( output_Aux.get() ); + output_shapex->reserve( input_shape->size() ); + + for(auto s=input_shape->begin(); s!=input_shape->end(); s++) + { + xAOD::HIEventShape* s_copy=new xAOD::HIEventShape(); + output_shapex->push_back(s_copy); + *s_copy=**s; + } + if(record) + { + if(writeHandleEvtShape.record ( std::move(output_shapex), std::move(output_Aux)).isFailure() ){ + ATH_MSG_ERROR("Unable to write Output Shape containers for event shape with key: " << m_outputEventShapeKey.key()); + return(StatusCode::FAILURE); + } + output_shape = writeHandleEvtShape.ptr(); + } + } + return StatusCode::SUCCESS; } diff --git a/Reconstruction/HeavyIonRec/HIJetRec/Root/HIJetClusterIndexAssociationTool.cxx b/Reconstruction/HeavyIonRec/HIJetRec/Root/HIJetClusterIndexAssociationTool.cxx index d9f0c4923cd1f3e8a4b5249884060fae99796fa9..bc57d1213fdcc339d0437e9e7aca878229131599 100644 --- a/Reconstruction/HeavyIonRec/HIJetRec/Root/HIJetClusterIndexAssociationTool.cxx +++ b/Reconstruction/HeavyIonRec/HIJetRec/Root/HIJetClusterIndexAssociationTool.cxx @@ -11,38 +11,25 @@ HIJetClusterIndexAssociationTool::HIJetClusterIndexAssociationTool(const std::string& n) : JetModifierBase(n) { - declareProperty("ContainerKey",m_container_key); - declareProperty("AssociationName",m_assoc_name); - declareProperty("DeltaR", m_DR = 0.8); - declareProperty("ApplyFilter", m_apply_filter=false); - declareProperty("FilterMinE", m_E_min = -999); - declareProperty("FilterMinPt", m_pT_min = 0); - - } //********************************************************************** +StatusCode HIJetClusterIndexAssociationTool::initialize(){ + ATH_MSG_DEBUG("Initializing HIJetClusterIndexAssociationTool"); + ATH_CHECK( m_containerKey.initialize( !m_containerKey.key().empty() ) ); + return StatusCode::SUCCESS; +} +//********************************************************************** StatusCode HIJetClusterIndexAssociationTool::modify(xAOD::JetContainer& jets) const { - const xAOD::IParticleContainer* ppars=0; - if ( evtStore()->contains<xAOD::IParticleContainer>(m_container_key) ) - { - ATH_MSG_DEBUG("Retrieving xAOD container " << m_container_key ); - ppars = evtStore()->retrieve<const xAOD::IParticleContainer>(m_container_key); - if (!ppars) - { - ATH_MSG_ERROR("Failed to retrieve xAOD container " << m_container_key ); - return StatusCode::FAILURE; - } - } - else - { - ATH_MSG_ERROR("Failed to retrieve xAOD container " << m_container_key ); - return StatusCode::FAILURE; - } + const xAOD::IParticleContainer* ppars=0; + + ATH_MSG_DEBUG("Retrieving xAOD container " << m_containerKey.key() ); + SG::ReadHandle<xAOD::IParticleContainer> readHandlePcontainer ( m_containerKey ); + ppars = readHandlePcontainer.get(); for (xAOD::JetContainer::iterator ijet=jets.begin(); ijet!=jets.end(); ijet++) { @@ -51,16 +38,16 @@ StatusCode HIJetClusterIndexAssociationTool::modify(xAOD::JetContainer& jets) co float eta=HI::TowerBins::getBinCenterEta(HI::TowerBins::findBinEta(theJet->eta())); float phi=HI::TowerBins::getBinCenterPhi(HI::TowerBins::findBinPhi(theJet->phi())); - + int etabinmin=HI::TowerBins::findBinEta(eta-m_DR); int etabinmax=HI::TowerBins::findBinEta(eta+m_DR); - + if(etabinmin < 0) etabinmin=0; if(static_cast<unsigned int>(etabinmax) > HI::TowerBins::numEtaBins()) etabinmax=HI::TowerBins::numEtaBins(); - + for(int ieta=etabinmin; ieta<=etabinmax; ieta++) { - + float ev=HI::TowerBins::getBinCenterEta(ieta); float delta_ev2=(ev-eta)*(ev-eta); float phimin=phi-std::sqrt( m_DR*m_DR-delta_ev2+1e-4 ); @@ -68,7 +55,7 @@ StatusCode HIJetClusterIndexAssociationTool::modify(xAOD::JetContainer& jets) co float pbc=HI::TowerBins::getBinCenterPhi(iphi); float dphi=TVector2::Phi_mpi_pi(phi-pbc); float rv2=dphi*dphi+delta_ev2; - + if(rv2 > m_DR*m_DR) { iphi++; @@ -90,7 +77,7 @@ StatusCode HIJetClusterIndexAssociationTool::modify(xAOD::JetContainer& jets) co } } - theJet->setAssociatedObjects(m_assoc_name,ParticleVector); + theJet->setAssociatedObjects(m_assocName,ParticleVector); } // return 1; @@ -105,8 +92,8 @@ StatusCode HIJetClusterIndexAssociationTool::modify(xAOD::JetContainer& jets) co // << std::setw(15) << theJet->phi() // << std::setw(15) << theJet->pt() // << endmsg; - - // std::vector<const xAOD::IParticle*> theParticles=theJet->getAssociatedObjects<xAOD::IParticle>(m_assoc_name); + + // std::vector<const xAOD::IParticle*> theParticles=theJet->getAssociatedObjects<xAOD::IParticle>(m_assocName); // unsigned int ip=0; // for(auto pItr=theParticles.begin(); pItr!=theParticles.end(); pItr++, ip++) // { @@ -120,4 +107,3 @@ StatusCode HIJetClusterIndexAssociationTool::modify(xAOD::JetContainer& jets) co // } return StatusCode::SUCCESS; } - diff --git a/Reconstruction/HeavyIonRec/HIJetRec/Root/HIJetClusterSubtractorTool.cxx b/Reconstruction/HeavyIonRec/HIJetRec/Root/HIJetClusterSubtractorTool.cxx index 928b7891d5e426021ee4125bacadb9f5e1cb26a3..d5326b86ecc38856fd0949ef39cec83c74c5ac3a 100644 --- a/Reconstruction/HeavyIonRec/HIJetRec/Root/HIJetClusterSubtractorTool.cxx +++ b/Reconstruction/HeavyIonRec/HIJetRec/Root/HIJetClusterSubtractorTool.cxx @@ -1,9 +1,10 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ #include "HIJetRec/HIJetClusterSubtractorTool.h" #include "xAODCaloEvent/CaloCluster.h" +#include "xAODEventInfo/EventInfo.h" #include "HIEventUtils/HIEventShapeIndex.h" #include "HIJetRec/HIJetRecDefs.h" #include "HIJetRec/IHIUEModulatorTool.h" @@ -14,17 +15,18 @@ HIJetClusterSubtractorTool::HIJetClusterSubtractorTool(const std::string& myname) : HIJetSubtractorToolBase(myname), m_init(false), - m_h3_w(nullptr), - m_h3_eta(nullptr), - m_h3_phi(nullptr) + m_h3W(nullptr), + m_h3Eta(nullptr), + m_h3Phi(nullptr), + m_useSamplings(true) { - declareProperty("InputFile",m_input_file="cluster.geo.root","File containing cluster geometric moments."); - declareProperty("ConfigDir",m_config_dir="HIJetRec/","Directory containing configuration file."); + declareProperty("UseSamplings",m_useSamplings=true); setUseCells(false); } -void HIJetClusterSubtractorTool::Subtract(xAOD::IParticle::FourMom_t& subtr_mom, const xAOD::IParticle* cl_in, const xAOD::HIEventShapeContainer* shape, const HIEventShapeIndex* index, const ToolHandle<IHIUEModulatorTool>& modulator, const xAOD::HIEventShape* eshape) const -{ +void HIJetClusterSubtractorTool::subtract(xAOD::IParticle::FourMom_t& subtr_mom, const xAOD::IParticle* cl_in, const xAOD::HIEventShapeContainer* shape, const HIEventShapeIndex* index, const ToolHandle<IHIUEModulatorTool>& modulator, const xAOD::HIEventShape* eshape) const +{ + const xAOD::CaloCluster* cl=static_cast<const xAOD::CaloCluster*>(cl_in); float E_unsubtr=cl->e(HIJetRec::unsubtractedClusterState()); float eta_unsubtr=cl->eta(HIJetRec::unsubtractedClusterState()); @@ -35,119 +37,173 @@ void HIJetClusterSubtractorTool::Subtract(xAOD::IParticle::FourMom_t& subtr_mom, float E_phi_subtr=0; const float eta0=cl->eta0(); const float phi0=cl->phi0(); - float mod=modulator->getModulation(phi0, eshape); + float mod=1; + if(modulator) mod=modulator->getModulation(phi0, eshape); + + float energy=E_unsubtr; + float eta=eta0; + float phi=phi0; - for(unsigned int sample=0; sample<24; sample++) + if(cl->isAvailable<float>("HIEtaPhiWeight")) { - CaloSampling::CaloSample s=static_cast<CaloSampling::CaloSample>(sample); - if(!cl->hasSampling(s)) continue; - - float nCells=index->getShape(eta0,sample,shape)->nCells(); - float rho=0; - if(nCells!=0.) rho=index->getShape(eta0,sample,shape)->rho()/nCells; - rho*=mod*std::cosh(eta0); + float DF_weight=cl->auxdataConst<float>("HIEtaPhiWeight"); + if(DF_weight!=0.) mod/=DF_weight; + } - E_subtr+=rho*getWeight(eta0,phi0,sample); - E_eta_subtr+=rho*getWeightEta(eta0,phi0,sample); - E_phi_subtr+=rho*getWeightPhi(eta0,phi0,sample); + if(shape==nullptr) + { + ATH_MSG_ERROR("No HIEventShape supplied, cannot do subtraction"); + return; } + if(m_useSamplings) + { + if(index==nullptr) + { + ATH_MSG_ERROR("No HIEventShapeIndex supplied, cannot do subtraction"); + return; + } - float energy=E_unsubtr-E_subtr; - float eta=eta0; - float phi=phi0; + for(unsigned int sample=0; sample<24; sample++) + { + CaloSampling::CaloSample s=static_cast<CaloSampling::CaloSample>(sample); + if(!cl->hasSampling(s)) continue; + float nCells=index->getShape(eta0,sample,shape)->nCells(); + float rho=0; + if(nCells!=0.) rho=index->getShape(eta0,sample,shape)->rho()/nCells; + rho*=mod*std::cosh(eta0); + + E_subtr+=rho*getWeight(eta0,phi0,sample); + E_eta_subtr+=rho*getWeightEta(eta0,phi0,sample); + E_phi_subtr+=rho*getWeightPhi(eta0,phi0,sample); + } - if(energy!=0.) + energy=E_unsubtr-E_subtr; + if(energy!=0.) + { + eta=eta_unsubtr+(eta_unsubtr*E_subtr-E_eta_subtr)/energy; + phi=phi_unsubtr+(phi_unsubtr*E_subtr-E_phi_subtr)/energy; + } + setSubtractedEtaPhi(energy,eta,phi,eta0,phi0,energy/E_subtr); + } + else { - eta=eta_unsubtr+(eta_unsubtr*E_subtr-E_eta_subtr)/energy; - phi=phi_unsubtr+(phi_unsubtr*E_subtr-E_phi_subtr)/energy; + unsigned int es_bin=HI::TowerBins::findBinEta(eta0); + + float area=shape->at(es_bin)->area(); + float rho=(area==0.) ? 0. : shape->at(es_bin)->et()/area; + + rho*=mod*std::cosh(eta0); + E_subtr=rho*HI::TowerBins::getBinArea(); + energy=E_unsubtr-E_subtr; + eta=eta_unsubtr; + phi=phi_unsubtr; + + ATH_MSG_VERBOSE("Subtracting" + << std::setw(8) << eta0 + << std::setw(8) << phi0 + << std::setw(10) << std::setprecision(3) << modulator->getModulation(phi0, eshape) + << std::setw(10) << std::setprecision(3) << mod + << std::setw(10) << std::setprecision(3) << modulator->getModulation(phi0, eshape)/mod + << std::setw(10) << std::setprecision(3) << area + << std::setw(10) << std::setprecision(3) << rho*area + << std::setw(10) << std::setprecision(3) << E_unsubtr*1e-3 + << std::setw(10) << std::setprecision(3) << E_subtr*1e-3 + << std::setw(10) << std::setprecision(3) << E_unsubtr*1e-3/std::cosh(eta0) + << std::setw(10) << std::setprecision(3) << E_subtr*1e-3/std::cosh(eta0)); + + + + } - setSubtractedEtaPhi(energy,eta,phi,eta0,phi0,energy/E_subtr); float ET=energy/std::cosh(eta); subtr_mom.SetPxPyPzE(ET*std::cos(phi),ET*std::sin(phi),ET*std::sinh(eta),energy); } -void HIJetClusterSubtractorTool::UpdateUsingCluster(xAOD::HIEventShapeContainer* shape, const HIEventShapeIndex* index, const xAOD::CaloCluster* cl) const +void HIJetClusterSubtractorTool::updateUsingCluster(xAOD::HIEventShapeContainer* shape, const HIEventShapeIndex* index, const xAOD::CaloCluster* cl) const { + float eta0=cl->eta0(); float phi0=cl->phi0(); - - for(unsigned int sample=0; sample<24; sample++) + if(m_useSamplings) { - CaloSampling::CaloSample s=static_cast<CaloSampling::CaloSample>(sample); - if(!cl->hasSampling(s)) continue; - float esamp=cl->eSample(s); - float ET=esamp/std::cosh(eta0); - xAOD::HIEventShape* slice=shape->at(index->getIndex(eta0,sample)); - - //update members - float area_slice=slice->area(); - float area_cluster=getWeight(eta0,phi0,sample); - float area_sf=1.; - if(area_slice!=0.) area_sf-=area_cluster/area_slice; - slice->setNCells( std::floor(area_sf*slice->nCells()) ); - slice->setEt(slice->et()-ET); - slice->setArea(area_slice-area_cluster); - slice->setRho(slice->rho() - ET/area_cluster); - - - for(unsigned int ih=0; ih<slice->etCos().size(); ih++) + for(unsigned int sample=0; sample<24; sample++) { - float ih_f=ih+1; - float tmp_cos = slice->etCos().at(ih); - slice->etCos()[ih] = tmp_cos + cos(ih_f*phi0)*ET; - - float tmp_sin = slice->etSin().at(ih); - slice->etSin()[ih] = tmp_sin + sin(ih_f*phi0)*ET; + CaloSampling::CaloSample s=static_cast<CaloSampling::CaloSample>(sample); + if(!cl->hasSampling(s)) continue; + float esamp=cl->eSample(s); + float ET=esamp/std::cosh(eta0); + xAOD::HIEventShape* slice=shape->at(index->getIndex(eta0,sample)); + float area_cluster=getWeight(eta0,phi0,sample); + //update members + updateSlice(slice,ET,phi0,area_cluster); } } - + else + { + unsigned int es_bin=HI::TowerBins::findBinEta(eta0); + xAOD::HIEventShape* slice=shape->at(es_bin); + constexpr float area_cluster=HI::TowerBins::getBinArea(); + float ET=cl->e(HIJetRec::unsubtractedClusterState())/std::cosh(eta0); + if(cl->isAvailable<float>("HIEtaPhiWeight")) + { + float HI_weight=cl->auxdataConst<float>("HIEtaPhiWeight"); + ET*=HI_weight; + } + //update members + updateSlice(slice,ET,phi0,area_cluster); + } } -void HIJetClusterSubtractorTool::SubtractWithMoments(xAOD::CaloCluster* cl, const xAOD::HIEventShapeContainer* shape, const HIEventShapeIndex* index, const ToolHandle<IHIUEModulatorTool>& modulator, const xAOD::HIEventShape* eshape) const -{ + +void HIJetClusterSubtractorTool::subtractWithMoments(xAOD::CaloCluster* cl, const xAOD::HIEventShapeContainer* shape, const HIEventShapeIndex* index, const ToolHandle<IHIUEModulatorTool>& modulator, const xAOD::HIEventShape* eshape) const +{ xAOD::IParticle::FourMom_t subtr_mom; - Subtract(subtr_mom, cl, shape, index, modulator, eshape); + subtract(subtr_mom, cl, shape, index, modulator, eshape); HIJetRec::setClusterP4(subtr_mom,cl,HIJetRec::subtractedClusterState()); } StatusCode HIJetClusterSubtractorTool::initializeTool() { - std::string local_path=m_config_dir+m_input_file; - std::string full_path=PathResolverFindCalibFile(local_path); - TFile* f=TFile::Open(full_path.c_str()); - if(f==nullptr) + if(m_useSamplings) { - ATH_MSG_FATAL("Cannot read config file " << full_path ); - return StatusCode::FAILURE; - } + std::string local_path=m_configDir+m_inputFile; + std::string full_path=PathResolverFindCalibFile(local_path); + TFile* f=TFile::Open(full_path.c_str()); + if(f==nullptr) + { + ATH_MSG_FATAL("Cannot read config file " << full_path ); + return StatusCode::FAILURE; + } - m_h3_w=(TH3F*)f->GetObjectChecked("h3_w","TH3F"); - if(m_h3_w==nullptr) - { - ATH_MSG_FATAL("Cannot find TH3F m_h3_w in config file " << full_path ); - return StatusCode::FAILURE; - } + m_h3W=(TH3F*)f->GetObjectChecked("h3_w","TH3F"); + if(m_h3W==nullptr) + { + ATH_MSG_FATAL("Cannot find TH3F m_h3W in config file " << full_path ); + return StatusCode::FAILURE; + } - m_h3_eta=(TH3F*)f->GetObjectChecked("h3_eta","TH3F"); - if(m_h3_eta==nullptr) - { - ATH_MSG_FATAL("Cannot find TH3F m_h3_eta in config file " << full_path ); - return StatusCode::FAILURE; - } + m_h3Eta=(TH3F*)f->GetObjectChecked("h3_eta","TH3F"); + if(m_h3Eta==nullptr) + { + ATH_MSG_FATAL("Cannot find TH3F m_h3Eta in config file " << full_path ); + return StatusCode::FAILURE; + } - m_h3_phi=(TH3F*)f->GetObjectChecked("h3_phi","TH3F"); - if(m_h3_phi==nullptr) - { - ATH_MSG_FATAL("Cannot find TH3F m_h3_phi in config file " << full_path ); - return StatusCode::FAILURE; + m_h3Phi=(TH3F*)f->GetObjectChecked("h3_phi","TH3F"); + if(m_h3Phi==nullptr) + { + ATH_MSG_FATAL("Cannot find TH3F m_h3Phi in config file " << full_path ); + return StatusCode::FAILURE; + } + m_h3W->SetDirectory(0); + m_h3Eta->SetDirectory(0); + m_h3Phi->SetDirectory(0); + + f->Close(); } - m_h3_w->SetDirectory(0); - m_h3_eta->SetDirectory(0); - m_h3_phi->SetDirectory(0); - f->Close(); m_init=true; return StatusCode::SUCCESS; @@ -157,32 +213,43 @@ StatusCode HIJetClusterSubtractorTool::initializeTool() StatusCode HIJetClusterSubtractorTool::initialize() { return initializeTool(); + } float HIJetClusterSubtractorTool::getWeight(float eta, float phi, int sample) const { - return m_h3_w->GetBinContent(m_h3_w->FindBin(eta,phi,sample)); + return m_h3W->GetBinContent(m_h3W->FindBin(eta,phi,sample)); } float HIJetClusterSubtractorTool::getWeightEta(float eta, float phi, int sample) const { - return m_h3_eta->GetBinContent(m_h3_eta->FindBin(eta,phi,sample)); + return m_h3Eta->GetBinContent(m_h3Eta->FindBin(eta,phi,sample)); } float HIJetClusterSubtractorTool::getWeightPhi(float eta, float phi, int sample) const { - return m_h3_phi->GetBinContent(m_h3_phi->FindBin(eta,phi,sample)); + return m_h3Phi->GetBinContent(m_h3Phi->FindBin(eta,phi,sample)); } - -// float HIJetClusterSubtractorTool::getWeight(float eta, float phi, int sample) const -// { -// return 0.01; -// } -// float HIJetClusterSubtractorTool::getWeightEta(float eta, float phi, int sample) const -// { -// return 0.01*eta; -// } -// float HIJetClusterSubtractorTool::getWeightPhi(float eta, float phi, int sample) const -// { -// return 0.01*phi; -// } +void HIJetClusterSubtractorTool::updateSlice(xAOD::HIEventShape* slice, float ET, float phi0, float area_cluster) const +{ + float area_slice=slice->area(); + float area_sf=1.; + + if(area_slice!=0.) area_sf-=area_cluster/area_slice; + slice->setNCells( std::floor(area_sf*slice->nCells()) ); + slice->setEt(slice->et()-ET); + slice->setArea(area_slice-area_cluster); + + slice->setRho(slice->rho() - ET/area_cluster); + + + for(unsigned int ih=0; ih<slice->etCos().size(); ih++) + { + float ih_f=ih+1; + float tmp_cos = slice->etCos().at(ih); + slice->etCos()[ih] = tmp_cos + cos(ih_f*phi0)*ET; + + float tmp_sin = slice->etSin().at(ih); + slice->etSin()[ih] = tmp_sin + sin(ih_f*phi0)*ET; + } +} diff --git a/Reconstruction/HeavyIonRec/HIJetRec/Root/HIJetConstituentSubtractionTool.cxx b/Reconstruction/HeavyIonRec/HIJetRec/Root/HIJetConstituentSubtractionTool.cxx index 7ae6658cdf7ae1df2a77c0c6694ff2682a6c340a..c4f4202b7606767c7b14e12d8d09e34bcf59928b 100644 --- a/Reconstruction/HeavyIonRec/HIJetRec/Root/HIJetConstituentSubtractionTool.cxx +++ b/Reconstruction/HeavyIonRec/HIJetRec/Root/HIJetConstituentSubtractionTool.cxx @@ -1,64 +1,118 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ #include "HIJetRec/HIJetConstituentSubtractionTool.h" #include "HIJetRec/HIJetRecDefs.h" #include "xAODJet/JetConstituentVector.h" #include "xAODHIEvent/HIEventShapeContainer.h" +#include "xAODTracking/Vertex.h" +#include "xAODTracking/VertexContainer.h" #include "HIEventUtils/HIEventShapeMap.h" +#include "StoreGate/ReadHandle.h" +#include "StoreGate/WriteHandle.h" //********************************************************************** HIJetConstituentSubtractionTool::HIJetConstituentSubtractionTool(const std::string& n) : JetModifierBase(n) { - declareProperty("EventShapeKey",m_event_shape_key); - declareProperty("MomentName",m_moment_name=HIJetRec::subtractedJetState()); - declareProperty("SetMomentOnly",m_moment_only=true); - declareProperty("Subtractor",m_subtractor_tool); - declareProperty("Modulator",m_modulator_tool); } -//********************************************************************** +StatusCode HIJetConstituentSubtractionTool::initialize() +{ + ATH_MSG_VERBOSE("HIJetConstituentSubtractionTool initialize"); + ATH_CHECK( m_eventShapeKey.initialize( !m_eventShapeKey.key().empty()) ); + ATH_CHECK( m_vertexContainer.initialize( !m_vertexContainer.key().empty()) ); + return StatusCode::SUCCESS; +} +//********************************************************************** +//Fix from conflict beetween d1493284 (master) and 5af8a733 (21.0) StatusCode HIJetConstituentSubtractionTool::modify(xAOD::JetContainer& jets) const { - float E_min=m_subtractor_tool->MinEnergyForMoments(); + float E_min=m_subtractorTool->minEnergyForMoments(); //const jet::cellset_t & badcells = badCellMap.cells() ; //retrieve UE - const xAOD::HIEventShapeContainer* shape=0; - if(EventShapeKey().compare("")==0) + //Introduction of a read handle for the HIShapeContainer + SG::ReadHandle<xAOD::HIEventShapeContainer> read_handle_evtShape ( m_eventShapeKey ); + + const xAOD::HIEventShapeContainer* shape=nullptr; + const HIEventShapeIndex* es_index=nullptr; + if(m_eventShapeKey.key().compare("") != 0) { - ATH_MSG_INFO("No HIEventShape specified, skipping tool."); - return StatusCode::SUCCESS; + //if(evtStore()->retrieve(shape,EventShapeKey()).isFailure()) + if (!read_handle_evtShape.isValid()) + { + ATH_MSG_ERROR("Could not retrieve input HIEventShape " << m_eventShapeKey.key() ); + return StatusCode::FAILURE; + } + shape = read_handle_evtShape.get(); /** TODO check if this is neeed **/ + //HIEventShapeMap is a c++ map that neeeds the string key to identify the paired object + es_index=HIEventShapeMap::getIndex(m_eventShapeKey.key()); + if(es_index==nullptr) + { + ATH_MSG_INFO("No HIEventShapeIndex w/ name " << m_eventShapeKey.key() << " adding it to the map"); + HIEventShapeIndex* h=new HIEventShapeIndex(); + h->setBinning(shape); + es_index=HIEventShapeMap::insert(m_eventShapeKey.key(),*h); + } } - if(evtStore()->retrieve(shape,EventShapeKey()).isFailure()) + + if(m_modulatorTool->retrieveShape().isFailure()) { - ATH_MSG_ERROR("Could not retrieve input HIEventShape " << EventShapeKey() ); + ATH_MSG_ERROR("Could not retrieve output shape w/ modulator tool"); return StatusCode::FAILURE; } - const HIEventShapeIndex* es_index=HIEventShapeMap::getIndex(EventShapeKey()); - if(es_index==nullptr) + const xAOD::Vertex* primVertex=nullptr; + const xAOD::VertexContainer* vertices=nullptr; + + //Introduction of a read handle for the HIShapeContainer + SG::ReadHandle<xAOD::VertexContainer> read_handle_vertexContainer ( m_vertexContainer ); + + if(m_originCorrection) { - ATH_MSG_INFO("No HIEventShapeIndex w/ name " << EventShapeKey() << " adding it to the map"); - HIEventShapeIndex* h=new HIEventShapeIndex(); - h->setBinning(shape); - es_index=HIEventShapeMap::insert(EventShapeKey(),*h); + if(!read_handle_vertexContainer.isValid()) + { + ATH_MSG_ERROR("Could not retrieve VertexContainer " << m_vertexContainer.key()); + return StatusCode::FAILURE; + } + //if(evtStore()->retrieve(vertices,m_vertexContainer).isFailure()) + vertices = read_handle_vertexContainer.get(); + for ( size_t iVertex = 0; iVertex < vertices->size(); ++iVertex ) + { + if(vertices->at(iVertex)->vertexType() == xAOD::VxType::PriVtx) + { + primVertex=vertices->at(iVertex); + break; + } + } + if(!primVertex) + { + ATH_MSG_WARNING("No primary vertices found, using first in container"); + primVertex=vertices->at(0); + } } const xAOD::HIEventShape* eshape = nullptr; - if(m_modulator_tool->getShape(eshape).isFailure()) + if(m_modulatorTool->getShape(eshape).isFailure()) { ATH_MSG_ERROR("Could not retrieve output shape w/ modulator tool"); return StatusCode::FAILURE; } - + + bool missingMoment=false; + bool needsUnsubMoment=false; + if(jets.size() > 0){ + xAOD::JetFourMom_t tmp; + needsUnsubMoment = !((*jets.begin())->getAttribute<xAOD::JetFourMom_t>(HIJetRec::unsubtractedJetState(),tmp)); + } + //check to see if unsubtracted moment has been stored for ( xAOD::JetContainer::iterator ijet=jets.begin(); ijet!=jets.end(); ++ijet) { @@ -66,20 +120,63 @@ StatusCode HIJetConstituentSubtractionTool::modify(xAOD::JetContainer& jets) con xAOD::IParticle::FourMom_t p4_cl; xAOD::IParticle::FourMom_t p4_subtr; xAOD::IParticle::FourMom_t p4_unsubtr; - + const xAOD::Vertex* origin=nullptr; + if(m_originCorrection) + { + if( !(*ijet)->getAssociatedObject<xAOD::Vertex>("OriginVertex", origin) ) + { + origin=primVertex; + ATH_MSG_DEBUG("Jet has no associated vertex, using PV from container"); + } + } + const xAOD::JetConstituentVector constituents = (*ijet)->getConstituents(); - for (xAOD::JetConstituentVector::iterator itr = constituents.begin(); itr != constituents.end(); ++itr) + for (xAOD::JetConstituentVector::iterator itr = constituents.begin(); itr != constituents.end(); ++itr) { - m_subtractor_tool->Subtract(p4_cl,itr->rawConstituent(),shape,es_index,m_modulator_tool, eshape); //modifies p4_cl to be constituent 4-vector AFTER subtraction - p4_subtr+=p4_cl; - if( msgLvl(MSG::DEBUG) ) + m_subtractorTool->subtract(p4_cl,itr->rawConstituent(),shape,es_index,m_modulatorTool, eshape); //modifies p4_cl to be constituent 4-vector AFTER subtraction + if(m_originCorrection) { const xAOD::CaloCluster* cl=static_cast<const xAOD::CaloCluster*>(itr->rawConstituent()); - p4_unsubtr+=cl->p4(HIJetRec::unsubtractedClusterState()); + float mag = 0; + if(cl->isAvailable<float>("HIMag")) mag=cl->auxdataConst<float>("HIMag"); + else + { + double cm_mag=0; + if(cl->retrieveMoment (xAOD::CaloCluster::CENTER_MAG, cm_mag)) mag=cm_mag; + } + if(mag!=0.) + { + float eta0=cl->eta0(); + float phi0=cl->phi0(); + float radius=mag/std::cosh(eta0); + xAOD::IParticle::FourMom_t p4_pos; + p4_pos.SetX(radius*std::cos(phi0)-origin->x()); + p4_pos.SetY(radius*std::sin(phi0)-origin->y()); + p4_pos.SetZ(radius*std::sinh(eta0)-origin->z()); + + double deta=p4_pos.Eta()-eta0; + double dphi=p4_pos.Phi()-phi0; + //adjust in case eta/phi are flipped in case of neg E clusters + //this method is agnostic wrt convention + if(p4_cl.Eta()*eta0 <0.) deta*=-1; + + double eta_prime=p4_cl.Eta()+deta; + double phi_prime=p4_cl.Phi()+dphi; + double e_subtr=p4_cl.E(); + p4_cl.SetPtEtaPhiE(e_subtr/std::cosh(eta_prime),eta_prime,phi_prime,e_subtr); + } + else missingMoment=true; + } + + p4_subtr+=p4_cl; + if( msgLvl(MSG::DEBUG) ) + { + const xAOD::CaloCluster* cl=static_cast<const xAOD::CaloCluster*>(itr->rawConstituent()); + p4_unsubtr+=cl->p4(HIJetRec::unsubtractedClusterState()); } } - - ATH_MSG_DEBUG("Subtracting" + + ATH_MSG_DEBUG("Subtracting" << std::setw(12) << "Before:" << std::setw(10) << std::setprecision(3) << p4_unsubtr.Pt()*1e-3 << std::setw(10) << std::setprecision(3) << p4_unsubtr.Eta() @@ -94,9 +191,12 @@ StatusCode HIJetConstituentSubtractionTool::modify(xAOD::JetContainer& jets) con << std::setw(10) << std::setprecision(3) << p4_subtr.M()*1e-3); - + + xAOD::JetFourMom_t jet4vec; - if(p4_subtr.E()/std::cosh(p4_subtr.Eta()) < E_min) + //if entire jet has negative E, do no subtraction but set to ghost scale + //prevents cases with large cancellations with small E but pT non-trivial + if(p4_subtr.E()/std::cosh(p4_subtr.Eta()) < E_min) { p4_subtr=p4_unsubtr; p4_subtr*=1e-7;//ghost scale @@ -104,11 +204,15 @@ StatusCode HIJetConstituentSubtractionTool::modify(xAOD::JetContainer& jets) con jet4vec.SetCoordinates(p4_subtr.Pt(),p4_subtr.Eta(),p4_subtr.Phi(),p4_subtr.M()); - (*ijet)->setJetP4(MomentName(),jet4vec); + (*ijet)->setJetP4(momentName(),jet4vec); - if(!MomentOnly()) + xAOD::JetFourMom_t tmp; + //if(! (*ijet)->getAttribute<xAOD::JetFourMom_t>(HIJetRec::unsubtractedJetState(),tmp) ){ + if(needsUnsubMoment) + (*ijet)->setJetP4(HIJetRec::unsubtractedJetState(), (*ijet)->jetP4()); +// } + if(!momentOnly()) { - (*ijet)->setJetP4(HIJetRec::unsubtractedJetState(), (*ijet)->jetP4()); //hack for now to allow use of pp calib tool skipping pileup subtraction //can be skipped in future if custom HI calibration configuration file exists (*ijet)->setJetP4("JetPileupScaleMomentum", jet4vec ); @@ -118,7 +222,7 @@ StatusCode HIJetConstituentSubtractionTool::modify(xAOD::JetContainer& jets) con (*ijet)->setConstituentsSignalState(HIJetRec::subtractedConstitState()); } } - - return StatusCode::SUCCESS; + if(missingMoment) ATH_MSG_WARNING("No origin correction applied, CENTERMAG missing"); + //Fix from conflict beetween d1493284 (master) and 5af8a733 (21.0) + return StatusCode::SUCCESS; } - diff --git a/Reconstruction/HeavyIonRec/HIJetRec/Root/HIJetDRAssociationTool.cxx b/Reconstruction/HeavyIonRec/HIJetRec/Root/HIJetDRAssociationTool.cxx index 8786439a379f23e3a0c064b660e89aa577b22afd..b7474c71224c6229f436ad3557c5f52a7b952533 100644 --- a/Reconstruction/HeavyIonRec/HIJetRec/Root/HIJetDRAssociationTool.cxx +++ b/Reconstruction/HeavyIonRec/HIJetRec/Root/HIJetDRAssociationTool.cxx @@ -10,38 +10,25 @@ HIJetDRAssociationTool::HIJetDRAssociationTool(const std::string& n) : JetModifierBase(n) { - declareProperty("ContainerKey",m_container_key); - declareProperty("AssociationName",m_assoc_name); - declareProperty("DeltaR", m_DR = 0.8); - declareProperty("ApplyFilter", m_apply_filter=false); - declareProperty("FilterMinE", m_E_min = -999); - declareProperty("FilterMinPt", m_pT_min = 0); - - } //********************************************************************** +StatusCode HIJetDRAssociationTool::initialize() +{ + ATH_MSG_VERBOSE("HIJetDRAssociationTool initialize"); + ATH_CHECK( m_containerKey.initialize( !m_containerKey.key().empty() ) ); + return StatusCode::SUCCESS; +} StatusCode HIJetDRAssociationTool::modify(xAOD::JetContainer& jets) const { const xAOD::IParticleContainer* ppars=0; - if ( evtStore()->contains<xAOD::IParticleContainer>(m_container_key) ) - { - ATH_MSG_DEBUG("Retrieving xAOD container " << m_container_key ); - ppars = evtStore()->retrieve<const xAOD::IParticleContainer>(m_container_key); - if (!ppars) - { - ATH_MSG_ERROR("Failed to retrieve xAOD container " << m_container_key ); - return StatusCode::FAILURE; - } - } - else - { - ATH_MSG_ERROR("Failed to retrieve xAOD container " << m_container_key ); - return StatusCode::FAILURE; - } + + ATH_MSG_DEBUG("Retrieving xAOD container " << m_containerKey.key() ); + SG::ReadHandle<xAOD::IParticleContainer> readHandlePcontainer ( m_containerKey ); + ppars = readHandlePcontainer.get(); for (xAOD::JetContainer::iterator ijet=jets.begin(); ijet!=jets.end(); ijet++) { @@ -52,8 +39,7 @@ StatusCode HIJetDRAssociationTool::modify(xAOD::JetContainer& jets) const const xAOD::IParticle* ap=(*pItr); if(theJet->p4().DeltaR( ap->p4()) < m_DR) ParticleVector.push_back(ap); } - theJet->setAssociatedObjects(m_assoc_name,ParticleVector); + theJet->setAssociatedObjects(m_assocName,ParticleVector); } return StatusCode::SUCCESS; -} - +} diff --git a/Reconstruction/HeavyIonRec/HIJetRec/Root/HIJetDiscriminatorTool.cxx b/Reconstruction/HeavyIonRec/HIJetRec/Root/HIJetDiscriminatorTool.cxx index 97008167cc57aec3e2dd6f4141316bea1e197dab..5047bf2a50bdaedab81ec0b0a764d611b41d6191 100644 --- a/Reconstruction/HeavyIonRec/HIJetRec/Root/HIJetDiscriminatorTool.cxx +++ b/Reconstruction/HeavyIonRec/HIJetRec/Root/HIJetDiscriminatorTool.cxx @@ -8,7 +8,7 @@ namespace{ struct Discrim{ Discrim(float maxOverMean, float ETMin) : _maxOverMean(maxOverMean), _ETMin(ETMin){}; - + float _maxOverMean; float _ETMin; @@ -27,15 +27,13 @@ namespace{ HIJetDiscriminatorTool::HIJetDiscriminatorTool(const std::string& t) : JetModifierBase(t) { - declareProperty("MaxOverMeanCut",m_MaxOverMean_cut=4.); - declareProperty("MinimumETMaxCut",m_ET_min_cut=3000.); } StatusCode HIJetDiscriminatorTool::modify(xAOD::JetContainer& jets) const { xAOD::JetContainer::iterator itB = jets.begin(); xAOD::JetContainer::iterator itE = jets.end(); - xAOD::JetContainer::iterator lastFiltered=std::remove_if(itB, itE, Discrim(m_MaxOverMean_cut,m_ET_min_cut)); + xAOD::JetContainer::iterator lastFiltered=std::remove_if(itB, itE, Discrim(m_MaxOverMeanCut,m_ETminCut)); jets.erase( lastFiltered, itE ); return StatusCode::SUCCESS; } diff --git a/Reconstruction/HeavyIonRec/HIJetRec/Root/HIJetSubtractorToolBase.cxx b/Reconstruction/HeavyIonRec/HIJetRec/Root/HIJetSubtractorToolBase.cxx index d21e6d3b4b2b18e89decb39f24ea8b842ffde631..5532ff4b5a6ff5d0f122c6952dd2b10b3eaa9142 100644 --- a/Reconstruction/HeavyIonRec/HIJetRec/Root/HIJetSubtractorToolBase.cxx +++ b/Reconstruction/HeavyIonRec/HIJetRec/Root/HIJetSubtractorToolBase.cxx @@ -7,18 +7,17 @@ #include <TVector2.h> HIJetSubtractorToolBase::HIJetSubtractorToolBase(const std::string& myname) : asg::AsgTool(myname), - m_useCells(true) + m_useCells(true), + m_shape(nullptr), + m_index(nullptr), + m_modulator(nullptr) { #ifndef XAOD_STANDALONE - //should not need this due to ASG_TOOL_CLASS macro since + //should not need this due to ASG_TOOL_CLASS macro since //athena only calls 3 arg constructor which explicitly declares athena interface? - declareInterface<IHISubtractorTool>(this); + declareInterface<IHISubtractorTool>(this); #endif - declareProperty("MinimumEnergyForMoments",m_E_min_moment=50.,"> E, cluster given tower coordinates"); - declareProperty("MinimumSignificanceForMoments",m_E_sig_moment=0.1,"if E after subtr / E total < this cut, cluster given tower coordinates"); - declareProperty("UpdateClusters",m_update_clusters=false,"If true set cluster kinematics to reflect subtraction"); - } @@ -30,10 +29,19 @@ void HIJetSubtractorToolBase::setSubtractedEtaPhi(float E, float& eta, float& ph eta=eta0; phi=phi0; } - else if( E < MinEnergyForMoments() || ( (sig > 0) && sig < MinEnergySigForMoments() ) ) + else if( E < minEnergyForMoments() || ( (sig > 0) && sig < minEnergySigForMoments() ) ) { eta=eta0; phi=phi0; } } + +StatusCode HIJetSubtractorToolBase::configureEvent(const xAOD::HIEventShapeContainer* shape, const HIEventShapeIndex* index, const IHIUEModulatorTool* modulator) +{ + setShape(shape); + setIndex(index); + setModulator(modulator); + return StatusCode::SUCCESS; + +} diff --git a/Reconstruction/HeavyIonRec/HIJetRec/Root/HIUEModulatorTool.cxx b/Reconstruction/HeavyIonRec/HIJetRec/Root/HIUEModulatorTool.cxx index 30a750e7578a20df10dbc0b94579e7294fe8de61..9a7d3803c72d46bc47009d46ee8d418e0043a3c4 100644 --- a/Reconstruction/HeavyIonRec/HIJetRec/Root/HIUEModulatorTool.cxx +++ b/Reconstruction/HeavyIonRec/HIJetRec/Root/HIUEModulatorTool.cxx @@ -6,29 +6,29 @@ #include "CxxUtils/sincos.h" #include "xAODHIEvent/HIEventShapeContainer.h" +#include "StoreGate/ReadHandle.h" +#include "StoreGate/WriteHandle.h" + HIUEModulatorTool::HIUEModulatorTool(const std::string& n) : asg::AsgTool(n), m_shape(nullptr) { #ifndef XAOD_STANDALONE - //should not need this due to ASG_TOOL_CLASS macro since + //should not need this due to ASG_TOOL_CLASS macro since //athena only calls 3 arg constructor which explicitly declares athena interface? - declareInterface<IHIUEModulatorTool>(this); + declareInterface<IHIUEModulatorTool>(this); #endif - - declareProperty("EventShapeKey",m_shape_key="NULL"); - declareProperty("DoV2",m_do_v2=true); - declareProperty("DoV3",m_do_v3=true); - declareProperty("DoV4",m_do_v4=true); } StatusCode HIUEModulatorTool::initialize() { - - m_nh_vector.reserve(3); + //First we initialize keys - after initialization they are frozen + ATH_CHECK( m_shape_key.initialize( !m_shape_key.key().empty()) ); + + m_nh_vector.reserve(3); if(m_do_v2) m_nh_vector.push_back(2); if(m_do_v3) m_nh_vector.push_back(3); if(m_do_v4) m_nh_vector.push_back(4); - if(m_nh_vector.size()!=0 &&(m_shape_key.compare("NULL")==0)) + if(m_nh_vector.size()!=0 && (m_shape_key.key().compare("NULL") == 0)) ATH_MSG_WARNING("Requested modulation, but provided no name for HIEventShapeContainer, no modulation will be applied"); ATH_MSG_DEBUG("Equipping " << m_do_v2 << "\t" << m_do_v3 << "\t" << m_do_v4); return StatusCode::SUCCESS; @@ -61,26 +61,28 @@ float HIUEModulatorTool::getModulation(float phi, StatusCode HIUEModulatorTool::getShape(const xAOD::HIEventShape* & shape) const { shape = 0; - if(m_shape_key.compare("NULL")==0) return StatusCode::SUCCESS; - const xAOD::HIEventShapeContainer* mod_shape=0; - if(evtStore()->retrieve(mod_shape,m_shape_key).isFailure()) - { - ATH_MSG_ERROR("Could not retrieve shape " << m_shape_key); - return StatusCode::FAILURE; - - } + if( m_shape_key.key().compare("NULL") == 0) return StatusCode::SUCCESS; + + SG::ReadHandle<xAOD::HIEventShapeContainer> read_handle_evtShape ( m_shape_key ); + if (!read_handle_evtShape.isValid()) { + ATH_MSG_FATAL( "Could not find HI event shape!" ); + return(StatusCode::FAILURE); + } + + const xAOD::HIEventShapeContainer* mod_shape = read_handle_evtShape.get(); + if(mod_shape->size()==0) { ATH_MSG_ERROR("Modulation container empty : " << m_shape_key); return StatusCode::FAILURE; } - shape=mod_shape->at(0); + shape = mod_shape->at(0); return StatusCode::SUCCESS; } -StatusCode HIUEModulatorTool::retrieveShape() +StatusCode HIUEModulatorTool::retrieveShape() const { - return getShape (m_shape); + return getShape (const_cast<const xAOD::HIEventShape* &> (m_shape)); //TODO check for a smarter implementation } float HIUEModulatorTool::modulate(const std::vector<unsigned int>& nh_vector, const xAOD::HIEventShape* shape, float phi) @@ -91,18 +93,15 @@ float HIUEModulatorTool::modulate(const std::vector<unsigned int>& nh_vector, co { for(unsigned int i=0; i < nh_vector.size(); i++) { - + unsigned int ih=nh_vector.at(i)-1; float nphi=nh_vector.at(i); + nphi*=phi; float qx=shape->etCos().at(ih); float qy=shape->etSin().at(ih); CxxUtils::sincos sc(nphi); - //careful w/ factors of 2: - //|q_vector| is 2 times v_n - //so 2 v_n cos( n (phi-psi_n) ) = 2 v_n (cos (nphi) cos(npsi_n) +sin(nphi) sin(npsi_n)) - // = qx cos (nphi) + qy sin(nphi) - modulation+=sc.apply(qy,qx); + modulation+=2.*sc.apply(qy,qx); } modulation/=et; } @@ -111,16 +110,16 @@ float HIUEModulatorTool::modulate(const std::vector<unsigned int>& nh_vector, co StatusCode HIUEModulatorTool::checkQVectorSize(const xAOD::HIEventShape* shape, unsigned int n) const { - return ( n+1 < shape->etCos().size() ) ? StatusCode::SUCCESS : StatusCode::FAILURE; + return ( shape->etCos().size() >= n ) ? StatusCode::SUCCESS : StatusCode::FAILURE; } StatusCode HIUEModulatorTool::checkCompatibility() const { - for(unsigned int i=0; i < m_nh_vector.size(); i++) + for(unsigned int i=0; i < m_nh_vector.size(); i++) { if(checkQVectorSize(m_shape,m_nh_vector.at(i)).isFailure()) { - ATH_MSG_ERROR("HIEventShapeContainer " << m_shape_key << " does not have requested harmonic"); + ATH_MSG_ERROR("HIEventShapeContainer " << m_shape_key << " does not have requested harmonic " << m_nh_vector.at(i) ); return StatusCode::FAILURE; } } diff --git a/Reconstruction/HeavyIonRec/HIJetRec/python/HIJetRecConfig.py b/Reconstruction/HeavyIonRec/HIJetRec/python/HIJetRecConfig.py index 8e3194723d6c522e890ca03cf31b66bcdde4d18a..8d918bdfa50cbb283f64d32d852bc7a8269cd451 100644 --- a/Reconstruction/HeavyIonRec/HIJetRec/python/HIJetRecConfig.py +++ b/Reconstruction/HeavyIonRec/HIJetRec/python/HIJetRecConfig.py @@ -15,6 +15,7 @@ def SetHIPMode() : HIJetFlags.SeedPtMin.set_Value_and_Lock(8*Units.GeV) HIJetFlags.RecoOutputPtMin.set_Value_and_Lock(8*Units.GeV) HIJetFlags.TrackJetPtMin.set_Value_and_Lock(4*Units.GeV) + HIJetFlags.ApplyTowerEtaPhiCorrection.set_Value_and_Lock(False) def SetDebugMode(): print ('Setting HIJetRec in DEBUG mode') diff --git a/Reconstruction/HeavyIonRec/HIJetRec/python/HIJetRecFlags.py b/Reconstruction/HeavyIonRec/HIJetRec/python/HIJetRecFlags.py index 94a0a7535f601e8c332eefccb8aa9802b9662d54..d7a8b43435cc722fc23ed00df820781bb701b629 100644 --- a/Reconstruction/HeavyIonRec/HIJetRec/python/HIJetRecFlags.py +++ b/Reconstruction/HeavyIonRec/HIJetRec/python/HIJetRecFlags.py @@ -30,7 +30,7 @@ class SeedPtMin(JobProperty): """ statusOn = True allowedTypes = ['float'] - StoredValue = 20*Units.GeV + StoredValue = 25*Units.GeV class RecoOutputPtMin(JobProperty): """ Minimum pT for seeds after iteration @@ -62,7 +62,14 @@ class ApplyOriginCorrection(JobProperty): StoredValue = True class ApplyEtaJESCalibration(JobProperty): - """ Option to apply MC-derived calibration + """ Option to apply MC-derived calibration + """ + statusOn = True + allowedTypes = ['bool'] + StoredValue = True + +class ApplyTowerEtaPhiCorrection(JobProperty): + """ Option to apply MC-derived calibration """ statusOn = True allowedTypes = ['bool'] @@ -102,8 +109,8 @@ class HarmonicsForSubtraction(JobProperty): """ statusOn = True allowedTypes = ['list'] - #StoredValue = [2,3,4] - StoredValue = [] + StoredValue = [2,3,4] + #StoredValue = [] class ModulationScheme(JobProperty): """ 1, 2 or 3 correspond to total calo, total calo w/ fcal phase, fcal only @@ -129,9 +136,9 @@ class ExtraFlowMoments(JobProperty): class DoHIBTagging(JobProperty): """ Perform b-tagging over HI jet collections """ - statusOn = True + statusOn = False allowedTypes = ['bool'] - StoredValue = True + StoredValue = False class HIClusterKey(JobProperty): @@ -157,7 +164,7 @@ class TruthJetPtMin(JobProperty): class TrackInputPtMin(JobProperty): """ Minimum track pT used in track jet finding -xo """ + """ statusOn = True allowedTypes = ['float'] StoredValue = 4*Units.GeV @@ -179,9 +186,9 @@ class TrackJetContainerName(JobProperty): class TrackJetSeeds(JobProperty): """ Flag to control whether track jets are used as seeds in addition to calo jets """ - statusOn = True + statusOn = False allowedTypes = ['bool'] - StoredValue = True + StoredValue = False class HIJetOutputList(JobProperty): """ List of items to be written to AOD, initially empty but filled based on configuration @@ -236,11 +243,16 @@ class HIJetRecFlags(JobPropertyContainer): """ The HIJetRec property container. """ pass - -# add the flags container to the top container +class TWConfigFile(JobProperty): + """ Name of main track jets used in iteration and ghost matching + """ + statusOn = True + allowedTypes = ['str'] + StoredValue = 'cluster.geo.HIJING_2018.root' +# add the flags container to the top container jobproperties.add_Container(HIJetRecFlags) -# We want always the following flags in the container +# We want always the following flags in the container list_jobproperties = [UnsubtractedSuffix, SeedSuffix, SeedRValue, @@ -272,7 +284,9 @@ list_jobproperties = [UnsubtractedSuffix, WriteUnsubtracted, WriteSeeds, UseHITracks, - MomentsSkipped + MomentsSkipped, + TWConfigFile, + ApplyTowerEtaPhiCorrection ] for i in list_jobproperties: diff --git a/Reconstruction/HeavyIonRec/HIJetRec/python/HIJetRecTools.py b/Reconstruction/HeavyIonRec/HIJetRec/python/HIJetRecTools.py index d2732b638a862457da277f09a83fce2fb85d12a0..fbebcf188ea4d0ab78c074fd8594ae8d424889a5 100644 --- a/Reconstruction/HeavyIonRec/HIJetRec/python/HIJetRecTools.py +++ b/Reconstruction/HeavyIonRec/HIJetRec/python/HIJetRecTools.py @@ -12,18 +12,17 @@ from JetRecTools.JetRecToolsConf import TrackPseudoJetGetter from JetRecTools.JetRecToolsConf import JetTrackSelectionTool from JetRecTools.JetRecToolsConf import SimpleJetTrackSelectionTool from JetRecTools.JetRecToolsConf import TrackVertexAssociationTool -from JetMomentTools.JetMomentToolsConf import JetCaloQualityTool -from JetMomentTools.JetMomentToolsConf import JetCaloCellQualityTool +from JetMomentTools.JetMomentToolsConf import JetCaloQualityTool +from JetMomentTools.JetMomentToolsConf import JetCaloCellQualityTool #select the tracks -if jetFlags.Enabled() : HIJetFlags.UseHITracks.set_Value_and_Lock(False) +#if jetFlags.Enabled() : HIJetFlags.UseHITracks.set_Value_and_Lock(False) if HIJetFlags.UseHITracks() : jtm += InDet__InDetTrackSelectionTool("trk_tracksel_HI", minPt = HIJetFlags.TrackInputPtMin(), maxAbsEta = 2.5, minNSiHits = 7, - maxNPixelSharedHits = 1, - maxOneSharedModule = True, + ## maxNSiSharedModules = 100, maxNSiHoles = 2, maxNPixelHoles = 1) @@ -54,8 +53,7 @@ if HIJetFlags.UseHITracks() : minPt = 400.*Units.MeV, maxAbsEta = 2.5, minNSiHits = 7, - maxNPixelSharedHits = 1, - maxOneSharedModule = True, + ###maxNSiSharedModules = 100, maxNSiHoles = 2, maxNPixelHoles = 1) #select the tracks for jet finding @@ -63,8 +61,8 @@ if HIJetFlags.UseHITracks() : InputContainer = jtm.trackContainer, OutputContainer = "JetSelectedTracks_HI_ghost", Selector = jtm.trk_gtracksel_HI) - - + + jtm += TrackPseudoJetGetter("gtrackget_HI", InputContainer = jtm.gtracksel_HI.OutputContainer, Label = "GhostTrack", @@ -77,10 +75,6 @@ if HIJetFlags.UseHITracks() : jtm.jvf.TrackVertexAssociation=jtm.tvassoc_HI.TrackVertexAssociation jtm.jvf.lock() - jtm.jvt.unlock() - jtm.jvt.TrackVertexAssociation=jtm.tvassoc_HI.TrackVertexAssociation - jtm.jvt.lock() - jtm.trkmoms.unlock() jtm.trkmoms.TrackVertexAssociation=jtm.tvassoc_HI.TrackVertexAssociation jtm.trkmoms.TrackMinPtCuts = [int(500*Units.MeV), int(1*Units.GeV), int(2*Units.GeV), int(4*Units.GeV)] @@ -100,22 +94,22 @@ jtm += HIClusterPseudoJetGetter("get_HI", GhostScale = 1.e-20 ) -jtm += PseudoJetGetter("gakt4trackget_HI", +jtm += PseudoJetGetter("gakt4trackget_HI", InputContainer = HIJetFlags.TrackJetContainerName(), - Label = "Ghost" + HIJetFlags.TrackJetContainerName(), + Label = "Ghost" + HIJetFlags.TrackJetContainerName(), SkipNegativeEnergy = True, OutputContainer = "PseudoJetGhost" + HIJetFlags.TrackJetContainerName(), - GhostScale = 1.e-20) + GhostScale = 1.e-20) HIgetters_ghost_track = [] HIgetters_common=[] if jetFlags.useMuonSegments(): HIgetters_common += [jtm.gmusegget] -if jetFlags.useTracks(): - HIgetters_ghost_track += [jtm.gakt4trackget_HI] +if jetFlags.useTracks(): + #HIgetters_ghost_track += [jtm.gakt4trackget_HI] if HIJetFlags.UseHITracks() : HIgetters_ghost_track += [jtm.gtrackget_HI] else: HIgetters_ghost_track += [jtm.gtrackget] -if jetFlags.useTruth(): +if jetFlags.useTruth(): #HIgetters_common += [jtm.gtruthget] flavorgetters=[] for ptype in jetFlags.truthFlavorTags(): @@ -165,7 +159,7 @@ discrim.MaxOverMeanCut=HIJetFlags.DCutMaxOverMean() discrim.MinimumETMaxCut=HIJetFlags.DCutMax() jtm.add(discrim) -jtm.modifiersMap['HI_Unsubtr']=[assoc,max_over_mean,jetfil5] +jtm.modifiersMap['HI_Unsubtr']=[assoc,max_over_mean,jetfil5] hi_trk_modifiers=[assoc,max_over_mean,jtm.width] hi_modifiers = [] @@ -176,23 +170,34 @@ jtm.add(HIJetCellSubtractorTool("HIJetCellSubtractor")) from HIJetRec.HIJetRecConf import HIJetClusterSubtractorTool cl_subtr_tool=HIJetClusterSubtractorTool("HIJetClusterSubtractor") -cl_subtr_tool.ConfigDir='HIJetRec/' +cl_subtr_tool.ConfigDir='HIEventUtils/' jtm.add(cl_subtr_tool) - -if HIJetFlags.ApplyOriginCorrection() : hi_modifiers += [jtm.jetorigincorr] +hi_calib_map={} if HIJetFlags.ApplyEtaJESCalibration() : from JetCalibTools.JetCalibToolsConf import JetCalibrationTool - calib_tool=JetCalibrationTool('HICalibTool',JetCollection='AntiKt4EMTopo',ConfigFile='JES_Full2012dataset_Preliminary_Jan13.config',CalibSequence='AbsoluteEtaJES') - jtm.add(calib_tool) - hi_modifiers += [jtm.HICalibTool] + for R in HIJetFlags.AntiKtRValues() : + #non existing calibration for R=1.0 jets, R=0.4 jet calibration to be used (GetHIModifierList) + if int(10*R) is 10 : continue + calib_seq='EtaJES' + JES_is_data=True + if jetFlags.useTruth(): JES_is_data=False + elif R is 0.4 : calib_seq='EtaJES_Insitu' #only do in situ for R=0.4 jets in data + #elif R is 1.0 : R = 0.4 + calib_tool=JetCalibrationTool('HICalibToolR%d' % int(10*R),JetCollection='AntiKt%dHI' % int(10*R), + ConfigFile='JES_MC15c_HI_Nov2016.config',CalibSequence=calib_seq,IsData=JES_is_data) + + jtm.add(calib_tool) + hi_calib_map['AntiKt%dHIJets' % int(10*R)]=calib_tool +jtm.HICalibMap=hi_calib_map hi_modifiers += [jtm.jetfilHI,jtm.jetsorter] hi_modifiers+=[jtm.width,jtm.jetens,jtm.larhvcorr] if jetFlags.useCaloQualityTool(): hi_modifiers += [jtm.caloqual_cluster] -if jetFlags.useTracks(): - hi_modifiers += [jtm.jvf, jtm.jvt, jtm.trkmoms] +if jetFlags.useTracks(): + hi_modifiers += [jtm.trkmoms, jtm.jvf, jtm.jvt] +# hi_modifiers += [jtm.jvf, jtm.jvt, jtm.trkmoms] if jetFlags.useTruth(): hi_modifiers += [jtm.truthpartondr,jtm.partontruthlabel,jtm.jetdrlabeler] hi_trk_modifiers += [jtm.truthpartondr,jtm.partontruthlabel,jtm.jetdrlabeler] diff --git a/Reconstruction/HeavyIonRec/HIJetRec/python/HIJetRecUtils.py b/Reconstruction/HeavyIonRec/HIJetRec/python/HIJetRecUtils.py index 21fc03c15bba0f99c5f9abe56212d0887d5d0ead..345e86b517136d9b219598d4b44d2e9bd3f7b4a1 100644 --- a/Reconstruction/HeavyIonRec/HIJetRec/python/HIJetRecUtils.py +++ b/Reconstruction/HeavyIonRec/HIJetRec/python/HIJetRecUtils.py @@ -5,20 +5,20 @@ from AthenaConfiguration.ComponentFactory import CompFactory from HIJetRec.HIJetRecTools import jtm from JetRec.JetRecFlags import jetFlags -def AddToOutputList(tname, objType='xAOD::JetContainer') : +def AddToOutputList(tname, objType='xAOD::JetContainer') : #filter container based on package flags if HIJetFlags.UnsubtractedSuffix() in tname and not HIJetFlags.WriteUnsubtracted() : return if HIJetFlags.SeedSuffix() in tname and not HIJetFlags.WriteSeeds() : return has_key=False - for k in HIJetFlags.HIJetOutputList() : - if tname==k.split('#')[1] : + for k in HIJetFlags.HIJetOutputList() : + if tname==k.split('#')[1] : has_key=True break if not has_key : aux_suffix='Aux.' - if 'CaloCluster' in objType : + if 'CaloCluster' in objType : HIJetFlags.HIJetOutputList += [ objType.replace("Container","CellLinkContainer") + "#" + tname + "_links" ] if not HIJetFlags.WriteClusterMoments() : aux_suffix+='-' else : @@ -37,7 +37,7 @@ def AppendOutputList(HIAODItemList=[]) : if HIJetFlags.WriteClusters() : AddToOutputList(HIJetFlags.HIClusterKey(),"xAOD::CaloClusterContainer") from RecExConfig.RecFlags import rec if not rec.doESD(): - for R in HIJetFlags.AntiKtRValues() : + for R in HIJetFlags.AntiKtRValues() : AddToOutputList("AntiKt%dHIJets" % int(10*R)) if jetFlags.useTruth(): AddToOutputList("AntiKt%dTruthJets" % int(10*R)) AddToOutputList(HIJetFlags.TrackJetContainerName()) @@ -79,14 +79,14 @@ def AddHIJetFinder(R=0.4) : def AddPtAssociationTools(R, doTracks=True) : tlist=[] - if doTracks and jetFlags.useTracks(): + if doTracks and jetFlags.useTracks(): cname=HIJetFlags.TrackJetContainerName() tname='hitrackassoc_04' if tname not in jtm.tools: JetPtAssociationTool=CompFactory.JetPtAssociationTool jtm.add(JetPtAssociationTool(tname, InputContainer=cname, AssociationName="GhostTrack")) tlist += [ jtm.tools[tname] ] - if jetFlags.useTruth(): + if jetFlags.useTruth(): cname='AntiKt%dTruthJets' % int(10*R) tname='truthassoc_0%d' % int(10*R) if tname not in jtm.tools: @@ -118,7 +118,7 @@ def MakeModulatorTool(mod_key, **kwargs) : jtm.add(mod) return mod -def MakeSubtractionTool(shapeKey, moment_name='', momentOnly=False, **kwargs) : +def MakeSubtractionTool(shapeKey, moment_name='', momentOnly=False, **kwargs) : HIJetConstituentSubtractionTool=CompFactory.HIJetConstituentSubtractionTool suffix=shapeKey if momentOnly : suffix+='_'+moment_name @@ -131,6 +131,7 @@ def MakeSubtractionTool(shapeKey, moment_name='', momentOnly=False, **kwargs) : subtr.Modulator=mod_tool subtr.MomentName='JetSubtractedScale%sMomentum' % moment_name subtr.SetMomentOnly=momentOnly + subtr.ApplyOriginCorrection=HIJetFlags.ApplyOriginCorrection() subtr.Subtractor=GetSubtractorTool(**kwargs) jtm.add(subtr) return subtr @@ -143,11 +144,14 @@ def ApplySubtractionToClusters(**kwargs) : if 'cluster_key' in kwargs.keys() : cluster_key=kwargs['cluster_key'] else : cluster_key=HIJetFlags.HIClusterKey() - + if 'modulator' in kwargs.keys() : mod_tool=kwargs['modulator'] else : mod_tool=GetNullModulator() + if 'update_only' in kwargs.keys() : update_only = kwargs['update_only'] + else : update_only = False + HIClusterSubtraction=CompFactory.HIClusterSubtraction toolName='HIClusterSubtraction' if 'name' in kwargs.keys() : toolName = kwargs['name'] @@ -156,6 +160,7 @@ def ApplySubtractionToClusters(**kwargs) : theAlg.EventShapeKey=event_shape_key theAlg.Subtractor=GetSubtractorTool(**kwargs) theAlg.Modulator=mod_tool + theAlg.UpdateOnly=update_only do_cluster_moments=False if 'CalculateMoments' in kwargs.keys() : do_cluster_moments=kwargs['CalculateMoments'] @@ -168,16 +173,16 @@ def ApplySubtractionToClusters(**kwargs) : HIClusterMoments = CaloClusterMomentsMaker ("HIClusterMoments") #HIClusterMoments.MaxAxisAngle = 20*deg - HIClusterMoments.CaloNoiseTool = theCaloNoiseTool - HIClusterMoments.UsePileUpNoise = False + #HIClusterMoments.CaloNoiseTool = theCaloNoiseTool + #HIClusterMoments.UsePileUpNoise = False HIClusterMoments.MinBadLArQuality = 4000 HIClusterMoments.MomentsNames = ["CENTER_MAG", "LONGITUDINAL", - "FIRST_ENG_DENS", - "SECOND_ENG_DENS", - "ENG_FRAC_EM", - "ENG_FRAC_MAX", - "ENG_FRAC_CORE", + "FIRST_ENG_DENS", + "SECOND_ENG_DENS", + "ENG_FRAC_EM", + "ENG_FRAC_MAX", + "ENG_FRAC_CORE", "ENG_BAD_CELLS", "N_BAD_CELLS", "N_BAD_CELLS_CORR", @@ -192,16 +197,17 @@ def ApplySubtractionToClusters(**kwargs) : from IOVDbSvc.CondDB import conddb if not conddb.isOnline: - from LArRecUtils.LArHVScaleRetrieverDefault import LArHVScaleRetrieverDefault - HIClusterMoments.LArHVScaleRetriever=LArHVScaleRetrieverDefault() +# from LArRecUtils.LArHVScaleRetrieverDefault import LArHVScaleRetrieverDefault +# HIClusterMoments.LArHVScaleRetriever=LArHVScaleRetrieverDefault() HIClusterMoments.MomentsNames += ["ENG_BAD_HV_CELLS","N_BAD_HV_CELLS"] - + theAlg.ClusterCorrectionTools=[HIClusterMoments] jtm.add(theAlg) jtm.jetrecs += [theAlg] jtm.HIJetRecs+=[theAlg] + def AddIteration(seed_container,shape_name, **kwargs) : out_shape_name=shape_name @@ -209,21 +215,20 @@ def AddIteration(seed_container,shape_name, **kwargs) : mod_shape_key=out_shape_name+'_Modulate' remodulate=True if 'remodulate' in kwargs.keys() : - if not kwargs['remodulate'] : + if not kwargs['remodulate'] : mod_tool=GetNullModulator() remodulate=False if remodulate : if 'modulator' in kwargs.keys() : mod_tool=kwargs['modulator'] - else : - mod_shape_key=BuildHarmonicName(out_shape_name,**kwargs) + else : + #mod_shape_name=BuildHarmonicName(out_shape_name,**kwargs) mod_tool=MakeModulatorTool(mod_shape_key,**kwargs) - assoc_name=jtm.HIJetDRAssociation.AssociationName HIEventShapeJetIteration=CompFactory.HIEventShapeJetIteration iter_tool=HIEventShapeJetIteration('HIJetIteration_%s' % out_shape_name ) - + iter_tool.InputEventShapeKey=shape_name iter_tool.OutputEventShapeKey=out_shape_name iter_tool.AssociationKey=assoc_name @@ -232,8 +237,10 @@ def AddIteration(seed_container,shape_name, **kwargs) : iter_tool.ModulationScheme=HIJetFlags.ModulationScheme() iter_tool.RemodulateUE=HIJetFlags.Remodulate() iter_tool.Modulator=mod_tool + iter_tool.ShallowCopy=False iter_tool.ModulationEventShapeKey=mod_shape_key - if 'track_jet_seeds' in kwargs.keys() : + + if 'track_jet_seeds' in kwargs.keys() : iter_tool.TrackJetSeedContainerKey=kwargs['track_jet_seeds'] jtm.add(iter_tool) jtm.jetrecs += [iter_tool] @@ -241,35 +248,61 @@ def AddIteration(seed_container,shape_name, **kwargs) : return iter_tool def JetAlgFromTools(rtools, suffix="HI",persistify=True) : + + from HIJetRec.HIJetRecTools import jtm #insert exe tools at front of list, e.g. tracksel and tvassoc for HI etc. HIJet_exe_tools=[] from JetRec.JetRecFlags import jetFlags if jetFlags.useTruth() and not jetFlags.Enabled() : HIJet_exe_tools += HITruthParticleCopy() #if jetFlags.useCells(): HIJet_exe_tools += [jtm.missingcells] if HIJetFlags.UseHITracks() : HIJet_exe_tools += [jtm.tracksel_HI,jtm.gtracksel_HI,jtm.tvassoc_HI] - rtools=HIJet_exe_tools+rtools + + #Now we split in two algorithms to provide input to PseudoJetAlgorithm + #rtools=HIJet_exe_tools+rtools + + from AthenaCommon.AlgSequence import AlgSequence + topsequence = AlgSequence() + JetToolRunner=CompFactory.JetToolRunner - runner=JetToolRunner("jetrun"+suffix, Tools=rtools, Timer=jetFlags.timeJetToolRunner()) - jtm.add(runner) - JetAlgorithm=CompFactory.JetAlgorithm + + if len(HIJet_exe_tools)>0: + jtm += JetToolRunner("jetrunconstit"+suffix, + Tools=HIJet_exe_tools, + Timer=jetFlags.timeJetToolRunner()) + topsequence += JetAlgorithm("jetalgconstit"+suffix, + Tools=[jtm.jetrunconstitHI]) + + #### test : add the PseudoJetAlgorithm + from JetRec.JetRecConf import PseudoJetAlgorithm + for getter in jtm.allGetters: + print ('Adding PseudoJetAlgorithm for PseudoJetGetter %s' % getter.name) + print ('Input Container %s' % getter.InputContainer) + print ('Output Container %s' % getter.OutputContainer) + print ('Label %s' % getter.Label) + topsequence += PseudoJetAlgorithm("pjalg_"+suffix+getter.Label,PJGetter=getter) + + runner=JetToolRunner("jetrun"+suffix, + Tools=rtools, + Timer=jetFlags.timeJetToolRunner()) + jtm.add(runner) + theAlg=JetAlgorithm("jetalg"+suffix) theAlg.Tools = [runner] - from AthenaCommon.AlgSequence import AlgSequence - topsequence = AlgSequence() topsequence += theAlg - + + from GaudiKernel.Constants import DEBUG if jetFlags.debug > 0: - + jtm.setOutputLevel(runner, DEBUG) theAlg.OutputLevel = DEBUG - + if jetFlags.debug > 3: jtm.setOutputLevel(jtm.jetBuilderWithoutArea, DEBUG) - + if persistify : - for t in rtools: + for t in rtools: if hasattr(t,"OutputContainer") : AddToOutputList(t.OutputContainer) return theAlg @@ -287,7 +320,7 @@ def HITruthParticleCopy() : def BuildHarmonicName(shape_key, **kwargs) : tname=shape_key - if 'harmonics' in kwargs.keys() : + if 'harmonics' in kwargs.keys() : for n in kwargs['harmonics'] : tname += '_V%d' % n return tname @@ -300,7 +333,7 @@ def GetNullModulator() : for n in [2,3,4] : setattr(mod,'DoV%d' % n,False) jtm.add(mod) return mod - + def GetFlowMomentTools(key,mod_key) : @@ -310,7 +343,7 @@ def GetFlowMomentTools(key,mod_key) : if len(HIJetFlags.HarmonicsForSubtraction()) > 0 : null_mod_tool=GetNullModulator() mtools+=[MakeSubtractionTool(key,moment_name='NoVn',momentOnly=True,modulator=null_mod_tool)] - + if not HIJetFlags.ExtraFlowMoments() : return mtools #only add these tools if requested by package flag @@ -330,19 +363,28 @@ def GetFlowMomentTools(key,mod_key) : def GetSubtractorTool(**kwargs) : useClusters=False - if 'useClusters' in kwargs.keys() : useClusters=kwargs['useClusters'] + if 'useClusters' in kwargs.keys() : useClusters=kwargs['useClusters'] elif HIJetFlags.DoCellBasedSubtraction() : useClusters=False else : useClusters=True - if useClusters : - if not hasattr(jtm,"HIJetClusterSubtractor") : + if useClusters : + if not hasattr(jtm,"HIJetClusterSubtractor") : HIJetClusterSubtractorTool=CompFactory.HIJetClusterSubtractorTool jtm.add(HIJetClusterSubtractorTool("HIJetClusterSubtractor")) return jtm.HIJetClusterSubtractor else: - if not hasattr(jtm,"HIJetCellSubtractor") : + if not hasattr(jtm,"HIJetCellSubtractor") : HIJetCellSubtractorTool=CompFactory.HIJetCellSubtractorTool jtm.add(HIJetCellSubtractorTool("HIJetCellSubtractor")) return jtm.HIJetCellSubtractor - + +def GetHIModifierList(coll_name='AntiKt4HIJets',prepend_tools=[],append_tools=[]) : + if coll_name not in jtm.HICalibMap.keys() : + print ('Calibration for R=%d not available using default R=0.4 calibration') + coll_name='AntiKt4HIJets' + mod_list=prepend_tools + mod_list+=[jtm.HICalibMap[coll_name]] + mod_list+=jtm.modifiersMap['HI'] + mod_list+=append_tools + return mod_list diff --git a/Reconstruction/HeavyIonRec/HIJetRec/share/HIJetRec_AODFix_207.py b/Reconstruction/HeavyIonRec/HIJetRec/share/HIJetRec_AODFix_207.py new file mode 100644 index 0000000000000000000000000000000000000000..2c16ef6890c8e722690dffc5740582a82a990de0 --- /dev/null +++ b/Reconstruction/HeavyIonRec/HIJetRec/share/HIJetRec_AODFix_207.py @@ -0,0 +1,152 @@ +print 'In HIJetRec_AODFix_r207.py' + +## +#check if is MC or overlay and configure calibration tool properly +from JetRec.JetRecFlags import jetFlags +is_mc_or_overlay=False +is_pp_mc=False +if not jetFlags.useTruth(): + if globalflags.DataSource()=='geant4' : + is_mc_or_overlay=True + #Check if it is pp (not HIJING) + if rec.doHIP(): is_pp_mc=True + else : + from PyUtils import AthFile + af = AthFile.fopen(svcMgr.EventSelector.InputCollections[0]) + containers=af.fileinfos['eventdata_items'] + for c in containers: + if 'Truth' in c[0] : + is_mc_or_overlay=True + break + +jetFlags.useTruth.set_Value_and_Lock(is_mc_or_overlay) + +### + +#add new event shape: 100 bins, no layers, demodulated by tower weights +from AthenaCommon.AlgSequence import AlgSequence +topSequence = AlgSequence() +from HIGlobal.HIGlobalFlags import jobproperties +from HIGlobal.HIGlobalConf import HIEventShapeMaker +from HIGlobal.HIGlobalConf import HIEventShapeFillerTool + +ESAlg_W=HIEventShapeMaker("ESAlg_W") +ESAlg_W.OutputContainerKey="EventShapeWeighted" +ESAlg_W.UseCaloCell=False +ESAlg_W.InputTowerKey="HIClusters" + +###the following is a workaround +#only necessary because the HIEventShapeMaker algorithm requires a summary tool +#it doesn't use the tool if SummaryContainerKey=="" +from HIEventUtils.HIEventUtilsConf import HIEventShapeSummaryTool +SummaryTool=HIEventShapeSummaryTool("SummaryTool2") +SummaryTool.SubCalos=jobproperties.HIGlobalFlags.SummarySubCalos() +ESAlg_W.SummaryTool=SummaryTool +ESAlg_W.SummaryContainerKey="" +##### + +EventShapeKey="EventShapeWeighted" + +from HIGlobal.HIGlobalConf import HIEventShapeFillerTool +ESFiller=HIEventShapeFillerTool("WeightedFiller") +ESFiller.UseClusters=True + +from HIEventUtils.HIEventUtilsConf import HITowerWeightTool +TWTool=HITowerWeightTool() +TWTool.ApplyCorrection=HIJetFlags.ApplyTowerEtaPhiCorrection() +TWTool.ConfigDir='HIJetCorrection/' +TWTool.InputFile=HIJetFlags.TWConfigFile() +from AthenaCommon.AppMgr import ToolSvc +ToolSvc += HITowerWeightTool() +ESFiller.TowerWeightTool=TWTool +ESAlg_W.HIEventShapeFillerTool=ESFiller +topSequence += ESAlg_W + + +###configure the package flags for re-running +import AthenaCommon.SystemOfUnits as Units +from HIJetRec.HIJetRecFlags import HIJetFlags +from JetRec.JetRecFlags import jetFlags +from HIJetRec.HIJetRecConfig import * + +jetFlags.useTracks.set_Value_and_Lock(True) +HIJetFlags.DoCellBasedSubtraction.set_Value_and_Lock(False) +if rec.doHIP() : SetHIPMode() +else : + HIJetFlags.HarmonicsForSubtraction.set_Value_and_Lock([2,3,4]); + HIJetFlags.Remodulate.set_Value_and_Lock(True) + HIJetFlags.ModulationScheme.set_Value_and_Lock(1) + HIJetFlags.SeedPtMin.set_Value_and_Lock(25*Units.GeV); + +##call tools as in standard reco +from HIJetRec.HIJetRecTools import jtm +from HIJetRec.HIJetRecUtils import * + +theSubtrTool=jtm.HIJetClusterSubtractor +theSubtrTool.unlock() +theSubtrTool.UseSamplings=False +theSubtrTool.lock() + +if is_mc_or_overlay : + for theCalibTool in jtm.HICalibMap.values() : + theCalibTool.unlock() + theCalibTool.IsData=False + theCalibTool.CalibSequence='EtaJES' + theCalibTool.lock() + +#use existing R=0.2 jets from previous reco, only making use of discriminant +seed_prefix='AntiKt%dHIJets' % int(10*HIJetFlags.SeedRValue()) +seeds0=jtm.addJetCopier("%s_%s0" % (seed_prefix, HIJetFlags.SeedSuffix()),seed_prefix,[jtm.discrim],shallow=False) +jtm.HIJetRecs+=[seeds0] +iter0=AddIteration(seed_container=seeds0.OutputContainer,shape_name=EventShapeKey,suffix="iter0") +modulator0=iter0.Modulator +subtr1=MakeSubtractionTool(iter0.OutputEventShapeKey,modulator=modulator0) + +#now iterate +seeds1=jtm.addJetCopier("%s_%s1" % (seed_prefix,HIJetFlags.SeedSuffix()),seed_prefix,[subtr1,jtm.HICalibMap[seed_prefix],jtm.jetfilHISeeds],shallow=False) +jtm.HIJetRecs+=[seeds1] +iteration_dict=dict(suffix="iter1") +if jetFlags.useTracks() and HIJetFlags.TrackJetSeeds() : iteration_dict['track_jet_seeds']=HIJetFlags.TrackJetContainerName() +iter1=AddIteration(seed_container=seeds1.OutputContainer,shape_name=EventShapeKey,**iteration_dict) + +HIJetFlags.IteratedEventShapeKey=iter1.OutputEventShapeKey +modulator1=iter1.Modulator +jtm.modulator=modulator1 + +from HIJetRec.HIJetRecConf import HIClusterSubtraction +cluster_update=HIClusterSubtraction('HIClusterUpdate') +cluster_update.ClusterKey="HIClusters" +cluster_update.EventShapeKey=HIJetFlags.IteratedEventShapeKey() +cluster_update.Subtractor=jtm.HIJetClusterSubtractor +cluster_update.Modulator=modulator1 +cluster_update.UpdateOnly=True +jtm.add(cluster_update) +jtm.jetrecs += [cluster_update] +jtm.HIJetRecs+=[cluster_update] + + +#subtraction BEFORE iteration for moment +subtr2=MakeSubtractionTool(HIJetFlags.IteratedEventShapeKey(),modulator=modulator1) + +### +#subtracted algorithms +#make main jets from unsubtr collections w/ same R, add modifiers for subtraction +unsubtr_suffix=HIJetFlags.UnsubtractedSuffix() +for R in HIJetFlags.AntiKtRValues() : + in_name="AntiKt%sHIJets" % int(10*R) + copier=jtm.addJetCopier("DF"+in_name,in_name,GetHIModifierList(in_name,[subtr2],[jtm.jetfilHI,jtm.jetsorter]),shallow=False) + jtm.HIJetRecs+=[copier] +### +from JetSubStructureMomentTools.JetSubStructureMomentToolsConf import KtDeltaRTool +jtm += KtDeltaRTool('ktdr10',JetRadius =1.0) +#use calibration for R=0.4 jets for R=1 jets... +largeRmodifiers=GetHIModifierList('AntiKt4HIJets',[subtr2],[jtm.ktdr10, jtm.ktsplitter, jtm.pull, jtm.angularity, jtm.planarflow,jtm.ktmassdrop]) +a10hi=jtm.addJetFinder('DFAntiKt10HIJets', 'AntiKt', 1.0, 'HI',largeRmodifiers) +jtm.HIJetRecs+=[a10hi] +if is_mc_or_overlay and not is_pp_mc: #AntiKt10TruthJets are present in pp MC + a10truth=jtm.addJetFinder('AntiKt10TruthJets','AntiKt',1.0,'truth') + jtm.HIJetRecs+=[a10truth] + +### +JetAlgFromTools(jtm.HIJetRecs,suffix="HI",persistify=True) +for t in jtm.HIJetRecs : jtm.jetrecs.remove(t) diff --git a/Reconstruction/HeavyIonRec/HIJetRec/share/HIJetRec_jobOptions.py b/Reconstruction/HeavyIonRec/HIJetRec/share/HIJetRec_jobOptions.py index 285c0578cc5c57846426aa6e15edceaffa8f16b9..fd21ac03c097e94fd3c68625851aeb0629d03296 100644 --- a/Reconstruction/HeavyIonRec/HIJetRec/share/HIJetRec_jobOptions.py +++ b/Reconstruction/HeavyIonRec/HIJetRec/share/HIJetRec_jobOptions.py @@ -25,10 +25,81 @@ HIClusterGetter() #equip basic tools from HIJetRec.HIJetRecTools import jtm -### -##truth jets -if jetFlags.useTruth(): - for R in HIJetFlags.AntiKtRValues() : +#------------------------------ +#set flags, keys and configure new event shape algorithm +#>check if is MC or overlay and configure calibration tool properly +from JetRec.JetRecFlags import jetFlags +is_mc_or_overlay=False +is_pp_mc=False +if not jetFlags.useTruth(): + if globalflags.DataSource()=='geant4' : + is_mc_or_overlay=True + #Check if it is pp (not HIJING) + if rec.doHIP(): is_pp_mc=True +jetFlags.useTruth.set_Value_and_Lock(is_mc_or_overlay) + + +#Tower level subtraction +HIJetFlags.DoCellBasedSubtraction.set_Value_and_Lock(False) + +jetFlags.useTracks.set_Value_and_Lock(True) +#HIP mode +if rec.doHIP() : SetHIPMode() + +theSubtrTool=jtm.HIJetClusterSubtractor +theSubtrTool.unlock() +theSubtrTool.UseSamplings=False +theSubtrTool.lock() + +if is_mc_or_overlay : + for theCalibTool in jtm.HICalibMap.values() : + theCalibTool.unlock() + theCalibTool.IsData=False + theCalibTool.CalibSequence='EtaJES' + theCalibTool.lock() + +if not HIJetFlags.DoCellBasedSubtraction(): + #Make new event shape at tower level + from HIGlobal.HIGlobalConf import HIEventShapeMaker + from HIGlobal.HIGlobalConf import HIEventShapeFillerTool + #EventShapeKey set to point to weighted container, can remove code on L16 + EventShapeKey=jobproperties.HIGlobalFlags.EventShapeKey()+'Weighted' + ESAlg_W=HIEventShapeMaker("ESAlg_W") + ESAlg_W.OutputContainerKey=EventShapeKey + ESAlg_W.UseCaloCell=False + ESAlg_W.InputTowerKey="HIClusters" + + #Hack needed because ES algorithm requires a summary tool, this disables it + from HIEventUtils.HIEventUtilsConf import HIEventShapeSummaryTool + SummaryTool=HIEventShapeSummaryTool("SummaryTool2") + SummaryTool.SubCalos=jobproperties.HIGlobalFlags.SummarySubCalos() + ESAlg_W.SummaryTool=SummaryTool + ESAlg_W.SummaryContainerKey="" + + #Add filler tool + from HIGlobal.HIGlobalConf import HIEventShapeFillerTool + ESFiller=HIEventShapeFillerTool("WeightedFiller") + ESFiller.UseClusters=True + + #Add weight tool to filler tool + from HIEventUtils.HIEventUtilsConf import HITowerWeightTool + TWTool=HITowerWeightTool() + TWTool.ApplyCorrection=HIJetFlags.ApplyTowerEtaPhiCorrection() + TWTool.ConfigDir='HIJetCorrection/' + TWTool.InputFile=HIJetFlags.TWConfigFile() + from AthenaCommon.AppMgr import ToolSvc + ToolSvc += HITowerWeightTool() + ESFiller.TowerWeightTool=TWTool + + #Add to top sequence + ESAlg_W.HIEventShapeFillerTool=ESFiller + topSequence += ESAlg_W + +#------------------------------------------------------------ + +#truth, track and unsubtracted jet setup: +if jetFlags.useTruth(): + for R in HIJetFlags.AntiKtRValues() : tname="AntiKt%dTruthJets" % int(10*R) collExists=False if tname in jtm.tools : continue @@ -37,14 +108,14 @@ if jetFlags.useTruth(): inputcontent = objKeyStore['inputFile'].list() for t in inputcontent : if tname in t: - printfunc ('Truth collection %s already exists, no need to rebuild it' % tname) + print 'Truth collection %s already exists, no need to rebuild it' % tname collExists=True break if collExists: continue f=jtm.addJetFinder(tname,"AntiKt", R,"truth", ptmin= HIJetFlags.TruthJetPtMin()) - printfunc ('Adding %s' %tname) + print 'Adding %s' %tname AddToOutputList(tname) - jtm.HIJetRecs+=[f] + #jtm.HIJetRecs+=[f] #track jets if jetFlags.useTracks(): @@ -61,28 +132,30 @@ if jetFlags.useTracks(): for R in HIJetFlags.AntiKtRValues() : AddHIJetFinder(R) #initial seeds -if HIJetFlags.SeedRValue() not in HIJetFlags.AntiKtRValues() :AddHIJetFinder(HIJetFlags.SeedRValue()) +if HIJetFlags.SeedRValue() not in HIJetFlags.AntiKtRValues() : AddHIJetFinder(HIJetFlags.SeedRValue()) seed_prefix='AntiKt%dHIJets' % int(10*HIJetFlags.SeedRValue()) seeds0=jtm.addJetCopier("%s_%s0" % (seed_prefix, HIJetFlags.SeedSuffix()),"%s_Unsubtracted" % seed_prefix,[jtm.discrim],shallow=False) jtm.HIJetRecs+=[seeds0] + +#code nearly identical, but new behavior since upstream ES container and package flags are different iter0=AddIteration(seed_container=seeds0.OutputContainer,shape_name=EventShapeKey,suffix="iter0") modulator0=iter0.Modulator subtr1=MakeSubtractionTool(iter0.OutputEventShapeKey,modulator=modulator0) #now iterate -seeds1=jtm.addJetCopier("%s_%s1" % (seed_prefix,HIJetFlags.SeedSuffix()),"%s_Unsubtracted" % seed_prefix,[subtr1,jtm.HICalibTool,jtm.jetfilHISeeds],shallow=False) +print 'Now moving to iteration 1' + +seeds1=jtm.addJetCopier("%s_%s1" % (seed_prefix,HIJetFlags.SeedSuffix()),"%s_Unsubtracted" % seed_prefix,[subtr1,jtm.HICalibMap[seed_prefix],jtm.jetfilHISeeds],shallow=False) jtm.HIJetRecs+=[seeds1] iteration_dict=dict(suffix="iter1") if jetFlags.useTracks() and HIJetFlags.TrackJetSeeds() : iteration_dict['track_jet_seeds']=HIJetFlags.TrackJetContainerName() +print 'Adding iteration 1' iter1=AddIteration(seed_container=seeds1.OutputContainer,shape_name=EventShapeKey,**iteration_dict) HIJetFlags.IteratedEventShapeKey=iter1.OutputEventShapeKey modulator1=iter1.Modulator jtm.modulator=modulator1 -#apply subtraction to cluster constituents -ApplySubtractionToClusters(event_shape_key=HIJetFlags.IteratedEventShapeKey(), cluster_key=ClusterKey, modulator=modulator1,CalculateMoments=True) - #subtraction BEFORE iteration for moment subtr1=MakeSubtractionTool(iter0.OutputEventShapeKey,moment_name="NoIteration",momentOnly=True,modulator=modulator0) #main subtractor @@ -91,25 +164,44 @@ subtr2=MakeSubtractionTool(HIJetFlags.IteratedEventShapeKey(),modulator=modulato #put subtraction tool at the FRONT of the jet modifiers list hi_tools=[subtr1,subtr2] hi_tools+=GetFlowMomentTools(iter1.OutputEventShapeKey,iter1.ModulationEventShapeKey) -hi_tools += jtm.modifiersMap['HI'] -jtm.modifiersMap['HI']=hi_tools + +#==========#==========#==========#==========#==========#========== +#special addition for egamma +#Downstream egamma jo will call SubtractedCellGetter, it assumes that the container pointed to by +#HIJetFlags.IteratedEventShapeKey() is defined per layer/per eta bin, which is no longer true w/ above changes +#The fix is to define one more container from the seeds above just as in original reconstruction +if not HIJetFlags.DoCellBasedSubtraction(): + iteration_dict=dict(suffix="iter_egamma") + iter_egamma=AddIteration(seed_container=seeds1.OutputContainer,shape_name=jobproperties.HIGlobalFlags.EventShapeKey(),useClusters=False,**iteration_dict) + cell_level_shape_key=iter_egamma.OutputEventShapeKey + #HIJetFlags.IteratedEventShapeKey=iter_egamma.OutputEventShapeKey + +#Subtraction for egamma and to get layers +ApplySubtractionToClusters(name="HIClusterSubtraction_egamma", event_shape_key=cell_level_shape_key, cluster_key=ClusterKey, modulator=modulator1, CalculateMoments=True, useClusters=False) +#Cluster subtraction for jets +ApplySubtractionToClusters(event_shape_key=HIJetFlags.IteratedEventShapeKey(), update_only=True, cluster_key=ClusterKey, modulator=modulator1, CalculateMoments=False, useClusters=True) ### #subtracted algorithms #make main jets from unsubtr collections w/ same R, add modifiers for subtraction - unsubtr_suffix=HIJetFlags.UnsubtractedSuffix() for k in jtm.jetrecs : if unsubtr_suffix in k.name() : in_name=k.OutputContainer out_name=in_name.replace("_%s" % unsubtr_suffix,"") - copier=jtm.addJetCopier(out_name,in_name,"HI",shallow=False) + #>slight tweak in case R=1.0 jets are requestd, add some substructure tools + modifiers=GetHIModifierList(out_name,hi_tools) + if '10HIJets' in k.name() : + from JetSubStructureMomentTools.JetSubStructureMomentToolsConf import KtDeltaRTool + jtm += KtDeltaRTool('ktdr10',JetRadius =1.0) + modifiers+=[jtm.ktdr10, jtm.ktsplitter, jtm.pull, jtm.angularity, jtm.planarflow,jtm.ktmassdrop] + copier=jtm.addJetCopier(out_name,in_name,modifiers,shallow=False) AddToOutputList(out_name) jtm.HIJetRecs+=[copier] - AppendOutputList(jetFlags.jetAODList) JetAlgFromTools(jtm.HIJetRecs,suffix="HI",persistify=True) +HIJetFlags.IteratedEventShapeKey=cell_level_shape_key # code cloned from BTagging_jobOptions.py # to allow b-tagging over HI jets @@ -151,9 +243,9 @@ if HIJetFlags.DoHIBTagging(): jetname.JetModifiers += [ btagger ] jetname.lock() if BTaggingFlags.OutputLevel < 3: - printfunc (ConfInstance.getJetCollectionTool(jet[:-4])) + print ConfInstance.getJetCollectionTool(jet[:-4]) except AttributeError as error: - printfunc ('#BTAG# --> ' + str(error)) + print '#BTAG# --> ' + str(error) NotInJetToolManager.append(AuthorSubString[i]) if len(NotInJetToolManager) > 0: diff --git a/Reconstruction/HeavyIonRec/HIJetRec/src/HICaloCellHelper.cxx b/Reconstruction/HeavyIonRec/HIJetRec/src/HICaloCellHelper.cxx index 547459d381c9638cac6b4bbdfea0ebc48f9525d4..befd0524560c524b76a891cc3cd475930927e475 100644 --- a/Reconstruction/HeavyIonRec/HIJetRec/src/HICaloCellHelper.cxx +++ b/Reconstruction/HeavyIonRec/HIJetRec/src/HICaloCellHelper.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ #include "HICaloCellHelper.h" @@ -12,26 +12,26 @@ #include <set> #include <TMath.h> -float HICaloCellHelper::GetAreaEtaPhi(const CaloCell* theCell) +float HICaloCellHelper::getAreaEtaPhi(const CaloCell* theCell) { float deta=theCell->caloDDE()->deta(); float dphi=theCell->caloDDE()->dphi(); return std::abs(deta*dphi); } -float HICaloCellHelper::GetEtDensity(const CaloCell* theCell, float geoWeight) +float HICaloCellHelper::getEtDensity(const CaloCell* theCell, float geoWeight) { float density=theCell->et(); - float area=HICaloCellHelper::GetAreaEtaPhi(theCell); + float area=HICaloCellHelper::getAreaEtaPhi(theCell); if(area<1e-9) area=0.2*TMath::Pi()/geoWeight; density/=area; return density; } -std::string HICaloCellHelper::DumpCell(const CaloCell* theCell) +std::string HICaloCellHelper::dumpCell(const CaloCell* theCell) { std::stringstream ss; - ss << "CELLINFO:" + ss << "CELLINFO:" << std::setw(10) << (CaloSampling::CaloSample) theCell->caloDDE()->getSampling() << std::setw(20) << theCell->ID().get_compact() << std::setw(10) << theCell->et() @@ -39,6 +39,6 @@ std::string HICaloCellHelper::DumpCell(const CaloCell* theCell) << std::setw(10) << theCell->caloDDE()->phi() << std::setw(15) << theCell->caloDDE()->deta() << std::setw(15) << theCell->caloDDE()->dphi() - << std::setw(15) << HICaloCellHelper::GetAreaEtaPhi(theCell); + << std::setw(15) << HICaloCellHelper::getAreaEtaPhi(theCell); return ss.str(); } diff --git a/Reconstruction/HeavyIonRec/HIJetRec/src/HICaloCellHelper.h b/Reconstruction/HeavyIonRec/HIJetRec/src/HICaloCellHelper.h index 84a6bbe63cd53a796bb8c4c4e0ec40cc9333f53b..a6280eee08bfb301f9b6272902063f843ea82e82 100644 --- a/Reconstruction/HeavyIonRec/HIJetRec/src/HICaloCellHelper.h +++ b/Reconstruction/HeavyIonRec/HIJetRec/src/HICaloCellHelper.h @@ -1,9 +1,9 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ -#ifndef __HICALOHELPER_H__ -#define __HICALOHELPER_H__ +#ifndef HIJETREC_HICALOHELPER_H__ +#define HIJETREC_HICALOHELPER_H__ #include <string> #include <vector> @@ -16,17 +16,11 @@ class CaloCell; namespace HICaloCellHelper{ - float GetEtDensity(const CaloCell* theCell, float geoWeight); - float GetAreaEtaPhi(const CaloCell* theCell); - void UpdateShape(xAOD::HIEventShapeContainer* shape, const CaloCell* theCell, float geoWeight, float eta0, float phi0, bool isNeg=false); + float getEtDensity(const CaloCell* theCell, float geoWeight); + float getAreaEtaPhi(const CaloCell* theCell); + void updateShape(xAOD::HIEventShapeContainer* shape, const CaloCell* theCell, float geoWeight, float eta0, float phi0, bool isNeg=false); - - std::string DumpCell(const CaloCell* theCell); - - - + std::string dumpCell(const CaloCell* theCell); } - #endif - diff --git a/Reconstruction/HeavyIonRec/HIJetRec/src/HIClusterMaker.cxx b/Reconstruction/HeavyIonRec/HIJetRec/src/HIClusterMaker.cxx index acc5ba2bfbaced5b9d682cf23171db834c9a99a3..cac9585bfe836428bd3ddc8da3d0d7b033764744 100644 --- a/Reconstruction/HeavyIonRec/HIJetRec/src/HIClusterMaker.cxx +++ b/Reconstruction/HeavyIonRec/HIJetRec/src/HIClusterMaker.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ #include "HIClusterMaker.h" @@ -13,15 +13,21 @@ #include <cmath> #include <TVector2.h> -HIClusterMaker::HIClusterMaker(const std::string& name, ISvcLocator* pSvcLocator) : AthAlgorithm(name,pSvcLocator) +#include "StoreGate/ReadHandle.h" +#include "StoreGate/WriteHandle.h" + +HIClusterMaker::HIClusterMaker(const std::string& name, ISvcLocator* pSvcLocator) + : AthAlgorithm(name,pSvcLocator) { - declareProperty("InputTowerKey",m_tower_container_key="CombinedTower"); - declareProperty("CaloCellContainerKey",m_cell_container_key="AllCalo"); - declareProperty("OutputContainerKey",m_output_key="PseudoJet"); - declareProperty("MinimumEnergyForMoments",m_E_min_moment=50.,"> E, cluster given tower coordinates"); } + StatusCode HIClusterMaker::initialize() { + //First we initialize keys - after initialization they are frozen + ATH_CHECK( m_towerContainerKey.initialize() ); + ATH_CHECK( m_cellContainerKey.initialize() ); + ATH_CHECK( m_outputKey.initialize() ); + return StatusCode::SUCCESS; } @@ -30,36 +36,17 @@ StatusCode HIClusterMaker::execute() //retrieve the tower container from store const INavigable4MomentumCollection* navInColl = 0; - if(evtStore()->retrieve(navInColl,m_tower_container_key).isFailure()) - { - msg(MSG::WARNING) << " Could not retrieve tower container with key " - << m_tower_container_key - << endmsg; - return StatusCode::FAILURE; - } + SG::ReadHandle<INavigable4MomentumCollection> readHandleTower ( m_towerContainerKey ); + navInColl = readHandleTower.cptr(); const CaloCellContainer * cellColl ; - if(evtStore()->retrieve(cellColl,m_cell_container_key).isFailure()) - { - msg(MSG::WARNING) << " Could not retrieve cell container with key " - << m_cell_container_key - << endmsg; - return StatusCode::FAILURE; - } - - - //HIPseudoJetContainer cl_container=new HIPseudoJetContainer(); - // if(evtStore()->record(shape,m_output_key).isFailure()) - // { - // msg(MSG::ERROR) << "Could not record PseudoJet " << m_output_key << endmsg; - // return StatusCode::FAILURE; - // } + SG::ReadHandle<CaloCellContainer> readHandleCell ( m_cellContainerKey ); + cellColl = readHandleCell.cptr(); //make the container - xAOD::CaloClusterContainer* cl_container=CaloClusterStoreHelper::makeContainer(&(*evtStore()),m_output_key,msg()); - if (!cl_container) return StatusCode::FAILURE; - - + //Tricky migration: here we don't have to migrate our methods but what we use from CaloClusterStoreHelper + SG::WriteHandle<xAOD::CaloClusterContainer> writeHandleContainer ( m_outputKey ); + ATH_CHECK(CaloClusterStoreHelper::AddContainerWriteHandle(&(*evtStore()), writeHandleContainer, msg())); //loop on towers for(INavigable4MomentumCollection::const_iterator towerItr=navInColl->begin(); @@ -73,9 +60,6 @@ StatusCode HIClusterMaker::execute() float time_cl=0; float E2_cl=0; uint32_t samplingPattern=0; - // std::vector<float> E_sampling(NUMSAMPLES,0); - // std::vector<float> eta_sampling(NUMSAMPLES,0); - // std::vector<float> phi_sampling(NUMSAMPLES,0); //navigate back to cells //Default is to sort the cells by either pointer values leading to irreproducible output @@ -90,13 +74,13 @@ StatusCode HIClusterMaker::execute() for(NavigationToken<CaloCell,double,CaloCellIDFcn>::const_iterator cellItr = cellToken.begin(); cellItr != cellToken.end(); cellItr++ ) { - //Bad cell policy + //Bad cell policy - to be kept //if(m_bad_cell_tool->SkipCell(*cellItr)) //{ //if(m_skipBadCells && (*cellItr)->badcell()) continue; //} - - double geoWeight = cellToken.getParameter(*cellItr); + + double geoWeight = cellToken.getParameter(*cellItr); double cell_E_w=(*cellItr)->energy()*geoWeight; IdentifierHash hashid =(*cellItr)->caloDDE()->calo_hash(); @@ -109,19 +93,15 @@ StatusCode HIClusterMaker::execute() E2_cl+=cell_E_w*cell_E_w; time_cl+=cell_E_w*cell_E_w*(*cellItr)->time(); - // unsigned int isample=0; - // E_sampling[isample]+=cell_E_w; - // eta_sampling[isample] =cell_E_w*(*cellItr)->eta(); - // phi_sampling[isample]+=cell_E_w*(*cellItr)->phi(); unsigned int sample = (CaloSampling::CaloSample) (*cellItr)->caloDDE()->getSampling(); samplingPattern |= (0x1U<<sample); - + }//end cell loop float eta0=(*towerItr)->eta(); float phi0=(*towerItr)->phi(); - if(E_cl < m_E_min_moment) + if(E_cl < m_EminMoment) { eta_cl=eta0; phi_cl=phi0; @@ -173,7 +153,7 @@ StatusCode HIClusterMaker::execute() << std::setw(15) << cl->phi() << endmsg; - cl_container->push_back(std::move(cl)); + writeHandleContainer->push_back(std::move(cl)); }//end tower loop return StatusCode::SUCCESS; } @@ -184,20 +164,20 @@ StatusCode HIClusterMaker::finalize() } -StatusCode HIClusterMaker::DumpClusters(xAOD::CaloClusterContainer* clusColl) +StatusCode HIClusterMaker::dumpClusters(xAOD::CaloClusterContainer* clusColl) { msg(MSG::INFO) << "Dumping PseudoJets" << endmsg; for(xAOD::CaloClusterContainer::iterator clusCollIter= clusColl->begin(); clusCollIter!= clusColl->end(); clusCollIter++) { xAOD::CaloCluster* cl = (*clusCollIter); - + float E_cl=0; float eta_cl=0; float phi_cl=0; - + CaloClusterCellLink* cellLinks=cl->getOwnCellLinks(); - + if (!cellLinks) { msg(MSG::ERROR) << "Can't get valid links to CaloCells (CaloClusterCellLink)!" << endmsg; @@ -218,19 +198,19 @@ StatusCode HIClusterMaker::DumpClusters(xAOD::CaloClusterContainer* clusColl) const CaloCell* pCell=(*cellIter); //double geoWeight =cellIter.weight(); //weird synatx, "." on iterator double cell_E_w=pCell->energy();//*geoWeight; - + E_cl+=cell_E_w; eta_cl+=cell_E_w*pCell->eta(); phi_cl+=cell_E_w*pCell->phi(); //sumw+=geoWeight; } - if(E_cl!=0.) + if(E_cl!=0.) { eta_cl/=E_cl; phi_cl/=E_cl; } - - msg(MSG::INFO) << std::setw(10) << "DUMPING CLUSTER" + + ATH_MSG_INFO( std::setw(10) << "DUMPING CLUSTER" << std::setw(15) << cl->e() << std::setw(15) << cl->eta() << std::setw(15) << cl->phi() @@ -238,9 +218,7 @@ StatusCode HIClusterMaker::DumpClusters(xAOD::CaloClusterContainer* clusColl) << std::setw(15) << eta_cl << std::setw(15) << phi_cl << std::setw(15) << ncells - << std::setw(15) << sumw - << endmsg; - + << std::setw(15) << sumw ); } return StatusCode::SUCCESS; diff --git a/Reconstruction/HeavyIonRec/HIJetRec/src/HIClusterMaker.h b/Reconstruction/HeavyIonRec/HIJetRec/src/HIClusterMaker.h index 41653bd83dcfccf560f433ac35cb74b006f98614..abf3676616e22f5af1110ea6652880fede2af561 100644 --- a/Reconstruction/HeavyIonRec/HIJetRec/src/HIClusterMaker.h +++ b/Reconstruction/HeavyIonRec/HIJetRec/src/HIClusterMaker.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ // HIClusterMaker.h @@ -26,6 +26,12 @@ //Ideally use forward class decl. for CaloClusterContainer //Cannot because this class is defined via typedef #include <xAODCaloEvent/CaloClusterContainer.h> +#include "NavFourMom/INavigable4MomentumCollection.h" + +#include "StoreGate/ReadHandleKey.h" +#include "StoreGate/WriteHandleKey.h" + +class CaloCellContainer; class HIClusterMaker : public AthAlgorithm { @@ -40,13 +46,16 @@ public: virtual StatusCode finalize(); //Simple helper to dump clusters for debugging - StatusCode DumpClusters(xAOD::CaloClusterContainer* clusColl); + StatusCode dumpClusters(xAOD::CaloClusterContainer* clusColl); private: - - std::string m_tower_container_key; /// \brief Name of input CaloTowerContainer, e.g CmbTower - std::string m_cell_container_key;/// \brief Name of input CaloCellContainer, e.g. AllCalo - std::string m_output_key; /// \brief Name of output CaloClusterContainer, e.g. HIClusters - float m_E_min_moment; /// \brief For clusters w/ E less than this, set their eta/phi to tower eta/phi + /// \brief Name of input CaloTowerContainer, e.g CmbTower + SG::ReadHandleKey<INavigable4MomentumCollection> m_towerContainerKey { this, "InputTowerKey" , "CombinedTower" , "InputTowerKey"}; + /// \brief Name of input CaloCellContainer, e.g. AllCalo + SG::ReadHandleKey<CaloCellContainer> m_cellContainerKey { this, "CaloCellContainerKey" , "AllCalo" , "InputCellKey" }; + /// \brief Name of output CaloClusterContainer, e.g. HIClusters + SG::WriteHandleKey<xAOD::CaloClusterContainer> m_outputKey { this, "OutputContainerKey" , "PseudoJet" , "Read version of output Container Key"}; + /// \brief For clusters w/ E less than this, set their eta/phi to tower eta/phi + Gaudi::Property< float > m_EminMoment { this, "MinimumEnergyForMoments", 50., "> E, cluster given tower coordinates" }; }; #endif diff --git a/Reconstruction/HeavyIonRec/HIJetRec/src/HIClusterSubtraction.cxx b/Reconstruction/HeavyIonRec/HIJetRec/src/HIClusterSubtraction.cxx index 0f11ed3cbe26ff4703b4cd3716677fec31a5640a..651947798b5246ee6717ef70ede8f7564d2bba96 100644 --- a/Reconstruction/HeavyIonRec/HIJetRec/src/HIClusterSubtraction.cxx +++ b/Reconstruction/HeavyIonRec/HIJetRec/src/HIClusterSubtraction.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ #include "HIClusterSubtraction.h" @@ -8,27 +8,26 @@ #include "HIEventUtils/HIEventShapeMap.h" #include "HIJetRec/HIJetRecDefs.h" +#include "StoreGate/ReadHandle.h" +#include "StoreGate/WriteHandle.h" + //********************************************************************** -HIClusterSubtraction::HIClusterSubtraction(std::string name) : asg::AsgTool(name), - m_clusterCorrectionTools(this) +HIClusterSubtraction::HIClusterSubtraction(std::string name) : asg::AsgTool(name)//, { - declareProperty("ClusterKey", m_cluster_key); - declareProperty("EventShapeKey",m_event_shape_key); - declareProperty("Subtractor",m_subtractor_tool); - declareProperty("Modulator",m_modulator_tool); - declareProperty("SetMoments",m_set_moments=true); - declareProperty("ClusterCorrectionTools",m_clusterCorrectionTools); - } //********************************************************************** StatusCode HIClusterSubtraction::initialize() { - for (auto tool : m_clusterCorrectionTools) + //Keys initialization + ATH_CHECK( m_eventShapeKey.initialize() ); + ATH_CHECK( m_clusterKey.initialize() ); + + for (auto tool : m_clusterCorrectionTools) { - StatusCode sc=tool.retrieve(); + StatusCode sc = tool.retrieve(); if (sc.isFailure()) ATH_MSG_ERROR("Failed to retrieve correction tool " << tool); else ATH_MSG_DEBUG("Successfully retrieved correction tool " << tool); } @@ -39,45 +38,70 @@ int HIClusterSubtraction::execute() const { //const jet::cellset_t & badcells = badCellMap.cells() ; - //retrieve UE + //From here on temporarily commented out code bc decorators needs a dedicated treatment in MT + //const xAOD::HIEventShapeContainer* shape = 0; + SG::ReadHandle<xAOD::HIEventShapeContainer> readHandleEvtShape ( m_eventShapeKey ); + //shape = readHandleEvtShape.get(); + ATH_MSG_WARNING("HIClusterSubtraction not yet migrated to MT. Currently disabled! "); + //const HIEventShapeIndex* es_index = HIEventShapeMap::getIndex( m_eventShapeKey.key() ); - const xAOD::HIEventShapeContainer* shape=0; - if(evtStore()->retrieve(shape,m_event_shape_key).isFailure()) - { - ATH_MSG_ERROR("Could not retrieve input HIEventShape " << m_event_shape_key ); - return 1; - } - - const HIEventShapeIndex* es_index=HIEventShapeMap::getIndex(m_event_shape_key); - - xAOD::CaloClusterContainer* ccl=0; - if(evtStore()->retrieve(ccl,m_cluster_key).isFailure()) - { - ATH_MSG_ERROR("Could not retrieve input HIEventShape " << m_cluster_key ); - return 1; - } const xAOD::HIEventShape* eshape = nullptr; - CHECK(m_modulator_tool->getShape(eshape), 1); - - for(xAOD::CaloClusterContainer::iterator itr=ccl->begin(); itr!=ccl->end(); itr++) + //Hibryd merging between commit c2aeaed0 to master and 5af8a733 to 21.0ss + CHECK(m_modulatorTool->getShape(eshape), 1); + //This part regards decoration! + //Needs a more deep implementation to work in MT - to be discussed w/ Bill Balunas + //Will be fronted in the next step of the migration + /* + SG::ReadHandle<xAOD::CaloClusterContainer> read_handle_clusters ( m_clusterKey ); + if (!read_handle_clusters.isValid()) + { + ATH_MSG_ERROR("Could not retrieve input CaloClusterContainer " << m_clusterKey.key() ); + return 1; + } + const xAOD::CaloClusterContainer* ccl=0; + if(m_updateMode) { - xAOD::CaloCluster* cl=*itr; - xAOD::IParticle::FourMom_t p4; - if(m_set_moments) m_subtractor_tool->SubtractWithMoments(cl,shape,es_index,m_modulator_tool,eshape); - else + ccl = read_handle_clusters.get(); + //if(evtStore()->retrieve(ccl,m_clusterKey).isFailure()) + std::unique_ptr<std::vector<float> > subtractedE(new std::vector<float>()); + subtractedE->reserve(ccl->size()); + //Decoration TODO: check for migration + SG::AuxElement::Decorator< float > decorator("HISubtractedE"); + + for(xAOD::CaloClusterContainer::const_iterator itr=ccl->begin(); itr!=ccl->end(); itr++) { - m_subtractor_tool->Subtract(p4,cl,shape,es_index,m_modulator_tool,eshape); - HIJetRec::setClusterP4(p4,cl,HIJetRec::subtractedClusterState()); + const xAOD::CaloCluster* cl=*itr; + xAOD::IParticle::FourMom_t p4; + m_subtractorTool->Subtract(p4,cl,shape,es_index,m_modulatorTool,eshape); + subtractedE->push_back(p4.E()); + decorator(*cl)=p4.E(); } - } - for(ToolHandleArray<CaloClusterCollectionProcessor>::const_iterator toolIt=m_clusterCorrectionTools.begin(); - toolIt!=m_clusterCorrectionTools.end();toolIt++) + else { - ATH_MSG_DEBUG(" Applying correction = " << (*toolIt)->name() ); - CHECK((*toolIt)->execute(Gaudi::Hive::currentContext(), ccl), 1); - }//End loop over correction tools + xAOD::CaloClusterContainer* ccl=0; + ccl = read_handle_clusters.get(); + for(xAOD::CaloClusterContainer::iterator itr=ccl->begin(); itr!=ccl->end(); itr++) + { + xAOD::CaloCluster* cl=*itr; + xAOD::IParticle::FourMom_t p4; + if(m_setMoments) m_subtractorTool->SubtractWithMoments(cl, shape, es_index, m_modulatorTool, eshape); + else + { + m_subtractorTool->Subtract(p4,cl,shape,es_index,m_modulatorTool,eshape); + HIJetRec::setClusterP4(p4,cl,HIJetRec::subtractedClusterState()); + } + } + for(ToolHandleArray<CaloClusterCollectionProcessor>::const_iterator toolIt=m_clusterCorrectionTools.begin(); + toolIt != m_clusterCorrectionTools.end(); toolIt++) + { + ATH_MSG_DEBUG(" Applying correction = " << (*toolIt)->name() ); + CHECK((*toolIt)->execute(Gaudi::Hive::currentContext(), ccl), 1); + //Hibryd merging between commit c2aeaed0 to master and 5af8a733 to 21.0 + //eventually needs to be changed to following for r21: + //CHECK((*toolIt)->execute(ccl), 1); + }//End loop over correction tools + }*/ return 0; } - diff --git a/Reconstruction/HeavyIonRec/HIJetRec/src/HIClusterSubtraction.h b/Reconstruction/HeavyIonRec/HIJetRec/src/HIClusterSubtraction.h index 2f93556045700615b44f4ef7b9596e22f0718fce..44e53ca88ff339e13ff3b80094c5421a288dd44a 100644 --- a/Reconstruction/HeavyIonRec/HIJetRec/src/HIClusterSubtraction.h +++ b/Reconstruction/HeavyIonRec/HIJetRec/src/HIClusterSubtraction.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ // HIClusterSubtraction.h @@ -28,6 +28,12 @@ #include <HIJetRec/IHIUEModulatorTool.h> #include "CaloRec/CaloClusterCollectionProcessor.h" +#include "StoreGate/ReadHandleKey.h" +#include "StoreGate/WriteHandleKey.h" + +#include "xAODCaloEvent/CaloClusterContainer.h" +#include "xAODHIEvent/HIEventShapeContainer.h" + class HIClusterSubtraction : virtual public asg::AsgTool, virtual public IJetExecuteTool { @@ -42,15 +48,18 @@ public: private: /// \brief Name of input cluster container - std::string m_cluster_key; - + SG::ReadHandleKey< xAOD::CaloClusterContainer > m_clusterKey { this, "ClusterKey", "ClusterKey", "Name of the input Cluster Container"}; /// \brief Name of HIEventShapeContainer defining background - std::string m_event_shape_key; + SG::ReadHandleKey< xAOD::HIEventShapeContainer > m_eventShapeKey { this, "EventShapeKey", "EventShapeKey", "Name of HIEventShapeContainer defining background"}; + + // Tool handles + ToolHandle<IHISubtractorTool> m_subtractorTool { this, "Subtractor", "HIJetSubtractorToolBase", "Handle to IHISubtractorTool which does calculates subtracted kinematics" }; + ToolHandle<IHIUEModulatorTool> m_modulatorTool { this, "Modulator" , "HIUEModulatorTool" , "Handle to IHIModulatorTool" }; + ToolHandleArray<CaloClusterCollectionProcessor> m_clusterCorrectionTools { this, "ClusterCorrectionTools", {}, "" }; + + // Booleans + Gaudi::Property< bool > m_setMoments { this, "SetMoments", true, "Set Moments boolean switch"}; + Gaudi::Property< bool > m_updateMode { this, "UpdateOnly", false, "Update Mode boolean switch"}; - /// \brief handle to IHISubtractorTool which does calculates subtracted kinematics - ToolHandle<IHISubtractorTool> m_subtractor_tool; - ToolHandle<IHIUEModulatorTool> m_modulator_tool; - ToolHandleArray<CaloClusterCollectionProcessor> m_clusterCorrectionTools; - bool m_set_moments; }; #endif diff --git a/Reconstruction/HeavyIonRec/HIJetRec/src/HIJetCellSubtractorTool.cxx b/Reconstruction/HeavyIonRec/HIJetRec/src/HIJetCellSubtractorTool.cxx index 8fdc53e8e2fdc2658b089c617651d7f491257a46..920fc265b04440aaf1fe148c297fd7c1c93cac03 100644 --- a/Reconstruction/HeavyIonRec/HIJetRec/src/HIJetCellSubtractorTool.cxx +++ b/Reconstruction/HeavyIonRec/HIJetRec/src/HIJetCellSubtractorTool.cxx @@ -1,184 +1,203 @@ -/* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration -*/ - -#include "HIJetCellSubtractorTool.h" -#include "HICaloCellHelper.h" -#include "CxxUtils/prefetch.h" -#include "xAODCaloEvent/CaloCluster.h" -#include "HIEventUtils/HIEventShapeIndex.h" -#include "HIJetRec/HIJetRecDefs.h" -#include "FourMomUtils/xAODP4Helpers.h" -//forward class decl in base class. -#include "HIJetRec/IHIUEModulatorTool.h" - -HIJetCellSubtractorTool::HIJetCellSubtractorTool(const std::string& myname) : HIJetSubtractorToolBase(myname) -{ - -} - -void HIJetCellSubtractorTool::Subtract(xAOD::IParticle::FourMom_t& subtr_mom, const xAOD::IParticle* cl_in, const xAOD::HIEventShapeContainer* shape, const HIEventShapeIndex* index, const ToolHandle<IHIUEModulatorTool>& modulator, const xAOD::HIEventShape* eshape) const -{ - //if( cl_in->type() == xAOD::Type::CaloCluster ) - //use static cast, derived type of IParticle checked explicitly upstream - const xAOD::CaloCluster* cl=static_cast<const xAOD::CaloCluster*>(cl_in); - float E_cl=0; - float eta_cl=0; - float phi_cl=0; - - const float eta0=cl->eta0(); - const float phi0=cl->phi0(); - - float mod=modulator->getModulation(phi0, eshape); - - //unsigned int eta_phi_index=HICaloCellHelper::FindEtaPhiBin(cl->eta0(),cl->phi0()); - xAOD::CaloCluster::const_cell_iterator cellIterEnd = cl->cell_end(); - for(xAOD::CaloCluster::const_cell_iterator cellIter=cl->cell_begin(); cellIter != cellIterEnd; cellIter++ ) - { - CxxUtils::prefetchNext(cellIter, cellIterEnd); - - unsigned int sample = (CaloSampling::CaloSample) (*cellIter)->caloDDE()->getSampling(); - float eta=(*cellIter)->eta(); - float phi=(*cellIter)->phi(); - - float nCells=index->getShape(eta0,sample,shape)->nCells(); - float rho=0; - if(nCells!=0.) rho=index->getShape(eta0,sample,shape)->rho()/nCells; - rho*=mod; - float geoWeight=cellIter.weight(); - float cell_E_w=(*cellIter)->energy()*geoWeight; - cell_E_w-=rho*HICaloCellHelper::GetAreaEtaPhi(*cellIter)*geoWeight*std::cosh(eta0); - - - E_cl+=cell_E_w; - eta_cl+=cell_E_w*eta; - phi_cl+=cell_E_w*phi; - - } - if(E_cl!=0.) - { - eta_cl/=E_cl; - phi_cl/=E_cl; - } - //rare case E_cl==0 is also handled by setSubtractedEtaPhi - float E_unsubtr=cl->e(HIJetRec::unsubtractedClusterState()); - setSubtractedEtaPhi(E_cl,eta_cl,phi_cl -,eta0,phi0,E_cl/E_unsubtr); - float ET_cl=E_cl/std::cosh(eta_cl); - subtr_mom.SetPxPyPzE(ET_cl*std::cos(phi_cl),ET_cl*std::sin(phi_cl),ET_cl*std::sinh(eta_cl),E_cl); -} - -void HIJetCellSubtractorTool::UpdateUsingCluster(xAOD::HIEventShapeContainer* shape, const HIEventShapeIndex* index, const xAOD::CaloCluster* cl) const -{ - float eta0=cl->eta0(); - float phi0=cl->phi0(); - - xAOD::CaloCluster::const_cell_iterator cellIterEnd = cl->cell_end(); - for(xAOD::CaloCluster::const_cell_iterator cellIter=cl->cell_begin(); cellIter != cellIterEnd; cellIter++ ) - { - CxxUtils::prefetchNext(cellIter, cellIterEnd); - UpdateShape(shape,index,*cellIter,cellIter.weight(),eta0,phi0,true); - } -} - -void HIJetCellSubtractorTool::UpdateShape(xAOD::HIEventShapeContainer* shape, const HIEventShapeIndex* index, const CaloCell* theCell, float geoWeight, float eta0, float phi0, bool isNeg) const -{ - float sgn=(isNeg) ? -1 : 1; - - int layer = theCell->caloDDE()->getSampling(); - float cell_et = theCell->et(); - - unsigned int iSlice=index->getIndex(eta0,layer); - - - xAOD::HIEventShape* slice=shape->at(iSlice); - //update members - slice->setNCells(slice->nCells()+sgn); - slice->setEt(slice->et()+sgn*cell_et*geoWeight); - float area=HICaloCellHelper::GetAreaEtaPhi(theCell); - float rho=0; - if(area!=0.) rho=cell_et/area; - slice->setArea(slice->area() + sgn*area*geoWeight); - slice->setRho(slice->rho() + sgn*rho); - - for(unsigned int ih=0; ih<shape->at(iSlice)->etCos().size(); ih++) - { - float ih_f=ih+1; - float tmp_cos = shape->at(iSlice)->etCos().at(ih); - shape->at(iSlice)->etCos()[ih] = tmp_cos + cell_et*cos(ih_f*phi0)*geoWeight; - - float tmp_sin = shape->at(iSlice)->etSin().at(ih); - shape->at(iSlice)->etSin()[ih] = tmp_sin + cell_et*sin(ih_f*phi0)*geoWeight; - } - -} - -void HIJetCellSubtractorTool::SubtractWithMoments(xAOD::CaloCluster* cl, const xAOD::HIEventShapeContainer* shape, const HIEventShapeIndex* index, const ToolHandle<IHIUEModulatorTool>& modulator, const xAOD::HIEventShape* eshape) const -{ - //if( cl_in->type() == xAOD::Type::CaloCluster ) - //use static cast, derived type of IParticle checked explicitly upstream - - float E_cl=0; - float eta_cl=0; - float phi_cl=0; - - const float eta0=cl->eta0(); - const float phi0=cl->phi0(); - - float mod=modulator->getModulation(phi0, eshape); - - std::vector<float> E_sample(CaloSampling::Unknown,0); - uint32_t samplingPattern=0; - //unsigned int eta_phi_index=HICaloCellHelper::FindEtaPhiBin(cl->eta0(),cl->phi0()); - xAOD::CaloCluster::cell_iterator cellIterEnd = cl->cell_end(); - for(xAOD::CaloCluster::cell_iterator cellIter=cl->cell_begin(); cellIter != cellIterEnd; cellIter++ ) - { - CxxUtils::prefetchNext(cellIter, cellIterEnd); - - unsigned int sample = (CaloSampling::CaloSample) (*cellIter)->caloDDE()->getSampling(); - samplingPattern |= (0x1U<<sample); - float eta=(*cellIter)->eta(); - float phi=(*cellIter)->phi(); - - float nCells=index->getShape(eta0,sample,shape)->nCells(); - float rho=0; - if(nCells!=0.) rho=index->getShape(eta0,sample,shape)->rho()/nCells; - - rho*=mod; - float geoWeight=cellIter.weight(); - float cell_E_w=(*cellIter)->energy()*geoWeight; - cell_E_w-=rho*HICaloCellHelper::GetAreaEtaPhi(*cellIter)*geoWeight*std::cosh(eta0); - - E_cl+=cell_E_w; - eta_cl+=cell_E_w*eta; - phi_cl+=cell_E_w*phi; - - E_sample[sample]+=cell_E_w; - } - - if(E_cl!=0.) - { - eta_cl/=E_cl; - phi_cl/=E_cl; - } - //rare case E_cl==0 is also handled by setSubtractedEtaPhi - float E_unsubtr=cl->e(HIJetRec::unsubtractedClusterState()); - setSubtractedEtaPhi(E_cl,eta_cl,phi_cl,eta0,phi0,E_cl/E_unsubtr); - - float ET_cl=E_cl/std::cosh(eta_cl); - xAOD::IParticle::FourMom_t subtr_mom; - subtr_mom.SetPxPyPzE(ET_cl*std::cos(phi_cl),ET_cl*std::sin(phi_cl),ET_cl*std::sinh(eta_cl),E_cl); - HIJetRec::setClusterP4(subtr_mom,cl,HIJetRec::subtractedClusterState()); - - cl->setSamplingPattern(samplingPattern); - for(unsigned int isample=0; isample < E_sample.size(); isample++) - { - if( samplingPattern & (0x1U << isample) ) - { - float current_energy=E_sample.at(isample); - xAOD::CaloCluster::CaloSample s=static_cast<xAOD::CaloCluster::CaloSample>(isample); - cl->setEnergy(s,current_energy); - } - } -} - +/* + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration +*/ + +#include "HIJetCellSubtractorTool.h" +#include "HICaloCellHelper.h" +#include "CxxUtils/prefetch.h" +#include "xAODCaloEvent/CaloCluster.h" +#include "HIEventUtils/HIEventShapeIndex.h" +#include "HIJetRec/HIJetRecDefs.h" +#include "FourMomUtils/xAODP4Helpers.h" +//forward class decl in base class. +#include "HIJetRec/IHIUEModulatorTool.h" + +HIJetCellSubtractorTool::HIJetCellSubtractorTool(const std::string& myname) : HIJetSubtractorToolBase(myname) +{ + +} + +void HIJetCellSubtractorTool::subtract(xAOD::IParticle::FourMom_t& subtr_mom, const xAOD::IParticle* cl_in, const xAOD::HIEventShapeContainer* shape, const HIEventShapeIndex* index, const ToolHandle<IHIUEModulatorTool>& modulator, const xAOD::HIEventShape* eshape) const +{ + //if( cl_in->type() == xAOD::Type::CaloCluster ) + //use static cast, derived type of IParticle checked explicitly upstream + const xAOD::CaloCluster* cl=static_cast<const xAOD::CaloCluster*>(cl_in); + float E_cl=0; + float eta_cl=0; + float phi_cl=0; + + const float eta0=cl->eta0(); + const float phi0=cl->phi0(); + + float mod=modulator->getModulation(phi0, eshape); + + //unsigned int eta_phi_index=HICaloCellHelper::FindEtaPhiBin(cl->eta0(),cl->phi0()); + xAOD::CaloCluster::const_cell_iterator cellIterEnd = cl->cell_end(); + for(xAOD::CaloCluster::const_cell_iterator cellIter=cl->cell_begin(); cellIter != cellIterEnd; cellIter++ ) + { + CxxUtils::prefetchNext(cellIter, cellIterEnd); + + unsigned int sample = (CaloSampling::CaloSample) (*cellIter)->caloDDE()->getSampling(); + float eta=(*cellIter)->eta(); + float phi=(*cellIter)->phi(); + + float nCells=index->getShape(eta0,sample,shape)->nCells(); + float rho=0; + if(nCells!=0.) rho=index->getShape(eta0,sample,shape)->rho()/nCells; + rho*=mod; + float geoWeight=cellIter.weight(); + float cell_E_w=(*cellIter)->energy()*geoWeight; + cell_E_w-=rho*HICaloCellHelper::getAreaEtaPhi(*cellIter)*geoWeight*std::cosh(eta0); + + + E_cl+=cell_E_w; + eta_cl+=cell_E_w*eta; + phi_cl+=cell_E_w*phi; + + } + if(E_cl!=0.) + { + eta_cl/=E_cl; + phi_cl/=E_cl; + } + //rare case E_cl==0 is also handled by setSubtractedEtaPhi + float E_unsubtr=cl->e(HIJetRec::unsubtractedClusterState()); + setSubtractedEtaPhi(E_cl,eta_cl,phi_cl +,eta0,phi0,E_cl/E_unsubtr); + float ET_cl=E_cl/std::cosh(eta_cl); + subtr_mom.SetPxPyPzE(ET_cl*std::cos(phi_cl),ET_cl*std::sin(phi_cl),ET_cl*std::sinh(eta_cl),E_cl); +} + +void HIJetCellSubtractorTool::updateUsingCluster(xAOD::HIEventShapeContainer* shape, const HIEventShapeIndex* index, const xAOD::CaloCluster* cl) const +{ + float eta0=cl->eta0(); + float phi0=cl->phi0(); + + xAOD::CaloCluster::const_cell_iterator cellIterEnd = cl->cell_end(); + for(xAOD::CaloCluster::const_cell_iterator cellIter=cl->cell_begin(); cellIter != cellIterEnd; cellIter++ ) + { + CxxUtils::prefetchNext(cellIter, cellIterEnd); + UpdateShape(shape,index,*cellIter,cellIter.weight(),eta0,phi0,true); + } +} + +void HIJetCellSubtractorTool::UpdateShape(xAOD::HIEventShapeContainer* shape, const HIEventShapeIndex* index, const CaloCell* theCell, float geoWeight, float eta0, float phi0, bool isNeg) const +{ + float sgn=(isNeg) ? -1 : 1; + + int layer = theCell->caloDDE()->getSampling(); + float cell_et = theCell->et(); + + unsigned int iSlice=index->getIndex(eta0,layer); + + + xAOD::HIEventShape* slice=shape->at(iSlice); + //update members + slice->setNCells(slice->nCells()+sgn); + slice->setEt(slice->et()+sgn*cell_et*geoWeight); + float area=HICaloCellHelper::getAreaEtaPhi(theCell); + float rho=0; + if(area!=0.) rho=cell_et/area; + slice->setArea(slice->area() + sgn*area*geoWeight); + slice->setRho(slice->rho() + sgn*rho); + + for(unsigned int ih=0; ih<shape->at(iSlice)->etCos().size(); ih++) + { + float ih_f=ih+1; + float tmp_cos = shape->at(iSlice)->etCos().at(ih); + shape->at(iSlice)->etCos()[ih] = tmp_cos + cell_et*cos(ih_f*phi0)*geoWeight; + + float tmp_sin = shape->at(iSlice)->etSin().at(ih); + shape->at(iSlice)->etSin()[ih] = tmp_sin + cell_et*sin(ih_f*phi0)*geoWeight; + } + +} + +void HIJetCellSubtractorTool::subtractWithMoments(xAOD::CaloCluster* cl, const xAOD::HIEventShapeContainer* shape, const HIEventShapeIndex* index, const ToolHandle<IHIUEModulatorTool>& modulator, const xAOD::HIEventShape* eshape) const +{ + //if( cl_in->type() == xAOD::Type::CaloCluster ) + //use static cast, derived type of IParticle checked explicitly upstream + + float E_cl=0; + float eta_cl=0; + float phi_cl=0; + + const float eta0=cl->eta0(); + const float phi0=cl->phi0(); + + float mod=modulator->getModulation(phi0, eshape); + + //declaring quantities to be summed during cell loop + //using same variable names as original implementation in HIEventShapeFillerTool + float etot2=0; //sum of the weights, in this case weights are |E| + float er2=0; //sum of weight x moment, in this case moments are magnitudes of cell coordinate three vectors + + std::vector<float> E_sample(CaloSampling::Unknown,0); + uint32_t samplingPattern=0; + //unsigned int eta_phi_index=HICaloCellHelper::FindEtaPhiBin(cl->eta0(),cl->phi0()); + xAOD::CaloCluster::cell_iterator cellIterEnd = cl->cell_end(); + for(xAOD::CaloCluster::cell_iterator cellIter=cl->cell_begin(); cellIter != cellIterEnd; cellIter++ ) + { + CxxUtils::prefetchNext(cellIter, cellIterEnd); + + unsigned int sample = (CaloSampling::CaloSample) (*cellIter)->caloDDE()->getSampling(); + samplingPattern |= (0x1U<<sample); + float eta=(*cellIter)->eta(); + float phi=(*cellIter)->phi(); + + float nCells=index->getShape(eta0,sample,shape)->nCells(); + float rho=0; + if(nCells!=0.) rho=index->getShape(eta0,sample,shape)->rho()/nCells; + + rho*=mod; + float geoWeight=cellIter.weight(); + float cell_E_w=(*cellIter)->energy()*geoWeight; + cell_E_w-=rho*HICaloCellHelper::getAreaEtaPhi(*cellIter)*geoWeight*std::cosh(eta0); + + E_cl+=cell_E_w; + eta_cl+=cell_E_w*eta; + phi_cl+=cell_E_w*phi; + + E_sample[sample]+=cell_E_w; + + float abs_weight=std::abs(cell_E_w); + float cell_x=(*cellIter)->x(); + float cell_y=(*cellIter)->y(); + float cell_z=(*cellIter)->z(); + etot2+=abs_weight; + er2+=std::sqrt(cell_x*cell_x+cell_y*cell_y+cell_z*cell_z)*abs_weight; + + + } + if(E_cl!=0.) + { + eta_cl/=E_cl; + phi_cl/=E_cl; + } + //rare case E_cl==0 is also handled by setSubtractedEtaPhi + float E_unsubtr=cl->e(HIJetRec::unsubtractedClusterState()); + setSubtractedEtaPhi(E_cl,eta_cl,phi_cl,eta0,phi0,E_cl/E_unsubtr); + + float ET_cl=E_cl/std::cosh(eta_cl); + xAOD::IParticle::FourMom_t subtr_mom; + subtr_mom.SetPxPyPzE(ET_cl*std::cos(phi_cl),ET_cl*std::sin(phi_cl),ET_cl*std::sinh(eta_cl),E_cl); + HIJetRec::setClusterP4(subtr_mom,cl,HIJetRec::subtractedClusterState()); + + cl->setSamplingPattern(samplingPattern); + for(unsigned int isample=0; isample < E_sample.size(); isample++) + { + if( samplingPattern & (0x1U << isample) ) + { + float current_energy=E_sample.at(isample); + xAOD::CaloCluster::CaloSample s=static_cast<xAOD::CaloCluster::CaloSample>(isample); + cl->setEnergy(s,current_energy); + } + } + + float cm=0.; + if(etot2!=0.) cm=er2/etot2; + + //attach the moment to the cluster + if(cl->isAvailable<float>("HIMag")) cl->auxdata<float>("HIMag")=cm; + else cl->insertMoment(xAOD::CaloCluster::CENTER_MAG,cm); +} diff --git a/Reconstruction/HeavyIonRec/HIJetRec/src/HIJetCellSubtractorTool.h b/Reconstruction/HeavyIonRec/HIJetRec/src/HIJetCellSubtractorTool.h index 1518e9a78fc53670964666e324f4543756f507c1..47899c6f3a44867abefde2b108ee21c3df4a1d69 100644 --- a/Reconstruction/HeavyIonRec/HIJetRec/src/HIJetCellSubtractorTool.h +++ b/Reconstruction/HeavyIonRec/HIJetRec/src/HIJetCellSubtractorTool.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ // HIJetCellSubtractorTool.h @@ -17,7 +17,7 @@ /// Class used by HIClusterSubtraction and HIJetConstituentSubtractionTool /// to provide kinematics of a cluster after subtraction given an event shape. /// This version of the tool navigates back to the cells. -/// +/// //////////////////////////////////////////////////////////////////////////////// @@ -38,12 +38,11 @@ class HIJetCellSubtractorTool : public HIJetSubtractorToolBase /// First argument is reference to four vector that is updated to reflect /// the subtracted kinematics of the IParticle passed in the second arg /// Method expects cl_in to be a cluster - virtual void Subtract(xAOD::IParticle::FourMom_t& subtr_mom, const xAOD::IParticle* cl_in, const xAOD::HIEventShapeContainer* shape, const HIEventShapeIndex* index, const ToolHandle<IHIUEModulatorTool>& modulator, const xAOD::HIEventShape* eshape) const override; - - virtual void UpdateUsingCluster(xAOD::HIEventShapeContainer* shape, const HIEventShapeIndex* index, const xAOD::CaloCluster* cl) const override; + virtual void subtract(xAOD::IParticle::FourMom_t& subtr_mom, const xAOD::IParticle* cl_in, const xAOD::HIEventShapeContainer* shape, const HIEventShapeIndex* index, const ToolHandle<IHIUEModulatorTool>& modulator, const xAOD::HIEventShape* eshape) const override; + virtual void subtractWithMoments(xAOD::CaloCluster* cl, const xAOD::HIEventShapeContainer* shape, const HIEventShapeIndex* index, const ToolHandle<IHIUEModulatorTool>& modulator, const xAOD::HIEventShape* eshape) const override; + virtual void updateUsingCluster(xAOD::HIEventShapeContainer* shape, const HIEventShapeIndex* index, const xAOD::CaloCluster* cl) const override; - virtual void SubtractWithMoments(xAOD::CaloCluster* cl, const xAOD::HIEventShapeContainer* shape, const HIEventShapeIndex* index, const ToolHandle<IHIUEModulatorTool>& modulator, const xAOD::HIEventShape* eshape) const override; private: void UpdateShape(xAOD::HIEventShapeContainer* shape, const HIEventShapeIndex* index, const CaloCell* theCell, float geoWeight, float eta0, float phi0, bool isNeg) const; diff --git a/Reconstruction/HeavyIonRec/HIJetRec/src/HISubtractedCellMakerTool.cxx b/Reconstruction/HeavyIonRec/HIJetRec/src/HISubtractedCellMakerTool.cxx index c9190e714e9e163956c3c89cca5ad5e2b4c403eb..04b80f0cd74240e888feea240d998353f7be8699 100644 --- a/Reconstruction/HeavyIonRec/HIJetRec/src/HISubtractedCellMakerTool.cxx +++ b/Reconstruction/HeavyIonRec/HIJetRec/src/HISubtractedCellMakerTool.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ #include "HISubtractedCellMakerTool.h" @@ -10,6 +10,9 @@ #include "HIEventUtils/HIEventShapeMap.h" #include "HIEventUtils/HICaloRange.h" +#include "StoreGate/ReadHandle.h" +#include "StoreGate/WriteHandle.h" + #include <algorithm> //********************************************************************** @@ -17,14 +20,13 @@ HISubtractedCellMakerTool::HISubtractedCellMakerTool(const std::string& type, const std::string& name, const IInterface* parent) : AthAlgTool(type, name, parent) { declareInterface<ICaloCellMakerTool>(this); - declareProperty("EventShapeKey",m_event_shape_key); - declareProperty("Modulator",m_modulator_tool); } //********************************************************************** StatusCode HISubtractedCellMakerTool::initialize() { + ATH_CHECK( m_eventShapeKey.initialize() ); return StatusCode::SUCCESS; } @@ -33,30 +35,34 @@ StatusCode HISubtractedCellMakerTool::process (CaloCellContainer* theCells, { if (ctx.slot() > 1) { ATH_MSG_ERROR("This tool hasn't been converted for MT."); - return StatusCode::FAILURE; + return StatusCode::FAILURE; } const xAOD::HIEventShapeContainer* shape=0; - CHECK(evtStore()->retrieve(shape,m_event_shape_key)); - const HIEventShapeIndex* index=HIEventShapeMap::getIndex(m_event_shape_key); - if(index==nullptr) + + SG::ReadHandle<xAOD::HIEventShapeContainer> readHandleEvtShape ( m_eventShapeKey , ctx); + shape = readHandleEvtShape.cptr(); + + const HIEventShapeIndex* index=HIEventShapeMap::getIndex(m_eventShapeKey.key()); + if(index==nullptr) { - ATH_MSG_ERROR("Could not retrieve HIEventShapeIndex for key " << m_event_shape_key); - return StatusCode::FAILURE; + ATH_MSG_ERROR("Could not retrieve HIEventShapeIndex for key " << m_eventShapeKey.key()); + return StatusCode::FAILURE; } if(shape->size()==0) { - ATH_MSG_WARNING("HIEventShapeContainer " << m_event_shape_key << " exists but has zero size"); + ATH_MSG_WARNING("HIEventShapeContainer " << m_eventShapeKey.key() << " exists but has zero size"); return StatusCode::SUCCESS; } - // FIXME: m_modulator_tool->retrieveShape() is non-const. + // FIXME: m_modulatorTool->retrieveShape() is non-const. // It should be made const in order to be able to safely call it from here. // However, this method already needs updating to work in MT (and is checked // above), so just use a const_cast for now to allow this to compile // when ToolHandle restrictions are enabled. - IHIUEModulatorTool* modtool_nc = const_cast<IHIUEModulatorTool*> (m_modulator_tool.get()); + + IHIUEModulatorTool* modtool_nc = const_cast<IHIUEModulatorTool*> (m_modulatorTool.get()); CHECK(modtool_nc->retrieveShape()); for(auto pCell : *theCells) @@ -75,20 +81,13 @@ StatusCode HISubtractedCellMakerTool::process (CaloCellContainer* theCells, } } - // if( bin >= shape->size() ) - // { - // ATH_MSG_ERROR("Requested bin for cell " << bin << " is out of range " shape->size()); - // return StatusCode::ERROR; - // } - - const xAOD::HIEventShape* s=shape->at(bin); + const xAOD::HIEventShape* s=shape->at(bin); float nCells=s->nCells(); float rho=0; if(nCells!=0.) rho=s->rho()/nCells; - rho*=m_modulator_tool->getModulation(phi); - float ue=rho*HICaloCellHelper::GetAreaEtaPhi(pCell)*std::cosh(eta); + rho*=m_modulatorTool->getModulation(phi); + float ue=rho*HICaloCellHelper::getAreaEtaPhi(pCell)*std::cosh(eta); pCell->setEnergy(pCell->energy()-ue); } return StatusCode::SUCCESS; } - diff --git a/Reconstruction/HeavyIonRec/HIJetRec/src/HISubtractedCellMakerTool.h b/Reconstruction/HeavyIonRec/HIJetRec/src/HISubtractedCellMakerTool.h index fca503f128b67904f6919519819ad61515e914da..cfd255c9eba6b466b6ada2e2407ca9ff47fc5e89 100644 --- a/Reconstruction/HeavyIonRec/HIJetRec/src/HISubtractedCellMakerTool.h +++ b/Reconstruction/HeavyIonRec/HIJetRec/src/HISubtractedCellMakerTool.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ #ifndef HIJETREC_HISUBTRACTEDCELLMAKERTOOL_H @@ -8,11 +8,13 @@ #include "AthenaBaseComps/AthAlgTool.h" #include "CaloInterface/ICaloCellMakerTool.h" #include "HIJetRec/IHIUEModulatorTool.h" +#include "xAODHIEvent/HIEventShapeContainer.h" #include "AsgTools/ToolHandle.h" #include <string> #include <vector> +#include "StoreGate/ReadHandleKey.h" class HISubtractedCellMakerTool : public AthAlgTool, virtual ICaloCellMakerTool { @@ -23,15 +25,12 @@ public: virtual StatusCode initialize() override; virtual StatusCode process (CaloCellContainer* theCellContainer, const EventContext& ctx) const override; - private: - std::string m_event_shape_key; - ToolHandle<IHIUEModulatorTool> m_modulator_tool; - + SG::ReadHandleKey<xAOD::HIEventShapeContainer> m_eventShapeKey { this, "EventShapeKey", "HIEventShapeContainer", "Event Shape Key"}; + ToolHandle<IHIUEModulatorTool> m_modulatorTool { this, "Modulator", "HIUEModulatorTool", "Handle to HIUEModulatorTool"}; }; #endif - diff --git a/Reconstruction/HeavyIonRec/HIMonitoring/HIMonitoring/HIMonitoringPhotonsTool.h b/Reconstruction/HeavyIonRec/HIMonitoring/HIMonitoring/HIMonitoringPhotonsTool.h index fd9ce586d4f7cb74af81883b1f0ff2de9fb48b04..19dd986d01be086ae0a71fe5b47965d851b0e6ca 100755 --- a/Reconstruction/HeavyIonRec/HIMonitoring/HIMonitoring/HIMonitoringPhotonsTool.h +++ b/Reconstruction/HeavyIonRec/HIMonitoring/HIMonitoring/HIMonitoringPhotonsTool.h @@ -35,7 +35,10 @@ private: int m_FCalEt_nbins; float m_FCalEt_low; float m_FCalEt_high; - + //Cherry-picking commit 345b289e on 21.0 + float m_FCalEt_peripheral; + float m_FCalEt_central; + ////////// int m_PhotonPt_nbins; float m_PhotonPt_low; float m_PhotonPt_high; diff --git a/Reconstruction/HeavyIonRec/HIMonitoring/src/HIMonitoringElectronsTool.cxx b/Reconstruction/HeavyIonRec/HIMonitoring/src/HIMonitoringElectronsTool.cxx index 576745fe37dbeadb1b03c1c905dca006d863678f..235df922370fd76e17e9688d849f07a75d745fcc 100755 --- a/Reconstruction/HeavyIonRec/HIMonitoring/src/HIMonitoringElectronsTool.cxx +++ b/Reconstruction/HeavyIonRec/HIMonitoring/src/HIMonitoringElectronsTool.cxx @@ -18,13 +18,20 @@ HIMonitoringElectronsTool:: m_FCalEt_A = 0; m_FCalEt_C = 0; - m_FCalEt_nbins = 95; - m_low_FCalEt = -0.15; - m_high_FCalEt = 0.8; - - m_FCalEt_oneSide_nbins = 50; - m_low_FCalEt_oneSide = -0.1; - m_high_FCalEt_oneSide = 0.4; + //From Dominik Derendarz - manual cherry-picking of 345b289e + declareProperty( "FCalEt_nbins", m_FCalEt_nbins=96 ); + declareProperty( "lowFCalEt", m_low_FCalEt=-0.16 ); + declareProperty( "highFCalEt", m_high_FCalEt=0.8 ); + m_FCalEt_oneSide_nbins = m_FCalEt_nbins/2; + m_low_FCalEt_oneSide = m_low_FCalEt/2.0; + m_high_FCalEt_oneSide = m_high_FCalEt/2.0; + //In master, before the cherry picking, was: + //m_FCalEt_nbins = 95; + //m_low_FCalEt = -0.15; + //m_high_FCalEt = 0.8; + //m_FCalEt_oneSide_nbins = 50; + //m_low_FCalEt_oneSide = -0.1; + //m_high_FCalEt_oneSide = 0.4; m_eta_nbins = 60; m_low_eta = -3.0; diff --git a/Reconstruction/HeavyIonRec/HIMonitoring/src/HIMonitoringEventShapeTool.cxx b/Reconstruction/HeavyIonRec/HIMonitoring/src/HIMonitoringEventShapeTool.cxx index 91cad7f100df5b776b5fcb4632c3087bcdcee140..41a27908741b17dca2fe691057d970ebb0c66efd 100755 --- a/Reconstruction/HeavyIonRec/HIMonitoring/src/HIMonitoringEventShapeTool.cxx +++ b/Reconstruction/HeavyIonRec/HIMonitoring/src/HIMonitoringEventShapeTool.cxx @@ -13,25 +13,26 @@ #include "LWHists/TProfile_LW.h" HIMonitoringEventShapeTool:: - HIMonitoringEventShapeTool(const std::string& type, const std::string& name, - const IInterface* parent) : ManagedMonitorToolBase(type, name, parent) { - m_FCalEt = 0; - m_FCalEt_A = 0; - m_FCalEt_C = 0; - m_ZDC_HG = 0; - m_ZDC_LG = 0; - m_h_FCalEt = 0; - m_h_FCalEt_vs_eta = 0; - m_FCalEt_nbins = 95; - m_low_FCalEt = -0.15; - m_high_FCalEt = 0.8; - m_nbins_phi = 64; - m_nbins_eta = s_num_of_eta_bins; - m_eta_range = 5.0; - m_Pi = 3.14159265359; - declareProperty("ZDCmon", m_ZDCmon = true); - declareProperty("ESmon", m_ESmon = true); - declareProperty("FCalEt_eta_hist_cut", m_FCalEt_eta_hist_cut = 0.05); // in TeV +HIMonitoringEventShapeTool( const std::string & type, const std::string & name, + const IInterface* parent ): ManagedMonitorToolBase( type, name, parent ) +{ + m_FCalEt=0; + m_FCalEt_A=0; + m_FCalEt_C=0; + m_ZDC_HG=0; + m_ZDC_LG=0; + m_h_FCalEt=0; + m_h_FCalEt_vs_eta=0; + m_nbins_phi=64; + m_nbins_eta=s_num_of_eta_bins; + m_eta_range=5.0; + m_Pi = 3.14159265359; + declareProperty( "ZDCmon", m_ZDCmon=true); + declareProperty( "ESmon", m_ESmon=true); + declareProperty( "FCalEt_eta_hist_cut", m_FCalEt_eta_hist_cut=0.05); // in TeV + declareProperty( "FCalEt_nbins", m_FCalEt_nbins=95); + declareProperty( "lowFCalEt", m_low_FCalEt=-0.15); + declareProperty( "highFCalEt", m_high_FCalEt=0.8); } HIMonitoringEventShapeTool::~HIMonitoringEventShapeTool() { @@ -360,16 +361,15 @@ void HIMonitoringEventShapeTool::bookZDC_hist() { } void HIMonitoringEventShapeTool::getZDC(const xAOD::TrigT2ZdcSignalsContainer* TrigZdc_p) { - double zdc_energies[2] = { - 0.0, 0.0 - }; // {High gain, Low gain} + + double zdc_energies[2] = { 0.0, 0.0 }; // {High gain, Low gain} int size = TrigZdc_p->size(); for (int i = 0; i < size; i++) { const xAOD::TrigT2ZdcSignals* zdc = TrigZdc_p->at(i); std::vector<float> triggerEnergies = zdc->triggerEnergies(); - for (int j = 0; j < (int) triggerEnergies.size(); j++) - zdc_energies[i] += triggerEnergies.at(j); + for (auto & zdc_towers : triggerEnergies) + zdc_energies[i]+= zdc_towers; } m_ZDC_HG = zdc_energies[0] * 1e-3; diff --git a/Reconstruction/HeavyIonRec/HIMonitoring/src/HIMonitoringPhotonsTool.cxx b/Reconstruction/HeavyIonRec/HIMonitoring/src/HIMonitoringPhotonsTool.cxx index e225ebd41525aafd6a874cba3a0bfa94da044749..aa7c35d4eab1448a4bbfc3ab3d01ac6b3c89ab91 100755 --- a/Reconstruction/HeavyIonRec/HIMonitoring/src/HIMonitoringPhotonsTool.cxx +++ b/Reconstruction/HeavyIonRec/HIMonitoring/src/HIMonitoringPhotonsTool.cxx @@ -7,10 +7,14 @@ #include "AthenaMonitoring/AthenaMonManager.h" #include "HIMonitoring/HIMonitoringPhotonsTool.h" + #include "ElectronPhotonSelectorTools/AsgPhotonIsEMSelector.h" #include "ElectronPhotonSelectorTools/egammaPIDdefs.h" + #include "xAODHIEvent/HIEventShapeContainer.h" #include "xAODEgamma/PhotonContainer.h" + +#include "LWHists/TH1D_LW.h" #include "LWHists/TH2D_LW.h" HIMonitoringPhotonsTool:: @@ -18,9 +22,16 @@ HIMonitoringPhotonsTool:: const IInterface* parent) : ManagedMonitorToolBase(type, name, parent) { m_FCalEt = 0; - m_FCalEt_nbins = 50; - m_FCalEt_low = -50; - m_FCalEt_high = 200; + //From Dominik Derendarz - manual cherry-picking of 345b289e + declareProperty( "FCalEt_nbins", m_FCalEt_nbins=95); + declareProperty( "lowFCalEt", m_FCalEt_low=-0.15); + declareProperty( "highFCalEt", m_FCalEt_high=0.8); + declareProperty( "FCalEt_peripheral", m_FCalEt_peripheral=20); + declareProperty( "FCalEt_central", m_FCalEt_central=50); + //In master, before the cherry picking, was: + //m_FCalEt_nbins = 50; + //m_FCalEt_low = -50; + //m_FCalEt_high = 200; m_PhotonPt_nbins = 50; m_PhotonPt_low = 0; @@ -194,7 +205,9 @@ StatusCode HIMonitoringPhotonsTool::fillHistograms() { m_h_photon_fcal_etcone30_ptCut->Fill(m_FCalEt, etcone30); m_h_photon_fcal_etcone40_ptCut->Fill(m_FCalEt, etcone40); - if (m_FCalEt < 20) { + //In master, before the cherry picking, was: + //if (m_FCalEt < 20) { + if (m_FCalEt < m_FCalEt_peripheral) { m_h_photon_pt_etcone40_fcal0->Fill(pt, etcone40); m_h_photon_etcone20_ptCut_fcal0->Fill(etcone20); @@ -205,7 +218,8 @@ StatusCode HIMonitoringPhotonsTool::fillHistograms() { if (loose_MC15) m_h_photon_etcone30_ptCut_fcal0_loose->Fill(etcone30); if (tight_MC15) m_h_photon_etcone30_ptCut_fcal0_tight->Fill(etcone30); } - if (m_FCalEt > 20 && m_FCalEt < 50) { + //if (m_FCalEt > 20 && m_FCalEt < 50) { + if (m_FCalEt > m_FCalEt_peripheral && m_FCalEt < m_FCalEt_central) { m_h_photon_pt_etcone40_fcal1->Fill(pt, etcone40); m_h_photon_etcone20_ptCut_fcal1->Fill(etcone20); @@ -216,7 +230,8 @@ StatusCode HIMonitoringPhotonsTool::fillHistograms() { if (loose_MC15) m_h_photon_etcone30_ptCut_fcal1_loose->Fill(etcone30); if (tight_MC15) m_h_photon_etcone30_ptCut_fcal1_tight->Fill(etcone30); } - if (m_FCalEt > 50) { + //if (m_FCalEt > 50) { + if (m_FCalEt > m_FCalEt_central) { m_h_photon_pt_etcone40_fcal2->Fill(pt, etcone40); m_h_photon_etcone20_ptCut_fcal2->Fill(etcone20); diff --git a/Reconstruction/HeavyIonRec/HIRecExample/python/HIRecExampleFlags.py b/Reconstruction/HeavyIonRec/HIRecExample/python/HIRecExampleFlags.py index 09634893224d53d5e87adbc840057a7d0427ac42..e9a77f4ce759028190353734a63e20be9cb0b686 100644 --- a/Reconstruction/HeavyIonRec/HIRecExample/python/HIRecExampleFlags.py +++ b/Reconstruction/HeavyIonRec/HIRecExample/python/HIRecExampleFlags.py @@ -44,6 +44,13 @@ class doHIegamma(JobProperty): allowedTypes = ['bool'] StoredValue = True +class doHIAODFix(JobProperty): + """ Run AOD fix + """ + statusOn = True + allowedTypes = ['bool'] + StoredValue = False + class doHIJetAnalysis(JobProperty): """ Run heavy ion jet analysis """ @@ -109,6 +116,7 @@ list_jobproperties = [ doHIGlobal, doHIJetRec, doHIegamma, + doHIAODFix, doHIJetAnalysis, doHIEventView, doValidation, diff --git a/Reconstruction/HeavyIonRec/HIRecExample/share/HIRec_jobOptions.py b/Reconstruction/HeavyIonRec/HIRecExample/share/HIRec_jobOptions.py index ed294efcc1c30ec5549467f6b16e435c2d7e81d7..1497a4374a270a22cc47e24093474b98c4e52ab5 100755 --- a/Reconstruction/HeavyIonRec/HIRecExample/share/HIRec_jobOptions.py +++ b/Reconstruction/HeavyIonRec/HIRecExample/share/HIRec_jobOptions.py @@ -12,7 +12,7 @@ print 'IN HEAVY ION REC' # include("HIRecExample/HICalibrationsCoolFolders.py") # from AthenaCommon.DetFlags import DetFlags -# from HIRecExample.HIRecExampleFlags import jobproperties +from HIRecExample.HIRecExampleFlags import jobproperties # if jobproperties.HIRecExampleFlags.doHIEventView: # include( "HIRecExample/HIEventView_jobOptions.py" ) @@ -23,11 +23,14 @@ if rec.doESD: print "Including HI algorithms in ESD step" if jobproperties.HIRecExampleFlags.doHIGlobal: include( "HIGlobal/HIGlobal_jobOptions.py" ) - - if (jobproperties.HIRecExampleFlags.doHIJetRec and DetFlags.haveRIO.Calo_on() and rec.triggerStream() != 'CosmicCalo') : + + if (jobproperties.HIRecExampleFlags.doHIJetRec and \ + DetFlags.haveRIO.Calo_on() and \ + rec.triggerStream() != 'CosmicCalo') : include( "HIJetRec/HIJetRec_jobOptions.py" ) - if jobproperties.HIRecExampleFlags.doHIegamma : + if jobproperties.HIRecExampleFlags.doHIegamma : include ("HIJetRec/HIegamma_jobOptions.py"); + # else : # jobproperties.HIRecExampleFlags.doHIJetRec=False @@ -35,3 +38,8 @@ if rec.doESD: # include( "HIValidation/HIValidation_jobOptions.py") +if (jobproperties.HIRecExampleFlags.doHIJetRec and \ + DetFlags.haveRIO.Calo_on() and \ + rec.triggerStream() != 'CosmicCalo') : + if jobproperties.HIRecExampleFlags.doHIAODFix : + include( "HIJetRec/HIJetRec_AODFix_207.py" ); diff --git a/Reconstruction/HeavyIonRec/HIRecExample/share/heavyion_flagsESD.py b/Reconstruction/HeavyIonRec/HIRecExample/share/heavyion_flagsESD.py index 67d0eab96a92eaaa661f3768a43747c8615b4799..78f36f25135d485bad4eae2a8c11dd3a683cea82 100755 --- a/Reconstruction/HeavyIonRec/HIRecExample/share/heavyion_flagsESD.py +++ b/Reconstruction/HeavyIonRec/HIRecExample/share/heavyion_flagsESD.py @@ -31,8 +31,7 @@ if not jobproperties.HIRecExampleFlags.ppMode : from CaloRec.CaloRecFlags import jobproperties #need this eventually, but for now it breaks egamma isolation - #needed for now in rel. 21 for egamma reco - #jobproperties.CaloRecFlags.doCaloTopoCluster = False + jobproperties.CaloRecFlags.doCaloTopoCluster = False jobproperties.CaloRecFlags.doCaloEMTopoCluster = False jobproperties.CaloRecFlags.doCaloTopoTower = False # 2015 data, no pileup diff --git a/Reconstruction/HeavyIonRec/HIRecTPCnv/src/EtaPhiBinsCnv_p1.cxx b/Reconstruction/HeavyIonRec/HIRecTPCnv/src/EtaPhiBinsCnv_p1.cxx index a20c88dc815774723ef8ff9fc0d522ef377b514d..7ecb67c31a1d37838989a884f7ef1ec1073e2f04 100755 --- a/Reconstruction/HeavyIonRec/HIRecTPCnv/src/EtaPhiBinsCnv_p1.cxx +++ b/Reconstruction/HeavyIonRec/HIRecTPCnv/src/EtaPhiBinsCnv_p1.cxx @@ -26,10 +26,8 @@ PURPOSE: Transient/Persisten converter for EtaPhiBins class // RecTPCnv includes #include "HIRecTPCnv/EtaPhiBinsCnv_p1.h" -#if ROOT_VERSION_CODE >= ROOT_VERSION(5,15,1) #include <TBufferFile.h> #include <TROOT.h> -#endif /////////////////////////////////////////////////////////////////// // methods: @@ -46,11 +44,7 @@ void EtaPhiBinsCnv_p1::persToTrans( const EtaPhiBins_p1* pers, trans->m_EtaMax = pers->m_EtaMax; trans->m_NEtaBins = pers->m_NEtaBins; trans->m_NPhiBins = pers->m_NPhiBins; -#if ROOT_VERSION_CODE < ROOT_VERSION(5,15,1) - TBuffer b(TBuffer::kRead); -#else TBufferFile b(TBuffer::kRead); -#endif b.SetBuffer((void*)&(pers->m_h2vec[0]),pers->m_h2vec.size(),kFALSE); TH2F* h2 = (TH2F*) b.ReadObject(gROOT->GetClass("TH2F")); trans->m_H2 = *h2; @@ -76,11 +70,7 @@ void EtaPhiBinsCnv_p1::transToPers( const EtaPhiBins* trans, //trans->m_H2.Print(); msg << MSG::DEBUG << "Make TBuffer" << endmsg; -#if ROOT_VERSION_CODE < ROOT_VERSION(5,15,1) - TBuffer b(TBuffer::kWrite); -#else TBufferFile b(TBuffer::kWrite); -#endif msg << MSG::DEBUG << "Writing H2 into TBuffer" << endmsg; b.WriteObject(&trans->m_H2); char* buf = b.Buffer(); diff --git a/Reconstruction/Jet/JetCalibTools/JetCalibTools/JetCalibrationTool.h b/Reconstruction/Jet/JetCalibTools/JetCalibTools/JetCalibrationTool.h index 884b02f389549eab083c5d46e97c5d1d87356ff3..660a96793227be506973dc7089efd9ffb581c7dd 100644 --- a/Reconstruction/Jet/JetCalibTools/JetCalibTools/JetCalibrationTool.h +++ b/Reconstruction/Jet/JetCalibTools/JetCalibTools/JetCalibrationTool.h @@ -21,6 +21,7 @@ #include "xAODEventInfo/EventInfo.h" #include "xAODTracking/VertexContainer.h" #include "xAODEventShape/EventShape.h" +#include "StoreGate/ReadDecorHandleKey.h" // JetCalibTools includes #include "JetCalibTools/IJetCalibrationTool.h" @@ -91,6 +92,10 @@ private: SG::ReadHandleKey<xAOD::EventInfo> m_rhkEvtInfo; SG::ReadHandleKey<xAOD::EventShape> m_rhkRhoKey; SG::ReadHandleKey<xAOD::VertexContainer> m_rhkPV; + SG::ReadDecorHandleKey<xAOD::EventInfo> m_rdhkEvtInfo {this + ,"AveIntPerXKey" + ,"EventInfo.AveIntPerXDecor" + ,"Decoration for Average Interaction Per Crossing"}; //Variables for configuration std::string m_jetAlgo; diff --git a/Reconstruction/Jet/JetCalibTools/Root/JetCalibrationTool.cxx b/Reconstruction/Jet/JetCalibTools/Root/JetCalibrationTool.cxx index 9a755ae121ded076a9bb6591d3353b8a2a32ca27..9c6c239c7c751ad9ed0c7aa7bd7a72badbb236c6 100644 --- a/Reconstruction/Jet/JetCalibTools/Root/JetCalibrationTool.cxx +++ b/Reconstruction/Jet/JetCalibTools/Root/JetCalibrationTool.cxx @@ -13,6 +13,7 @@ // JetCalibTools includes #include "JetCalibTools/JetCalibrationTool.h" #include "PathResolver/PathResolver.h" +#include "StoreGate/ReadDecorHandle.h" // Constructors //////////////// @@ -69,6 +70,7 @@ StatusCode JetCalibrationTool::initialize() { // Initialise ReadHandle(s) ATH_CHECK( m_rhkEvtInfo.initialize() ); + ATH_CHECK( m_rdhkEvtInfo.initialize() ); if(m_rhkPV.empty()) { // No PV key: -- check if it is required if(m_doResidual) { @@ -430,9 +432,15 @@ StatusCode JetCalibrationTool::initializeEvent(JetEventInfo& jetEventInfo) const } // If we are applying the reisdual, then store mu - if (m_doResidual) - jetEventInfo.setMu( eventObj->averageInteractionsPerCrossing() ); - + if (m_doResidual) { + SG::ReadDecorHandle<xAOD::EventInfo,float> eventInfoDecor(m_rdhkEvtInfo); + if(!eventInfoDecor.isPresent()) { + ATH_MSG_ERROR("EventInfo decoration not available!"); + return StatusCode::FAILURE; + } + jetEventInfo.setMu( eventInfoDecor(0) ); + } + // If this is GSC, we need EventInfo to determine the PV to use // This is support for groups where PV0 is not the vertex of interest (H->gamgam, etc) if (m_doGSC) diff --git a/Reconstruction/Jet/JetRec/python/JetRecFlags.py b/Reconstruction/Jet/JetRec/python/JetRecFlags.py index 0568859e30900dd244d18dedae8ee80d29762421..d0ae00271fa4fb38ba4ec10c8d0db22014b3a422 100644 --- a/Reconstruction/Jet/JetRec/python/JetRecFlags.py +++ b/Reconstruction/Jet/JetRec/python/JetRecFlags.py @@ -39,14 +39,14 @@ class JetRecFlags(JobPropertyContainer): class Enabled(JobProperty): """ If false will prevent run of any Jet Alg """ - statusOn = True + statusOn = True allowedTypes = ['bool'] # type StoredValue = True # default value class debug(JobProperty): """ If > 0, debug (or higher) messages are written by jet tools. """ - statusOn = True + statusOn = True allowedTypes = ['int'] # type StoredValue = 0 # default value @@ -54,14 +54,14 @@ class useTruth(JobProperty): """ If true, truth is present and used in jet reconstruction. The status is set on in JetRecStandardToolManager. """ - statusOn = False + statusOn = False allowedTypes = ['bool'] # type StoredValue = True # default value class truthFlavorTags(JobProperty): """ List of flavor tags for truth tagging jets. """ - statusOn = True + statusOn = True allowedTypes = ['array'] # type StoredValue = ["BHadronsInitial", "BHadronsFinal", "BQuarksFinal", "CHadronsInitial", "CHadronsFinal", "CQuarksFinal", @@ -69,12 +69,12 @@ class truthFlavorTags(JobProperty): "WBosons", "ZBosons", "HBosons", "TQuarksFinal", "Partons", ] - + class useTopo(JobProperty): """ If true, topoclusters are present and used in jet reconstruction. The status is set on in JetRecStandardToolManager. """ - statusOn = False + statusOn = False allowedTypes = ['bool'] # type StoredValue = True # default value @@ -82,14 +82,14 @@ class useTracks(JobProperty): """ If true, tracks and vertices are present and used in jet reconstruction. The status is set on in JetRecStandardToolManager. """ - statusOn = False + statusOn = True allowedTypes = ['bool'] # type - StoredValue = True # default value + StoredValue = True # default value changed to False for Test by RL class useVertices(JobProperty): """ If true, vertices are present and used in pflow jet reconstruction. """ - statusOn = False + statusOn = False allowedTypes = ['bool'] # type StoredValue = True # default value @@ -97,7 +97,7 @@ class useMuonSegments(JobProperty): """ If true, muon segments are present and used in jet reconstruction. The status is set on in JetRecStandardToolManager. """ - statusOn = False + statusOn = False allowedTypes = ['bool'] # type StoredValue = True # default value @@ -105,7 +105,7 @@ class usePFlow(JobProperty): """ If true, pflow objects are present and used in jet reconstruction. The status is set in JetRecStandardToolManager. """ - statusOn = True + statusOn = True allowedTypes = ['bool'] # type StoredValue = True # default value @@ -113,42 +113,42 @@ class eventShapeTools(JobProperty): """ List of event shape tools that should be called to calculate rho. Allowed values are "emtopo", "lctopo", "emorig", "lcorig", "empflow", "emcpflow", "lcpflow". """ - statusOn = True + statusOn = True allowedTypes = ['None', 'list'] # type StoredValue = None # default value class useInDetTrackSelection(JobProperty): """ If true, the InDet track selection tool is used. """ - statusOn = True + statusOn = True allowedTypes = ['bool'] # type StoredValue = False # default value class useCells(JobProperty): """ If true, calo cells are accesible """ - statusOn = True + statusOn = True allowedTypes = ['bool'] # type StoredValue = False # default value class useCaloQualityTool(JobProperty): """ If true, the (slow) CaloQuality tool is used """ - statusOn = True + statusOn = True allowedTypes = ['bool'] # type StoredValue = True # default value class useBTagging(JobProperty): """ If true, then btagging is done when requested """ - statusOn = True + statusOn = True allowedTypes = ['bool'] # type StoredValue = False # default value class skipTools(JobProperty): """ List of modifier tools to exclude """ - statusOn = True + statusOn = True allowedTypes = ['list'] # type StoredValue = [] # default value @@ -156,42 +156,42 @@ class additionalTopoGetters(JobProperty): """ List of PseudoJet getters to add for Topo jets. E.g. to tag jets with track jets """ - statusOn = True + statusOn = True allowedTypes = ['list'] # type StoredValue = [] # default value class defaultCalibOpt(JobProperty): """ Calibration applied to topo jets during jet building. See JetRecCalibrationFinder. """ - statusOn = True + statusOn = True allowedTypes = ['str'] # type StoredValue = "" # default value class containerNamePrefix(JobProperty): """ Prefix for jet collection names """ - statusOn = True + statusOn = True allowedTypes = ['str'] # type StoredValue = "" # default value class separateJetAlgs(JobProperty): """ If true, find and build jet containers in separate alg. Used for debugging. """ - statusOn = True + statusOn = True allowedTypes = ['bool'] # type StoredValue = True # default value class timeJetToolRunner(JobProperty): """ Timing flag for JetToolRunner: 0 for no timing, 1 for some, 2 for detailed """ - statusOn = True + statusOn = True allowedTypes = ['int'] # type StoredValue = 0 # default value class timeJetRecTool(JobProperty): """ Timing flag for JetRecTool: 0 for no timing, 1 for some, 2 for detailed """ - statusOn = True + statusOn = True allowedTypes = ['int'] # type StoredValue = 0 # default value @@ -199,8 +199,8 @@ class jetAODList(JobProperty): """ The collections to be saved in (x)AOD files """ statusOn = True - allowedTypes = ['list'] - StoredValue = [] + allowedTypes = ['list'] + StoredValue = [] class useTrackVertexTool(JobProperty): """ Toggles whether to use track-vertex tool (only known client is currently pflow jet finding) diff --git a/Reconstruction/Jet/JetRec/python/JetToolSupport.py b/Reconstruction/Jet/JetRec/python/JetToolSupport.py index 1db409c70f088b4216381a628511c41b830e60c2..b9edbfc33c026f0b2b759a3bd1b3436f49c6a161 100644 --- a/Reconstruction/Jet/JetRec/python/JetToolSupport.py +++ b/Reconstruction/Jet/JetRec/python/JetToolSupport.py @@ -648,7 +648,7 @@ class JetToolManager: self.ptminFilter = ptminSave jetrec.Trigger = isTrigger or useTriggerStore jetrec.Timer = jetFlags.timeJetRecTool() - jetrec.ShallowCopy = shallow +### jetrec.ShallowCopy = shallow self += jetrec self.jetrecs += [jetrec] self.jetcons += [output] diff --git a/Reconstruction/Jet/JetRec/share/JetRecAlgTestCfg.py b/Reconstruction/Jet/JetRec/share/JetRecAlgTestCfg.py index 625f9d43943f832ecd14c8fe493ecd5925795282..d6e0f52dfe178d6e3f2723713e8a3e9cb6173cbb 100755 --- a/Reconstruction/Jet/JetRec/share/JetRecAlgTestCfg.py +++ b/Reconstruction/Jet/JetRec/share/JetRecAlgTestCfg.py @@ -123,7 +123,8 @@ def JetBuildAlgCfg(ConfigFlags,buildjetsname): # This should get its own dictionary. # Add a simple jet modifier to the JetRecAlg - jclsmoms = CompFactory.JetClusterMomentsTool("clsmoms") + jclsmoms = CompFactory.JetClusterMomentsTool("clsmoms", + JetContainer = buildjetsname) # Create the JetRecAlg, configure it to use the builder # using constructor syntax instead @@ -153,7 +154,8 @@ def JetCopyAlgCfg(ConfigFlags,buildjetsname,copyjetsname): jcopy.InputJets = buildjetsname # Add a simple jet modifier to the JetRecAlg - jclsmoms = CompFactory.JetClusterMomentsTool("clsmoms") + jclsmoms = CompFactory.JetClusterMomentsTool("clsmoms", + JetContainer = copyjetsname) # Create the JetRecAlg, configure it to use the copier # using constructor syntax instead diff --git a/Reconstruction/MissingETGoodness/MissingETGoodness/TEasyFormula.h b/Reconstruction/MissingETGoodness/MissingETGoodness/TEasyFormula.h index 0be3fc0195af0724ffb52a573296d2eb41ce1b5e..a013ac525fbbe8ffcfda2a3edde8f0d55ff7520a 100644 --- a/Reconstruction/MissingETGoodness/MissingETGoodness/TEasyFormula.h +++ b/Reconstruction/MissingETGoodness/MissingETGoodness/TEasyFormula.h @@ -68,9 +68,7 @@ namespace MET { ClassDef(TEasyFormula,0) -#if ROOT_VERSION_CODE >= ROOT_VERSION(6,0,0) enum { kDefinedVariable = 150 } ; -#endif }; } diff --git a/Reconstruction/RecExample/RecExCommon/share/RecExCommon_topOptions.py b/Reconstruction/RecExample/RecExCommon/share/RecExCommon_topOptions.py index 1e63efa2ada35b1db247fd21360ef2f6aaf95f9e..34f8662ce46150430ade760e08f84fcaaf5efcc9 100644 --- a/Reconstruction/RecExample/RecExCommon/share/RecExCommon_topOptions.py +++ b/Reconstruction/RecExample/RecExCommon/share/RecExCommon_topOptions.py @@ -592,8 +592,20 @@ if globalflags.InputFormat.is_bytestream(): pass pass -### Writing of mu values to xAOD::EventInfo is done in the converter step; -### It's no longer necessary to write it in the old EventInfo +### write mu values into xAOD::EventInfo +if rec.doESD() and rec.readRDO(): + if globalflags.DataSource()=='geant4': + include_muwriter = hasattr( condSeq, "xAODMaker::EventInfoCnvAlg" ) + else: + include_muwriter = jobproperties.Beam.beamType()=="collisions" and not athenaCommonFlags.isOnline() + + if include_muwriter: + try: + include ("LumiBlockComps/LumiBlockMuWriter_jobOptions.py") + except Exception: + treatException("Could not load LumiBlockMuWriter_jobOptions.py") + pass + pass if rec.doMonitoring(): try: diff --git a/Reconstruction/RecJobTransforms/share/skeleton.RDOtoRDOtrigger.py b/Reconstruction/RecJobTransforms/share/skeleton.RDOtoRDOtrigger.py index 30eec989ef50b61efa25dacf2c0ee93b3653f98f..0f56381a9df448391329c7fad48b3d273c491612 100644 --- a/Reconstruction/RecJobTransforms/share/skeleton.RDOtoRDOtrigger.py +++ b/Reconstruction/RecJobTransforms/share/skeleton.RDOtoRDOtrigger.py @@ -260,6 +260,9 @@ StreamRDO.ItemList += [ "PixelRDO_Container#PixelRDOs" ] StreamRDO.ItemList +=["2721#*"] StreamRDO.ItemList +=["2927#*"] StreamRDO.ItemList +=["2934#*"] +StreamRDO.ItemList += [ "xAOD::EventInfo#*", "xAOD::EventAuxInfo#*" ] +if not hasattr( topSequence, "LumiBlockMuWriter" ): + include ("LumiBlockComps/LumiBlockMuWriter_jobOptions.py") rec.OutputFileNameForRecoStep="RDOtoRDO_TRIG" diff --git a/Reconstruction/tauRec/test/test_tau_q431.sh b/Reconstruction/tauRec/test/test_tau_q431.sh index cc525003ce7e389f4dd4e669a5cc1e5d12989d5c..272f65b27e671d41b85c2b8e0104a69d96246b5f 100755 --- a/Reconstruction/tauRec/test/test_tau_q431.sh +++ b/Reconstruction/tauRec/test/test_tau_q431.sh @@ -8,6 +8,8 @@ # art-output: rootcomp.root # art-output: *.log # art-output: *.ps +# art-output: dcube +# art-html: dcube NEVENTS=500 REF_DIR="/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/tauRec/reference/q431" @@ -27,3 +29,12 @@ echo "art-result: $? PhysVal" # compare the histograms rootcomp.py NTUP_PHYSVAL.root ${REF_DIR}/NTUP_PHYSVAL.root >> rootcomp.log 2>&1 echo "art-result: $? rootcomp" + +# run dcube +INPUT_DIR="/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/tauRec/input" +$ATLAS_LOCAL_ROOT/dcube/current/DCubeClient/python/dcube.py \ + --plot --output dcube \ + --config ${INPUT_DIR}/config.xml \ + --reference ${REF_DIR}/NTUP_PHYSVAL.root \ + NTUP_PHYSVAL.root +echo "art-result: $? dcube" diff --git a/Reconstruction/tauRec/test/test_tau_standalone.sh b/Reconstruction/tauRec/test/test_tau_standalone.sh index 16ae6fd1711e5a45bcb0dc41188f36ee0da3b66e..94247e5c67a7f74e3a2da9f83d6e1f1b8a8d05c8 100755 --- a/Reconstruction/tauRec/test/test_tau_standalone.sh +++ b/Reconstruction/tauRec/test/test_tau_standalone.sh @@ -6,6 +6,8 @@ # art-output: *.root # art-output: *.log # art-output: *.ps +# art-output: dcube +# art-html: dcube NEVENTS=1000 REF_DIR="/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/tauRec/reference/standalone" @@ -25,3 +27,12 @@ echo "art-result: $? PhysVal" # compare the histograms rootcomp.py NTUP_PHYSVAL.root ${REF_DIR}/NTUP_PHYSVAL.root >> rootcomp.log 2>&1 echo "art-result: $? rootcomp" + +# run dcube +INPUT_DIR="/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/tauRec/input" +$ATLAS_LOCAL_ROOT/dcube/current/DCubeClient/python/dcube.py \ + --plot --output dcube \ + --config ${INPUT_DIR}/config.xml \ + --reference ${REF_DIR}/NTUP_PHYSVAL.root \ + NTUP_PHYSVAL.root +echo "art-result: $? dcube" diff --git a/Simulation/Barcode/BarcodeEvent/CMakeLists.txt b/Simulation/Barcode/BarcodeEvent/CMakeLists.txt index 37d06fb5296181669e5318061bb1c68657848df7..ba8c20be4d009086dc17f73c19cc63fac8e2ea97 100644 --- a/Simulation/Barcode/BarcodeEvent/CMakeLists.txt +++ b/Simulation/Barcode/BarcodeEvent/CMakeLists.txt @@ -9,5 +9,7 @@ atlas_subdir( BarcodeEvent ) atlas_depends_on_subdirs( PUBLIC GaudiKernel ) -# Install files from the package: -atlas_install_headers( BarcodeEvent ) +atlas_add_library( BarcodeEventLib + BarcodeEvent/*.h + INTERFACE + PUBLIC_HEADERS BarcodeEvent ) diff --git a/Simulation/Barcode/BarcodeInterfaces/CMakeLists.txt b/Simulation/Barcode/BarcodeInterfaces/CMakeLists.txt index d3c47e888991037bda1e407f388ebb864fec760b..d2da87fff935257cb6b16366a31cc992c6adc202 100644 --- a/Simulation/Barcode/BarcodeInterfaces/CMakeLists.txt +++ b/Simulation/Barcode/BarcodeInterfaces/CMakeLists.txt @@ -10,6 +10,9 @@ atlas_depends_on_subdirs( PUBLIC GaudiKernel Simulation/Barcode/BarcodeEvent ) -# Install files from the package: -atlas_install_headers( BarcodeInterfaces ) +atlas_add_library( BarcodeInterfacesLib + BarcodeInterfaces/*.h + INTERFACE + PUBLIC_HEADERS BarcodeInterfaces + LINK_LIBRARIES BarcodeEventLib GaudiKernel ) diff --git a/Simulation/Barcode/BarcodeServices/CMakeLists.txt b/Simulation/Barcode/BarcodeServices/CMakeLists.txt index 4d5a7f0dbd6f3fb87a071aef8bdc4caf4fe56751..c50234e4d8e3f706846936003d2a35eed4359a9c 100644 --- a/Simulation/Barcode/BarcodeServices/CMakeLists.txt +++ b/Simulation/Barcode/BarcodeServices/CMakeLists.txt @@ -34,7 +34,7 @@ atlas_add_component( BarcodeServices src/*.cxx src/components/*.cxx INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} - LINK_LIBRARIES ${ROOT_LIBRARIES} AthenaBaseComps GaudiKernel BarcodeServicesLib ) + LINK_LIBRARIES ${ROOT_LIBRARIES} AthenaBaseComps GaudiKernel BarcodeEventLib BarcodeInterfacesLib BarcodeServicesLib ) # Install files from the package: atlas_install_python_modules( python/*.py ) diff --git a/Simulation/BeamEffects/CMakeLists.txt b/Simulation/BeamEffects/CMakeLists.txt index 4bc0f27b9b6bceaead0e7e266b0dd4f45dd06139..af8e055daed7eb84a0dc2cf0ccd54385d860bb70 100644 --- a/Simulation/BeamEffects/CMakeLists.txt +++ b/Simulation/BeamEffects/CMakeLists.txt @@ -31,21 +31,19 @@ include_directories(SYSTEM ${EIGEN_INCLUDE_DIRS}) atlas_add_test( BeamEffectsAlg_test SOURCES src/*.cxx test/BeamEffectsAlg_test.cxx INCLUDE_DIRS ${EIGEN_INCLUDE_DIRS} ${CLHEP_INCLUDE_DIRS} ${GTEST_INCLUDE_DIRS} #${GMOCK_INCLUDE_DIRS} - LINK_LIBRARIES ${CLHEP_LIBRARIES} AtlasHepMCLib GaudiKernel TestTools AthenaBaseComps StoreGateLib EventInfo GeneratorObjects BeamSpotConditionsData ${GTEST_LIBRARIES} #${GMOCK_LIBRARIES} + LINK_LIBRARIES ${CLHEP_LIBRARIES} AtlasHepMCLib GaudiKernel TestTools AthenaBaseComps StoreGateLib EventInfo GeneratorObjects HepMC_InterfacesLib BeamSpotConditionsData ${GTEST_LIBRARIES} #${GMOCK_LIBRARIES} ) - #Added test of new component accumulator syntax atlas_add_test( BeamEffectsAlgConfig_test SCRIPT python/BeamEffectsAlgConfig.py PROPERTIES TIMEOUT 300 ) - atlas_add_component( BeamEffects src/*.cxx src/components/*.cxx INCLUDE_DIRS ${EIGEN_INCLUDE_DIRS} ${CLHEP_INCLUDE_DIRS} - LINK_LIBRARIES ${CLHEP_LIBRARIES} AtlasHepMCLib GaudiKernel AthenaBaseComps StoreGateLib EventInfo GeneratorObjects BeamSpotConditionsData ) + LINK_LIBRARIES ${CLHEP_LIBRARIES} AtlasHepMCLib GaudiKernel AthenaBaseComps HepMC_InterfacesLib StoreGateLib EventInfo GeneratorObjects BeamSpotConditionsData ) # Install files from the package: atlas_install_python_modules( python/*.py ) diff --git a/Simulation/FastShower/FastCaloSim/CMakeLists.txt b/Simulation/FastShower/FastCaloSim/CMakeLists.txt index 85e00e690e429eb1271c48566bf47ae9ed0aa0c3..4a606b4fe66d4d994e7866fd76eb7136133ba76f 100644 --- a/Simulation/FastShower/FastCaloSim/CMakeLists.txt +++ b/Simulation/FastShower/FastCaloSim/CMakeLists.txt @@ -81,8 +81,8 @@ atlas_add_library( FastCaloSimLib INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} ${HEPPDT_INCLUDE_DIRS} PRIVATE_INCLUDE_DIRS ${CLHEP_INCLUDE_DIRS} ${EIGEN_INCLUDE_DIRS} PRIVATE_DEFINITIONS ${CLHEP_DEFINITIONS} - LINK_LIBRARIES ${ROOT_LIBRARIES} ${HEPPDT_LIBRARIES} CaloEvent CaloIdentifier AthenaBaseComps AthenaKernel Identifier GaudiKernel LArRecEvent TileEvent TrkEventPrimitives TrkParameters TrkExInterfaces CaloDetDescrLib StoreGateLib SGtests - PRIVATE_LINK_LIBRARIES ${CLHEP_LIBRARIES} AtlasHepMCLib ${EIGEN_LIBRARIES} AthAllocators AthenaPoolUtilities AtlasDetDescr GeoPrimitives EventKernel NavFourMom GeneratorObjects TruthUtils FastCaloSimAthenaPool PathResolver TrkGeometry TrkSurfaces TrkMaterialOnTrack ) + LINK_LIBRARIES ${ROOT_LIBRARIES} ${HEPPDT_LIBRARIES} CaloEvent CaloIdentifier CaloInterfaceLib AthenaBaseComps AthenaKernel FastCaloSimAthenaPool FastSimulationEventLib Identifier GaudiKernel LArRecEvent TileEvent TrkEventPrimitives TrkParameters TrkExInterfaces CaloDetDescrLib StoreGateLib SGtests + PRIVATE_LINK_LIBRARIES ${CLHEP_LIBRARIES} AtlasHepMCLib ${EIGEN_LIBRARIES} AthAllocators AthenaPoolUtilities AtlasDetDescr DetDescrCondToolsLib GeoPrimitives EventKernel NavFourMom GeneratorObjects TruthUtils PathResolver TrkGeometry TrkSurfaces TrkMaterialOnTrack ) atlas_add_component( FastCaloSim src/components/*.cxx diff --git a/Simulation/FastShower/FastCaloSimHit/CMakeLists.txt b/Simulation/FastShower/FastCaloSimHit/CMakeLists.txt index 8b9b570c36097a3bb2b6aa1ea96f8d44b9c8ad06..7108e6e2ac96442492537b76a83d01ce385b092e 100644 --- a/Simulation/FastShower/FastCaloSimHit/CMakeLists.txt +++ b/Simulation/FastShower/FastCaloSimHit/CMakeLists.txt @@ -35,7 +35,7 @@ atlas_depends_on_subdirs( PUBLIC atlas_add_library( FastCaloSimHitLib src/*.cxx PUBLIC_HEADERS FastCaloSimHit - LINK_LIBRARIES AthenaBaseComps GaudiKernel LArSimEvent TileSimEvent StoreGateLib SGtests PileUpToolsLib TileConditionsLib + LINK_LIBRARIES AthenaBaseComps GaudiKernel CaloInterfaceLib LArSimEvent TileSimEvent StoreGateLib SGtests PileUpToolsLib TileConditionsLib PRIVATE_LINK_LIBRARIES CaloEvent CaloIdentifier EventInfo TileEvent ) atlas_add_component( FastCaloSimHit diff --git a/Simulation/FastSimulation/FastSimulationEvent/CMakeLists.txt b/Simulation/FastSimulation/FastSimulationEvent/CMakeLists.txt index 250309efbfc62509282a93bc3084aeed296daa42..f67c472d0da9ba4a16925f71985ac3042cbf5c28 100644 --- a/Simulation/FastSimulation/FastSimulationEvent/CMakeLists.txt +++ b/Simulation/FastSimulation/FastSimulationEvent/CMakeLists.txt @@ -11,9 +11,8 @@ atlas_depends_on_subdirs( PUBLIC DetectorDescription/GeoPrimitives Tracking/TrkEvent/TrkMaterialOnTrack ) -# External dependencies: -find_package( Eigen ) - -# Install files from the package: -atlas_install_headers( FastSimulationEvent ) +atlas_add_library( FastSimulationEventLib + src/*.cxx + PUBLIC_HEADERS FastSimulationEvent + LINK_LIBRARIES AthenaKernel GeoPrimitives TrkMaterialOnTrack ) diff --git a/Simulation/G4Atlas/G4AtlasAlg/CMakeLists.txt b/Simulation/G4Atlas/G4AtlasAlg/CMakeLists.txt index 4bd638d877009ae2b56f12792572cb759818d592..c49cd430ed4d91b1b484a66a4b10f5f5e06058f1 100644 --- a/Simulation/G4Atlas/G4AtlasAlg/CMakeLists.txt +++ b/Simulation/G4Atlas/G4AtlasAlg/CMakeLists.txt @@ -35,7 +35,7 @@ atlas_add_library( G4AtlasAlgLib PUBLIC_HEADERS G4AtlasAlg INCLUDE_DIRS ${GEANT4_INCLUDE_DIRS} ${EIGEN_INCLUDE_DIRS} ${XERCESC_INCLUDE_DIRS} ${CLHEP_INCLUDE_DIRS} - LINK_LIBRARIES ${GEANT4_LIBRARIES} ${EIGEN_LIBRARIES} ${XERCESC_LIBRARIES} ${CLHEP_LIBRARIES} AtlasHepMCLib AthenaBaseComps AthenaKernel GaudiKernel G4AtlasInterfaces SGTools StoreGateLib SGtests EventInfo GeneratorObjects MCTruthBaseLib ) + LINK_LIBRARIES ${GEANT4_LIBRARIES} ${EIGEN_LIBRARIES} ${XERCESC_LIBRARIES} ${CLHEP_LIBRARIES} AtlasHepMCLib AthenaBaseComps AthenaKernel BarcodeInterfacesLib GaudiKernel G4AtlasInterfaces SGTools StoreGateLib SGtests EventInfo GeneratorObjects GeoModelInterfaces ISF_InterfacesLib MCTruthBaseLib ) # Component(s) in the package: atlas_add_component( G4AtlasAlg diff --git a/Simulation/G4Atlas/G4AtlasTests/CMakeLists.txt b/Simulation/G4Atlas/G4AtlasTests/CMakeLists.txt index 307695cfc60d73ff815c56dc281fda6aebd3dbf9..8a41c26951af14add8ce239df61e3a5b2c7b15aa 100644 --- a/Simulation/G4Atlas/G4AtlasTests/CMakeLists.txt +++ b/Simulation/G4Atlas/G4AtlasTests/CMakeLists.txt @@ -50,7 +50,7 @@ find_package( XercesC ) atlas_add_component( G4AtlasTests src/*.cxx INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} ${XERCESC_INCLUDE_DIRS} ${CLHEP_INCLUDE_DIRS} ${GEANT4_INCLUDE_DIRS} ${EIGEN_INCLUDE_DIRS} - LINK_LIBRARIES ${ROOT_LIBRARIES} ${XERCESC_LIBRARIES} ${CLHEP_LIBRARIES} AtlasHepMCLib ${GEANT4_LIBRARIES} ${EIGEN_LIBRARIES} AthenaBaseComps GaudiKernel CaloDetDescrLib CaloIdentifier CaloSimEvent AthenaKernel StoreGateLib SGtests GeoAdaptors GeoPrimitives Identifier EventInfo ALFA_SimEv LUCID_SimEvent ZDC_SimEvent GeneratorObjects InDetSimEvent LArSimEvent MuonReadoutGeometry MuonIdHelpersLib MuonSimEvent McParticleEvent G4AtlasToolsLib MCTruth HitManagement TileDetDescr TileIdentifier TileSimEvent ) + LINK_LIBRARIES ${ROOT_LIBRARIES} ${XERCESC_LIBRARIES} ${CLHEP_LIBRARIES} AtlasHepMCLib ${GEANT4_LIBRARIES} ${EIGEN_LIBRARIES} AthenaBaseComps GaudiKernel CaloDetDescrLib CaloIdentifier CaloSimEvent AthenaKernel StoreGateLib SGtests GeoAdaptors GeoPrimitives Identifier EventInfo ALFA_SimEv LUCID_SimEvent ZDC_SimEvent GeneratorObjects InDetSimEvent LArSimEvent MuonReadoutGeometry MuonIdHelpersLib MuonSimEvent McParticleEvent G4AtlasToolsLib MCTruth HitManagement TileDetDescr TileIdentifier TileSimEvent TrackRecordLib ) # Install files from the package: atlas_install_headers( G4AtlasTests ) diff --git a/Simulation/G4Atlas/G4AtlasTools/CMakeLists.txt b/Simulation/G4Atlas/G4AtlasTools/CMakeLists.txt index c673cc6eb66d7c5add5a9bc7d6caaec3f43b860c..b2485364a4392c1a9a8b1f8df0653134c9b7e902 100644 --- a/Simulation/G4Atlas/G4AtlasTools/CMakeLists.txt +++ b/Simulation/G4Atlas/G4AtlasTools/CMakeLists.txt @@ -28,7 +28,7 @@ atlas_add_library( G4AtlasToolsLib INCLUDE_DIRS ${XERCESC_INCLUDE_DIRS} ${GEANT4_INCLUDE_DIRS} ${TBB_INCLUDE_DIRS} PRIVATE_INCLUDE_DIRS ${Boost_INCLUDE_DIRS} ${CLHEP_INCLUDE_DIRS} PRIVATE_DEFINITIONS ${CLHEP_DEFINITIONS} - LINK_LIBRARIES ${XERCESC_LIBRARIES} ${GEANT4_LIBRARIES} ${TBB_LIBRARIES} AthenaBaseComps G4AtlasInterfaces + LINK_LIBRARIES ${XERCESC_LIBRARIES} ${GEANT4_LIBRARIES} ${TBB_LIBRARIES} AthenaBaseComps G4AtlasInterfaces SubDetectorEnvelopesLib PRIVATE_LINK_LIBRARIES ${Boost_LIBRARIES} ${CLHEP_LIBRARIES} GaudiKernel ) atlas_add_component( G4AtlasTools diff --git a/Simulation/G4Extensions/G4CosmicFilter/CMakeLists.txt b/Simulation/G4Extensions/G4CosmicFilter/CMakeLists.txt index c339ad433beb7f3f33cd378d39fc002697e6914c..32c07d1a7ad519c6e67e1ac655cc05b9e506213b 100644 --- a/Simulation/G4Extensions/G4CosmicFilter/CMakeLists.txt +++ b/Simulation/G4Extensions/G4CosmicFilter/CMakeLists.txt @@ -26,7 +26,7 @@ atlas_add_component( G4CosmicFilter src/*.cxx src/components/*.cxx INCLUDE_DIRS ${GEANT4_INCLUDE_DIRS} ${XERCESC_INCLUDE_DIRS} ${CLHEP_INCLUDE_DIRS} - LINK_LIBRARIES ${GEANT4_LIBRARIES} ${XERCESC_LIBRARIES} ${CLHEP_LIBRARIES} AthenaBaseComps StoreGateLib SGtests GaudiKernel G4AtlasInterfaces G4AtlasToolsLib MCTruth ) + LINK_LIBRARIES ${GEANT4_LIBRARIES} ${XERCESC_LIBRARIES} ${CLHEP_LIBRARIES} AthenaBaseComps StoreGateLib SGtests GaudiKernel G4AtlasInterfaces G4AtlasToolsLib MCTruth TrackRecordLib ) # Install files from the package: atlas_install_headers( G4CosmicFilter ) diff --git a/Simulation/G4Sim/MCTruthBase/CMakeLists.txt b/Simulation/G4Sim/MCTruthBase/CMakeLists.txt index ffe5e7f3d062d26e9d55d13187e479dabf5418f8..1849bf34dff19f5a996ac0187aad262f32f41e82 100644 --- a/Simulation/G4Sim/MCTruthBase/CMakeLists.txt +++ b/Simulation/G4Sim/MCTruthBase/CMakeLists.txt @@ -35,7 +35,7 @@ atlas_add_library( MCTruthBaseLib DEFINITIONS ${CLHEP_DEFINITIONS} LINK_LIBRARIES ${GEANT4_LIBRARIES} ${XERCESC_LIBRARIES} ${CLHEP_LIBRARIES} AtlasHepMCLib AthenaKernel GaudiKernel StoreGateLib SGtests G4AtlasToolsLib PRIVATE_LINK_LIBRARIES AthenaBaseComps - G4AtlasInterfaces MCTruth SimHelpers ISF_Interfaces + G4AtlasInterfaces MCTruth SimHelpers ISF_InterfacesLib AtlasDetDescr ISF_Geant4Event ) @@ -47,7 +47,7 @@ atlas_add_component( MCTruthBase AtlasHepMCLib AthenaKernel GaudiKernel AthenaBaseComps StoreGateLib SGtests G4AtlasInterfaces G4AtlasToolsLib MCTruth - SimHelpers ISF_Interfaces + SimHelpers ISF_InterfacesLib AtlasDetDescr MCTruthBaseLib ISF_Geant4Event ) diff --git a/Simulation/G4SimCnv/G4SimTPCnv/CMakeLists.txt b/Simulation/G4SimCnv/G4SimTPCnv/CMakeLists.txt index 204f24fb82b62b537d282eae66ec39f8d694191a..abd1b40a832ac3cfaa89a63ec913a4be88f93f2d 100644 --- a/Simulation/G4SimCnv/G4SimTPCnv/CMakeLists.txt +++ b/Simulation/G4SimCnv/G4SimTPCnv/CMakeLists.txt @@ -25,7 +25,7 @@ atlas_add_tpcnv_library( G4SimTPCnv INCLUDE_DIRS ${CLHEP_INCLUDE_DIRS} PRIVATE_INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} DEFINITIONS ${CLHEP_DEFINITIONS} - LINK_LIBRARIES ${ROOT_LIBRARIES} ${CLHEP_LIBRARIES} AthenaPoolCnvSvcLib AthenaKernel ) + LINK_LIBRARIES ${ROOT_LIBRARIES} ${CLHEP_LIBRARIES} AthenaPoolCnvSvcLib AthenaPoolServicesLib AthenaKernel TrackRecordLib ) atlas_add_dictionary( G4SimTPCnvDict G4SimTPCnv/G4SimTPCnvDict.h diff --git a/Simulation/G4Utilities/Geo2G4/CMakeLists.txt b/Simulation/G4Utilities/Geo2G4/CMakeLists.txt index 360303d5eda753f254337babd061a616a484864f..65e07185004cac9b9dab1a7d69fd7769dcc436c3 100644 --- a/Simulation/G4Utilities/Geo2G4/CMakeLists.txt +++ b/Simulation/G4Utilities/Geo2G4/CMakeLists.txt @@ -37,7 +37,7 @@ atlas_add_library( Geo2G4Lib PRIVATE_INCLUDE_DIRS ${Boost_INCLUDE_DIRS} ${CLHEP_INCLUDE_DIRS} ${GEOMODELCORE_INCLUDE_DIRS} PRIVATE_DEFINITIONS ${CLHEP_DEFINITIONS} LINK_LIBRARIES ${XERCESC_LIBRARIES} ${GEANT4_LIBRARIES} ${ROOT_LIBRARIES} GaudiKernel - PRIVATE_LINK_LIBRARIES ${Boost_LIBRARIES} ${CLHEP_LIBRARIES} ${GEOMODELCORE_LIBRARIES} AthenaBaseComps GeoSpecialShapes G4AtlasToolsLib SimHelpers GeoMaterial2G4 AthenaKernel GeoModelUtilities StoreGateLib SGtests ) + PRIVATE_LINK_LIBRARIES ${Boost_LIBRARIES} ${CLHEP_LIBRARIES} ${GEOMODELCORE_LIBRARIES} AthenaBaseComps GeoSpecialShapes G4AtlasToolsLib SimHelpers GeoMaterial2G4 AthenaKernel GeoModelInterfaces GeoModelUtilities StoreGateLib SGtests GeoPrimitives ) atlas_add_component( Geo2G4 src/components/*.cxx diff --git a/Simulation/G4Utilities/Geo2G4/src/LArWheelSliceSolidTests.cxx b/Simulation/G4Utilities/Geo2G4/src/LArWheelSliceSolidTests.cxx index 1c92d7cea1a4aa59c592d4dab24b57a7b659336d..3640ac025ef039f0ed82e6df8c6b1c00443a178a 100644 --- a/Simulation/G4Utilities/Geo2G4/src/LArWheelSliceSolidTests.cxx +++ b/Simulation/G4Utilities/Geo2G4/src/LArWheelSliceSolidTests.cxx @@ -313,13 +313,8 @@ void LArWheelSliceSolid::get_point_on_flat_surface(G4ThreeVector &p) const G4double LArWheelSliceSolid::GetCubicVolume(void) { // sagging ignored, effect should be negligible -#if ROOT_VERSION_CODE < ROOT_VERSION(6,0,0) - double result = - f_vol->Integral(m_Rmin, Rmax, (const Double_t *)0, IntPrecision) -#else double result = m_f_vol->Integral(m_Rmin, m_Rmax, IntPrecision) -#endif #ifndef LOCAL_DEBUG * GetCalculator()->GetNumberOfFans() @@ -363,11 +358,7 @@ G4double LArWheelSliceSolid::get_length_at_r(G4double r) const G4double LArWheelSliceSolid::get_area_on_side(void) const { -#if ROOT_VERSION_CODE < ROOT_VERSION(6,0,0) - return f_side_area->Integral(m_Rmin, m_Rmax, (const Double_t *)0, IntPrecision); -#else return m_f_side_area->Integral(m_Rmin, m_Rmax, IntPrecision); -#endif } G4double LArWheelSliceSolid::GetSurfaceArea(void) diff --git a/Simulation/G4Utilities/Geo2G4/src/LArWheelSolidTests.cxx b/Simulation/G4Utilities/Geo2G4/src/LArWheelSolidTests.cxx index 59e32809de4b8a17feb4581f92e7f9140e49ca4a..2694968c47391f94767adadbfd0fdd9429201aea 100644 --- a/Simulation/G4Utilities/Geo2G4/src/LArWheelSolidTests.cxx +++ b/Simulation/G4Utilities/Geo2G4/src/LArWheelSolidTests.cxx @@ -313,13 +313,7 @@ void LArWheelSolid::get_point_on_flat_surface(G4ThreeVector &p) const G4double LArWheelSolid::GetCubicVolume(void) { // sagging ignored, effect should be negligible -#if ROOT_VERSION_CODE < ROOT_VERSION(6,0,0) - double result = - f_vol->Integral(m_Rmin, Rmax, (const Double_t *)0, IntPrecision) -#else - double result = - m_f_vol->Integral(m_Rmin, m_Rmax, IntPrecision) -#endif + double result = m_f_vol->Integral(m_Rmin, m_Rmax, IntPrecision) #ifndef LOCAL_DEBUG * GetCalculator()->GetNumberOfFans() @@ -363,11 +357,7 @@ G4double LArWheelSolid::get_length_at_r(G4double r) const G4double LArWheelSolid::get_area_on_side(void) const { -#if ROOT_VERSION_CODE < ROOT_VERSION(6,0,0) - return f_side_area->Integral(m_Rmin, m_Rmax, (const Double_t *)0, IntPrecision); -#else return m_f_side_area->Integral(m_Rmin, m_Rmax, IntPrecision); -#endif } G4double LArWheelSolid::GetSurfaceArea(void) diff --git a/Simulation/G4Utilities/MCTruthAlgs/CMakeLists.txt b/Simulation/G4Utilities/MCTruthAlgs/CMakeLists.txt index 65e5a40324ea6a4b45c7d460a2033fa66dc8b64c..991e913f851532177f46a9d60e9652ac558e19ee 100644 --- a/Simulation/G4Utilities/MCTruthAlgs/CMakeLists.txt +++ b/Simulation/G4Utilities/MCTruthAlgs/CMakeLists.txt @@ -23,7 +23,7 @@ atlas_add_library( MCTruthAlgsLib INCLUDE_DIRS ${HEPPDT_INCLUDE_DIRS} PRIVATE_INCLUDE_DIRS ${CLHEP_INCLUDE_DIRS} PRIVATE_DEFINITIONS ${CLHEP_DEFINITIONS} - LINK_LIBRARIES ${HEPPDT_LIBRARIES} AthenaBaseComps GaudiKernel + LINK_LIBRARIES ${HEPPDT_LIBRARIES} AthenaBaseComps GaudiKernel TrackRecordLib PRIVATE_LINK_LIBRARIES ${CLHEP_LIBRARIES} ) atlas_add_component( MCTruthAlgs diff --git a/Simulation/G4Utilities/MCTruthSimAlgs/CMakeLists.txt b/Simulation/G4Utilities/MCTruthSimAlgs/CMakeLists.txt index 236ea6973b55f94b11d02dc08f975b2cc6f6e87e..88d84bad8cae560090ea99658ec29e63bdb5a18d 100644 --- a/Simulation/G4Utilities/MCTruthSimAlgs/CMakeLists.txt +++ b/Simulation/G4Utilities/MCTruthSimAlgs/CMakeLists.txt @@ -25,7 +25,7 @@ atlas_depends_on_subdirs( PRIVATE atlas_add_component( MCTruthSimAlgs src/*.cxx src/components/MCTruthSimAlgs_entries.cxx - LINK_LIBRARIES CaloSimEvent AthenaBaseComps AthenaKernel PileUpToolsLib StoreGateLib SGtests xAODJet GaudiKernel GeneratorObjects TruthUtils MuonSimEvent RecEvent EventInfo) + LINK_LIBRARIES CaloSimEvent AthenaBaseComps AthenaKernel PileUpToolsLib StoreGateLib SGtests xAODJet GaudiKernel GeneratorObjects TruthUtils MuonSimEvent RecEvent EventInfo TrackRecordLib ) # Install files from the package: atlas_install_python_modules( python/*.py ) diff --git a/Simulation/G4Utilities/TrackWriteFastSim/CMakeLists.txt b/Simulation/G4Utilities/TrackWriteFastSim/CMakeLists.txt index c6a25d31dd43ddd2997663ae1528b7e5cbabf544..70e02fe3c05fbf2c2771d0758ce39dff29020700 100644 --- a/Simulation/G4Utilities/TrackWriteFastSim/CMakeLists.txt +++ b/Simulation/G4Utilities/TrackWriteFastSim/CMakeLists.txt @@ -27,7 +27,7 @@ atlas_add_library( TrackWriteFastSimLib INCLUDE_DIRS ${GEANT4_INCLUDE_DIRS} ${XERCESC_INCLUDE_DIRS} PRIVATE_INCLUDE_DIRS ${CLHEP_INCLUDE_DIRS} PRIVATE_DEFINITIONS ${CLHEP_DEFINITIONS} - LINK_LIBRARIES ${GEANT4_LIBRARIES} ${XERCESC_LIBRARIES} StoreGateLib SGtests G4AtlasToolsLib + LINK_LIBRARIES ${GEANT4_LIBRARIES} ${XERCESC_LIBRARIES} StoreGateLib SGtests G4AtlasToolsLib TrackRecordLib PRIVATE_LINK_LIBRARIES ${CLHEP_LIBRARIES} GaudiKernel G4AtlasInterfaces MCTruth ) atlas_add_component( TrackWriteFastSim diff --git a/Simulation/ISF/ISF_Core/ISF_Algorithms/CMakeLists.txt b/Simulation/ISF/ISF_Core/ISF_Algorithms/CMakeLists.txt index 3cbe4f087562bc6966e4ed064e79177854b6c6a2..75c22e7ffd34f32dd91343634da3a9a4e5de5ede 100644 --- a/Simulation/ISF/ISF_Core/ISF_Algorithms/CMakeLists.txt +++ b/Simulation/ISF/ISF_Core/ISF_Algorithms/CMakeLists.txt @@ -37,16 +37,16 @@ atlas_add_component( ISF_Algorithms src/*.h src/*.cxx src/components/*.cxx INCLUDE_DIRS ${Boost_INCLUDE_DIRS} ${ROOT_INCLUDE_DIRS} LINK_LIBRARIES ${Boost_LIBRARIES} ${ROOT_LIBRARIES} GaudiKernel - AthenaBaseComps StoreGateLib AtlasDetDescr GeneratorObjects - ISF_Event ISF_Interfaces PmbCxxUtils InDetSimEvent LArSimEvent TileSimEvent - MuonSimEvent ) + AthenaBaseComps StoreGateLib AtlasDetDescr GeneratorObjects HepMC_InterfacesLib + ISF_Event ISF_InterfacesLib PmbCxxUtils InDetSimEvent LArSimEvent TileSimEvent + MuonSimEvent TrackRecordLib ) atlas_add_test( CollectionMerger_test SOURCES test/CollectionMerger_test.cxx src/CollectionMerger.h src/CollectionMerger.cxx INCLUDE_DIRS ${GTEST_INCLUDE_DIRS} #${GMOCK_INCLUDE_DIRS} LINK_LIBRARIES TestTools GaudiKernel AthenaBaseComps AtlasDetDescr - ISF_Event ISF_Interfaces PmbCxxUtils InDetSimEvent LArSimEvent TileSimEvent + ISF_Event ISF_InterfacesLib PmbCxxUtils InDetSimEvent LArSimEvent TileSimEvent MuonSimEvent ${GTEST_LIBRARIES} #${GMOCK_LIBRARIES} ENVIRONMENT "JOBOPTSEARCHPATH=${CMAKE_CURRENT_SOURCE_DIR}/share" ) @@ -63,12 +63,14 @@ atlas_add_test( SimKernelMT_test ${GMOCK_INCLUDE_DIRS} LINK_LIBRARIES ISF_Event - ISF_Interfaces + ISF_InterfacesLib ${EIGEN_LIBRARIES} ${GTEST_LIBRARIES} ${GMOCK_LIBRARIES} AthenaBaseComps GeneratorObjects + HepMC_InterfacesLib + TrackRecordLib ENVIRONMENT "JOBOPTSEARCHPATH=${CMAKE_CURRENT_SOURCE_DIR}/test" ) diff --git a/Simulation/ISF/ISF_Core/ISF_Event/CMakeLists.txt b/Simulation/ISF/ISF_Core/ISF_Event/CMakeLists.txt index e1acf8b6debc89ee2df94bd63b74d2f9c62ca928..00e8e845b7431756ea82269060f7c7cb9d939a7f 100644 --- a/Simulation/ISF/ISF_Core/ISF_Event/CMakeLists.txt +++ b/Simulation/ISF/ISF_Core/ISF_Event/CMakeLists.txt @@ -26,7 +26,7 @@ atlas_add_library( ISF_Event PUBLIC_HEADERS ISF_Event INCLUDE_DIRS ${CLHEP_INCLUDE_DIRS} ${EIGEN_INCLUDE_DIRS} DEFINITIONS ${CLHEP_DEFINITIONS} - LINK_LIBRARIES ${CLHEP_LIBRARIES} AtlasHepMCLib ${EIGEN_LIBRARIES} TestTools AthenaBaseComps AtlasDetDescr GeoPrimitives GeneratorObjects GaudiKernel ) + LINK_LIBRARIES ${CLHEP_LIBRARIES} AtlasHepMCLib ${EIGEN_LIBRARIES} TestTools AthenaBaseComps AtlasDetDescr BarcodeEventLib GeoPrimitives GeneratorObjects GaudiKernel ) atlas_add_test( ISFParticle_test SOURCES diff --git a/Simulation/ISF/ISF_Core/ISF_Interfaces/CMakeLists.txt b/Simulation/ISF/ISF_Core/ISF_Interfaces/CMakeLists.txt index 09ce87e72bae7c3217c5d640f81929a01fc65a19..b0af11de8537b7e68bd0d1238ac87897a142c90c 100644 --- a/Simulation/ISF/ISF_Core/ISF_Interfaces/CMakeLists.txt +++ b/Simulation/ISF/ISF_Core/ISF_Interfaces/CMakeLists.txt @@ -24,10 +24,10 @@ find_package( CLHEP ) find_package( Eigen ) # Component(s) in the package: -atlas_add_library( ISF_Interfaces +atlas_add_library( ISF_InterfacesLib src/*.cxx PUBLIC_HEADERS ISF_Interfaces INCLUDE_DIRS ${CLHEP_INCLUDE_DIRS} ${EIGEN_INCLUDE_DIRS} DEFINITIONS ${CLHEP_DEFINITIONS} - LINK_LIBRARIES ${CLHEP_LIBRARIES} ${EIGEN_LIBRARIES} AthenaBaseComps AthenaKernel AtlasDetDescr GeoPrimitives GaudiKernel GeneratorObjects ISF_Event StoreGateLib SGtests ) + LINK_LIBRARIES ${CLHEP_LIBRARIES} ${EIGEN_LIBRARIES} AthenaBaseComps AthenaKernel AtlasDetDescr GeoPrimitives GaudiKernel GeneratorObjects ISF_Event StoreGateLib SGtests TrackRecordLib ) diff --git a/Simulation/ISF/ISF_Core/ISF_Services/CMakeLists.txt b/Simulation/ISF/ISF_Core/ISF_Services/CMakeLists.txt index 57d11d1b07578fc0d42b28050695998e88778a7e..019b5e6e23c5f2b4c1846a7782187147700cce5f 100644 --- a/Simulation/ISF/ISF_Core/ISF_Services/CMakeLists.txt +++ b/Simulation/ISF/ISF_Core/ISF_Services/CMakeLists.txt @@ -48,7 +48,7 @@ atlas_add_component( ISF_Services src/*.cxx src/components/*.cxx INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} ${GEANT4_INCLUDE_DIRS} ${CLHEP_INCLUDE_DIRS} ${HEPPDT_INCLUDE_DIRS} - LINK_LIBRARIES ${ROOT_LIBRARIES} ${GEANT4_LIBRARIES} AtlasHepMCLib ${CLHEP_LIBRARIES} ${HEPPDT_LIBRARIES} GaudiKernel CaloIdentifier CaloSimEvent AthenaBaseComps StoreGateLib SGtests AtlasDetDescr GeneratorObjects InDetSimEvent MuonSimEvent G4AtlasInterfaces MCTruth SimHelpers ISF_Event ISF_Interfaces TileSimEvent PmbCxxUtils TruthUtils ) + LINK_LIBRARIES ${ROOT_LIBRARIES} ${GEANT4_LIBRARIES} AtlasHepMCLib ${CLHEP_LIBRARIES} ${HEPPDT_LIBRARIES} GaudiKernel BarcodeInterfacesLib CaloIdentifier CaloSimEvent AthenaBaseComps StoreGateLib SubDetectorEnvelopesLib SGtests AtlasDetDescr GeneratorObjects InDetSimEvent MuonSimEvent G4AtlasInterfaces MCTruth SimHelpers ISF_Event ISF_HepMC_Interfaces ISF_InterfacesLib TileSimEvent PmbCxxUtils TruthUtils ) # Tests in the package: atlas_add_test( InputConverter_test @@ -62,10 +62,12 @@ atlas_add_test( InputConverter_test ${GMOCK_INCLUDE_DIRS} LINK_LIBRARIES ISF_Event - ISF_Interfaces + ISF_HepMC_Interfaces + ISF_InterfacesLib ${GEANT4_LIBRARIES} ${HEPPDT_LIBRARIES} AthenaBaseComps + BarcodeInterfacesLib GeneratorObjects MCTruth ${GTEST_LIBRARIES} @@ -97,6 +99,7 @@ atlas_add_test( TruthSvc_test ${CLHEP_LIBRARIES} ${HEPPDT_LIBRARIES} GaudiKernel + BarcodeInterfacesLib CaloIdentifier CaloSimEvent AthenaBaseComps @@ -104,7 +107,8 @@ atlas_add_test( TruthSvc_test InDetSimEvent MuonSimEvent ISF_Event - ISF_Interfaces + ISF_HepMC_Interfaces + ISF_InterfacesLib PmbCxxUtils MCTruth TruthUtils diff --git a/Simulation/ISF/ISF_Core/ISF_Tools/CMakeLists.txt b/Simulation/ISF/ISF_Core/ISF_Tools/CMakeLists.txt index 77d5f84b24de4910ea54bf3cb7dc414c47133301..fc4ca04db1814e1f5e84bba0a974c6251a8e2731 100644 --- a/Simulation/ISF/ISF_Core/ISF_Tools/CMakeLists.txt +++ b/Simulation/ISF/ISF_Core/ISF_Tools/CMakeLists.txt @@ -22,7 +22,7 @@ atlas_depends_on_subdirs( PUBLIC atlas_add_component( ISF_Tools src/*.cxx src/components/*.cxx - LINK_LIBRARIES GaudiKernel AthenaBaseComps AtlasDetDescr GeneratorObjects ISF_Event ISF_Interfaces ) + LINK_LIBRARIES GaudiKernel AthenaBaseComps AtlasDetDescr BarcodeInterfacesLib GeneratorObjects ISF_Event ISF_InterfacesLib TrackRecordLib ) # Install files from the package: atlas_install_python_modules( python/*.py ) diff --git a/Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimParametrization/CMakeLists.txt b/Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimParametrization/CMakeLists.txt index ff49138660cbdc82436dd33d34df844c525c43e6..c1e6bab44ee6c4fec7dab587032563abad354cf5 100644 --- a/Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimParametrization/CMakeLists.txt +++ b/Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimParametrization/CMakeLists.txt @@ -72,14 +72,14 @@ atlas_add_library( ISF_FastCaloSimParametrizationLib INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} ${HEPPDT_INCLUDE_DIRS} PRIVATE_INCLUDE_DIRS ${XERCESC_INCLUDE_DIRS} ${CLHEP_INCLUDE_DIRS} ${GEANT4_INCLUDE_DIRS} PRIVATE_DEFINITIONS ${CLHEP_DEFINITIONS} - LINK_LIBRARIES ${ROOT_LIBRARIES} ${HEPPDT_LIBRARIES} AtlasHepMCLib CaloGeoHelpers AthenaBaseComps AthenaKernel Identifier GaudiKernel ISF_Interfaces TrkEventPrimitives TrkParameters TrkExInterfaces CaloDetDescrLib StoreGateLib SGtests TileConditionsLib + LINK_LIBRARIES ${ROOT_LIBRARIES} ${HEPPDT_LIBRARIES} AtlasHepMCLib CaloGeoHelpers AthenaBaseComps AthenaKernel Identifier GaudiKernel ISF_InterfacesLib TrkEventPrimitives TrkParameters TrkExInterfaces CaloDetDescrLib StoreGateLib SGtests TileConditionsLib PRIVATE_LINK_LIBRARIES ${XERCESC_LIBRARIES} ${CLHEP_LIBRARIES} ${GEANT4_LIBRARIES} CaloEvent CaloIdentifier AthenaPoolUtilities GeoAdaptors EventInfo NavFourMom GeneratorObjects LArSimEvent ISF_Event ISF_FastCaloSimEvent ISF_FastCaloSimInterfaces TileDetDescr TileSimEvent TrkGeometry TrkSurfaces TrkMaterialOnTrack ) atlas_add_component( ISF_FastCaloSimParametrization src/*.cxx src/components/*.cxx INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} ${HEPPDT_INCLUDE_DIRS} ${XERCESC_INCLUDE_DIRS} ${CLHEP_INCLUDE_DIRS} ${GEANT4_INCLUDE_DIRS} - LINK_LIBRARIES ${ROOT_LIBRARIES} ${HEPPDT_LIBRARIES} ${XERCESC_LIBRARIES} ${CLHEP_LIBRARIES} AtlasHepMCLib ${GEANT4_LIBRARIES} CaloDetDescrLib CaloGeoHelpers AthenaBaseComps AthenaKernel StoreGateLib SGtests Identifier GaudiKernel ISF_Interfaces TrkEventPrimitives TrkParameters TrkExInterfaces CaloEvent CaloIdentifier AthenaPoolUtilities GeoAdaptors EventInfo NavFourMom GeneratorObjects LArSimEvent ISF_Event ISF_FastCaloSimEvent ISF_FastCaloSimInterfaces TileConditionsLib TileDetDescr TileSimEvent TrkGeometry TrkSurfaces TrkMaterialOnTrack ISF_FastCaloSimParametrizationLib ) + LINK_LIBRARIES ${ROOT_LIBRARIES} ${HEPPDT_LIBRARIES} ${XERCESC_LIBRARIES} ${CLHEP_LIBRARIES} AtlasHepMCLib ${GEANT4_LIBRARIES} CaloDetDescrLib CaloGeoHelpers CaloInterfaceLib AthenaBaseComps AthenaKernel StoreGateLib SGtests Identifier GaudiKernel ISF_InterfacesLib TrkEventPrimitives TrkParameters TrkExInterfaces CaloEvent CaloIdentifier AthenaPoolUtilities GeoAdaptors EventInfo NavFourMom GeneratorObjects LArSimEvent ISF_Event ISF_FastCaloSimEvent ISF_FastCaloSimInterfaces TileConditionsLib TileDetDescr TileSimEvent TrkGeometry TrkSurfaces TrkMaterialOnTrack ISF_FastCaloSimParametrizationLib ) # Install files from the package: atlas_install_python_modules( python/*.py ) diff --git a/Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimSD/CMakeLists.txt b/Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimSD/CMakeLists.txt index 162cf7156e7988170eb95881c21d76a1a356888a..29a7e7802fac28baa9eed1ff4893ad0a6a0c2821 100644 --- a/Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimSD/CMakeLists.txt +++ b/Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimSD/CMakeLists.txt @@ -32,7 +32,7 @@ atlas_add_component( ISF_FastCaloSimSD src/*.cxx src/components/*.cxx INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} ${XERCESC_INCLUDE_DIRS} ${GEANT4_INCLUDE_DIRS} ${CLHEP_INCLUDE_DIRS} - LINK_LIBRARIES ${ROOT_LIBRARIES} ${XERCESC_LIBRARIES} ${GEANT4_LIBRARIES} ${CLHEP_LIBRARIES} StoreGateLib SGtests GaudiKernel G4AtlasInterfaces G4AtlasToolsLib CaloDetDescrLib CaloIdentifier GeneratorObjects LArG4Code ISF_FastCaloSimEvent Identifier ) + LINK_LIBRARIES ${ROOT_LIBRARIES} ${XERCESC_LIBRARIES} ${GEANT4_LIBRARIES} ${CLHEP_LIBRARIES} StoreGateLib SGtests GaudiKernel G4AtlasInterfaces G4AtlasToolsLib CaloDetDescrLib CaloIdentifier GeneratorObjects LArG4Code ISF_FastCaloSimEvent Identifier TileG4InterfacesLib ) # Install files from the package: atlas_install_python_modules( python/*.py ) diff --git a/Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimServices/CMakeLists.txt b/Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimServices/CMakeLists.txt index 0f284499c6d850e39efa6b90bf5b2d7a40cbc911..f3972dc300f65b12aa40f8145917e2069fb6f3be 100644 --- a/Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimServices/CMakeLists.txt +++ b/Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimServices/CMakeLists.txt @@ -41,7 +41,7 @@ atlas_add_component( ISF_FastCaloSimServices src/*.cxx src/components/*.cxx INCLUDE_DIRS ${CLHEP_INCLUDE_DIRS} ${LWTNN_INCLUDE_DIRS} - LINK_LIBRARIES ${CLHEP_LIBRARIES} AtlasHepMCLib ${LWTNN_LIBRARIES} AthenaBaseComps AthenaKernel GaudiKernel IdDictParser ISF_Interfaces TrkEventPrimitives TrkExInterfaces CaloEvent StoreGateLib SGtests NavFourMom GeneratorObjects FastCaloSimLib ISF_Event ISF_FastCaloSimEvent ISF_FastCaloSimInterfaces ISF_FastCaloSimParametrizationLib PathResolver) + LINK_LIBRARIES ${CLHEP_LIBRARIES} AtlasHepMCLib ${LWTNN_LIBRARIES} AthenaBaseComps AthenaKernel GaudiKernel IdDictParser ISF_InterfacesLib TrkEventPrimitives TrkExInterfaces CaloEvent StoreGateLib SGtests NavFourMom GeneratorObjects FastCaloSimLib ISF_Event ISF_FastCaloSimEvent ISF_FastCaloSimInterfaces ISF_FastCaloSimParametrizationLib PathResolver) # Install files from the package: atlas_install_python_modules( python/*.py ) diff --git a/Simulation/ISF/ISF_FastCaloSim/ISF_PunchThroughTools/CMakeLists.txt b/Simulation/ISF/ISF_FastCaloSim/ISF_PunchThroughTools/CMakeLists.txt index 421e23419bcae30472cf40b98086e659e3b6e809..a5d6ae7eb2f322e3c53c1f0b845ffe9967873638 100644 --- a/Simulation/ISF/ISF_FastCaloSim/ISF_PunchThroughTools/CMakeLists.txt +++ b/Simulation/ISF/ISF_FastCaloSim/ISF_PunchThroughTools/CMakeLists.txt @@ -33,7 +33,7 @@ atlas_add_component( ISF_PunchThroughTools src/*.cxx src/components/*.cxx INCLUDE_DIRS ${HEPPDT_INCLUDE_DIRS} ${ROOT_INCLUDE_DIRS} ${CLHEP_INCLUDE_DIRS} ${EIGEN_INCLUDE_DIRS} - LINK_LIBRARIES ${HEPPDT_LIBRARIES} ${ROOT_LIBRARIES} ${CLHEP_LIBRARIES} AtlasHepMCLib ${EIGEN_LIBRARIES} AthenaBaseComps AthenaKernel GeoPrimitives ISF_FastCaloSimInterfaces AthContainers GaudiKernel ISF_Event ISF_Interfaces PathResolver ) + LINK_LIBRARIES ${HEPPDT_LIBRARIES} ${ROOT_LIBRARIES} ${CLHEP_LIBRARIES} AtlasHepMCLib ${EIGEN_LIBRARIES} AthenaBaseComps AthenaKernel BarcodeInterfacesLib GeoPrimitives ISF_FastCaloSimInterfaces AthContainers GaudiKernel ISF_Event ISF_InterfacesLib PathResolver SubDetectorEnvelopesLib ) # Install files from the package: atlas_install_runtime( Data/*.root ) diff --git a/Simulation/ISF/ISF_Fatras/ISF_FatrasDetDescrInterfaces/CMakeLists.txt b/Simulation/ISF/ISF_Fatras/ISF_FatrasDetDescrInterfaces/CMakeLists.txt index 540e3f6435c1d730c1a53a640a06df29a52006b2..e03c63bf10a4c62fc04008ade90ed22a2a5c9458 100644 --- a/Simulation/ISF/ISF_Fatras/ISF_FatrasDetDescrInterfaces/CMakeLists.txt +++ b/Simulation/ISF/ISF_Fatras/ISF_FatrasDetDescrInterfaces/CMakeLists.txt @@ -18,6 +18,8 @@ find_package( ROOT COMPONENTS Core Tree MathCore Hist RIO pthread ) # Component(s) in the package: atlas_add_library( ISF_FatrasDetDescrInterfaces + ISF_FatrasDetDescrInterfaces/*.h + INTERFACE PUBLIC_HEADERS ISF_FatrasDetDescrInterfaces INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} ${EIGEN_INCLUDE_DIRS} LINK_LIBRARIES ${ROOT_LIBRARIES} ${EIGEN_LIBRARIES} GeoPrimitives EventPrimitives GaudiKernel InDetReadoutGeometry ) diff --git a/Simulation/ISF/ISF_Fatras/ISF_FatrasInterfaces/CMakeLists.txt b/Simulation/ISF/ISF_Fatras/ISF_FatrasInterfaces/CMakeLists.txt index 654945afb045739841fea606b35c0ff19e5d2def..a71b62a91b4fddb6726d6ad5edc19e8e462f37fc 100644 --- a/Simulation/ISF/ISF_Fatras/ISF_FatrasInterfaces/CMakeLists.txt +++ b/Simulation/ISF/ISF_Fatras/ISF_FatrasInterfaces/CMakeLists.txt @@ -5,23 +5,13 @@ # Declare the package name: atlas_subdir( ISF_FatrasInterfaces ) -# Declare the package's dependencies: -atlas_depends_on_subdirs( PUBLIC - Control/AthContainers - DetectorDescription/GeoPrimitives - GaudiKernel - Simulation/ISF/ISF_Core/ISF_Event - Tracking/TrkEvent/TrkEventPrimitives - Tracking/TrkEvent/TrkNeutralParameters - Tracking/TrkEvent/TrkParameters - Tracking/TrkExtrapolation/TrkExInterfaces - Tracking/TrkExtrapolation/TrkExUtils ) - # External dependencies: find_package( Eigen ) # Component(s) in the package: atlas_add_library( ISF_FatrasInterfaces + ISF_FatrasInterfaces/*.h + INTERFACE PUBLIC_HEADERS ISF_FatrasInterfaces INCLUDE_DIRS ${EIGEN_INCLUDE_DIRS} LINK_LIBRARIES ${EIGEN_LIBRARIES} AthContainers GeoPrimitives GaudiKernel ISF_Event TrkEventPrimitives TrkNeutralParameters TrkParameters TrkExInterfaces TrkExUtils ) diff --git a/Simulation/ISF/ISF_Fatras/ISF_FatrasRecoTools/CMakeLists.txt b/Simulation/ISF/ISF_Fatras/ISF_FatrasRecoTools/CMakeLists.txt index 059b4cf71a1546c6044f7f62d68b031bbd25a757..5a5c7628841a938163455d94082e005b64581fa9 100644 --- a/Simulation/ISF/ISF_Fatras/ISF_FatrasRecoTools/CMakeLists.txt +++ b/Simulation/ISF/ISF_Fatras/ISF_FatrasRecoTools/CMakeLists.txt @@ -42,7 +42,7 @@ find_package( ROOT COMPONENTS Core Tree MathCore Hist RIO pthread ) atlas_add_component( ISF_FatrasRecoTools src/*.cxx src/components/*.cxx - INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} ${EIGEN_INCLUDE_DIRS} + INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} ${EIGEN_INCLUDE_DIRS} LINK_LIBRARIES ${ROOT_LIBRARIES} ${EIGEN_LIBRARIES} AtlasHepMCLib AthenaBaseComps GeoPrimitives Identifier ISF_FatrasEvent TrkEventPrimitives TrkParameters TrkSpacePoint TrkTrackSummary TrkToolInterfaces AtlasDetDescr EventPrimitives GaudiKernel InDetIdentifier InDetPrepRawData SiSpacePoint ISF_FatrasDetDescrModel TrkDetElementBase TrkCompetingRIOsOnTrack TrkEventUtils TrkPrepRawData TrkRIO_OnTrack TrkTrack TrkTruthData ) # Install files from the package: diff --git a/Simulation/ISF/ISF_Fatras/ISF_FatrasServices/CMakeLists.txt b/Simulation/ISF/ISF_Fatras/ISF_FatrasServices/CMakeLists.txt index 5d7fa6d075d7c48f38f5314fce37cf6a15ef1334..19ece0bf0cf803a98f581bfe9d7d834c1a13292a 100644 --- a/Simulation/ISF/ISF_Fatras/ISF_FatrasServices/CMakeLists.txt +++ b/Simulation/ISF/ISF_Fatras/ISF_FatrasServices/CMakeLists.txt @@ -19,7 +19,7 @@ atlas_depends_on_subdirs( PUBLIC atlas_add_component( ISF_FatrasServices src/*.cxx src/components/*.cxx - LINK_LIBRARIES AthenaBaseComps AtlasDetDescr GaudiKernel ISF_Interfaces TrkTrack ISF_Event ) + LINK_LIBRARIES AthenaBaseComps AtlasDetDescr GaudiKernel ISF_InterfacesLib TrkTrack ISF_Event ) # Install files from the package: atlas_install_python_modules( python/*.py ) diff --git a/Simulation/ISF/ISF_Fatras/ISF_FatrasServices/python/ISF_FatrasConfig.py b/Simulation/ISF/ISF_Fatras/ISF_FatrasServices/python/ISF_FatrasConfig.py new file mode 100644 index 0000000000000000000000000000000000000000..8916d22761bad1fd1257aa56ba2717ac34b4707b --- /dev/null +++ b/Simulation/ISF/ISF_Fatras/ISF_FatrasServices/python/ISF_FatrasConfig.py @@ -0,0 +1,552 @@ +# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration + +__doc__ = "New configuration for the ISF_FatrasSimTool" + +from AthenaCommon.Logging import logging +from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator +from AthenaConfiguration.ComponentFactory import CompFactory +from ISF_Algorithms.collection_merger_helpers import generate_mergeable_collection_name + +################################################################################ +# HIT CREATION SECTION +################################################################################ + +# Fatras Hadronic Interaction Processor +# hadronic interaction creator + + +def fatrasHitCreatorPixelCfg(flags, name="ISF_FatrasHitCreatorPixel", **kwargs): + """Return ISF_FatrasHitCreatorPixel configured with ComponentAccumulator""" + mlog = logging.getLogger(name) + mlog.debug('Start configuration') + + acc = ComponentAccumulator() + + hits_collection_name = generate_mergeable_collection_name(bare_collection_name="PixelHits", + mergeable_collection_suffix="_Fatras", + merger_input_property="PixelHits") + + kwargs.setdefault("IdHelperName", 'PixelID') + kwargs.setdefault("CollectionName", hits_collection_name) + + # NOTE why it is here ? + # FastHitConvertTool = CompFactory.FastHitConvertTool + kwargs.setdefault("UseConditionsTool", False) + + iFatras__HitCreatorSilicon = CompFactory.iFatras.HitCreatorSilicon + acc.addPublicTool(iFatras__HitCreatorSilicon(name=name, **kwargs)) + return acc + + +def fatrasHitCreatorSCTCfg(flags, name="ISF_FatrasHitCreatorSCT", **kwargs): + """Return ISF_FatrasHitCreatorSCT configured with ComponentAccumulator""" + mlog = logging.getLogger(name) + mlog.debug('Start configuration') + + acc = ComponentAccumulator() + + hits_collection_name = generate_mergeable_collection_name(bare_collection_name="SCT_Hits", + mergeable_collection_suffix="_Fatras", + merger_input_property="SCTHits") + kwargs.setdefault("IdHelperName", 'SCT_ID') + kwargs.setdefault("CollectionName", hits_collection_name) + kwargs.setdefault("UseConditionsTool", False) + + iFatras__HitCreatorSilicon = CompFactory.iFatras.HitCreatorSilicon + acc.addPublicTool(iFatras__HitCreatorSilicon(name=name, **kwargs)) + return acc + + +def fatrasHitCreatorTRTCfg(flags, name="ISF_FatrasHitCreatorTRT", **kwargs): + mlog = logging.getLogger(name) + mlog.debug('Start configuration') + + acc = ComponentAccumulator() + + hits_collection_name = generate_mergeable_collection_name(bare_collection_name="TRTUncompressedHits", + mergeable_collection_suffix="_Fatras", + merger_input_property="TRTUncompressedHits") + kwargs.setdefault("CollectionName", hits_collection_name) + + iFatras__HitCreatorTRT = CompFactory.iFatras.HitCreatorTRT + acc.addPublicTool(iFatras__HitCreatorTRT(name=name, **kwargs)) + return acc + + +################################################################################ +# TRACK CREATION SECTION +################################################################################ + +def fatrasSimHitCreatorIDCfg(flags, name="ISF_FatrasSimHitCreatorID", **kwargs): + """Return ISF_FatrasSimHitCreatorID configured with ComponentAccumulator""" + + mlog = logging.getLogger(name) + mlog.debug('Start configuration') + + result = ComponentAccumulator() + + acc = fatrasHitCreatorPixelCfg(flags) + pixel_hit_cfg = acc.getPublicTool('ISF_FatrasHitCreatorPixel') + result.merge(acc) + kwargs.setdefault("PixelHitCreator", pixel_hit_cfg) + + acc = fatrasHitCreatorSCTCfg(flags) + sct_hit_cfg = acc.getPublicTool('ISF_FatrasHitCreatorSCT') + result.merge(acc) + kwargs.setdefault("SctHitCreator", sct_hit_cfg) + + acc = fatrasHitCreatorTRTCfg(flags) + trt_hit_cfg = acc.getPublicTool("ISF_FatrasHitCreatorTRT") + result.merge(acc) + kwargs.setdefault("TrtHitCreator", trt_hit_cfg) + + kwargs.setdefault("OutputLevel", 3) + + iFatras__SimHitCreatorID = CompFactory.iFatras.SimHitCreatorID + result.addPublicTool(iFatras__SimHitCreatorID(name=name, **kwargs)) + return result + + +def fatrasSimHitCreatorMSCfg(flags, name="ISF_FatrasSimHitCreatorMS", **kwargs): + """Return ISF_FatrasSimHitCreatorMS configured with ComponentAccumulator""" + + mlog = logging.getLogger(name) + mlog.debug('Start configuration') + + result = ComponentAccumulator() + + mergeable_collection_suffix = "_Fatras" + + mdt_hits_collection_name = generate_mergeable_collection_name(bare_collection_name="MDT_Hits", + mergeable_collection_suffix=mergeable_collection_suffix, + merger_input_property="MDTHits") + + rpc_hits_collection_name = generate_mergeable_collection_name(bare_collection_name="RPC_Hits", + mergeable_collection_suffix=mergeable_collection_suffix, + merger_input_property="RPCHits") + + tgc_hits_collection_name = generate_mergeable_collection_name(bare_collection_name="TGC_Hits", + mergeable_collection_suffix=mergeable_collection_suffix, + merger_input_property="TGCHits") + + csc_hits_collection_name = generate_mergeable_collection_name(bare_collection_name="CSC_Hits", + mergeable_collection_suffix=mergeable_collection_suffix, + merger_input_property="CSCHits") + + ##### + # Extrapolator from ACTS to be added + # kwargs.setdefault("Extrapolator" , getPublicTool('ISF_FatrasExtrapolator')) + ##### + kwargs.setdefault("MDTCollectionName", mdt_hits_collection_name) + kwargs.setdefault("RPCCollectionName", rpc_hits_collection_name) + kwargs.setdefault("TGCCollectionName", tgc_hits_collection_name) + kwargs.setdefault("CSCCollectionName", csc_hits_collection_name) + + Muon__MuonTGMeasurementTool = CompFactory.Muon.MuonTGMeasurementTool + muon_tgmeasurement_tool = Muon__MuonTGMeasurementTool(name='MuonTGMeasurementTool', + UseDSManager=True) + result.addPublicTool(muon_tgmeasurement_tool) + kwargs.setdefault("MeasurementTool", muon_tgmeasurement_tool) + + iFatras__SimHitCreatorMS = CompFactory.iFatras.SimHitCreatorMS + result.addPublicTool(iFatras__SimHitCreatorMS(name=name, **kwargs)) + return result + + +def fatrasPdgG4ParticleCfg(flags, name="ISF_FatrasPdgG4Particle", **kwargs): + mlog = logging.getLogger(name) + mlog.debug('Start configuration') + + result = ComponentAccumulator() + + iFatras__PDGToG4Particle = CompFactory.iFatras.PDGToG4Particle + result.addPublicTool(iFatras__PDGToG4Particle(name=name, **kwargs)) + return result + +###################################################################################### +# validation & process sampling +###################################################################################### + + +def fatrasPhysicsValidationToolCfg(flags, name="ISF_FatrasPhysicsValidationTool", **kwargs): + mlog = logging.getLogger(name) + mlog.debug('Start configuration') + + result = ComponentAccumulator() + kwargs.setdefault("ValidationStreamName", "ISFFatras") + + iFatras__PhysicsValidationTool = CompFactory.iFatras.PhysicsValidationTool + result.addPublicTool(iFatras__PhysicsValidationTool(name=name, **kwargs)) + return result + + +def G4RunManagerHelperCfg(flags, name="ISF_G4RunManagerHelper", **kwargs): + mlog = logging.getLogger(name) + mlog.debug('Start configuration') + + result = ComponentAccumulator() + + iGeant4__G4RunManagerHelper = CompFactory.iGeant4.G4RunManagerHelper + result.addPublicTool(iGeant4__G4RunManagerHelper(name=name, **kwargs)) + + return result + + +def fatrasParticleHelperCfg(flags, name="ISF_ParticleHelper", **kwargs): + mlog = logging.getLogger(name) + mlog.debug('Start configuration') + + result = ComponentAccumulator() + + ISF__ParticleHelper = CompFactory.ISF.ParticleHelper + result.addPublicTool(ISF__ParticleHelper(name=name, **kwargs)) + + return result + + +def fatrasParticleDecayHelperCfg(flags, name="ISF_FatrasParticleDecayHelper", **kwargs): + mlog = logging.getLogger(name) + mlog.debug('Start configuration') + + result = ComponentAccumulator() + + acc = fatrasPdgG4ParticleCfg(flags) + pdg_g4part_cfg = acc.getPublicTool('ISF_FatrasPdgG4Particle') + result.merge(acc) + kwargs.setdefault("PDGToG4ParticleConverter", pdg_g4part_cfg) + + acc = fatrasPhysicsValidationToolCfg(flags) + phys_val_cfg = acc.getPublicTool('ISF_FatrasPhysicsValidationTool') + result.merge(acc) + kwargs.setdefault("PhysicsValidationTool", phys_val_cfg) + + acc = G4RunManagerHelperCfg(flags) + g4run_man_cfg = acc.getPublicTool('ISF_G4RunManagerHelper') + result.merge(acc) + kwargs.setdefault("PDGToG4ParticleConverter", g4run_man_cfg) + + iFatras__G4ParticleDecayHelper = CompFactory.iFatras.G4ParticleDecayHelper + result.addPublicTool(iFatras__G4ParticleDecayHelper(name=name, **kwargs)) + + return result + +################################################################################ +# Extrapolator +################################################################################ +# the definition of an extrapolator (to be cleaned up) +def fatrasNavigatorCfg(flags, name="ISF_FatrasNavigator", **kwargs): + mlog = logging.getLogger(name) + mlog.debug('Start configuration') + + result = ComponentAccumulator() + + from TrkConfig.AtlasTrackingGeometrySvcConfig import TrackingGeometrySvcCfg + acc = TrackingGeometrySvcCfg(flags) + kwargs.setdefault("TrackingGeometrySvc", acc.getPrimary()) + result.merge(acc) + + Trk__Navigator = CompFactory.Trk.Navigator + result.addPublicTool(Trk__Navigator(name=name, **kwargs)) + + return result + +def fatrasEnergyLossUpdatorCfg(flags, name="ISF_FatrasEnergyLossUpdator", **kwargs): + mlog = logging.getLogger(name) + mlog.debug('Start configuration') + + result = ComponentAccumulator() + + kwargs.setdefault("UsePDG_EnergyLossFormula", True) + kwargs.setdefault("EnergyLossDistribution", 2) + + iFatras__McEnergyLossUpdator = CompFactory.iFatras.McEnergyLossUpdator + result.addPublicTool(iFatras__McEnergyLossUpdator(name=name, **kwargs)) + + return result + +def fatrasMultipleScatteringUpdatorCfg(flags, name="ISF_FatrasMultipleScatteringUpdator", **kwargs): + mlog = logging.getLogger(name) + mlog.debug('Start configuration') + + result = ComponentAccumulator() + kwargs.setdefault("GaussianMixtureModel", True) + + Trk__MultipleScatteringUpdator = CompFactory.Trk.MultipleScatteringUpdator + result.addPublicTool(Trk__MultipleScatteringUpdator(name=name, **kwargs)) + + return result + +# Combining all in the MaterialEffectsUpdator +def fatrasMaterialUpdatorCfg(flags, name="ISF_FatrasMaterialUpdator", **kwargs): + mlog = logging.getLogger(name) + mlog.debug('Start configuration') + + result = ComponentAccumulator() + + # Geometry Svc + from TrkConfig.AtlasTrackingGeometrySvcConfig import TrackingGeometrySvcCfg + acc = TrackingGeometrySvcCfg(flags) + kwargs.setdefault("TrackingGeometrySvc", acc.getPrimary()) + result.merge(acc) + + # hadronic interactions + kwargs.setdefault("HadronicInteraction", True) + acc = fatrasG4HadIntProcessorCfg(flags) + g4had_proc_cfg = acc.getPublicTool('ISF_FatrasG4HadIntProcessor') + kwargs.setdefault("HadronicInteractionProcessor", g4had_proc_cfg) + result.merge(acc) + + # energy loss + kwargs.setdefault("EnergyLoss", True) + acc = fatrasEnergyLossUpdatorCfg(flags) + eloss_updator = acc.getPublicTool('ISF_FatrasEnergyLossUpdator') + kwargs.setdefault("EnergyLossUpdator", eloss_updator) + result.merge(acc) + + # mutiple scattering + kwargs.setdefault("MultipleScattering", True) + acc = fatrasMultipleScatteringUpdatorCfg(flags) + multi_scattering_updator = acc.getPublicTool('ISF_FatrasMultipleScatteringUpdator') + kwargs.setdefault("MultipleScatteringUpdator", multi_scattering_updator) + result.merge(acc) + + # photon conversion + acc = fatrasConversionCreatorCfg(flags) + ph_conv_cfg = acc.getPublicTool('ISF_FatrasConversionCreator') + result.merge(acc) + kwargs.setdefault("PhotonConversionTool", ph_conv_cfg) + + # the validation output + ## NOTE to be checked + ### kwargs.setdefault("ValidationMode", ISF_Flags.ValidationMode()) + + acc = fatrasPhysicsValidationToolCfg(flags) + phys_val_cfg = acc.getPublicTool('ISF_FatrasPhysicsValidationTool') + result.merge(acc) + kwargs.setdefault("PhysicsValidationTool", phys_val_cfg) + + acc = fatrasProcessSamplingToolCfg(flags) + proc_samp_cfg = acc.getPublicTool('ISF_FatrasProcessSamplingTool') + result.merge(acc) + kwargs.setdefault("ProcessSamplingTool", proc_samp_cfg) + + acc = fatrasParticleDecayHelperCfg(flags) + pdhelper_cfg = acc.getPublicTool('ISF_FatrasParticleDecayHelper') + result.merge(acc) + kwargs.setdefault("ParticleDecayHelper", pdhelper_cfg) + + + iFatras__McMaterialEffectsUpdator = CompFactory.iFatras.McMaterialEffectsUpdator + result.addPublicTool(iFatras__McMaterialEffectsUpdator(name=name, **kwargs)) + + return result + +def fatrasChargedPropagatorCfg(flags, name="ISF_FatrasChargedPropagator", **kwargs): + mlog = logging.getLogger(name) + mlog.debug('Start configuration') + + result = ComponentAccumulator() + # the charged particle propagator + ChargedPropagator = CompFactory.Trk.RungeKuttaPropagator + result.addPublicTool(ChargedPropagator(name=name, **kwargs)) + + return result + +def fatrasSTEP_PropagatorCfg(flags, name="ISF_FatrasSTEP_Propagator", **kwargs): + mlog = logging.getLogger(name) + mlog.debug('Start configuration') + + result = ComponentAccumulator() + kwargs.setdefault("SimulationMode", True) + + acc = fatrasMaterialUpdatorCfg(flags) + material_updator = acc.getPublicTool('ISF_FatrasMaterialUpdator') + result.merge(acc) + kwargs.setdefault("SimMatEffUpdator", material_updator) + + # the step propagaor + StepPropagator = CompFactory.Trk.STEP_Propagator + result.addPublicTool(StepPropagator(name=name, **kwargs)) + + return result + + +def fatrasExtrapolatorCfg(flags, name="ISF_FatrasExtrapolator", **kwargs): + mlog = logging.getLogger(name) + mlog.debug('Start configuration') + + result = ComponentAccumulator() + + # Charged Transport Tool + # assign the tools + acc = fatrasNavigatorCfg(flags) + navigator = acc.getPublicTool('ISF_FatrasNavigator') + result.merge(acc) + kwargs.setdefault("Navigator", navigator) + + acc = fatrasMaterialUpdatorCfg(flags) + material_updator = acc.getPublicTool('ISF_FatrasMaterialUpdator') + result.merge(acc) + kwargs.setdefault("MaterialEffectsUpdators", [material_updator]) + + acc = fatrasChargedPropagatorCfg(flags) + charged_propagator = acc.getPublicTool('ISF_FatrasChargedPropagator') + result.merge(acc) + kwargs.setdefault("Propagators", [charged_propagator]) + + acc = fatrasSTEP_PropagatorCfg(flags) + step_propagator = acc.getPublicTool('ISF_FatrasSTEP_Propagator') + result.merge(acc) + kwargs.setdefault("STEP_Propagator", step_propagator) + + # Fatras specific: stop the trajectory + kwargs.setdefault("StopWithNavigationBreak", True) + kwargs.setdefault("StopWithUpdateKill", True) + kwargs.setdefault("ResolveMuonStation", True) + kwargs.setdefault("UseMuonMatApproximation", True) + + TimedExtrapolator = CompFactory.Trk.TimedExtrapolator + result.addPublicTool(TimedExtrapolator(name=name, **kwargs)) + + return result + +################################################################################ +# SIMULATION TOOL and SERVICE +################################################################################ + +def fatrasKinematicFilterCfg(flags, name="ISF_FatrasKinematicFilter", **kwargs): + mlog = logging.getLogger(name) + mlog.debug('Start configuration') + + result = ComponentAccumulator() + + kwargs.setdefault("MaxEtaSymmetric", 10.) + + ISF__KinematicParticleFilter = CompFactory.ISF.KinematicParticleFilter + result.addPublicTool(ISF__KinematicParticleFilter(name=name, **kwargs)) + + return result + + +def fatrasConversionCreatorCfg(flags, name="ISF_FatrasConversionCreator", **kwargs): + + mlog = logging.getLogger(name) + mlog.debug('Start configuration') + + result = ComponentAccumulator() + + acc = fatrasPhysicsValidationToolCfg(flags) + phys_val_cfg = acc.getPublicTool('ISF_FatrasPhysicsValidationTool') + result.merge(acc) + kwargs.setdefault("PhysicsValidationTool", phys_val_cfg) + + iFatras__PhotonConversionTool = CompFactory.iFatras.PhotonConversionTool + result.addPublicTool(iFatras__PhotonConversionTool(name=name, **kwargs)) + + return result + + +def fatrasG4HadIntProcessorCfg(flags, name="ISF_FatrasG4HadIntProcessor", **kwargs): + mlog = logging.getLogger(name) + mlog.debug('Start configuration') + + result = ComponentAccumulator() + + acc = fatrasPhysicsValidationToolCfg(flags) + phys_val_cfg = acc.getPublicTool('ISF_FatrasPhysicsValidationTool') + result.merge(acc) + kwargs.setdefault("PhysicsValidationTool", phys_val_cfg) + + iFatras__G4HadIntProcessor = CompFactory.iFatras.G4HadIntProcessor + result.addPublicTool(iFatras__G4HadIntProcessor(name=name, **kwargs)) + + return result + + +def fatrasProcessSamplingToolCfg(flags, name="ISF_FatrasProcessSamplingTool", **kwargs): + mlog = logging.getLogger(name) + mlog.debug('Start configuration') + + result = ComponentAccumulator() + + # decays + acc = fatrasParticleDecayHelperCfg(flags) + pd_helper_cfg = acc.getPublicTool('ISF_FatrasParticleDecayHelper') + result.merge(acc) + kwargs.setdefault("ParticleDecayHelper", pd_helper_cfg) + + # photon conversion + acc = fatrasConversionCreatorCfg(flags) + ph_conv_cfg = acc.getPublicTool('ISF_FatrasConversionCreator') + result.merge(acc) + kwargs.setdefault("PhotonConversionTool", ph_conv_cfg) + + # Hadronic interactions + acc = fatrasG4HadIntProcessorCfg(flags) + g4had_proc_cfg = acc.getPublicTool('ISF_FatrasG4HadIntProcessor') + result.merge(acc) + kwargs.setdefault("HadronicInteractionProcessor", g4had_proc_cfg) + + # Validation Tool + acc = fatrasPhysicsValidationToolCfg(flags) + phys_val_cfg = acc.getPublicTool('ISF_FatrasPhysicsValidationTool') + result.merge(acc) + kwargs.setdefault("PhysicsValidationTool", phys_val_cfg) + + iFatras__ProcessSamplingTool = CompFactory.iFatras.ProcessSamplingTool + result.addPublicTool(iFatras__ProcessSamplingTool(name=name, **kwargs)) + + return result + + +def fatrasSimToolCfg(flags, name="ISF_FatrasSimTool", **kwargs): + mlog = logging.getLogger(name) + mlog.debug('Start configuration') + + result = ComponentAccumulator() + + acc = fatrasSimHitCreatorIDCfg(flags) + id_cfg = acc.getPublicTool('ISF_FatrasSimHitCreatorID') + result.merge(acc) + kwargs.setdefault("SimHitCreatorID", id_cfg) + + acc = fatrasSimHitCreatorMSCfg(flags) + ms_cfg = acc.getPublicTool('ISF_FatrasSimHitCreatorMS') + result.merge(acc) + kwargs.setdefault("SimHitCreatorMS", ms_cfg) + + acc = fatrasParticleDecayHelperCfg(flags) + pdhelper_cfg = acc.getPublicTool('ISF_FatrasParticleDecayHelper') + result.merge(acc) + kwargs.setdefault("ParticleDecayHelper", pdhelper_cfg) + + acc = fatrasParticleHelperCfg(flags) + part_helper_cfg = acc.getPublicTool('ISF_ParticleHelper') + result.merge(acc) + kwargs.setdefault("ParticleHelper", part_helper_cfg) + + acc = fatrasKinematicFilterCfg(flags) + kin_filter_cfg = acc.getPublicTool('ISF_FatrasKinematicFilter') + result.merge(acc) + kwargs.setdefault("TrackFilter", kin_filter_cfg) + kwargs.setdefault("NeutralFilter", kin_filter_cfg) + kwargs.setdefault("PhotonFilter", kin_filter_cfg) + + acc = fatrasExtrapolatorCfg(flags) + extrapolator_cfg = acc.getPublicTool('ISF_FatrasExtrapolator') + kwargs.setdefault("Extrapolator", extrapolator_cfg) + result.merge(acc) + + acc = fatrasPhysicsValidationToolCfg(flags) + phys_val_cfg = acc.getPublicTool('ISF_FatrasPhysicsValidationTool') + result.merge(acc) + kwargs.setdefault("PhysicsValidationTool", phys_val_cfg) + + acc = fatrasProcessSamplingToolCfg(flags) + proc_samp_cfg = acc.getPublicTool('ISF_FatrasProcessSamplingTool') + result.merge(acc) + kwargs.setdefault("ProcessSamplingTool", proc_samp_cfg) + + iFatras__TransportTool = CompFactory.iFatras.TransportTool + result.setPrivateTools(iFatras__TransportTool(name=name, **kwargs)) + return result diff --git a/Simulation/ISF/ISF_Fatras/ISF_FatrasTools/CMakeLists.txt b/Simulation/ISF/ISF_Fatras/ISF_FatrasTools/CMakeLists.txt index 99d0352b18117a9bf6362a7350f29d3c428d2a82..b997dc29b97ca87f33c859b032016d7e5a8bc3c6 100644 --- a/Simulation/ISF/ISF_Fatras/ISF_FatrasTools/CMakeLists.txt +++ b/Simulation/ISF/ISF_Fatras/ISF_FatrasTools/CMakeLists.txt @@ -43,4 +43,4 @@ atlas_add_component( ISF_FatrasTools src/*.cxx src/components/*.cxx INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} ${CLHEP_INCLUDE_DIRS} ${EIGEN_INCLUDE_DIRS} - LINK_LIBRARIES ${ROOT_LIBRARIES} ${CLHEP_LIBRARIES} ${EIGEN_LIBRARIES} AthenaBaseComps AthenaKernel GeoPrimitives EventPrimitives GaudiKernel ISF_Event ISF_Interfaces ISF_FatrasInterfaces TrkDetDescrUtils TrkGeometry TrkEventPrimitives TrkParameters TrkExInterfaces TrkExUtils StoreGateLib SGtests AtlasDetDescr TrkDetDescrInterfaces TrkSurfaces TrkVolumes TrkMaterialOnTrack TrkNeutralParameters TrkTrack ) + LINK_LIBRARIES ${ROOT_LIBRARIES} ${CLHEP_LIBRARIES} ${EIGEN_LIBRARIES} AthenaBaseComps AthenaKernel GeoPrimitives EventPrimitives FastSimulationEventLib GaudiKernel ISF_Event ISF_InterfacesLib ISF_FatrasInterfaces TrkDetDescrUtils TrkGeometry TrkEventPrimitives TrkParameters TrkExInterfaces TrkExUtils StoreGateLib SGtests AtlasDetDescr TrkDetDescrInterfaces TrkSurfaces TrkVolumes TrkMaterialOnTrack TrkNeutralParameters TrkTrack ) diff --git a/Simulation/ISF/ISF_Fatras/ISF_FatrasToolsG4/CMakeLists.txt b/Simulation/ISF/ISF_Fatras/ISF_FatrasToolsG4/CMakeLists.txt index 5eb594d7eae713a9f22b598139076a2e3bca5e07..0655fc16a86390bf028d22b6cf88b753a2be1269 100644 --- a/Simulation/ISF/ISF_Fatras/ISF_FatrasToolsG4/CMakeLists.txt +++ b/Simulation/ISF/ISF_Fatras/ISF_FatrasToolsG4/CMakeLists.txt @@ -34,8 +34,5 @@ atlas_add_component( ISF_FatrasToolsG4 src/*.cxx src/components/*.cxx INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} ${Boost_INCLUDE_DIRS} ${XERCESC_INCLUDE_DIRS} ${CLHEP_INCLUDE_DIRS} ${GEANT4_INCLUDE_DIRS} - LINK_LIBRARIES ${ROOT_LIBRARIES} ${Boost_LIBRARIES} ${XERCESC_LIBRARIES} ${CLHEP_LIBRARIES} AtlasHepMCLib ${GEANT4_LIBRARIES} AthenaBaseComps AthenaKernel GaudiKernel ISF_Event ISF_FatrasInterfaces TrkEventPrimitives StoreGateLib SGtests ISF_Interfaces TrkGeometry ) - -# Install files from the package: -atlas_install_headers( ISF_FatrasToolsG4 ) + LINK_LIBRARIES ${ROOT_LIBRARIES} ${Boost_LIBRARIES} ${XERCESC_LIBRARIES} ${CLHEP_LIBRARIES} AtlasHepMCLib ${GEANT4_LIBRARIES} AthenaBaseComps AthenaKernel GaudiKernel ISF_Event ISF_FatrasInterfaces TrkEventPrimitives StoreGateLib SGtests ISF_InterfacesLib ISF_Geant4ToolsLib TrkGeometry ) diff --git a/Simulation/ISF/ISF_Fatras/ISF_FatrasToolsID/CMakeLists.txt b/Simulation/ISF/ISF_Fatras/ISF_FatrasToolsID/CMakeLists.txt index 5479028ef17694450e7ad68c1a101ffe1f0f38d5..231366c6b1a9f54c60a51f8d8efdbc850e29a834 100644 --- a/Simulation/ISF/ISF_Fatras/ISF_FatrasToolsID/CMakeLists.txt +++ b/Simulation/ISF/ISF_Fatras/ISF_FatrasToolsID/CMakeLists.txt @@ -50,5 +50,5 @@ atlas_add_component( ISF_FatrasToolsID src/*.cxx src/components/*.cxx INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} ${CLHEP_INCLUDE_DIRS} - LINK_LIBRARIES ${ROOT_LIBRARIES} ${CLHEP_LIBRARIES} AthenaBaseComps AthenaKernel AthContainers Identifier GaudiKernel InDetSimEvent ISF_FatrasInterfaces TrkParameters TrkExInterfaces StoreGateLib SGtests AtlasDetDescr IdDictDetDescr TRT_ConditionsServicesLib InDetIdentifier InDetReadoutGeometry TRT_ReadoutGeometry InDetPrepRawData InDetRIO_OnTrack SiClusterizationToolLib ISF_Event ISF_Interfaces ISF_FatrasDetDescrModel TrkDetElementBase TrkSurfaces TrkEventPrimitives TrkMeasurementBase TrkRIO_OnTrack TrkTrack TrkExUtils TrkToolInterfaces ) + LINK_LIBRARIES ${ROOT_LIBRARIES} ${CLHEP_LIBRARIES} AthenaBaseComps AthenaKernel AthContainers Identifier GaudiKernel InDetSimEvent ISF_FatrasInterfaces TrkParameters TrkExInterfaces StoreGateLib SGtests AtlasDetDescr IdDictDetDescr TRT_ConditionsServicesLib InDetIdentifier InDetReadoutGeometry TRT_ReadoutGeometry InDetPrepRawData InDetRIO_OnTrack SiClusterizationToolLib ISF_Event ISF_InterfacesLib ISF_FatrasDetDescrModel TrkDetElementBase TrkSurfaces TrkEventPrimitives TrkMeasurementBase TrkRIO_OnTrack TrkTrack TrkExUtils TrkToolInterfaces ) diff --git a/Simulation/ISF/ISF_Fatras/ISF_FatrasToolsMS/CMakeLists.txt b/Simulation/ISF/ISF_Fatras/ISF_FatrasToolsMS/CMakeLists.txt index aff51d5f82ef7dcf4cb9adc5079c2b76be16985b..2828ae54024c259fc6cbd96aecbd36c056796dae 100644 --- a/Simulation/ISF/ISF_Fatras/ISF_FatrasToolsMS/CMakeLists.txt +++ b/Simulation/ISF/ISF_Fatras/ISF_FatrasToolsMS/CMakeLists.txt @@ -5,6 +5,9 @@ # Declare the package name: atlas_subdir( ISF_FatrasToolsMS ) +# External dependencies: +find_package( CLHEP ) + # Declare the package's dependencies: atlas_depends_on_subdirs( PUBLIC GaudiKernel @@ -23,13 +26,10 @@ atlas_depends_on_subdirs( PUBLIC Tracking/TrkEvent/TrkTrack Tracking/TrkExtrapolation/TrkExInterfaces ) -# External dependencies: -find_package( CLHEP ) - # Component(s) in the package: atlas_add_component( ISF_FatrasToolsMS src/*.cxx src/components/*.cxx INCLUDE_DIRS ${CLHEP_INCLUDE_DIRS} - LINK_LIBRARIES ${CLHEP_LIBRARIES} AthenaBaseComps AthenaKernel Identifier GaudiKernel MuonSimEvent ISF_FatrasInterfaces TrkParameters TrkExInterfaces MuonReadoutGeometry MuonIdHelpersLib ISF_Event ISF_Interfaces TrkTrack ) + LINK_LIBRARIES ${CLHEP_LIBRARIES} AthenaBaseComps AthenaKernel Identifier GaudiKernel MuonSimEvent ISF_FatrasInterfaces TrkParameters TrkExInterfaces MuonReadoutGeometry MuonIdHelpersLib ISF_Event ISF_InterfacesLib TrkTrack ) diff --git a/Simulation/ISF/ISF_Geant4/ISF_Geant4CommonServices/CMakeLists.txt b/Simulation/ISF/ISF_Geant4/ISF_Geant4CommonServices/CMakeLists.txt index bf40c560bd5e8b58934a549f25d956735b95be10..0d2a0e38e11c877e5093f40268f60772018c056f 100644 --- a/Simulation/ISF/ISF_Geant4/ISF_Geant4CommonServices/CMakeLists.txt +++ b/Simulation/ISF/ISF_Geant4/ISF_Geant4CommonServices/CMakeLists.txt @@ -25,7 +25,7 @@ atlas_add_component( ISF_Geant4CommonServices src/*.cxx src/components/*.cxx INCLUDE_DIRS ${GEANT4_INCLUDE_DIRS} ${XERCESC_INCLUDE_DIRS} ${CLHEP_INCLUDE_DIRS} - LINK_LIBRARIES ${GEANT4_LIBRARIES} ${XERCESC_LIBRARIES} ${CLHEP_LIBRARIES} GaudiKernel AthenaBaseComps AtlasDetDescr ISF_Event ISF_Interfaces ) + LINK_LIBRARIES ${GEANT4_LIBRARIES} ${XERCESC_LIBRARIES} ${CLHEP_LIBRARIES} GaudiKernel AthenaBaseComps AtlasDetDescr ISF_Event ISF_InterfacesLib SubDetectorEnvelopesLib ) # Install files from the package: atlas_install_python_modules( python/*.py ) diff --git a/Simulation/ISF/ISF_Geant4/ISF_Geant4CommonTools/CMakeLists.txt b/Simulation/ISF/ISF_Geant4/ISF_Geant4CommonTools/CMakeLists.txt index 60a337c4640841cc94c852408b8923c1fa308e9a..8d7b343610474751c473e7c1d974bd7066f09d50 100644 --- a/Simulation/ISF/ISF_Geant4/ISF_Geant4CommonTools/CMakeLists.txt +++ b/Simulation/ISF/ISF_Geant4/ISF_Geant4CommonTools/CMakeLists.txt @@ -19,7 +19,7 @@ atlas_depends_on_subdirs( PUBLIC atlas_add_component( ISF_Geant4CommonTools src/*.cxx src/components/*.cxx - LINK_LIBRARIES GaudiKernel AthenaBaseComps ISF_Event ISF_Interfaces G4AtlasToolsLib ) + LINK_LIBRARIES GaudiKernel AthenaBaseComps ISF_Event ISF_InterfacesLib G4AtlasToolsLib ) # Install files from the package: atlas_install_python_modules( python/*.py ) diff --git a/Simulation/ISF/ISF_Geant4/ISF_Geant4Event/CMakeLists.txt b/Simulation/ISF/ISF_Geant4/ISF_Geant4Event/CMakeLists.txt index 6bd2f4d29bef955f6f61190f67c6106ad269f7cf..8a05034d9ba60eb4737b97336eff2f7104a7dea8 100644 --- a/Simulation/ISF/ISF_Geant4/ISF_Geant4Event/CMakeLists.txt +++ b/Simulation/ISF/ISF_Geant4/ISF_Geant4Event/CMakeLists.txt @@ -36,7 +36,7 @@ atlas_add_library( ISF_Geant4Event LINK_LIBRARIES ${ROOT_LIBRARIES} ${XERCESC_LIBRARIES} ${CLHEP_LIBRARIES} AtlasHepMCLib ${GEANT4_LIBRARIES} ${EIGEN_LIBRARIES} ISF_Event - SimHelpers GeoPrimitives MCTruth) + ISF_InterfacesLib SimHelpers GeoPrimitives MCTruth) #atlas_add_test(SOURCES # INCLUDE_DIRS ${CLHEP_INCLUDE_DIRS} @@ -44,4 +44,4 @@ atlas_add_library( ISF_Geant4Event # LINK_LIBRARIES # ${CLHEP_LIBRARIES} AtlasHepMCLib # ${EIGEN_LIBRARIES} ISF_Event SimHelpers GeoPrimitives -# BarcodeEvent MCTruth) +# BarcodeEventLib MCTruth) diff --git a/Simulation/ISF/ISF_Geant4/ISF_Geant4Services/CMakeLists.txt b/Simulation/ISF/ISF_Geant4/ISF_Geant4Services/CMakeLists.txt index 33392bf411a533e7ed148c8b723b208bab80b9ed..e0d85b059967d9691a4ef7f6afbd9df21a6594ab 100644 --- a/Simulation/ISF/ISF_Geant4/ISF_Geant4Services/CMakeLists.txt +++ b/Simulation/ISF/ISF_Geant4/ISF_Geant4Services/CMakeLists.txt @@ -25,7 +25,7 @@ atlas_add_component( ISF_Geant4Services src/*.cxx src/components/*.cxx INCLUDE_DIRS ${GEANT4_INCLUDE_DIRS} ${XERCESC_INCLUDE_DIRS} ${CLHEP_INCLUDE_DIRS} - LINK_LIBRARIES ${GEANT4_LIBRARIES} ${XERCESC_LIBRARIES} ${CLHEP_LIBRARIES} GaudiKernel AthenaBaseComps StoreGateLib SGtests G4AtlasInterfaces ISF_Event ISF_Interfaces ) + LINK_LIBRARIES ${GEANT4_LIBRARIES} ${XERCESC_LIBRARIES} ${CLHEP_LIBRARIES} GaudiKernel AthenaBaseComps StoreGateLib SGtests G4AtlasInterfaces ISF_Event ISF_InterfacesLib ) # Install files from the package: atlas_install_python_modules( python/*.py ) diff --git a/Simulation/ISF/ISF_Geant4/ISF_Geant4Tools/CMakeLists.txt b/Simulation/ISF/ISF_Geant4/ISF_Geant4Tools/CMakeLists.txt index 6aad927886fd73ca54dcbb11912a9187c7b940d9..071abf40acba993f0414438a5c515a472d8a985e 100644 --- a/Simulation/ISF/ISF_Geant4/ISF_Geant4Tools/CMakeLists.txt +++ b/Simulation/ISF/ISF_Geant4/ISF_Geant4Tools/CMakeLists.txt @@ -17,7 +17,7 @@ atlas_depends_on_subdirs( PUBLIC Generators/AtlasHepMC Generators/GeneratorObjects Simulation/G4Atlas/G4AtlasTools - Simulation/G4Atlas/G4AtlasAlg + Simulation/G4Atlas/G4AtlasAlg Simulation/G4Sim/MCTruth Simulation/G4Sim/SimHelpers Simulation/ISF/ISF_Core/ISF_Event @@ -31,14 +31,19 @@ find_package( Geant4 ) find_package( ROOT COMPONENTS Core Tree MathCore Hist RIO pthread ) find_package( XercesC ) +atlas_add_library( ISF_Geant4ToolsLib + ISF_Geant4Tools/*.h + INTERFACE + PUBLIC_HEADERS ISF_Geant4Tools + LINK_LIBRARIES GaudiKernel G4AtlasAlgLib ) + # Component(s) in the package: atlas_add_component( ISF_Geant4Tools src/*.cxx src/components/*.cxx INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} ${XERCESC_INCLUDE_DIRS} ${CLHEP_INCLUDE_DIRS} ${GEANT4_INCLUDE_DIRS} ${EIGEN_INCLUDE_DIRS} - LINK_LIBRARIES ${ROOT_LIBRARIES} ${XERCESC_LIBRARIES} ${CLHEP_LIBRARIES} AtlasHepMCLib ${GEANT4_LIBRARIES} ${EIGEN_LIBRARIES} AthenaKernel GaudiKernel G4AtlasInterfaces AthenaBaseComps StoreGateLib SGtests AtlasDetDescr GeneratorObjects G4AtlasToolsLib G4AtlasAlgLib MCTruth SimHelpers ISF_Event ISF_Interfaces ISF_Geant4Event ) + LINK_LIBRARIES ${ROOT_LIBRARIES} ${XERCESC_LIBRARIES} ${CLHEP_LIBRARIES} AtlasHepMCLib ${GEANT4_LIBRARIES} ${EIGEN_LIBRARIES} AthenaKernel GaudiKernel G4AtlasInterfaces AthenaBaseComps StoreGateLib SGtests AtlasDetDescr GeneratorObjects G4AtlasToolsLib G4AtlasAlgLib MCTruth SimHelpers ISF_Event ISF_InterfacesLib ISF_Geant4Event ISF_Geant4ToolsLib ) # Install files from the package: -atlas_install_headers( ISF_Geant4Tools ) atlas_install_python_modules( python/*.py ) diff --git a/Simulation/ISF/ISF_Geant4/ISF_Geant4UserActions/CMakeLists.txt b/Simulation/ISF/ISF_Geant4/ISF_Geant4UserActions/CMakeLists.txt index bb3f6a56d3e66097e8f498cf92428c3c4fc0c747..05b2180d439d1c40737b012fa5ea9d63c4acd49f 100644 --- a/Simulation/ISF/ISF_Geant4/ISF_Geant4UserActions/CMakeLists.txt +++ b/Simulation/ISF/ISF_Geant4/ISF_Geant4UserActions/CMakeLists.txt @@ -32,7 +32,7 @@ atlas_add_component( ISF_Geant4UserActions src/*.cxx src/components/*.cxx INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} ${XERCESC_INCLUDE_DIRS} ${GEANT4_INCLUDE_DIRS} ${CLHEP_INCLUDE_DIRS} - LINK_LIBRARIES ${ROOT_LIBRARIES} ${XERCESC_LIBRARIES} ${GEANT4_LIBRARIES} ${CLHEP_LIBRARIES} StoreGateLib SGtests GaudiKernel G4AtlasInterfaces G4AtlasToolsLib CaloDetDescrLib CaloIdentifier GeneratorObjects LArG4Code ISF_FastCaloSimEvent Identifier ) + LINK_LIBRARIES ${ROOT_LIBRARIES} ${XERCESC_LIBRARIES} ${GEANT4_LIBRARIES} ${CLHEP_LIBRARIES} StoreGateLib SGtests GaudiKernel G4AtlasInterfaces G4AtlasToolsLib CaloDetDescrLib CaloIdentifier GeneratorObjects LArG4Code ISF_FastCaloSimEvent Identifier TileG4InterfacesLib ) # Install files from the package: atlas_install_python_modules( python/*.py ) diff --git a/Simulation/ISF/ISF_HepMC/ISF_HepMC_Interfaces/CMakeLists.txt b/Simulation/ISF/ISF_HepMC/ISF_HepMC_Interfaces/CMakeLists.txt index b0845f3d26a0ad9a8055fbf24a7af39f2398e002..0b9122bb837ef891039ab58094de3e46c04e4957 100644 --- a/Simulation/ISF/ISF_HepMC/ISF_HepMC_Interfaces/CMakeLists.txt +++ b/Simulation/ISF/ISF_HepMC/ISF_HepMC_Interfaces/CMakeLists.txt @@ -11,6 +11,9 @@ atlas_depends_on_subdirs( PUBLIC Generators/AtlasHepMC Simulation/ISF/ISF_Core/ISF_Event ) -# Install files from the package: -atlas_install_headers( ISF_HepMC_Interfaces ) +atlas_add_library( ISF_HepMC_Interfaces + ISF_HepMC_Interfaces/*.h + INTERFACE + PUBLIC_HEADERS ISF_HepMC_Interfaces + LINK_LIBRARIES AtlasHepMCLib GaudiKernel ISF_Event ) diff --git a/Simulation/ISF/ISF_HepMC/ISF_HepMC_Tools/CMakeLists.txt b/Simulation/ISF/ISF_HepMC/ISF_HepMC_Tools/CMakeLists.txt index 78f249afa983d22f9955f653f2b9772d73bc6b42..83274b189ef3c2287d0c208e2a78742d51f6566a 100644 --- a/Simulation/ISF/ISF_HepMC/ISF_HepMC_Tools/CMakeLists.txt +++ b/Simulation/ISF/ISF_HepMC/ISF_HepMC_Tools/CMakeLists.txt @@ -30,25 +30,25 @@ atlas_add_component( ISF_HepMC_Tools src/*.cxx src/components/*.cxx INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} - LINK_LIBRARIES ${ROOT_LIBRARIES} AtlasHepMCLib GaudiKernel AtlasDetDescr AthenaBaseComps TruthUtils ISF_Event ISF_Interfaces PathResolver ) + LINK_LIBRARIES ${ROOT_LIBRARIES} AtlasHepMCLib GaudiKernel AtlasDetDescr AthenaBaseComps TruthUtils ISF_Event ISF_HepMC_Interfaces ISF_InterfacesLib PathResolver ) # Tests atlas_add_test( GenParticleGenericFilter_test SOURCES test/GenParticleGenericFilter_test.cxx src/GenParticleGenericFilter.cxx INCLUDE_DIRS ${GTEST_INCLUDE_DIRS} ${GMOCK_INCLUDE_DIRS} - LINK_LIBRARIES ${GTEST_LIBRARIES} ${GMOCK_LIBRARIES} AtlasHepMCLib AthenaBaseComps ) + LINK_LIBRARIES ${GTEST_LIBRARIES} ${GMOCK_LIBRARIES} AtlasHepMCLib AthenaBaseComps ISF_HepMC_Interfaces ) # Tests atlas_add_test( GenParticleInteractingFilter_test SOURCES test/GenParticleInteractingFilter_test.cxx src/GenParticleInteractingFilter.cxx INCLUDE_DIRS ${GTEST_INCLUDE_DIRS} ${GMOCK_INCLUDE_DIRS} - LINK_LIBRARIES ${GTEST_LIBRARIES} ${GMOCK_LIBRARIES} AtlasHepMCLib AthenaBaseComps TruthUtils ) + LINK_LIBRARIES ${GTEST_LIBRARIES} ${GMOCK_LIBRARIES} AtlasHepMCLib AthenaBaseComps TruthUtils ISF_HepMC_Interfaces ) # Tests atlas_add_test( GenParticleLifetimeFilter_test SOURCES test/GenParticleLifetimeFilter_test.cxx src/GenParticleLifetimeFilter.cxx INCLUDE_DIRS ${GTEST_INCLUDE_DIRS} ${GMOCK_INCLUDE_DIRS} - LINK_LIBRARIES ${GTEST_LIBRARIES} ${GMOCK_LIBRARIES} AtlasHepMCLib AthenaBaseComps TruthUtils ) + LINK_LIBRARIES ${GTEST_LIBRARIES} ${GMOCK_LIBRARIES} AtlasHepMCLib AthenaBaseComps TruthUtils ISF_HepMC_Interfaces ) # Install files from the package: atlas_install_python_modules( python/*.py ) diff --git a/Simulation/ISF/ISF_ParametricSim/ISF_ParSimInterfaces/CMakeLists.txt b/Simulation/ISF/ISF_ParametricSim/ISF_ParSimInterfaces/CMakeLists.txt index c2dcd3cca32401a897765f2366f153091fab6101..b203d83575450d872f5669686f44c3987daa1b4b 100644 --- a/Simulation/ISF/ISF_ParametricSim/ISF_ParSimInterfaces/CMakeLists.txt +++ b/Simulation/ISF/ISF_ParametricSim/ISF_ParSimInterfaces/CMakeLists.txt @@ -11,6 +11,8 @@ atlas_depends_on_subdirs( PUBLIC GaudiKernel Tracking/TrkEvent/TrkParameters ) -# Install files from the package: -atlas_install_headers( ISF_ParSimInterfaces ) - +atlas_add_library( ISF_ParSimInterfacesLib + ISF_ParSimInterfaces/*.h + INTERFACE + PUBLIC_HEADERS ISF_ParSimInterfaces + LINK_LIBRARIES GaudiKernel TrkParameters xAODTracking ) diff --git a/Simulation/ISF/ISF_ParametricSim/ISF_ParSimServices/CMakeLists.txt b/Simulation/ISF/ISF_ParametricSim/ISF_ParSimServices/CMakeLists.txt index ff1d99b93db4da12c2946d11ad66e825b5fb1e2f..f7210c1a06a049963a891c63436f52b5ba2404c1 100644 --- a/Simulation/ISF/ISF_ParametricSim/ISF_ParSimServices/CMakeLists.txt +++ b/Simulation/ISF/ISF_ParametricSim/ISF_ParSimServices/CMakeLists.txt @@ -18,9 +18,8 @@ atlas_depends_on_subdirs( PUBLIC atlas_add_component( ISF_ParSimServices src/*.cxx src/components/*.cxx - LINK_LIBRARIES AthenaBaseComps GaudiKernel ISF_Interfaces TrkDetDescrInterfaces ISF_Event ) + LINK_LIBRARIES AthenaBaseComps GaudiKernel ISF_InterfacesLib ISF_ParSimInterfacesLib TrkDetDescrInterfaces ISF_Event ) # Install files from the package: -atlas_install_headers( ISF_ParSimServices ) atlas_install_python_modules( python/*.py ) diff --git a/Simulation/ISF/ISF_ParametricSim/ISF_ParSimTools/CMakeLists.txt b/Simulation/ISF/ISF_ParametricSim/ISF_ParSimTools/CMakeLists.txt index 1fbd2609ad869f4dfef0a8f8bf06dc582fec4b06..31c2a8934b776e0d4b1db885318bdcdfe5b397d8 100644 --- a/Simulation/ISF/ISF_ParametricSim/ISF_ParSimTools/CMakeLists.txt +++ b/Simulation/ISF/ISF_ParametricSim/ISF_ParSimTools/CMakeLists.txt @@ -30,9 +30,8 @@ atlas_add_component( ISF_ParSimTools src/*.cxx src/components/*.cxx INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} ${CLHEP_INCLUDE_DIRS} - LINK_LIBRARIES ${ROOT_LIBRARIES} ${CLHEP_LIBRARIES} AthenaBaseComps AthenaKernel xAODTracking GaudiKernel ISF_Interfaces TrkExInterfaces ISF_Event PathResolver TrkParameters ) + LINK_LIBRARIES ${ROOT_LIBRARIES} ${CLHEP_LIBRARIES} AthenaBaseComps AthenaKernel BeamSpotConditionsData xAODTracking GaudiKernel ISF_InterfacesLib TrkExInterfaces ISF_Event ISF_ParSimInterfacesLib PathResolver TrkParameters ) # Install files from the package: -atlas_install_headers( ISF_ParSimTools ) atlas_install_runtime( Data/*.txt Data/*.root ) diff --git a/Simulation/ISF/ISF_SimulationSelectors/CMakeLists.txt b/Simulation/ISF/ISF_SimulationSelectors/CMakeLists.txt index 3e6f6364606d91c019381f49b02f925b41731cc2..6e0e8c57a54e8e659a81a212f9b52e12aac83c1f 100644 --- a/Simulation/ISF/ISF_SimulationSelectors/CMakeLists.txt +++ b/Simulation/ISF/ISF_SimulationSelectors/CMakeLists.txt @@ -22,8 +22,8 @@ find_package( ROOT COMPONENTS Core Tree MathCore Hist RIO pthread ) atlas_add_component( ISF_SimulationSelectors src/*.cxx src/components/*.cxx - INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} - LINK_LIBRARIES ${ROOT_LIBRARIES} AtlasHepMCLib GaudiKernel BarcodeServicesLib ISF_Event ISF_Interfaces ) + INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} + LINK_LIBRARIES ${ROOT_LIBRARIES} AtlasHepMCLib GaudiKernel BarcodeServicesLib ISF_Event ISF_InterfacesLib ISF_TrackingInterfacesLib ) # Install files from the package: atlas_install_python_modules( python/*.py ) diff --git a/Simulation/ISF/ISF_Tracking/ISF_TrackingInterfaces/CMakeLists.txt b/Simulation/ISF/ISF_Tracking/ISF_TrackingInterfaces/CMakeLists.txt index cfb972892e23cec16074bf47397d082a5e2b18f3..fff627d0896d83f6c35ff4b7ec55289fb5a0289a 100644 --- a/Simulation/ISF/ISF_Tracking/ISF_TrackingInterfaces/CMakeLists.txt +++ b/Simulation/ISF/ISF_Tracking/ISF_TrackingInterfaces/CMakeLists.txt @@ -9,6 +9,8 @@ atlas_subdir( ISF_TrackingInterfaces ) atlas_depends_on_subdirs( PUBLIC GaudiKernel ) -# Install files from the package: -atlas_install_headers( ISF_TrackingInterfaces ) - +atlas_add_library( ISF_TrackingInterfacesLib + ISF_TrackingInterfaces/*.h + INTERFACE + PUBLIC_HEADERS ISF_TrackingInterfaces + LINK_LIBRARIES GaudiKernel ) diff --git a/Simulation/ISF/ISF_Tracking/ISF_TrackingTools/CMakeLists.txt b/Simulation/ISF/ISF_Tracking/ISF_TrackingTools/CMakeLists.txt index fa6ac65c7bd6053bca7ed6964568f895e60cd95d..3d33a6332f094cfbeae33b53c49778816d69935d 100644 --- a/Simulation/ISF/ISF_Tracking/ISF_TrackingTools/CMakeLists.txt +++ b/Simulation/ISF/ISF_Tracking/ISF_TrackingTools/CMakeLists.txt @@ -22,7 +22,7 @@ atlas_depends_on_subdirs( PUBLIC atlas_add_component( ISF_TrackingTools src/*.cxx src/components/*.cxx - LINK_LIBRARIES GaudiKernel AthenaBaseComps ISF_Event TrkDetDescrInterfaces TrkGeometry TrkEventPrimitives TrkParameters TrkExInterfaces ) + LINK_LIBRARIES GaudiKernel AthenaBaseComps ISF_Event ISF_TrackingInterfacesLib TrkDetDescrInterfaces TrkGeometry TrkEventPrimitives TrkParameters TrkExInterfaces ) # Install files from the package: atlas_install_python_modules( python/*.py ) diff --git a/Simulation/Interfaces/HepMC_Interfaces/CMakeLists.txt b/Simulation/Interfaces/HepMC_Interfaces/CMakeLists.txt index f2c455eec6e047de9d4d00c444bd6bc14ad4ab11..e79ad0932bdb4bf737cf4c19abb120929aa2092c 100644 --- a/Simulation/Interfaces/HepMC_Interfaces/CMakeLists.txt +++ b/Simulation/Interfaces/HepMC_Interfaces/CMakeLists.txt @@ -10,6 +10,9 @@ atlas_depends_on_subdirs( PUBLIC Generators/AtlasHepMC GaudiKernel ) -# Install files from the package: -atlas_install_headers( HepMC_Interfaces ) +atlas_add_library( HepMC_InterfacesLib + HepMC_Interfaces/*.h + INTERFACE + PUBLIC_HEADERS HepMC_Interfaces + LINK_LIBRARIES AtlasHepMCLib GaudiKernel ) diff --git a/Simulation/Overlay/OverlayCopyAlgs/CMakeLists.txt b/Simulation/Overlay/OverlayCopyAlgs/CMakeLists.txt index a83ac8846b1c9323e06d3cb34e5ba367e2bb8112..9b2fcdd62290f731300f3e1720f4b2ef3116ce51 100644 --- a/Simulation/Overlay/OverlayCopyAlgs/CMakeLists.txt +++ b/Simulation/Overlay/OverlayCopyAlgs/CMakeLists.txt @@ -5,24 +5,13 @@ # Declare the package name: atlas_subdir( OverlayCopyAlgs ) -# Declare the package's dependencies: -atlas_depends_on_subdirs( PUBLIC - GaudiKernel - PRIVATE - Calorimeter/CaloSimEvent - Control/AthenaBaseComps - Event/xAOD/xAODJet - Generators/GeneratorObjects - Reconstruction/RecEvent - Simulation/G4Sim/TrackRecord ) - # Component(s) in the package: atlas_add_component( OverlayCopyAlgs src/*.cxx src/components/*.cxx LINK_LIBRARIES GaudiKernel AthenaBaseComps CaloSimEvent GeneratorObjects RecEvent - xAODJet ) + TrackRecordLib xAODJet ) # Install files from the package: atlas_install_python_modules( python/*.py diff --git a/Simulation/Tools/HitAnalysis/CMakeLists.txt b/Simulation/Tools/HitAnalysis/CMakeLists.txt index c5755f260819e0b1d209c3f02c15a6866698985d..1ebce403dc6abf91e0e29b93db6eeb9330387e52 100644 --- a/Simulation/Tools/HitAnalysis/CMakeLists.txt +++ b/Simulation/Tools/HitAnalysis/CMakeLists.txt @@ -40,8 +40,8 @@ find_package( ROOT COMPONENTS Core Tree MathCore Hist RIO pthread Table MathMore atlas_add_component( HitAnalysis src/*.cxx src/components/*.cxx - INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} ${CLHEP_INCLUDE_DIRS} - LINK_LIBRARIES ${ROOT_LIBRARIES} ${CLHEP_LIBRARIES} AtlasHepMCLib GaudiKernel CaloDetDescrLib CaloIdentifier CaloSimEvent AthenaBaseComps GeoAdaptors EventInfo AFP_SimEv ALFA_SimEv LUCID_SimEvent ZDC_SimEvent GeneratorObjects InDetSimEvent LArSimEvent MuonSimEvent TileDetDescr TileSimEvent ) + INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} ${CLHEP_INCLUDE_DIRS} + LINK_LIBRARIES ${ROOT_LIBRARIES} ${CLHEP_LIBRARIES} AtlasHepMCLib GaudiKernel CaloDetDescrLib CaloIdentifier CaloSimEvent AthenaBaseComps GeoAdaptors EventInfo AFP_SimEv ALFA_SimEv LUCID_SimEvent ZDC_SimEvent GeneratorObjects InDetSimEvent LArSimEvent MuonSimEvent TileDetDescr TileSimEvent TrackRecordLib ) # Install files from the package: atlas_install_joboptions( share/*.py ) diff --git a/Simulation/TruthJiveXML/CMakeLists.txt b/Simulation/TruthJiveXML/CMakeLists.txt index fe2785555abb040e21df9d822e1926f9b2da93dc..5c26e995a99b74ae7351dcf41a97760d518ebafa 100644 --- a/Simulation/TruthJiveXML/CMakeLists.txt +++ b/Simulation/TruthJiveXML/CMakeLists.txt @@ -26,7 +26,7 @@ atlas_add_component( TruthJiveXML src/*.cxx src/components/*.cxx INCLUDE_DIRS ${HEPPDT_INCLUDE_DIRS} ${CLHEP_INCLUDE_DIRS} - LINK_LIBRARIES ${HEPPDT_LIBRARIES} ${CLHEP_LIBRARIES} AtlasHepMCLib AthenaBaseComps GaudiKernel JiveXMLLib StoreGateLib SGtests EventPrimitives GeneratorObjects ) + LINK_LIBRARIES ${HEPPDT_LIBRARIES} ${CLHEP_LIBRARIES} AtlasHepMCLib AthenaBaseComps GaudiKernel JiveXMLLib StoreGateLib SGtests EventPrimitives GeneratorObjects TrackRecordLib ) # Install files from the package: atlas_install_headers( TruthJiveXML ) diff --git a/TileCalorimeter/TileCalib/TileCalibAlgs/src/TileRawChNoiseCalibAlg.cxx b/TileCalorimeter/TileCalib/TileCalibAlgs/src/TileRawChNoiseCalibAlg.cxx index baf2c8822266941f2d35e8a86da8b955b0c7ec33..7ca07f53e033039b5c71982b6933fce8f1938093 100644 --- a/TileCalorimeter/TileCalib/TileCalibAlgs/src/TileRawChNoiseCalibAlg.cxx +++ b/TileCalorimeter/TileCalib/TileCalibAlgs/src/TileRawChNoiseCalibAlg.cxx @@ -48,13 +48,6 @@ #include <iostream> -#if ROOT_VERSION_CODE >= ROOT_VERSION(6,0,0) -# define CAN_REBIN(hist) hist->SetCanExtend(TH1::kAllAxes) -#else -# define CAN_REBIN(hist) hist->SetBit(TH1::kCanRebin) -#endif - - TileRawChNoiseCalibAlg::TileRawChNoiseCalibAlg(const std::string& name, ISvcLocator* pSvcLocator) : AthAlgorithm(name,pSvcLocator) , m_beamCnv(0) @@ -220,7 +213,7 @@ StatusCode TileRawChNoiseCalibAlg::initialize() { sStr << "Amplitudes_RC_" << rc << "_Part_" << ros << "_Drawer_" << drawer << "_Ch_" << ch << "_Gain_" << g; nam = sStr.str(); m_histAmp[rc][ros][drawer][ch][g] = new TH1F(nam.c_str(), nam.c_str(), nbin, -xmax[g], xmax[g]); - CAN_REBIN(m_histAmp[rc][ros][drawer][ch][g]); //in case some entries are outside the initial limits + m_histAmp[rc][ros][drawer][ch][g]->SetCanExtend(TH1::kAllAxes); //in case some entries are outside the initial limits m_histAmp[rc][ros][drawer][ch][g]->SetDirectory(0); } } @@ -241,7 +234,7 @@ StatusCode TileRawChNoiseCalibAlg::initialize() { sStr << "CellAmplitude_Side_" << side << "_Drawer_" << drawer << "_Sample_" << sample << "_Tower_" << tower << "_Gains_" << gg; nam = sStr.str(); m_histCellAmp[side][drawer][sample][tower][gg] = new TH1F(nam.c_str(), nam.c_str(), nbin, -xcellmax[gg / 3], xcellmax[gg / 3]); // cell limits should be at least sqrt(2)*channel limits - CAN_REBIN(m_histCellAmp[side][drawer][sample][tower][gg]); //in case some entries are outside the initial limits + m_histCellAmp[side][drawer][sample][tower][gg]->SetCanExtend(TH1::kAllAxes); //in case some entries are outside the initial limits m_histCellAmp[side][drawer][sample][tower][gg]->SetDirectory(0); } } diff --git a/TileCalorimeter/TileFastCaloSim/CMakeLists.txt b/TileCalorimeter/TileFastCaloSim/CMakeLists.txt index f8ad66c83c7b945b392981d4e14a1e54a9e648a2..61abce859aaada45355e395e524df0c3f6831d46 100644 --- a/TileCalorimeter/TileFastCaloSim/CMakeLists.txt +++ b/TileCalorimeter/TileFastCaloSim/CMakeLists.txt @@ -32,7 +32,7 @@ atlas_add_component( TileFastCaloSim src/*.cxx src/components/*.cxx INCLUDE_DIRS ${GEANT4_INCLUDE_DIRS} ${XERCESC_INCLUDE_DIRS} ${CLHEP_INCLUDE_DIRS} - LINK_LIBRARIES ${GEANT4_LIBRARIES} ${XERCESC_LIBRARIES} ${CLHEP_LIBRARIES} CaloEvent CaloIdentifier AthenaBaseComps AthenaKernel GaudiKernel ISF_FastCaloSimEvent TileConditionsLib TileDetDescr TileGeoModelLib TileSimEvent ) + LINK_LIBRARIES ${GEANT4_LIBRARIES} ${XERCESC_LIBRARIES} ${CLHEP_LIBRARIES} CaloEvent CaloIdentifier AthenaBaseComps AthenaKernel GaudiKernel ISF_FastCaloSimEvent TileConditionsLib TileDetDescr TileGeoModelLib TileG4InterfacesLib TileSimEvent ) # Install files from the package: atlas_install_joboptions( share/*.py ) diff --git a/TileCalorimeter/TileG4/TileAncillary/CombinedScintillator/CMakeLists.txt b/TileCalorimeter/TileG4/TileAncillary/CombinedScintillator/CMakeLists.txt index 45ff17552b9beb8ebfc2a0743911ede13cd0d6b5..dc893512ae88317f7a9d991c0ccd9c8110570ebb 100644 --- a/TileCalorimeter/TileG4/TileAncillary/CombinedScintillator/CMakeLists.txt +++ b/TileCalorimeter/TileG4/TileAncillary/CombinedScintillator/CMakeLists.txt @@ -26,7 +26,7 @@ atlas_add_component( CombinedScintillator src/*.cc src/components/*.cxx INCLUDE_DIRS ${GEANT4_INCLUDE_DIRS} ${XERCESC_INCLUDE_DIRS} ${CLHEP_INCLUDE_DIRS} ${GEOMODELCORE_INCLUDE_DIRS} - LINK_LIBRARIES ${GEANT4_LIBRARIES} ${XERCESC_LIBRARIES} ${CLHEP_LIBRARIES} ${GEOMODELCORE_LIBRARIES} CaloIdentifier StoreGateLib SGtests GaudiKernel G4AtlasToolsLib GeoMaterial2G4 TileSimEvent ) + LINK_LIBRARIES ${GEANT4_LIBRARIES} ${XERCESC_LIBRARIES} ${CLHEP_LIBRARIES} ${GEOMODELCORE_LIBRARIES} CaloIdentifier StoreGateLib SGtests GaudiKernel G4AtlasToolsLib GeoMaterial2G4 GeoModelInterfaces TileSimEvent ) # Install files from the package: atlas_install_python_modules( python/*.py ) diff --git a/TileCalorimeter/TileG4/TileAncillary/DeadMaterial/CMakeLists.txt b/TileCalorimeter/TileG4/TileAncillary/DeadMaterial/CMakeLists.txt index 003157f9ace40576f443422c723b058becaa9dc6..9935230e5ee14decbf79318cd2f3daa5ef8a1a4a 100644 --- a/TileCalorimeter/TileG4/TileAncillary/DeadMaterial/CMakeLists.txt +++ b/TileCalorimeter/TileG4/TileAncillary/DeadMaterial/CMakeLists.txt @@ -24,7 +24,7 @@ atlas_add_component( DeadMaterial src/*.cxx src/components/*.cxx INCLUDE_DIRS ${GEANT4_INCLUDE_DIRS} ${XERCESC_INCLUDE_DIRS} ${CLHEP_INCLUDE_DIRS} ${GEOMODELCORE_INCLUDE_DIRS} - LINK_LIBRARIES ${GEANT4_LIBRARIES} ${XERCESC_LIBRARIES} ${CLHEP_LIBRARIES} ${GEOMODELCORE_LIBRARIES} StoreGateLib SGtests GaudiKernel G4AtlasToolsLib GeoMaterial2G4 ) + LINK_LIBRARIES ${GEANT4_LIBRARIES} ${XERCESC_LIBRARIES} ${CLHEP_LIBRARIES} ${GEOMODELCORE_LIBRARIES} StoreGateLib SGtests GaudiKernel G4AtlasToolsLib GeoMaterial2G4 GeoModelInterfaces ) # Install files from the package: atlas_install_python_modules( python/*.py ) diff --git a/TileCalorimeter/TileG4/TileAncillary/LarCrate/CMakeLists.txt b/TileCalorimeter/TileG4/TileAncillary/LarCrate/CMakeLists.txt index 33792986ca2049794726018d32e8eb00a4023326..3ceff941462547fab912ebec76e66396ed6d324d 100644 --- a/TileCalorimeter/TileG4/TileAncillary/LarCrate/CMakeLists.txt +++ b/TileCalorimeter/TileG4/TileAncillary/LarCrate/CMakeLists.txt @@ -24,7 +24,7 @@ atlas_add_component( LarCrate src/*.cxx src/components/*.cxx INCLUDE_DIRS ${GEANT4_INCLUDE_DIRS} ${XERCESC_INCLUDE_DIRS} ${CLHEP_INCLUDE_DIRS} ${GEOMODELCORE_INCLUDE_DIRS} - LINK_LIBRARIES ${GEANT4_LIBRARIES} ${XERCESC_LIBRARIES} ${CLHEP_LIBRARIES} ${GEOMODELCORE_LIBRARIES} StoreGateLib SGtests GaudiKernel G4AtlasToolsLib GeoMaterial2G4 ) + LINK_LIBRARIES ${GEANT4_LIBRARIES} ${XERCESC_LIBRARIES} ${CLHEP_LIBRARIES} ${GEOMODELCORE_LIBRARIES} StoreGateLib SGtests GaudiKernel G4AtlasToolsLib GeoMaterial2G4 GeoModelInterfaces ) # Install files from the package: atlas_install_python_modules( python/*.py ) diff --git a/TileCalorimeter/TileG4/TileAncillary/MuonWall/CMakeLists.txt b/TileCalorimeter/TileG4/TileAncillary/MuonWall/CMakeLists.txt index bff63e779bbb4c8518148134197d2c9968eb50ae..176d0e772266e81d8e987a4b49a65168f39a67f6 100644 --- a/TileCalorimeter/TileG4/TileAncillary/MuonWall/CMakeLists.txt +++ b/TileCalorimeter/TileG4/TileAncillary/MuonWall/CMakeLists.txt @@ -26,7 +26,7 @@ atlas_add_component( MuonWall src/*.cxx src/components/*.cxx INCLUDE_DIRS ${GEANT4_INCLUDE_DIRS} ${XERCESC_INCLUDE_DIRS} ${CLHEP_INCLUDE_DIRS} ${GEOMODELCORE_INCLUDE_DIRS} - LINK_LIBRARIES ${GEANT4_LIBRARIES} ${XERCESC_LIBRARIES} ${CLHEP_LIBRARIES} ${GEOMODELCORE_LIBRARIES} CaloIdentifier StoreGateLib SGtests GaudiKernel G4AtlasToolsLib GeoMaterial2G4 TileSimEvent ) + LINK_LIBRARIES ${GEANT4_LIBRARIES} ${XERCESC_LIBRARIES} ${CLHEP_LIBRARIES} ${GEOMODELCORE_LIBRARIES} CaloIdentifier StoreGateLib SGtests GaudiKernel G4AtlasToolsLib GeoModelInterfaces GeoMaterial2G4 TileSimEvent ) # Install files from the package: atlas_install_python_modules( python/*.py ) diff --git a/TileCalorimeter/TileG4/TileAncillary/PhantomCalorimeter/CMakeLists.txt b/TileCalorimeter/TileG4/TileAncillary/PhantomCalorimeter/CMakeLists.txt index dbbe1099c16b93a670221d567a8f8c06c2d6cde2..c0ee2e92536910b6e2bc502239a52b00af4e3e2f 100644 --- a/TileCalorimeter/TileG4/TileAncillary/PhantomCalorimeter/CMakeLists.txt +++ b/TileCalorimeter/TileG4/TileAncillary/PhantomCalorimeter/CMakeLists.txt @@ -26,7 +26,7 @@ atlas_add_component( PhantomCalorimeter src/*.cc src/components/*.cxx INCLUDE_DIRS ${GEANT4_INCLUDE_DIRS} ${XERCESC_INCLUDE_DIRS} ${CLHEP_INCLUDE_DIRS} ${GEOMODELCORE_INCLUDE_DIRS} - LINK_LIBRARIES ${GEANT4_LIBRARIES} ${XERCESC_LIBRARIES} ${CLHEP_LIBRARIES} ${GEOMODELCORE_LIBRARIES} CaloIdentifier StoreGateLib SGtests GaudiKernel G4AtlasToolsLib GeoMaterial2G4 TileSimEvent ) + LINK_LIBRARIES ${GEANT4_LIBRARIES} ${XERCESC_LIBRARIES} ${CLHEP_LIBRARIES} ${GEOMODELCORE_LIBRARIES} CaloIdentifier StoreGateLib SGtests GaudiKernel G4AtlasToolsLib GeoMaterial2G4 GeoModelInterfaces TileSimEvent ) # Install files from the package: atlas_install_python_modules( python/*.py ) diff --git a/TileCalorimeter/TileG4/TileG4Interfaces/CMakeLists.txt b/TileCalorimeter/TileG4/TileG4Interfaces/CMakeLists.txt index d6441544b0666396eb5ea405ef57e7a43aa49321..c1f91e064cc83314ff835ec3d9e8950396a7c77f 100644 --- a/TileCalorimeter/TileG4/TileG4Interfaces/CMakeLists.txt +++ b/TileCalorimeter/TileG4/TileG4Interfaces/CMakeLists.txt @@ -14,6 +14,8 @@ atlas_depends_on_subdirs( PUBLIC # External dependencies: find_package( Geant4 ) -# Install files from the package: -atlas_install_headers( TileG4Interfaces ) - +atlas_add_library( TileG4InterfacesLib + TileG4Interfaces/*.h + INTERFACE + PUBLIC_HEADERS TileG4Interfaces + LINK_LIBRARIES GaudiKernel Identifier ) diff --git a/TileCalorimeter/TileG4/TileGeoG4Calib/CMakeLists.txt b/TileCalorimeter/TileG4/TileGeoG4Calib/CMakeLists.txt index 1b181fa9763d94eb37e401963e1657f5e18c7f70..1d25f541c04a1a5860553263c22a5b83346807f1 100644 --- a/TileCalorimeter/TileG4/TileGeoG4Calib/CMakeLists.txt +++ b/TileCalorimeter/TileG4/TileGeoG4Calib/CMakeLists.txt @@ -39,7 +39,7 @@ atlas_add_component( TileGeoG4Calib src/*.cc src/components/*.cxx INCLUDE_DIRS ${CORAL_INCLUDE_DIRS} ${Boost_INCLUDE_DIRS} ${XERCESC_INCLUDE_DIRS} ${GEANT4_INCLUDE_DIRS} ${CLHEP_INCLUDE_DIRS} - LINK_LIBRARIES ${CORAL_LIBRARIES} ${Boost_LIBRARIES} ${XERCESC_LIBRARIES} ${GEANT4_LIBRARIES} ${CLHEP_LIBRARIES} CaloG4SimLib CaloIdentifier CaloSimEvent CxxUtils StoreGateLib SGtests GeoModelUtilities GaudiKernel G4AtlasToolsLib MCTruth TileDetDescr TileGeoG4SDLib TileSimEvent TileSimUtilsLib PathResolver ) + LINK_LIBRARIES ${CORAL_LIBRARIES} ${Boost_LIBRARIES} ${XERCESC_LIBRARIES} ${GEANT4_LIBRARIES} ${CLHEP_LIBRARIES} CaloG4SimLib CaloIdentifier CaloSimEvent CxxUtils StoreGateLib SGtests GeoModelInterfaces GeoModelUtilities GaudiKernel G4AtlasToolsLib MCTruth TileDetDescr TileGeoG4SDLib TileG4InterfacesLib TileSimEvent TileSimUtilsLib PathResolver ) # Install files from the package: atlas_install_python_modules( python/*.py ) diff --git a/TileCalorimeter/TileG4/TileGeoG4SD/CMakeLists.txt b/TileCalorimeter/TileG4/TileGeoG4SD/CMakeLists.txt index 3808b9bca3cd572b95739cfb21811690237b8fdc..773051757dd3cbe5c977210734e1f55f077125c0 100644 --- a/TileCalorimeter/TileG4/TileGeoG4SD/CMakeLists.txt +++ b/TileCalorimeter/TileG4/TileGeoG4SD/CMakeLists.txt @@ -35,8 +35,8 @@ atlas_add_library( TileGeoG4SDLib INCLUDE_DIRS ${GEANT4_INCLUDE_DIRS} ${XERCESC_INCLUDE_DIRS} PRIVATE_INCLUDE_DIRS ${CLHEP_INCLUDE_DIRS} PRIVATE_DEFINITIONS ${CLHEP_DEFINITIONS} - LINK_LIBRARIES ${GEANT4_LIBRARIES} ${XERCESC_LIBRARIES} TileDetDescr TileSimEvent - PRIVATE_LINK_LIBRARIES ${CLHEP_LIBRARIES} CaloIdentifier CxxUtils GeoModelUtilities GaudiKernel PathResolver StoreGateLib SGtests CaloDetDescrLib G4AtlasToolsLib TileGeoModelLib ) + LINK_LIBRARIES ${GEANT4_LIBRARIES} ${XERCESC_LIBRARIES} G4AtlasToolsLib TileDetDescr TileSimEvent TileG4InterfacesLib + PRIVATE_LINK_LIBRARIES ${CLHEP_LIBRARIES} CaloIdentifier CxxUtils GeoModelInterfaces GeoModelUtilities GaudiKernel PathResolver StoreGateLib SGtests CaloDetDescrLib TileGeoModelLib ) atlas_add_component( TileGeoG4SD src/components/*.cxx diff --git a/Tools/LWHists/src/Flex1DHisto.icc b/Tools/LWHists/src/Flex1DHisto.icc index 95e25d97e35b5cbf44dc73b12a29889af5e7c506..0ddb52b0ad86640b1a7b037bcef6925fdf7a856b 100644 --- a/Tools/LWHists/src/Flex1DHisto.icc +++ b/Tools/LWHists/src/Flex1DHisto.icc @@ -307,9 +307,6 @@ template <class T> inline void Flex1DHisto<T>::setBinError(unsigned bin, const double& e) { if (bin>m_nbinsPlus1) {//as in root -#if defined(LW_STRICT_ROOT_BEHAVIOUR) && ROOT_VERSION_CODE < ROOT_VERSION(6,18,0) - m_flexArray.forcePretendSumWMode(); -#endif return; } assert(bin<m_nbinsPlus1+1); @@ -321,9 +318,6 @@ template <class T> inline void Flex1DHisto<T>::setBinContentAndError(unsigned bin, const double& cont, const double& err ) { if (bin>m_nbinsPlus1) {//as in root -#if defined(LW_STRICT_ROOT_BEHAVIOUR) && ROOT_VERSION_CODE < ROOT_VERSION(6,18,0) - m_flexArray.forcePretendSumWMode(); -#endif return; } assert(bin<m_nbinsPlus1+1); diff --git a/Tools/LWHists/src/Flex1DProfileHisto.icc b/Tools/LWHists/src/Flex1DProfileHisto.icc index cfc01db412bee9a9c37b7080e682d766394de34c..abd19e5baba10d1f7524a25e61ba37fdef603546 100644 --- a/Tools/LWHists/src/Flex1DProfileHisto.icc +++ b/Tools/LWHists/src/Flex1DProfileHisto.icc @@ -215,12 +215,6 @@ inline void Flex1DProfileHisto::setBinContent(unsigned bin, const double& c ) if (bin>m_nbinsPlus1) return; m_flexArray.setBinContent(bin,c); -#if ROOT_VERSION_CODE < ROOT_VERSION(5,28,0) -#ifdef LW_STRICT_ROOT_BEHAVIOUR - if (bin==m_nbinsPlus1)//inconsistent root behaviour for last bin... - return; -#endif -#endif ++m_nEntries; m_sumW = 0;//As in ROOT } diff --git a/Tools/LWHists/src/Flex2DHisto.icc b/Tools/LWHists/src/Flex2DHisto.icc index 604e7f9a5f8a0fc14e7fa3e9da9d16d0ec00ddf2..73702e6d740331b08a6e6d9895d18f94a92bde1c 100644 --- a/Tools/LWHists/src/Flex2DHisto.icc +++ b/Tools/LWHists/src/Flex2DHisto.icc @@ -506,9 +506,6 @@ inline void Flex2DHisto<T>::setBinError(unsigned binx, unsigned biny, const doub { //Weird root behaviour: For 2D version of setBinError we ignore rather than wrap: if (binx>m_nbinsxPlus1||biny>m_nbinsyPlus1) {//as in root -#if defined(LW_STRICT_ROOT_BEHAVIOUR) && ROOT_VERSION_CODE < ROOT_VERSION(6,18,0) - m_flexArray.forcePretendSumWMode(); -#endif return; } m_flexArray.setBinError(internal_bin(binx,biny),e); @@ -527,9 +524,6 @@ inline void Flex2DHisto<T>::setBinContentAndError(unsigned binx, unsigned biny, //Annoyingly enough, root has different behaviour for SetBinContent //(wrap) and SetBinError (ignore) in this case: setBinContent(binx,biny,cont); -#if ROOT_VERSION_CODE < ROOT_VERSION(6,18,0) - m_flexArray.forcePretendSumWMode(); -#endif #endif return; } diff --git a/Tracking/TrkFitter/TrkGaussianSumFilter/CMakeLists.txt b/Tracking/TrkFitter/TrkGaussianSumFilter/CMakeLists.txt index 131da594dd4b1aa23003b8e2a2cd0c7461abc6c5..bbd1b672efecf4b73183649453ebc722897495e0 100644 --- a/Tracking/TrkFitter/TrkGaussianSumFilter/CMakeLists.txt +++ b/Tracking/TrkFitter/TrkGaussianSumFilter/CMakeLists.txt @@ -61,7 +61,8 @@ atlas_add_executable( GSF_testFindMinimumIndex atlas_add_executable( GSF_testAlignedDynArray test/testAlignedDynArray.cxx) - +atlas_add_executable( GSF_testMergeComponents + test/testMergeComponents.cxx src/KLGaussianMixtureReduction.cxx) atlas_add_test(ut_GSF_testFindMinimumIndex SCRIPT GSF_testFindMinimumIndex) diff --git a/Tracking/TrkFitter/TrkGaussianSumFilter/TrkGaussianSumFilter/AlignedDynArray.h b/Tracking/TrkFitter/TrkGaussianSumFilter/TrkGaussianSumFilter/AlignedDynArray.h index 197661d189d48573cfac7ca5141850ebaaae3fd0..56ed8f8a97fdb03b231cc337a22113bf986fefe6 100644 --- a/Tracking/TrkFitter/TrkGaussianSumFilter/TrkGaussianSumFilter/AlignedDynArray.h +++ b/Tracking/TrkFitter/TrkGaussianSumFilter/TrkGaussianSumFilter/AlignedDynArray.h @@ -12,6 +12,7 @@ #ifndef GSFUtils_AlignedDynArray_H #define GSFUtils_AlignedDynArray_H #include <cstdlib> +#include <memory> namespace GSFUtils { template<typename T, int Alignment> /** @@ -21,7 +22,7 @@ template<typename T, int Alignment> * Provides * - Additional RAII functionality * - Default initialization of elements - * - Value initialization of elements + * - Initialization with copies of elements with value value. */ class AlignedDynArray diff --git a/Tracking/TrkFitter/TrkGaussianSumFilter/TrkGaussianSumFilter/AlignedDynArray.icc b/Tracking/TrkFitter/TrkGaussianSumFilter/TrkGaussianSumFilter/AlignedDynArray.icc index 0b780d95fe649041c91f82e6dd3b87bcb2b7f264..14995d57eba0abc03c5b51f65edb1dae12e3e348 100644 --- a/Tracking/TrkFitter/TrkGaussianSumFilter/TrkGaussianSumFilter/AlignedDynArray.icc +++ b/Tracking/TrkFitter/TrkGaussianSumFilter/TrkGaussianSumFilter/AlignedDynArray.icc @@ -18,10 +18,8 @@ inline AlignedDynArray<T, Alignment>::AlignedDynArray(size_t n) , m_size(n) { const size_t bufferSize = n * sizeof(T); - m_buffer = static_cast<T*>(aligned_alloc(Alignment, bufferSize)); - for (size_t i = 0; i < m_size; ++i) { - m_buffer[i] = T(); - } + m_buffer = static_cast<T*>(std::aligned_alloc(Alignment, bufferSize)); + std::uninitialized_default_construct(m_buffer,m_buffer+m_size); } template<typename T, int Alignment> @@ -30,10 +28,8 @@ inline AlignedDynArray<T, Alignment>::AlignedDynArray(size_t n, const T& value) , m_size(n) { const size_t bufferSize = n * sizeof(T); - m_buffer = static_cast<T*>(aligned_alloc(Alignment, bufferSize)); - for (size_t i = 0; i < m_size; ++i) { - m_buffer[i] = value; - } + m_buffer = static_cast<T*>(std::aligned_alloc(Alignment, bufferSize)); + std::uninitialized_fill(m_buffer,m_buffer+m_size,value); } template<typename T, int Alignment> diff --git a/Tracking/TrkFitter/TrkGaussianSumFilter/TrkGaussianSumFilter/KLGaussianMixtureReduction.h b/Tracking/TrkFitter/TrkGaussianSumFilter/TrkGaussianSumFilter/KLGaussianMixtureReduction.h index 15758259fe50b1263c889eb840742bf7bc2ec7c1..1235c8d45dfe56ef06071035d2e6f4a1fae7b687 100644 --- a/Tracking/TrkFitter/TrkGaussianSumFilter/TrkGaussianSumFilter/KLGaussianMixtureReduction.h +++ b/Tracking/TrkFitter/TrkGaussianSumFilter/TrkGaussianSumFilter/KLGaussianMixtureReduction.h @@ -14,7 +14,8 @@ #include "CxxUtils/restrict.h" #include "CxxUtils/features.h" -#include <utility> +#include <vector> +#include <utility> #include <cstdint> namespace GSFUtils { @@ -48,6 +49,7 @@ struct Component1D{ double mean=0.; double cov=0.; double invCov=1e10; + double weight=0.; }; /** @@ -96,54 +98,29 @@ typedef Component1D* ATH_RESTRICT componentPtrRestrict; #if HAVE_FUNCTION_MULTIVERSIONING #if defined(__x86_64__) __attribute__((target("avx2"))) -int32_t +std::pair<int32_t,float> findMinimumIndex(const floatPtrRestrict distancesIn, const int32_t n); __attribute__((target("sse4.2,sse2"))) -int32_t +std::pair<int32_t,float> findMinimumIndex(const floatPtrRestrict distancesIn, const int32_t n); #endif //x86_64 specific targets __attribute__((target("default"))) #endif// function multiversioning -int32_t +std::pair<int32_t,float> findMinimumIndex(const floatPtrRestrict distancesIn, const int32_t n); - /** - * Extra methods for finding the index of the minimum - * pairwise distance + * Merge the componentsIn and return + * which componets got merged */ -int32_t -findMinimumIndexSTL(const floatPtrRestrict distancesIn, const int n); -//find a pair of the indices of the 2 smaller values -std::pair<int32_t, int32_t> -findMinimumIndexPair(const floatPtrRestrict distancesIn, const int32_t n); +std::vector<std::pair<int32_t, int32_t>> +findMerges(componentPtrRestrict componentsIn, + const int32_t inputSize, + const int32_t reducedSize); -/** - * Recalculate the distances given a merged input - * and return the index of the minimum pair - */ -int32_t -recalculateDistances(const componentPtrRestrict componentsIn, - floatPtrRestrict distancesIn, - const int32_t mini, - const int32_t n); - -/** - * Calculate the distances for all component pairs - */ -void -calculateAllDistances(const componentPtrRestrict componentsIn, - floatPtrRestrict distancesIn, - const int32_t n); +} // namespace KLGaussianMixtureReduction -/* - * Reset the distances wrt to a mini index - */ -void -resetDistances(floatPtrRestrict distancesIn, - const int32_t mini, - const int32_t n); + -} // namespace KLGaussianMixtureReduction #endif diff --git a/Tracking/TrkFitter/TrkGaussianSumFilter/share/ut_GSF_testFindMinimumIndex.ref b/Tracking/TrkFitter/TrkGaussianSumFilter/share/ut_GSF_testFindMinimumIndex.ref index 456f6d332b4de7830e0c4bfbf588635fe774bc9c..1e0dae3692c81c63a1824874b732cef85c29fc73 100644 --- a/Tracking/TrkFitter/TrkGaussianSumFilter/share/ut_GSF_testFindMinimumIndex.ref +++ b/Tracking/TrkFitter/TrkGaussianSumFilter/share/ut_GSF_testFindMinimumIndex.ref @@ -1,3 +1 @@ FindMinimumIndex Index = 51 with value = 1.02537 -FindMinimumIndexSTL Index = 51 with value = 1.02537 -FindMinimumIndexPair 1st = 51 with value 1.02537 ,2nd = 15 with value 1.04305 diff --git a/Tracking/TrkFitter/TrkGaussianSumFilter/src/KLGaussianMixtureReduction.cxx b/Tracking/TrkFitter/TrkGaussianSumFilter/src/KLGaussianMixtureReduction.cxx index 1ec7d4e56193d2ab5e4095018fcade3fbd6ee54f..f14bb4dad08cc8f42099726bedb48239a238b1ca 100644 --- a/Tracking/TrkFitter/TrkGaussianSumFilter/src/KLGaussianMixtureReduction.cxx +++ b/Tracking/TrkFitter/TrkGaussianSumFilter/src/KLGaussianMixtureReduction.cxx @@ -2,6 +2,7 @@ Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ #include "TrkGaussianSumFilter/KLGaussianMixtureReduction.h" +#include "TrkGaussianSumFilter/AlignedDynArray.h" #include "CxxUtils/features.h" #include "CxxUtils/vectorize.h" #include <algorithm> @@ -18,6 +19,184 @@ #endif ATH_ENABLE_VECTORIZATION; +namespace{ +/* + * Component Merging helper methods + */ + +using namespace GSFUtils; + +/** + * Based on + * https://arxiv.org/pdf/2001.00727.pdf + * equation (10) + * but not accounting for weights + */ +[[maybe_unused]] +float +symmetricKL(const Component1D& componentI, + const Component1D& componentJ) +{ + const double meanDifference = componentI.mean - componentJ.mean; + const double covDifference = componentI.cov - componentJ.cov; + const double invertCovDiff = componentI.invCov - componentJ.invCov; + const double inverCovSum = componentI.invCov + componentJ.invCov; + return covDifference * invertCovDiff + + meanDifference * inverCovSum * meanDifference; +} +/** + * https://arxiv.org/pdf/2001.00727.pdf + * equation (10) + */ +[[maybe_unused]] +float +weightedSymmetricKL(const Component1D& componentI, + const Component1D& componentJ) +{ + const double meanDifference = componentI.mean - componentJ.mean; + const double covDifference = componentI.cov - componentJ.cov; + const double invertCovDiff = componentI.invCov - componentJ.invCov; + const double inverCovSum = componentI.invCov + componentJ.invCov; + const double weightMul = componentI.weight * componentJ.weight; + const double symmetricDis = covDifference * invertCovDiff + + meanDifference * inverCovSum * meanDifference; + return weightMul * symmetricDis; +} + +/* + * Moment-preserving merge of two 1D components + * for example see + * Runnalls, Andrew R.(2007) + * Kullback-Leibler approach to Gaussian mixture reduction + * equations (2),(3),(4) + */ +void +combine(GSFUtils::Component1D& updated, + GSFUtils::Component1D& removed) +{ + + const double sumWeight = updated.weight + removed.weight; + + const double invSumWeight = 1. / sumWeight; + const double weightI_IJ = updated.weight * invSumWeight; + const double weightJ_IJ = removed.weight * invSumWeight; + const double meanDiff = (updated.mean - removed.mean); + + const double sumMean = weightI_IJ * updated.mean + weightJ_IJ * removed.mean; + + const double sumVariance = weightI_IJ * updated.cov + + weightJ_IJ * removed.cov + + weightI_IJ * weightJ_IJ * meanDiff * meanDiff; + + updated.mean = sumMean; + updated.cov = sumVariance; + updated.invCov = 1. / sumVariance; + updated.weight = sumWeight; + + removed.mean = 0.; + removed.cov = 0.; + removed.invCov = 1e10; + removed.weight = 0.; +} + +/** + * Recalculate the distances given a merged input + * and return the index of the minimum pair + */ +std::pair<int32_t, float> +recalculateDistances(const componentPtrRestrict componentsIn, + floatPtrRestrict distancesIn, + const int32_t mini, + const int32_t n) +{ + const Component1D* components = + static_cast<const Component1D*>(__builtin_assume_aligned(componentsIn, alignment)); + float* distances = static_cast<float*>(__builtin_assume_aligned(distancesIn, alignment)); + + const int32_t j = mini; + const int32_t indexConst = (j + 1) * j / 2; + + int32_t minIndex = 0; + float minDistance = std::numeric_limits<float>::max(); + + const Component1D componentJ = components[j]; + + for (int32_t i = 0; i < j; ++i) { + const Component1D componentI = components[i]; + const int32_t index = indexConst + i; + if (componentI.cov == 0) { + distances[index] = std::numeric_limits<float>::max(); + continue; + } + distances[index] = symmetricKL(componentI,componentJ); + if (distances[index] < minDistance) { + minIndex = index; + minDistance = distances[index]; + } + } + for (int32_t i = j + 1; i < n; ++i) { + const int32_t index = (i + 1) * i / 2 + j; + const Component1D componentI = components[i]; + if (componentI.cov == 0) { + distances[index] = std::numeric_limits<float>::max(); + continue; + } + distances[index] = symmetricKL(componentI,componentJ); + if (distances[index] < minDistance) { + minIndex = index; + minDistance = distances[index]; + } + } + return {minIndex,minDistance}; +} + +/** + * Calculate the distances for all component pairs + */ +void +calculateAllDistances(const componentPtrRestrict componentsIn, + floatPtrRestrict distancesIn, + const int32_t n) +{ + + const Component1D* components = + static_cast<const Component1D*>(__builtin_assume_aligned(componentsIn, alignment)); + float* distances = static_cast<float*>(__builtin_assume_aligned(distancesIn, alignment)); + + for (int32_t i = 0; i < n; ++i) { + const int32_t indexConst = (i + 1) * i / 2; + const Component1D componentI = components[i]; + for (int32_t j = 0; j < i; ++j) { + const Component1D componentJ = components[j]; + distances[indexConst + j] = symmetricKL(componentI,componentJ); + } + } +} + +/* + * Reset the distances wrt to a mini index + */ +void +resetDistances(floatPtrRestrict distancesIn, + const int32_t mini, + const int32_t n) +{ + + float* distances = (float*)__builtin_assume_aligned(distancesIn, alignment); + const int32_t j = mini; + const int32_t indexConst = (j + 1) * j / 2; + for (int32_t i = 0; i < j; ++i) { + distances[indexConst + i] = std::numeric_limits<float>::max(); + } + + for (int32_t i = j; i < n; ++i) { + const int32_t index = (i + 1) * i / 2 + j; + distances[index] = std::numeric_limits<float>::max(); + } +} + +} + namespace GSFUtils { /* @@ -74,7 +253,7 @@ namespace GSFUtils { * in dst. */ __attribute__((target("avx2"))) -int32_t +std::pair<int32_t,float> findMinimumIndex(const floatPtrRestrict distancesIn, const int n) { float* array = (float*)__builtin_assume_aligned(distancesIn, alignment); @@ -109,7 +288,7 @@ findMinimumIndex(const floatPtrRestrict distancesIn, const int n) minDistance = distances[i]; } } - return minIndex; + return {minIndex,minDistance}; } /* * SSE @@ -159,7 +338,7 @@ static const auto mm_blendv_epi8 = SSE2_mm_blendv_epi8; * latency. */ __attribute__((target("sse4.2,sse2"))) -int32_t +std::pair<int32_t,float> findMinimumIndex(const floatPtrRestrict distancesIn, const int n) { float* array = (float*)__builtin_assume_aligned(distancesIn, alignment); @@ -206,7 +385,7 @@ findMinimumIndex(const floatPtrRestrict distancesIn, const int n) minDistance = distances[i]; } } - return minIndex; + return {minIndex,minDistance}; } #endif // end of x86_64 versions @@ -214,162 +393,96 @@ findMinimumIndex(const floatPtrRestrict distancesIn, const int n) __attribute__((target("default"))) #endif // HAVE_FUNCTION_MULTIVERSIONING -int32_t +std::pair<int32_t,float> findMinimumIndex(const floatPtrRestrict distancesIn, const int n) { float* array = (float*)__builtin_assume_aligned(distancesIn, alignment); - float minvalue = array[0]; + float minDistance = array[0]; size_t minIndex = 0; for (int i = 0; i < n; ++i) { const float value = array[i]; - if (value < minvalue) { + if (value < minDistance) { minIndex = i; - minvalue = value; + minDistance = value; } } - return minIndex; + return {minIndex,minDistance}; } /* - * Find Minimum Index STL style. - * This works quite well in Clang8 but not in gcc8 - * https://its.cern.ch/jira/projects/ATLASRECTS/issues/ATLASRECTS-5244 + * Merge the componentsIn and return + * which componets got merged */ -int32_t -findMinimumIndexSTL(const floatPtrRestrict distancesIn, const int n) +std::vector<std::pair<int32_t, int32_t>> +findMerges(componentPtrRestrict componentsIn, + const int32_t inputSize, + const int32_t reducedSize) { - float* array = (float*)__builtin_assume_aligned(distancesIn, alignment); - return std::distance(array, std::min_element(array, array + n)); -} -/* - * Find the index of the 2 smaller values - */ -std::pair<int32_t, int32_t> -findMinimumIndexPair(const floatPtrRestrict distancesIn, const int n) -{ + Component1D* components = + static_cast<Component1D*>(__builtin_assume_aligned(componentsIn, alignment)); + //Based on the inputSize allocate enough space for the pairwise distances + const int32_t n = inputSize; + const int32_t nn = (n + 1) * n/2; + const int32_t nn2 = + (nn & 7) == 0 ? nn + : nn + (8 - (nn & 7)); // make sure it is a multiplet of 8 - float* distances = (float*)__builtin_assume_aligned(distancesIn, alignment); - int32_t mini = 0; - int32_t mini2 = -1; - float minDistance = distances[0]; - float minDistance2 = std::numeric_limits<float>::max(); + AlignedDynArray<float, alignment> distances(nn2, std::numeric_limits<float>::max()); - for (int i = 1; i < n; ++i) { - if (distances[i] < minDistance) { - mini2 = mini; - minDistance2 = minDistance; - mini = i; - minDistance = distances[i]; - } else if (distances[i] < minDistance2) { - mini2 = i; - minDistance2 = distances[i]; + // Create a trianular mapping for the pairwise distances + std::vector<triangularToIJ> convert(nn2, { -1, -1 }); + for (int32_t i = 0; i < n; ++i) { + const int indexConst = (i + 1) * i / 2; + for (int32_t j = 0; j <= i; ++j) { + int32_t index = indexConst + j; + convert[index].I = i; + convert[index].J = j; } } - return std::make_pair(mini, mini2); -} -int32_t -recalculateDistances(const componentPtrRestrict componentsIn, - floatPtrRestrict distancesIn, - const int32_t mini, - const int32_t n) -{ - const Component1D* components = - static_cast<const Component1D*>(__builtin_assume_aligned(componentsIn, alignment)); - float* distances = static_cast<float*>(__builtin_assume_aligned(distancesIn, alignment)); - - const int32_t j = mini; - const int32_t indexConst = (j + 1) * j / 2; - - int32_t minIndex = 0; - float minDistance = std::numeric_limits<float>::max(); + // vector to be returned + std::vector<std::pair<int32_t, int32_t>> merges; + merges.reserve(inputSize - reducedSize); - const Component1D componentJ = components[j]; + // initial distance calculation + calculateAllDistances(components, distances, n); - for (int32_t i = 0; i < j; ++i) { - const Component1D componentI = components[i]; - const int32_t index = indexConst + i; - if (componentI.cov == 0) { - distances[index] = std::numeric_limits<float>::max(); - continue; + // merge loop + int32_t numberOfComponentsLeft = n; + int32_t minIndex = -1; + float currentMinValue = std::numeric_limits<float>::max(); + bool foundNext =false; + while (numberOfComponentsLeft > reducedSize) { + // see if we have the next already + if (!foundNext) { + std::pair<int32_t,float> minDis = findMinimumIndex(distances, nn2); + minIndex = minDis.first; + currentMinValue = minDis.second; } - const double meanDifference = componentI.mean - componentJ.mean; - const double covarianceDifference = componentI.cov - componentJ.cov; - const double invertCovDiff = componentI.invCov - componentJ.invCov; - const double inverCovSum = componentI.invCov + componentJ.invCov; - distances[index] = covarianceDifference * invertCovDiff + - meanDifference * inverCovSum * meanDifference; - if (distances[index] < minDistance) { - minIndex = index; - minDistance = distances[index]; + //always reset + foundNext=false; + const int32_t mini = convert[minIndex].I; + const int32_t minj = convert[minIndex].J; + // Combine the 2 components + combine(components[mini], components[minj]); + // re-calculate distances wrt the new component at mini + // re-calculate distances wrt the new component at mini + std::pair<int32_t, float> possibleNextMin = + recalculateDistances(components, distances, mini, n); + //We might already got something smaller than the previous minimum + if (possibleNextMin.first > 0 && possibleNextMin.second < currentMinValue) { + foundNext=true; + minIndex= possibleNextMin.first; + currentMinValue=possibleNextMin.second; } - } - for (int32_t i = j + 1; i < n; ++i) { - const int32_t index = (i + 1) * i / 2 + j; - const Component1D componentI = components[i]; - if (componentI.cov == 0) { - distances[index] = std::numeric_limits<float>::max(); - continue; - } - const double meanDifference = componentI.mean - componentJ.mean; - const double covarianceDifference = componentI.cov - componentJ.cov; - const double invertCovDiff = componentI.invCov - componentJ.invCov; - const double inverCovSum = componentI.invCov + componentJ.invCov; - distances[index] = covarianceDifference * invertCovDiff + - meanDifference * inverCovSum * meanDifference; - if (distances[index] < minDistance) { - minIndex = index; - minDistance = distances[index]; - } - } - return minIndex; -} - -// Calculate the distances for all pairs -void -calculateAllDistances(const componentPtrRestrict componentsIn, - floatPtrRestrict distancesIn, - const int32_t n) -{ - - const Component1D* components = - static_cast<const Component1D*>(__builtin_assume_aligned(componentsIn, alignment)); - float* distances = static_cast<float*>(__builtin_assume_aligned(distancesIn, alignment)); - - for (int32_t i = 0; i < n; ++i) { - const int32_t indexConst = (i + 1) * i / 2; - const Component1D componentI = components[i]; - for (int32_t j = 0; j < i; ++j) { - const Component1D componentJ = components[j]; - const double meanDifference = componentI.mean - componentJ.mean; - const double covarianceDifference = componentI.cov - componentJ.cov; - const double invertCovDiff = componentI.invCov - componentJ.invCov; - const double inverCovSum = componentI.invCov + componentJ.invCov; - distances[indexConst + j] = covarianceDifference * invertCovDiff + - meanDifference * inverCovSum * meanDifference; - } - } -} - -// Reset the distances for a row -void -resetDistances(floatPtrRestrict distancesIn, - const int32_t mini, - const int32_t n) -{ - - float* distances = (float*)__builtin_assume_aligned(distancesIn, alignment); - const int32_t j = mini; - const int32_t indexConst = (j + 1) * j / 2; - for (int32_t i = 0; i < j; ++i) { - distances[indexConst + i] = std::numeric_limits<float>::max(); - } - - for (int32_t i = j; i < n; ++i) { - const int32_t index = (i + 1) * i / 2 + j; - distances[index] = std::numeric_limits<float>::max(); - } + // Reset old weights wrt the minj position + resetDistances(distances, minj, n); + // keep track and decrement + merges.emplace_back(mini,minj); + --numberOfComponentsLeft; + } // end of merge while + return merges; } } // end namespace GSFUtils diff --git a/Tracking/TrkFitter/TrkGaussianSumFilter/src/QuickCloseComponentsMultiStateMerger.cxx b/Tracking/TrkFitter/TrkGaussianSumFilter/src/QuickCloseComponentsMultiStateMerger.cxx index a4ba73500173d8d25e8411bb05f3fb631fc07d76..eb75e59b498281626531c22fba584d0e9d0f6a49 100644 --- a/Tracking/TrkFitter/TrkGaussianSumFilter/src/QuickCloseComponentsMultiStateMerger.cxx +++ b/Tracking/TrkFitter/TrkGaussianSumFilter/src/QuickCloseComponentsMultiStateMerger.cxx @@ -90,118 +90,41 @@ Trk::QuickCloseComponentsMultiStateMerger::merge(Trk::MultiComponentState states } Trk::MultiComponentState -Trk::QuickCloseComponentsMultiStateMerger::mergeFullDistArray(MultiComponentStateAssembler::Cache& cache, - Trk::MultiComponentState& statesToMerge) const +Trk::QuickCloseComponentsMultiStateMerger::mergeFullDistArray( + MultiComponentStateAssembler::Cache& cache, + Trk::MultiComponentState& statesToMerge) const { - /* - * Allocate, and initialize the needed arrays - */ const int32_t n = statesToMerge.size(); - const int32_t nn = (n + 1) * n / 2; - const int32_t nn2 = (nn & 7) == 0 ? nn : nn + (8 - (nn & 7)); // make sure it is a multiplet of 8 - - // Array to store all of the distances between components - AlignedDynArray<float, alignment> distances(nn2, - std::numeric_limits<float>::max()); - AlignedDynArray<Component1D, alignment> components(n); // Arrayfor each component - // Needed to convert the triangular index to (i,j) - std::vector<triangularToIJ> convert(nn2, { -1, -1 }); - // Calculate indicies - for (int32_t i = 0; i < n; ++i) { - const int indexConst = (i + 1) * i / 2; - for (int32_t j = 0; j <= i; ++j) { - int32_t index = indexConst + j; - convert[index].I = i; - convert[index].J = j; - } - } - - // Create an array of all components to be merged + AlignedDynArray<Component1D, alignment> components(n); for (int32_t i = 0; i < n; ++i) { const AmgSymMatrix(5)* measuredCov = statesToMerge[i].first->covariance(); const AmgVector(5)& parameters = statesToMerge[i].first->parameters(); // Fill in infomation - const double cov= measuredCov ? (*measuredCov)(Trk::qOverP, Trk::qOverP) : -1.; - components[i].mean= parameters[Trk::qOverP]; + const double cov = measuredCov ? (*measuredCov)(Trk::qOverP, Trk::qOverP) : -1.; + components[i].mean = parameters[Trk::qOverP]; components[i].cov = cov; - components[i].invCov = cov > 0 ? 1./cov : 1e10; + components[i].invCov = cov > 0 ? 1. / cov : 1e10; + components[i].weight = statesToMerge[i].second; } - // Calculate distances for all pairs - // This loop can be vectorised - calculateAllDistances(components, distances, n); - - /* - * Loop over all components until you reach the target amount - */ - unsigned int numberOfComponents = n; - int32_t minIndex = -1; - int32_t nextMinIndex = -1; - - while (numberOfComponents > m_maximumNumberOfComponents) { - - /* - * Find the minimum index - * Do it only if we do not have a good new guess - */ - if(nextMinIndex<1){ - minIndex = findMinimumIndex(distances, nn2); - } else { - minIndex = nextMinIndex; - } - /* reset the nextMinindex*/ - nextMinIndex=-1; - /*Keep track of the current minimum value*/ - float currentMinValue=distances[minIndex]; - - /*convert the index in an (i,j) pair*/ - int32_t mini = convert[minIndex].I; - int32_t minj = convert[minIndex].J; - /* - * Combine the components to be merged - * statesToMerge[mini] becomes the merged - * statesToMerge[minj] is set to dummy values - */ + + // Gather the merges + const std::vector<std::pair<int32_t, int32_t>> merges = + findMerges(components, n, m_maximumNumberOfComponents); + + // Do the full 5D calculations of the merge + for (const auto& mergePair : merges) { + const int32_t mini = mergePair.first; + const int32_t minj = mergePair.second; MultiComponentStateCombiner::combineWithWeight(statesToMerge[mini], statesToMerge[minj]); statesToMerge[minj].first.reset(); statesToMerge[minj].second = 0.; - /* - * set relevant distances - */ - const AmgSymMatrix(5)* measuredCov = statesToMerge[mini].first->covariance(); - const AmgVector(5)& parameters = statesToMerge[mini].first->parameters(); - const double cov = (*measuredCov)(Trk::qOverP, Trk::qOverP); - - components[mini].mean= parameters[Trk::qOverP]; - components[mini].cov = cov; - components[mini].invCov = cov > 0 ? 1./cov : 1e10; - - components[minj].mean = 0.; - components[minj].cov = 0.; - components[minj].invCov = 1e10; - - // re-calculate distances wrt the new component at mini - int32_t possibleNextMin = recalculateDistances(components, distances, mini, n); - //We might already got something smaller than the previous minimum - //we can therefore use the new one directly - if (possibleNextMin > 0 && distances[possibleNextMin] < currentMinValue) { - nextMinIndex = possibleNextMin; - } - // Reset old weights wrt the minj position - resetDistances(distances, minj, n); - // Decrement the number of components - --numberOfComponents; - } // end of merge while - - // Build final state containing both merged and unmerged components + } + // Assemble the final result for (auto& state : statesToMerge) { // Avoid merge ones if (!state.first) { continue; } - /* - * Add componets to the state be prepared for assembly - * and update the relevant weight - */ cache.multiComponentState.push_back(ComponentParameters(state.first.release(), state.second)); cache.validWeightSum += state.second; } diff --git a/Tracking/TrkFitter/TrkGaussianSumFilter/test/testFindMinimumIndex.cxx b/Tracking/TrkFitter/TrkGaussianSumFilter/test/testFindMinimumIndex.cxx index 809d91158d6b3cd641ad37dcab8949b2f3685b35..93b1ec6be3350c3be3c6b67a250f16726f9351ff 100644 --- a/Tracking/TrkFitter/TrkGaussianSumFilter/test/testFindMinimumIndex.cxx +++ b/Tracking/TrkFitter/TrkGaussianSumFilter/test/testFindMinimumIndex.cxx @@ -14,13 +14,8 @@ int main(){ 6.97245, 2.13307, 2.89188, 1.46095, 1.32797, 4.67858, 5.1219, 5.38812, 8.14577, 9.28787, 8.26778, 7.35197, 1.02537, 7.39633, 6.79565, 5.1043, 7.96525, 6.16379, 8.89082, 8.27358, 1.15997, 8.39121, 8.38757, 9.46067, 4.714}; - int32_t minIndex=GSFUtils::findMinimumIndex(array,64); - std::cout << "FindMinimumIndex Index = " << minIndex << " with value = " <<array[minIndex] <<'\n'; - minIndex=GSFUtils::findMinimumIndexSTL(array,64); - std::cout << "FindMinimumIndexSTL Index = " << minIndex << " with value = " <<array[minIndex] <<'\n'; - std::pair<int32_t,int32_t> minpair = GSFUtils::findMinimumIndexPair(array,64); - std::cout << "FindMinimumIndexPair 1st = " << minpair.first << " with value " << array[minpair.first] - << " ,2nd = " << minpair.second << " with value " << array[minpair.second] << '\n'; + std::pair<int32_t,float> minIndex=GSFUtils::findMinimumIndex(array,64); + std::cout << "FindMinimumIndex Index = " << minIndex.first << " with value = " << minIndex.second <<'\n'; - return 0; + return 0; } diff --git a/Tracking/TrkFitter/TrkGaussianSumFilter/test/testMergeComponents.cxx b/Tracking/TrkFitter/TrkGaussianSumFilter/test/testMergeComponents.cxx new file mode 100644 index 0000000000000000000000000000000000000000..d4640bd6b5edb889c9b893af0713adcb5179443d --- /dev/null +++ b/Tracking/TrkFitter/TrkGaussianSumFilter/test/testMergeComponents.cxx @@ -0,0 +1,106 @@ +#include <array> +/* + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration +*/ + +#include "TrkGaussianSumFilter/AlignedDynArray.h" +#include "TrkGaussianSumFilter/KLGaussianMixtureReduction.h" +#include <iostream> + +using namespace GSFUtils; +namespace { +constexpr int32_t n =72; +constexpr std::array<Component1D,n> input = { + { { -4.66462e-06, 1.06618e-11, 9.37928e+10, 0.00608503 }, + { -2.08263e-05, 7.533e-11, 1.32749e+10, 0.0274963 }, + { -4.15487e-05, 4.79975e-11, 2.08344e+10, 0.0591673 }, + { -4.86464e-05, 7.57086e-12, 1.32085e+11, 0.0648575 }, + { -5.1025e-05, 3.16755e-12, 3.15701e+11, 0.0952169 }, + { -5.15536e-05, 2.9173e-12, 3.42782e+11, 0.536818 }, + { -4.71833e-06, 1.1939e-11, 8.3759e+10, 0.000587903 }, + { -2.10663e-05, 7.81055e-11, 1.28032e+10, 0.0026566 }, + { -4.20273e-05, 5.01395e-11, 1.99443e+10, 0.00571686 }, + { -4.92063e-05, 8.77638e-12, 1.13942e+11, 0.00626678 }, + { -5.16121e-05, 4.27124e-12, 2.34124e+11, 0.00920053 }, + { -5.21468e-05, 4.01522e-12, 2.49052e+11, 0.0518911 }, + { -4.58728e-06, 1.12379e-11, 8.89846e+10, 0.000489032 }, + { -2.0481e-05, 7.37793e-11, 1.35539e+10, 0.00220977 }, + { -4.08598e-05, 4.73457e-11, 2.11212e+10, 0.00475507 }, + { -4.78398e-05, 8.24862e-12, 1.21232e+11, 0.00521237 }, + { -5.01789e-05, 3.99012e-12, 2.50619e+11, 0.00765225 }, + { -5.06988e-05, 3.74811e-12, 2.66801e+11, 0.0431424 }, + { -4.78054e-06, 1.18292e-11, 8.45367e+10, 0.000296965 }, + { -2.1344e-05, 7.97519e-11, 1.25389e+10, 0.00134192 }, + { -4.25814e-05, 5.10436e-11, 1.95911e+10, 0.00288774 }, + { -4.9855e-05, 8.5826e-12, 1.16515e+11, 0.00316553 }, + { -5.22926e-05, 3.9579e-12, 2.52659e+11, 0.00464746 }, + { -5.28342e-05, 3.69508e-12, 2.7063e+11, 0.0262122 }, + { -4.46758e-06, 1.74302e-11, 5.73717e+10, 0.000201451 }, + { -1.99466e-05, 7.67504e-11, 1.30293e+10, 0.000910294 }, + { -3.97936e-05, 5.16782e-11, 1.93505e+10, 0.00195881 }, + { -4.65914e-05, 1.45949e-11, 6.85173e+10, 0.0021472 }, + { -4.88695e-05, 1.05557e-11, 9.47354e+10, 0.0031523 }, + { -4.93758e-05, 1.03262e-11, 9.68413e+10, 0.017773 }, + { -3.9244e-06, 1.94312e-11, 5.14636e+10, 2.28683e-05 }, + { -1.75215e-05, 6.52038e-11, 1.53365e+10, 0.000103336 }, + { -3.49554e-05, 4.58576e-11, 2.18066e+10, 0.000222367 }, + { -4.09266e-05, 1.72434e-11, 5.79933e+10, 0.000243755 }, + { -4.29277e-05, 1.41268e-11, 7.07877e+10, 0.000357862 }, + { -4.33724e-05, 1.39496e-11, 7.16864e+10, 0.00201799 }, + { -4.38853e-06, 1.66176e-11, 6.01772e+10, 1.22764e-05 }, + { -1.95937e-05, 7.38574e-11, 1.35396e+10, 5.54734e-05 }, + { -3.90896e-05, 4.96645e-11, 2.01351e+10, 0.000119371 }, + { -4.57671e-05, 1.38817e-11, 7.20373e+10, 0.000130852 }, + { -4.80049e-05, 9.98424e-12, 1.00158e+11, 0.000192104 }, + { -4.85022e-05, 9.76274e-12, 1.0243e+11, 0.00108316 }, + { -3.45701e-06, 5.26509e-11, 1.8993e+10, 8.66949e-06 }, + { -1.54349e-05, 8.81702e-11, 1.13417e+10, 3.91764e-05 }, + { -3.07925e-05, 7.31575e-11, 1.36691e+10, 8.43101e-05 }, + { -3.60521e-05, 5.09531e-11, 1.96259e+10, 9.24221e-05 }, + { -3.78147e-05, 4.85347e-11, 2.06038e+10, 0.000135694 }, + { -3.82063e-05, 4.83973e-11, 2.06623e+10, 0.000765623 }, + { -4.94321e-06, 1.29867e-11, 7.70021e+10, 7.54445e-07 }, + { -2.20705e-05, 8.56111e-11, 1.16807e+10, 3.40926e-06 }, + { -4.40305e-05, 5.49154e-11, 1.82098e+10, 7.33698e-06 }, + { -5.15512e-05, 9.51523e-12, 1.05095e+11, 8.04293e-06 }, + { -5.40715e-05, 4.57064e-12, 2.18788e+11, 1.18086e-05 }, + { -5.46316e-05, 4.28965e-12, 2.33119e+11, 6.66306e-05 }, + { -2.67066e-06, 8.51914e-12, 1.17383e+11, 4.90461e-07 }, + { -1.1924e-05, 2.97175e-11, 3.36503e+10, 2.21633e-06 }, + { -2.37883e-05, 2.07577e-11, 4.81749e+10, 4.76964e-06 }, + { -2.78515e-05, 7.50587e-12, 1.33229e+11, 5.22854e-06 }, + { -2.92132e-05, 6.06258e-12, 1.64946e+11, 7.67648e-06 }, + { -2.95158e-05, 5.98056e-12, 1.67208e+11, 4.33103e-05 }, + { -4.75742e-06, 1.31378e-11, 7.61161e+10, 2.66875e-07 }, + { -2.1241e-05, 8.04056e-11, 1.24369e+10, 1.20598e-06 }, + { -4.23756e-05, 5.1974e-11, 1.92404e+10, 2.59534e-06 }, + { -4.96137e-05, 9.92245e-12, 1.00782e+11, 2.84505e-06 }, + { -5.20393e-05, 5.34254e-12, 1.87177e+11, 4.17709e-06 }, + { -5.25783e-05, 5.08227e-12, 1.96762e+11, 2.35683e-05 }, + { -4.13925e-06, 1.32939e-11, 7.52224e+10, 7.37356e-10 }, + { -1.84807e-05, 6.42154e-11, 1.55726e+10, 3.33188e-09 }, + { -3.68691e-05, 4.2693e-11, 2.3423e+10, 7.16968e-09 }, + { -4.31674e-05, 1.086e-11, 9.20809e+10, 7.85921e-09 }, + { -4.5278e-05, 7.39274e-12, 1.35268e+11, 1.15381e-08 }, + { -4.57471e-05, 7.19569e-12, 1.38972e+11, 6.50527e-08 } } +}; +} + +int +main() +{ + AlignedDynArray<Component1D, alignment> components(n); + // Create an array of all components to be merged + for (int32_t i = 0; i < n; ++i) { + components[i].mean = input[i].mean; + components[i].cov = input[i].cov; + components[i].invCov = input[i].invCov; + components[i].weight = input[i].weight; + } + std::vector<std::pair<int32_t, int32_t>> mergeOrder=findMerges(components,n,12); + for (const auto& i : mergeOrder){ + std::cout << "[" << i.first << ", " << i.second << "]" << '\n'; + } + return 0; +} + diff --git a/Tracking/TrkTools/TrkTruthToTrack/CMakeLists.txt b/Tracking/TrkTools/TrkTruthToTrack/CMakeLists.txt index 72ff7263518bbb6fc594262548e0aae992d339f5..561b0a10527785747cd2d5841847229c343ac19b 100644 --- a/Tracking/TrkTools/TrkTruthToTrack/CMakeLists.txt +++ b/Tracking/TrkTools/TrkTruthToTrack/CMakeLists.txt @@ -25,7 +25,7 @@ atlas_add_component( TrkTruthToTrack src/*.cxx src/components/*.cxx INCLUDE_DIRS ${HEPPDT_INCLUDE_DIRS} - LINK_LIBRARIES ${HEPPDT_LIBRARIES} AtlasHepMCLib AthenaBaseComps GaudiKernel TrkParameters TrkToolInterfaces xAODTruth TrkExInterfaces ) + LINK_LIBRARIES ${HEPPDT_LIBRARIES} AtlasHepMCLib AthenaBaseComps GaudiKernel TrackRecordLib TrkParameters TrkToolInterfaces xAODTruth TrkExInterfaces ) # Install files from the package: atlas_install_headers( TrkTruthToTrack ) diff --git a/Trigger/TrigAlgorithms/TrigGenericAlgs/CMakeLists.txt b/Trigger/TrigAlgorithms/TrigGenericAlgs/CMakeLists.txt index b33a9b445e8d50d8da2131842c78511d61379cc6..3f57f658d92491ea6e402bdcf2c4210dd6dfae05 100644 --- a/Trigger/TrigAlgorithms/TrigGenericAlgs/CMakeLists.txt +++ b/Trigger/TrigAlgorithms/TrigGenericAlgs/CMakeLists.txt @@ -30,6 +30,7 @@ atlas_depends_on_subdirs( PUBLIC Trigger/TrigT1/L1Topo/L1TopoConfig Trigger/TrigT1/L1Topo/L1TopoRDO Trigger/TrigMonitoring/TrigMonitorBase + Trigger/TrigSteer/DecisionHandling Trigger/TrigSteer/TrigSteering ) # External dependencies: @@ -42,7 +43,11 @@ atlas_add_component( TrigGenericAlgs src/*.cxx src/components/*.cxx INCLUDE_DIRS ${Boost_INCLUDE_DIRS} ${TDAQ-COMMON_INCLUDE_DIRS} ${CLHEP_INCLUDE_DIRS} - LINK_LIBRARIES ${Boost_LIBRARIES} ${TDAQ-COMMON_LIBRARIES} ${CLHEP_LIBRARIES} xAODTrigL1Calo xAODTrigMuon xAODTrigger TrigL2MuonSALib TrigCaloEvent TrigMuonEvent TrigInterfacesLib TrigT1Interfaces AthenaKernel IRegionSelector ByteStreamCnvSvcBaseLib GaudiKernel TrigConfL1Data TrigNavigationLib TrigSteeringEvent TrigT1Result L1TopoConfig L1TopoRDO TrigMonitorBaseLib TrigSteeringLib ) + LINK_LIBRARIES ${Boost_LIBRARIES} ${TDAQ-COMMON_LIBRARIES} ${CLHEP_LIBRARIES} + xAODTrigL1Calo xAODTrigMuon xAODTrigger TrigL2MuonSALib TrigCaloEvent TrigMuonEvent + TrigInterfacesLib TrigT1Interfaces AthenaKernel IRegionSelector ByteStreamCnvSvcBaseLib + GaudiKernel TrigConfL1Data TrigNavigationLib TrigSteeringEvent TrigT1Result L1TopoConfig + L1TopoRDO TrigMonitorBaseLib TrigSteeringLib DecisionHandlingLib ) # Install files from the package: atlas_install_headers( TrigGenericAlgs ) diff --git a/Trigger/TrigAlgorithms/TrigGenericAlgs/python/TrigGenericAlgsConfig.py b/Trigger/TrigAlgorithms/TrigGenericAlgs/python/TrigGenericAlgsConfig.py index f311af3e4b55cf6f6446eaebd7a7ffe5e2e18df8..cbc0a71fcc677ac1fc01c48a9c4d52102f73daf9 100644 --- a/Trigger/TrigAlgorithms/TrigGenericAlgs/python/TrigGenericAlgsConfig.py +++ b/Trigger/TrigAlgorithms/TrigGenericAlgs/python/TrigGenericAlgsConfig.py @@ -1,44 +1,22 @@ -# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration -from TrigGenericAlgs.TrigGenericAlgsConf import OverlapRemoval, MergeTopoStarts, L1CorrelationAlgo, DetectorTimingAlgo, AcceptL1TopoMonitor -from TrigMonitorBase.TrigGenericMonitoringToolConfig import defineHistogram, TrigGenericMonitoringToolConfig +from AthenaConfiguration.ComponentFactory import CompFactory -class OverlapRemovalConfig(OverlapRemoval): - def __init__(self, name="OverlapRemovalDefault", **kwargs): - super(OverlapRemovalConfig , self ).__init__(name) - self.SuccessfulCombinationsLimit = 1 - for n,v in kwargs.items(): - setattr(self, n, v) - -class MergeTopoStartsConfig(MergeTopoStarts): - def __init__(self, name="MergeTopoStartsDefault", **kwargs): - super(MergeTopoStartsConfig , self ).__init__(name) - monitoring = TrigGenericMonitoringToolConfig(name+"Monitoring") - monitoring.Histograms += [ defineHistogram('reductionWrt1', type='TH1F', title="Combinations reduction wrt topo TE 1", xbins=20, xmin=0.0, xmax=1.0) ] - monitoring.Histograms += [ defineHistogram('reductionWrt2', type='TH1F', title="Combinations reduction wrt topo TE 2", xbins=20, xmin=0.0, xmax=1.0) ] - monitoring.defineTarget(["Validation", "Online"]) - - self.AthenaMonTools = [monitoring] - +class TimeBurnerCfg(CompFactory.TimeBurner): + def __init__(self, name="TimeBurner", **kwargs): + super(TimeBurnerCfg, self).__init__(name, **kwargs) + # Decorate the Configurable with a HypoTools property which is only required + # by the menu and python configuration framework, but has no use in C++ TimeBurner + self.HypoTools = [] -class L1CorrelationAlgoConfig(L1CorrelationAlgo): - def __init__(self, name="L1CorrelationAlgoDefault", **kwargs): - super(L1CorrelationAlgoConfig , self ).__init__(name) - from TrigGenericAlgs.TrigGenericAlgsMonitoring import L1CorrelationAlgoMonitoring +def TimeBurnerHypoToolGen(chainDict): + # Dummy HypoTool implementing only the functions used by the menu and python configuration framework + class DummyHypo: + def __init__(self, name): + self.name = name + def getName(self): + return self.name - validationMon = L1CorrelationAlgoMonitoring() - self.AthenaMonTools = [ validationMon ] - -class DetectorTimingAlgoConfig(DetectorTimingAlgo): - def __init__(self, name="DetectorTimingAlgoDefault", **kwargs): - super(DetectorTimingAlgoConfig , self ).__init__(name) - - from TrigGenericAlgs.TrigGenericAlgsMonitoring import DetectorTimingAlgoMonitoring - validationMon = DetectorTimingAlgoMonitoring() - self.AthenaMonTools = [ validationMon ] - -class AcceptL1TopoMonitorConfig(AcceptL1TopoMonitor): - def __init__(self, name="AcceptL1TopoMonitorDefault", **kwargs): - super(AcceptL1TopoMonitorConfig , self ).__init__(name) + return DummyHypo(chainDict['chainName']) diff --git a/Trigger/TrigAlgorithms/TrigGenericAlgs/python/TrigGenericAlgsLegacyConfig.py b/Trigger/TrigAlgorithms/TrigGenericAlgs/python/TrigGenericAlgsLegacyConfig.py new file mode 100644 index 0000000000000000000000000000000000000000..a096709d7ed38b06d0611efdea7275c311a68c5f --- /dev/null +++ b/Trigger/TrigAlgorithms/TrigGenericAlgs/python/TrigGenericAlgsLegacyConfig.py @@ -0,0 +1,44 @@ +# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration + +from TrigGenericAlgs.TrigGenericAlgsConf import OverlapRemoval, MergeTopoStarts, L1CorrelationAlgo, DetectorTimingAlgo, AcceptL1TopoMonitor +from TrigMonitorBase.TrigGenericMonitoringToolConfig import defineHistogram, TrigGenericMonitoringToolConfig + +class OverlapRemovalConfig(OverlapRemoval): + def __init__(self, name="OverlapRemovalDefault", **kwargs): + super(OverlapRemovalConfig , self ).__init__(name) + self.SuccessfulCombinationsLimit = 1 + for n,v in kwargs.items(): + setattr(self, n, v) + + +class MergeTopoStartsConfig(MergeTopoStarts): + def __init__(self, name="MergeTopoStartsDefault", **kwargs): + super(MergeTopoStartsConfig , self ).__init__(name) + monitoring = TrigGenericMonitoringToolConfig(name+"Monitoring") + monitoring.Histograms += [ defineHistogram('reductionWrt1', type='TH1F', title="Combinations reduction wrt topo TE 1", xbins=20, xmin=0.0, xmax=1.0) ] + monitoring.Histograms += [ defineHistogram('reductionWrt2', type='TH1F', title="Combinations reduction wrt topo TE 2", xbins=20, xmin=0.0, xmax=1.0) ] + monitoring.defineTarget(["Validation", "Online"]) + + self.AthenaMonTools = [monitoring] + + +class L1CorrelationAlgoConfig(L1CorrelationAlgo): + def __init__(self, name="L1CorrelationAlgoDefault", **kwargs): + super(L1CorrelationAlgoConfig , self ).__init__(name) + + from TrigGenericAlgs.TrigGenericAlgsMonitoring import L1CorrelationAlgoMonitoring + + validationMon = L1CorrelationAlgoMonitoring() + self.AthenaMonTools = [ validationMon ] + +class DetectorTimingAlgoConfig(DetectorTimingAlgo): + def __init__(self, name="DetectorTimingAlgoDefault", **kwargs): + super(DetectorTimingAlgoConfig , self ).__init__(name) + + from TrigGenericAlgs.TrigGenericAlgsMonitoring import DetectorTimingAlgoMonitoring + validationMon = DetectorTimingAlgoMonitoring() + self.AthenaMonTools = [ validationMon ] + +class AcceptL1TopoMonitorConfig(AcceptL1TopoMonitor): + def __init__(self, name="AcceptL1TopoMonitorDefault", **kwargs): + super(AcceptL1TopoMonitorConfig , self ).__init__(name) diff --git a/Trigger/TrigAlgorithms/TrigGenericAlgs/src/TimeBurner.cxx b/Trigger/TrigAlgorithms/TrigGenericAlgs/src/TimeBurner.cxx index 990dbe2477b662e3891764ab7f417a25d83a1804..d051622c4327a41b37c45ee6562631f766709271 100644 --- a/Trigger/TrigAlgorithms/TrigGenericAlgs/src/TimeBurner.cxx +++ b/Trigger/TrigAlgorithms/TrigGenericAlgs/src/TimeBurner.cxx @@ -1,24 +1,18 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ -/** - * @brief Algorithm to perform predefined ROB requests - * @author Frank Winklmeier - * - * $Id: TimeBurner.cxx 347029 2011-02-22 10:06:04Z stelzer $ - */ - #include "TimeBurner.h" +#include <thread> +#include <chrono> + TimeBurner::TimeBurner(const std::string& name, ISvcLocator* pSvcLocator) - : HLT::AllTEAlgo(name, pSvcLocator), - m_timeDelay(0) -{ - declareProperty("TimeDelay", m_timeDelay, "Time delay in ms"); -} +: ::HypoBase(name, pSvcLocator) {} + +StatusCode TimeBurner::execute(const EventContext& /*eventContext*/) const { + + std::this_thread::sleep_for(std::chrono::milliseconds(m_sleepTimeMillisec.value())); -HLT::ErrorCode TimeBurner::hltExecute(std::vector<HLT::TEVec>&, unsigned int) { - usleep(1000*m_timeDelay); // usleep argument is in microseconds - return HLT::OK; + return StatusCode::SUCCESS; } diff --git a/Trigger/TrigAlgorithms/TrigGenericAlgs/src/TimeBurner.h b/Trigger/TrigAlgorithms/TrigGenericAlgs/src/TimeBurner.h index d0ef3a67d22fe4d8cd5a469000e024c1d1450c83..0aebe354d2dd1c78077f843d17256b9c43bd0344 100644 --- a/Trigger/TrigAlgorithms/TrigGenericAlgs/src/TimeBurner.h +++ b/Trigger/TrigAlgorithms/TrigGenericAlgs/src/TimeBurner.h @@ -1,36 +1,27 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ #ifndef TRIGGENERICALGS_TimeBurner_h #define TRIGGENERICALGS_TimeBurner_h -/** - * @brief Algorithm to sleep for some time - * @author Joerg Stelzer - * - * $Id: TimeBurner.h 346947 2011-02-21 16:58:50Z stelzer $ - */ - -#include "TrigInterfaces/AllTEAlgo.h" - -#include <vector> +#include "DecisionHandling/HypoBase.h" /** - * Algorithm to sleep for some configurable time . - */ - -class TimeBurner : public HLT::AllTEAlgo { -public: - TimeBurner(const std::string& name, ISvcLocator* pSvcLocator); - - HLT::ErrorCode hltInitialize() { return HLT::OK; } - HLT::ErrorCode hltExecute(std::vector<HLT::TEVec>&, unsigned int); - HLT::ErrorCode hltFinalize() { return HLT::OK; } - -private: - // Properties - int m_timeDelay; // time delay in ms (default 0ms) + * @class TimeBurner + * @brief Reject-all hypo algorithm sleeping for some time and doing nothing else + **/ +class TimeBurner : public HypoBase { + public: + /// Standard constructor + TimeBurner(const std::string& name, ISvcLocator* svcLoc); + + virtual StatusCode execute(const EventContext& eventContext) const override; + + private: + Gaudi::Property<unsigned int> m_sleepTimeMillisec { + this, "SleepTimeMillisec", 0, "Time to sleep in each execution [ms]" + }; }; -#endif +#endif // TRIGGENERICALGS_TimeBurner_h diff --git a/Trigger/TrigAlgorithms/TrigHIRec/src/TrigHIEventShapeJetIteration.cxx b/Trigger/TrigAlgorithms/TrigHIRec/src/TrigHIEventShapeJetIteration.cxx index cd6b92ae2a04dba3a8779f80b1c9046085d98deb..efbc12070a5e20c1abef1c95569f5b76c314ec98 100644 --- a/Trigger/TrigAlgorithms/TrigHIRec/src/TrigHIEventShapeJetIteration.cxx +++ b/Trigger/TrigAlgorithms/TrigHIRec/src/TrigHIEventShapeJetIteration.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ #include "TrigHIEventShapeJetIteration.h" @@ -74,12 +74,12 @@ int TrigHIEventShapeJetIteration::execute() const { const xAOD::Jet* theJet=(*jItr); xAOD::IParticle::FourMom_t jet4mom=theJet->p4(); - + /* std::vector<const xAOD::IParticle*> assoc_clusters; //only use jet constituents if(m_exclude_constituents) assoc_clusters=theJet->getConstituents().asIParticleVector(); - + //use associations w/ name m_association_key else { @@ -91,9 +91,9 @@ int TrigHIEventShapeJetIteration::execute() const return StatusCode::FAILURE; } } - + //Now loop over associated objects - ATH_MSG(DEBUG) << "Jet " + ATH_MSG(DEBUG) << "Jet " << std::setw(10) << jet4mom.Pt()*1e-3 << std::setw(10) << jet4mom.Eta() << std::setw(10) << jet4mom.Phi() @@ -118,7 +118,7 @@ int TrigHIEventShapeJetIteration::execute() const if( jet4mom.DeltaR( cl->p4() ) > m_exclude_DR ) continue; - m_subtractor_tool->UpdateUsingCluster(output_shape,es_index,cl); //,used_indices,used_eta_bins); + m_subtractor_tool->updateUsingCluster(output_shape,es_index,cl); //,used_indices,used_eta_bins); } }//end jet loop @@ -131,14 +131,14 @@ int TrigHIEventShapeJetIteration::execute() const //if configured, define layer-depedent ET-weighted, eta-independent v2 and necessary event plane angles //loop again on bins and manually set flow part? - + // xAOD::HIEventShapeContainer* output_flow_shape=new xAOD::HIEventShapeContainer; // xAOD::HIEventShapeAuxContainer *output_flow_shape_aux = new xAOD::HIEventShapeAuxContainer; // output_flow_shape->setStore( output_flow_shape_aux ); // CHECK(evtStore()->record(output_flow_shape,m_output_event_flow_shape_key)); // CHECK(evtStore()->record(output_flow_shape_aux,m_output_event_flow_shape_key + std::string("Aux."))); - + // //FIX remove hard coded value // int N_CALO_LAYERS = 24; // output_flow_shape->reserve(N_CALO_LAYERS); @@ -153,5 +153,3 @@ int TrigHIEventShapeJetIteration::execute() const // //do averaging // } - - diff --git a/Trigger/TrigAlgorithms/TrigHIRec/src/TrigHIEventShapeMaker.cxx b/Trigger/TrigAlgorithms/TrigHIRec/src/TrigHIEventShapeMaker.cxx index 3ad052d7cf0703c4a98c88695d29c5f506eeed3d..300c8d82cf6bc396015a66cddf15ac5fb7804c06 100644 --- a/Trigger/TrigAlgorithms/TrigHIRec/src/TrigHIEventShapeMaker.cxx +++ b/Trigger/TrigAlgorithms/TrigHIRec/src/TrigHIEventShapeMaker.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ #include "xAODHIEvent/HIEventShape.h" @@ -32,7 +32,7 @@ HLT::ErrorCode TrigHIEventShapeMaker::hltInitialize() { if( m_fillerTool.retrieve().isFailure() ) { return HLT::ERROR; } - m_fillerTool->SetContainerName(m_HIEventShapeContainerKey); + m_fillerTool->setContainerName(m_HIEventShapeContainerKey); return HLT::OK; } @@ -56,40 +56,40 @@ HLT::ErrorCode TrigHIEventShapeMaker::hltExecute(const HLT::TriggerElement* inpu } */ - if( m_fillerTool->InitializeCollection(shape).isFailure() ) { + if( m_fillerTool->initializeCollection(shape).isFailure() ) { ATH_MSG_ERROR("TrigHIEventShapeMaker failing on init"); return HLT::ERROR; } - - if (m_use_calo_cell) + + if (m_use_calo_cell) {ATH_MSG_DEBUG("TrigHIEventShapeMaker will use cells"); - if (m_fillerTool->FillCollectionFromCells(m_cell_container_key).isFailure() ) + if (m_fillerTool->fillCollectionFromCells(m_cell_container_key).isFailure() ) {ATH_MSG_ERROR("TrigHIEventShapeMaker failing on filling from cells"); return HLT::ERROR; } } else {ATH_MSG_DEBUG("TrigHIEventShapeMaker will use towers"); - if (m_fillerTool->FillCollectionFromTowers(m_tower_container_key).isFailure() ) + if (m_fillerTool->fillCollectionFromTowers(m_tower_container_key).isFailure() ) {ATH_MSG_ERROR("TrigHIEventShapeMaker failing on filling from towers"); return HLT::ERROR; - } + } } - ATH_MSG_DEBUG("Container name in TrigHIEventShapeMaker: " << m_fillerTool->GetContainerName() ); + ATH_MSG_DEBUG("Container name in TrigHIEventShapeMaker: " << m_fillerTool->getContainerName() ); auto status = attachFeature(outputTE, shape, m_HIEventShapeContainerKey); if ( status != HLT::OK ) { ATH_MSG_ERROR("TrigHIEventShapeMaker could not attach the event shape container"); - return status; + return status; } ATH_MSG_DEBUG("The event shape collection was attached as: " << m_HIEventShapeContainerKey); - - + + return HLT::OK; } diff --git a/Trigger/TrigAnalysis/TrigRootAnalysis/Root/LinkDef.h b/Trigger/TrigAnalysis/TrigRootAnalysis/Root/LinkDef.h index 4f9cb0f930d14bb5209fdf6de78c5efdd8255ee1..8f6b7ef6e68e32e7bff5925ba6dd059fe0bca511 100644 --- a/Trigger/TrigAnalysis/TrigRootAnalysis/Root/LinkDef.h +++ b/Trigger/TrigAnalysis/TrigRootAnalysis/Root/LinkDef.h @@ -43,11 +43,6 @@ #pragma link C++ class map<string,string>+; #endif -// MN: in ROOT6 this comes from RELAX so we don't need it -#if ROOT_VERSION_CODE < 393216 // ROOT 6.0.0 version as int -# pragma link C++ class pair<string,string>+; -#endif - // [TrigMonConfig] addind some more dictionaries for additional structures used saving the full trig conf. // Will not run without these. #ifdef XAOD_STANDALONE diff --git a/Trigger/TrigAnalysis/TriggerMatchingTool/CMakeLists.txt b/Trigger/TrigAnalysis/TriggerMatchingTool/CMakeLists.txt index a564af2b76c9919c393365e5987f9315fa69c7d3..696721f7775e0b0558b6d349ba8189860136371e 100644 --- a/Trigger/TrigAnalysis/TriggerMatchingTool/CMakeLists.txt +++ b/Trigger/TrigAnalysis/TriggerMatchingTool/CMakeLists.txt @@ -19,9 +19,9 @@ atlas_depends_on_subdirs( Event/xAOD/xAODBase Trigger/TrigAnalysis/TrigDecisionTool Trigger/TrigEvent/TrigNavStructure - Trigger/TrigEvent/TrigDecisionInterface PRIVATE Event/FourMomUtils + Event/xAOD/xAODTrigger ${extra_deps} ) # External dependencies: @@ -34,8 +34,7 @@ atlas_add_library( TriggerMatchingToolLib PUBLIC_HEADERS TriggerMatchingTool PRIVATE_INCLUDE_DIRS ${Boost_INCLUDE_DIRS} LINK_LIBRARIES AsgTools xAODBase TrigNavStructure TrigDecisionToolLib - TrigDecisionInterface - PRIVATE_LINK_LIBRARIES ${Boost_LIBRARIES} FourMomUtils ) + PRIVATE_LINK_LIBRARIES ${Boost_LIBRARIES} FourMomUtils xAODTrigger ) if( NOT XAOD_STANDALONE ) atlas_add_component( TriggerMatchingTool diff --git a/Trigger/TrigAnalysis/TriggerMatchingTool/Root/IParticleRetrievalTool.cxx b/Trigger/TrigAnalysis/TriggerMatchingTool/Root/IParticleRetrievalTool.cxx new file mode 100644 index 0000000000000000000000000000000000000000..5aa6156d80fa3b9ace10103197d408a10363067b --- /dev/null +++ b/Trigger/TrigAnalysis/TriggerMatchingTool/Root/IParticleRetrievalTool.cxx @@ -0,0 +1,353 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +// Package includes +#include "TriggerMatchingTool/IParticleRetrievalTool.h" +#include <ostream> + +// Anonymous namespace contains helper functions +namespace { + /// @brief functions to convert between CLID, xAOD types and container names. + using CLIDTuple_t = + std::tuple<HLT::class_id_type, xAOD::Type::ObjectType, std::string>; + + template <std::size_t FROM, std::size_t TO> + bool CLIDLookUp( + typename std::tuple_element<TO, CLIDTuple_t>::type& to, + const typename std::tuple_element<FROM, CLIDTuple_t>::type& from) + { + static std::vector<CLIDTuple_t> CLIDVector { + {1178459224, xAOD::Type::Muon, "xAOD::MuonContainer"}, + {1087532415, xAOD::Type::Electron, "xAOD::ElectronContainer"}, + {1219821989, xAOD::Type::CaloCluster, "xAOD::CaloClusterContainer"}, + {1105575213, xAOD::Type::Photon, "xAOD::PhotonContainer"}, + {1177172564, xAOD::Type::Tau, "xAOD::TauJetContainer"} + }; + auto itr = std::find_if(CLIDVector.begin(), CLIDVector.end(), + [from] (const CLIDTuple_t& tup) { + return std::get<FROM>(tup) == from; + }); + if (itr == CLIDVector.end() ) + return false; + else { + to = std::get<TO>(*itr); + return true; + } + } + bool CLIDToObjectType(xAOD::Type::ObjectType& type, HLT::class_id_type clid) + { + return CLIDLookUp<0, 1>(type, clid); + } + bool ObjectTypeToCLID(HLT::class_id_type& clid, xAOD::Type::ObjectType type) + { + return CLIDLookUp<1, 0>(clid, type); + } + bool CLIDToContainerType(std::string& name, HLT::class_id_type clid) + { + return CLIDLookUp<0, 2>(name, clid); + } + +} //> end anonymous namespace + +namespace Trig { + IParticleRetrievalTool::IParticleRetrievalTool(const std::string& name) : + asg::AsgTool(name) + { + declareProperty("TrigDecisionTool", m_tdt, + "The trigger decision tool to use."); + declareProperty("WarnOnNavigationError", m_warnOnNavigationFailure = true, + "Only spit a warning on a navigation error, don't cause a job failure."); + + } + + IParticleRetrievalTool::~IParticleRetrievalTool() {} + + StatusCode IParticleRetrievalTool::initialize() + { + ATH_MSG_INFO("Initializing " << name() ); + ATH_CHECK( m_tdt.retrieve() ); + /// We need the expert methods for the navigation + m_tdt->ExperimentalAndExpertMethods()->enable(); + return StatusCode::SUCCESS; + } + + StatusCode IParticleRetrievalTool::retrieveParticles( + std::vector<std::vector<const xAOD::IParticle*>>& combinations, + const std::string& chain, + bool rerun) const + { + // Make sure what we're getting is cleared. + combinations.clear(); + // Start by getting the chain group + const ChainGroup* cg = m_tdt->getChainGroup(chain); + // Make sure that this group actually contains triggers. If it doesn't then + // this is very wrong and the job shouldn't be allowed to continue + if (cg->getListOfTriggers().size() == 0) { + ATH_MSG_ERROR("Chain group " << chain + << " is empty! This means that no matching chains were found!"); + return StatusCode::FAILURE; + } + if (!cg->isPassed( rerun + ? TrigDefs::Physics | TrigDefs::allowResurrectedDecision + : TrigDefs::Physics) ) { + ATH_MSG_DEBUG("Chain: " << chain << " was not passed!"); + return StatusCode::SUCCESS; + } + + FeatureContainer features = cg->features(); + for (const Combination& combo : features.getCombinations() ) { + // The assumption here is that each combination represents a *single* way + // in which the trigger could have been passed. This should be true for + // the types of trigger that this tool expects to examine. It won't be + // true for (e.g.) jet triggers. + std::vector<const xAOD::IParticle*> currentCombination; + bool navFailure = false; + for (const HLT::TriggerElement* te : combo.tes() ) { + if (!retrieveParticles(currentCombination, te, navFailure).isSuccess() ) { + // Interpret a failure this way so that we can report the chain name + ATH_MSG_ERROR("Failed to retrieve particles for chain " << chain ); + return StatusCode::FAILURE; + } + // If the navigation failed for this combination ignore it completely + if (navFailure) + break; + } + if (navFailure) + ATH_MSG_WARNING("Skipping combination for chain " << chain + << " due to navigation failure"); + else + combinations.push_back(currentCombination); + } + return StatusCode::SUCCESS; + } + + StatusCode IParticleRetrievalTool::retrieveParticles( + std::vector<const xAOD::IParticle*>& combination, + const HLT::TriggerElement* te, + bool& navFailure) const + { + ATH_MSG_DEBUG( "Processing TE " << Trig::getTEName(*te) ); + // Keep track of whether or not we found a particle here. + const xAOD::IParticle* part = nullptr; + for (const auto& feature : te->getFeatureAccessHelpers() ) { + xAOD::Type::ObjectType type; + if (!CLIDToObjectType(type, feature.getCLID() ) ) + // Skip any features that don't hold 'final' state particles + continue; + if (type == xAOD::Type::Electron || type == xAOD::Type::Photon) { + // If this is an egamma type we have to check if we are meant to be + // looking for a CaloCluster instead! + xAOD::Type::ObjectType egType = getEGammaTEType(te); + if (egType == xAOD::Type::Other) { + std::string message = + "Unable to determine the correct type for TE " + Trig::getTEName(*te); + navFailure = true; + if (m_warnOnNavigationFailure) { + ATH_MSG_WARNING( message ); + return StatusCode::SUCCESS; + } + else { + ATH_MSG_ERROR( message ); + return StatusCode::FAILURE; + } + } + else if (egType == xAOD::Type::CaloCluster) { + HLT::class_id_type clid = 0; + ObjectTypeToCLID(clid, egType); + // This will be where we store the TE containing the calo cluster + // feature + const HLT::TriggerElement* sourceTE = nullptr; + const HLT::TrigNavStructure* navigation = + m_tdt->ExperimentalAndExpertMethods()->getNavigation(); + HLT::TriggerElement::FeatureAccessHelper egFeature = + navigation->getFeatureRecursively(te, clid, "", sourceTE); + if (!sourceTE) { + std::ostringstream os; + os << "Unable to retrieve feature of type " << egType + << " from TE " << Trig::getTEName(*te); + navFailure = true; + if (m_warnOnNavigationFailure) { + ATH_MSG_WARNING( os.str() ); + return StatusCode::SUCCESS; + } + else { + ATH_MSG_ERROR( os.str() ); + return StatusCode::FAILURE; + } + } + ATH_CHECK( retrieveFeatureParticle(part, egFeature, sourceTE, navFailure) ); + if (navFailure) + return StatusCode::SUCCESS; + // If it's a calo-cluster like TE then stop here, otherwise we'll + // encounter the other EG type again and fail... + break; + } + else if (egType != type) { + // This is the wrong feature to be looking at + continue; + } + // Otherwise we continue as before + } + // If we found a particle from another feature access helper then this is + // a problem. Our assumption is that there is only one particle per leg! + if (part) { + std::string message = "TE" + Trig::getTEName(*te) + "has multiple " + + "'final' particles attached to it! This breaks this tool's asumptions!"; + navFailure = true; + if (m_warnOnNavigationFailure) { + ATH_MSG_WARNING(message); + return StatusCode::SUCCESS; + } + else { + ATH_MSG_ERROR(message); + return StatusCode::FAILURE; + } + } + ATH_CHECK( retrieveFeatureParticle(part, feature, te, navFailure) ); + if (navFailure) + return StatusCode::SUCCESS; + } //> end loop over features + + // If we found a particle then we can stop going through this branch of the + // tree + if (part) { + combination.push_back(part); + return StatusCode::SUCCESS; + } + + // Otherwise look at each of the next TEs separately + for (const HLT::TriggerElement* nextTE : + HLT::TrigNavStructure::getDirectPredecessors(te) ) + ATH_CHECK( retrieveParticles(combination, nextTE, navFailure) ); + + return StatusCode::SUCCESS; + } + + xAOD::Type::ObjectType IParticleRetrievalTool::getEGammaTEType( + const HLT::TriggerElement* te) const + { + // We need to check the TE name for this + std::string teName = Trig::getTEName(*te); + if (teName.find("etcut") != std::string::npos && + teName.find("trkcut") == std::string::npos) + return xAOD::Type::CaloCluster; + else if (teName.find("EF_e") == 0) + return xAOD::Type::Electron; + else if (teName.find("EF_g") == 0) + return xAOD::Type::Photon; + else + return xAOD::Type::Other; + } + + StatusCode IParticleRetrievalTool::retrieveFeatureParticle( + const xAOD::IParticle*& particle, + const HLT::TriggerElement::FeatureAccessHelper& feature, + const HLT::TriggerElement* te, + bool& navFailure) const + { + // Get the right container type name + std::string containerType; + if (!CLIDToContainerType(containerType, feature.getCLID() ) ) { + ATH_MSG_ERROR("Unrecognised CLID " << feature.getCLID() << " received!"); + // This isn't a navigation error - this is a failure in the tool's + // internal logic! + return StatusCode::FAILURE; + } + // Build a vector of typeless features so that we can use the central + // functions. + const HLT::TrigNavStructure* navigation = + m_tdt->ExperimentalAndExpertMethods()->getNavigation(); + + + /// Expand the typedGet function here + auto typelessHolder = navigation->getHolder(feature); + + if (!typelessHolder) { + std::string message = "Typeless holder for feature not present!"; + navFailure = true; + if (m_warnOnNavigationFailure) { + ATH_MSG_WARNING(message); + return StatusCode::SUCCESS; + } + else { + ATH_MSG_ERROR(message); + return StatusCode::FAILURE; + } + } + const xAOD::IParticleContainer* cont(nullptr); + // Get the name used in the event store + std::string key = HLTNavDetails::formatSGkey( + "HLT", containerType, typelessHolder->label() ); + // Now things are *much* more familiar + if (!evtStore()->contains<xAOD::IParticleContainer>(key) ) { + std::string message = "Store does not contain " + key + "!"; + navFailure = true; + if (m_warnOnNavigationFailure) { + ATH_MSG_WARNING(message); + return StatusCode::SUCCESS; + } + else { + ATH_MSG_ERROR(message); + return StatusCode::FAILURE; + } + } + ATH_CHECK( evtStore()->retrieve(cont, key) ); + HLT::TriggerElement::ObjectIndex idx = feature.getIndex(); + if (cont->size() < idx.objectsEnd() ) { + std::ostringstream os; + os << "Featured object end " << idx.objectsEnd() + << " is *after* the end of container " << key; + navFailure = true; + if (m_warnOnNavigationFailure) { + ATH_MSG_WARNING( os.str() ); + return StatusCode::SUCCESS; + } + else { + ATH_MSG_ERROR( os.str() ); + return StatusCode::FAILURE; + } + } + std::vector<const xAOD::IParticle*> particleFeatures; + particleFeatures.reserve(idx.objectsEnd() - idx.objectsBegin() ); + auto begin = cont->begin(); + auto end = cont->begin(); + std::advance(begin, idx.objectsBegin() ); + std::advance(end, idx.objectsEnd() ); + particleFeatures.insert(particleFeatures.end(), begin, end); + + // Make sure the answer is what we expect + std::ostringstream os; + switch (particleFeatures.size() ) { + case 0: + os << "No particles retrieved from feature " + << navigation->label(feature.getCLID(), feature.getIndex().subTypeIndex() ) + << " from TE " << Trig::getTEName(*te); + navFailure = true; + if (m_warnOnNavigationFailure) { + ATH_MSG_WARNING(os.str() ); + return StatusCode::SUCCESS; + } + else { + ATH_MSG_ERROR(os.str() ); + return StatusCode::FAILURE; + } + case 1: + // Set the output. + particle = particleFeatures.at(0); + break; + default: + // Some TEs can end up reporting multiple outputs within the same RoI. + // AFAIK this only happens within EGamma TEs but I don't know that for + // sure. In any case this shouldn't matter too much for the matching + // given that they will be nearby each other. Just return the highest pT + // object. + particle = *(std::max_element( + particleFeatures.begin(), particleFeatures.end(), + [] (const xAOD::IParticle* lhs, const xAOD::IParticle* rhs) + { return lhs->pt() < rhs->pt(); }) ); + } + return StatusCode::SUCCESS; + } + +} //> end namespace Trig diff --git a/Trigger/TrigAnalysis/TriggerMatchingTool/Root/MatchConfig.cxx b/Trigger/TrigAnalysis/TriggerMatchingTool/Root/MatchConfig.cxx deleted file mode 100644 index d0c90d9de683d6b573c047b8cea59c3f7429c491..0000000000000000000000000000000000000000 --- a/Trigger/TrigAnalysis/TriggerMatchingTool/Root/MatchConfig.cxx +++ /dev/null @@ -1,35 +0,0 @@ -/* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration -*/ - -#include "TriggerMatchingTool/MatchConfig.h" -namespace Trig{ - - MatchConfig::MatchConfig() : m_thresholds_by_type{ - {xAOD::Type::Muon, 0.1}, - {xAOD::Type::Electron, 0.1}, - {xAOD::Type::Photon, 0.1}, - {xAOD::Type::Tau, 0.1}, - {xAOD::Type::Jet, 0.3}, - } { - } - - MatchConfig::MatchConfig(const std::map<xAOD::Type::ObjectType, double>& thresholds) : MatchConfig() { - for(auto type_thr : thresholds){ - m_thresholds_by_type[type_thr.first] = type_thr.second; - } - } - - MatchConfig::~MatchConfig() { - } - - double MatchConfig::matchThreshold(xAOD::Type::ObjectType type) const { - auto pos = m_thresholds_by_type.find(type); - if(pos == m_thresholds_by_type.end()){ - return 0; - } - auto x = pos->second; - return x; - } - -}//end Trig namespace diff --git a/Trigger/TrigAnalysis/TriggerMatchingTool/Root/MatchFromCompositeTool.cxx b/Trigger/TrigAnalysis/TriggerMatchingTool/Root/MatchFromCompositeTool.cxx new file mode 100644 index 0000000000000000000000000000000000000000..f5a5f97db6d8c9b2679c6fa2f0651ef8e8b4f685 --- /dev/null +++ b/Trigger/TrigAnalysis/TriggerMatchingTool/Root/MatchFromCompositeTool.cxx @@ -0,0 +1,127 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +#include "TriggerMatchingTool/MatchFromCompositeTool.h" +#include "FourMomUtils/xAODP4Helpers.h" + +namespace Trig { + MatchFromCompositeTool::MatchFromCompositeTool(const std::string& name) : + asg::AsgTool(name) + { + declareProperty("MatchShallow", m_matchShallow, + "Whether to check if two objects are shallow copies of each other. " + "If this is not true then pointer equality will be used."); + declareProperty("DRThreshold", m_drThreshold, + "If greater than 0 then use the DR between two objects to check if " + "they are the same object."); + declareProperty("InputPrefix", m_inputPrefix="TrigMatch_", + "The input prefix to expect at the beginning of the TrigComposite " + "container names."); + } + + MatchFromCompositeTool::~MatchFromCompositeTool() {} + + StatusCode MatchFromCompositeTool::initialize() { + ATH_MSG_INFO( "initializing " << name() ); + return StatusCode::SUCCESS; + } + + bool MatchFromCompositeTool::match ( + const xAOD::IParticle& recoObject, + const std::string& chain, + double, bool) const + { + return match({&recoObject}, chain); + } + + bool MatchFromCompositeTool::match( + const std::vector<const xAOD::IParticle*>& recoObjects, + const std::string& chain, + double, bool) const + { + std::string containerName = m_inputPrefix+chain; + // We have to replace '.' characters with '_' characters so that these are + // valid container names... + std::replace(containerName.begin(), containerName.end(), '.', '_'); + const xAOD::TrigCompositeContainer* composites(nullptr); + if (evtStore()->retrieve(composites, containerName).isFailure() ){ + ATH_MSG_ERROR("Failed to retrieve composite container for chain "+chain); + ATH_MSG_ERROR("Please check your derivation to see if the container is there"); + ATH_MSG_ERROR("This likely means the trigger is not in your file's menu"); + throw std::runtime_error( + "Failed to retrieve composite corresponding to chain " + chain); + } + for (const xAOD::TrigComposite* composite : *composites) { + static constAcc_t<vecLink_t<xAOD::IParticleContainer>> accMatched( + "TrigMatchedObjects"); + if (testCombination(accMatched(*composite), recoObjects) ) + return true; + } + // If we get here then none of the online combinations worked + return false; + } + + bool MatchFromCompositeTool::testCombination( + const vecLink_t<xAOD::IParticleContainer>& onlineLinks, + const std::vector<const xAOD::IParticle*>& offline) const + { + // We need to make sure we don't allow two offline particles to match to the + // same online particle, so we copy the vector so we can erase objects if + // necessary. Dereference the links at the same time. + std::vector<const xAOD::IParticle*> online; + online.reserve(onlineLinks.size() ); + for (const ElementLink<xAOD::IParticleContainer>& link : onlineLinks) + // Skip invalid links - these are usually objects that have been removed + // by derivation framework level thinning. Going by the logic that we just + // need a match for all the offline particles provided rather than for the + // trigger particles implies that we should allow a combination that has + // had some of its members removed. + if (link.isValid() ) + online.push_back(*link); + // I will follow the way the current tool works and match even if there are + // fewer reco objects than trigger objects + for (const xAOD::IParticle* offlinePart : offline) { + bool isMatched = false; + for (auto itr = online.begin(); itr != online.end(); ++itr) { + if (areTheSame(*offlinePart, **itr) ) { + // Remove this online particle from consideration + online.erase(itr); + isMatched = true; + break; + } + } + if (!isMatched) + // We've found an offline particle we couldn't match so the whole + // combination doesn't match. + return false; + } + // To reach this point every offline particle must have found a match. + return true; + } + + bool MatchFromCompositeTool::areTheSame( + const xAOD::IParticle& lhs, + const xAOD::IParticle& rhs) const + { + // If we've been given a dR threshold > 0 then we just use that. + if (m_drThreshold > 0) { + return xAOD::P4Helpers::deltaR(lhs, rhs, false) < m_drThreshold; + } + else if (m_matchShallow) { + static SG::AuxElement::ConstAccessor< + ElementLink<xAOD::IParticleContainer>> accOOL("originalObjectLink"); + // For now assume that we've got a shallow copy iff this is available + const xAOD::IParticle* lhsOrig = + accOOL.isAvailable(lhs) ? *accOOL(lhs) : &lhs; + const xAOD::IParticle* rhsOrig = + accOOL.isAvailable(rhs) ? *accOOL(rhs) : &rhs; + return lhsOrig == rhsOrig; + } + else { + // Otherwise just use pointer equality + return &lhs == &rhs; + } + } + +} //> end namespace Trig diff --git a/Trigger/TrigAnalysis/TriggerMatchingTool/Root/MatchResult.cxx b/Trigger/TrigAnalysis/TriggerMatchingTool/Root/MatchResult.cxx deleted file mode 100644 index 035cb022887ad552358743646143868388a9d80e..0000000000000000000000000000000000000000 --- a/Trigger/TrigAnalysis/TriggerMatchingTool/Root/MatchResult.cxx +++ /dev/null @@ -1,64 +0,0 @@ -/* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration -*/ - -#include "TriggerMatchingTool/MatchResult.h" - -namespace Trig{ - - MatchResult::MatchResult() : m_matched(false) { - - } - - MatchResult::~MatchResult() { - } - - bool MatchResult::isMatched() { - return m_matched; - } - - std::vector<const xAOD::IParticle*> alignMatchedObjects(const std::vector<const xAOD::IParticle*>& recoObjects, const ComboMatch& result){ - std::vector<const xAOD::IParticle*> aligned; - std::map<xAOD::Type::ObjectType,unsigned int> indices_by_type; //reco indices by type so that we can get the matched objects - for(const auto& obj : recoObjects){ - if(indices_by_type.find(obj->type()) == indices_by_type.end()){ - indices_by_type[obj->type()] = 0; - } - else { - auto current_index = indices_by_type[obj->type()]; - indices_by_type[obj->type()] = current_index + 1; - } - - auto single_match = result.singlematch_by_type.at(obj->type()); - auto assignment = single_match.assignment; - auto recidx = indices_by_type.at(obj->type()); - int assigned_index = single_match.assignment[recidx]; - const xAOD::IParticle* trigobj = single_match.features[assigned_index].cptr(); - aligned.push_back(trigobj); - } - return aligned; - } - - std::vector<const xAOD::IParticle*> MatchResult::bestMatchedObjects(){ - double bestcost = 0; - int i = 0; - int bestindex = -1; - for (const auto combresult : m_combresults){ - double combocost = 0; - for (auto type_objs : m_recos_by_type){ - const auto& single_match = combresult.singlematch_by_type.at(type_objs.first); - combocost += single_match.total_cost; - } - if( combresult.matched and (bestindex < 0 || (combocost < bestcost) )){ - bestindex = i; - } - i++; - } - if(bestindex >= 0){ - return alignMatchedObjects(m_original_recolist,m_combresults.at(bestindex)); - } - - std::cout << "TriggerMatchingTool ERROR. Best matching combination was not found. This should not happen. Is the result matched (isMatched())? " << std::endl; - return std::vector<const xAOD::IParticle*>(); - } -} diff --git a/Trigger/TrigAnalysis/TriggerMatchingTool/Root/MatchResult.h b/Trigger/TrigAnalysis/TriggerMatchingTool/Root/MatchResult.h deleted file mode 100644 index a18568a03b8158a088d16c51b4ab68620bfbd708..0000000000000000000000000000000000000000 --- a/Trigger/TrigAnalysis/TriggerMatchingTool/Root/MatchResult.h +++ /dev/null @@ -1,46 +0,0 @@ -// Dear emacs, this is -*- c++ -*- - -/* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration -*/ - -#ifndef MATCHRESULT_H -#define MATCHRESULT_H - -#include "xAODBase/ObjectType.h" - -#include "TriggerMatchingTool/IMatchResult.h" -#include "TriggerMatchingTool/IAssociationStrategy.h" - -#include "TrigDecisionTool/Feature.h" - -namespace Trig { - - - typedef Feature<xAOD::IParticle> > TrigFeature; - struct ComboMatch { - std::map<xAOD::Type::ObjectType,std::vector<TrigFeature> > trigfeats_by_type; - std::map<xAOD::Type::ObjectType,IAssociationStrategy::index_assignment_t> assoc_by_type; - std::string message; - }; - - - class MatchingTool; - class MatchResult : public IMatchResult { - public: - friend class MatchingTool; - MatchResult(); - virtual bool isMatched() override; - - private: - bool m_matched; - - //we'll keep a type_sorted list to the reco particles that initiated this match - std::map<xAOD::Type::ObjectType,std::vector<const xAOD::IParticle*> > m_recos_by_type; - - std::vector<ComboMatch> m_combresults; - }; - -} - -#endif diff --git a/Trigger/TrigAnalysis/TriggerMatchingTool/Root/MatchingImplementation.cxx b/Trigger/TrigAnalysis/TriggerMatchingTool/Root/MatchingImplementation.cxx index 47843864e3f37e0e8b8b1bd40ec0bfabc4fe11fb..ce777cc4629ac3b9e13ee30ded2e83656ec2c759 100644 --- a/Trigger/TrigAnalysis/TriggerMatchingTool/Root/MatchingImplementation.cxx +++ b/Trigger/TrigAnalysis/TriggerMatchingTool/Root/MatchingImplementation.cxx @@ -8,7 +8,7 @@ namespace Trig { -MatchingImplementation::MatchingImplementation(MatchingTool& mt) : asg::AsgMessaging("MatchingImplementation"), m_tool(mt) { +MatchingImplementation::MatchingImplementation(MatchingTool& mt, double threshold) : asg::AsgMessaging("MatchingImplementation"), m_tool(mt), m_threshold(threshold) { m_strategies[Trig::MatchingStrategy::MinimalSum] = std::unique_ptr<IAssociationStrategy>(new MinimalSumAssociation()); } @@ -16,55 +16,55 @@ Trig::TrigDecisionTool* MatchingImplementation::tdt(){ return m_tool.m_trigDecTool.operator->(); } - bool MatchingImplementation::assocIsMatched(IAssociationStrategy::index_assignment_t association, const std::vector<std::vector<double> >& matrix, double threshold){ - int ndim = matrix.size(); - if(!ndim) return false; - - bool result = true; - for(auto reco_trig : association){ - double distance = matrix[reco_trig.first][reco_trig.second]; - bool single_assoc = distance < threshold; - result = result && single_assoc; - ATH_MSG_DEBUG("reco: " << reco_trig.first << " associated to trig: " << reco_trig.second << - " with distance: " << distance << " ok: " << single_assoc << " overall: " << result); + bool MatchingImplementation::assocIsMatched(IAssociationStrategy::index_assignment_t association, const std::vector<std::vector<double> >& matrix, double threshold) const { + int ndim = matrix.size(); + if(!ndim) return false; + + bool result = true; + for(auto trig_reco : association){ + double distance = matrix[trig_reco.first][trig_reco.second]; + bool single_assoc = distance < threshold; + result = result && single_assoc; + ATH_MSG_DEBUG("reco: " << trig_reco.first << " associated to trig: " << trig_reco.second << + " with distance: " << distance << " ok: " << single_assoc << " overall: " << result); + } + return result; +} + + bool MatchingImplementation::matchDistanceMatrix(const std::vector<std::vector<double> >& matrix, const Trig::MatchingStrategy::Strategy strategy, double threshold) const { + int nrows = matrix.size(); + int ncols = matrix.at(0).size(); + + ATH_MSG_DEBUG("matching a " << nrows << "x" << ncols << "matrix now"); + + + auto MSG_MATRIX = MSG::DEBUG; + if(msgLvl(MSG_MATRIX)){ + msg() << MSG_MATRIX << "===========" << endmsg; + for(auto& row : matrix){ + msg() << MSG_MATRIX << "|"; + for(auto distance : row){ + msg() << MSG_MATRIX << distance << " , "; + } + msg() << MSG_MATRIX << "|" << endmsg; } - return result; + msg() << MSG_MATRIX << "===========" << endmsg; } - std::pair<bool,IAssociationStrategy::index_assignment_t> MatchingImplementation::matchDistanceMatrix(const std::vector<std::vector<double> >& matrix, double threshold, const Trig::MatchingStrategy::Strategy strategy){ - int nrows = matrix.size(); - int ncols = matrix.at(0).size(); - - ATH_MSG_DEBUG("matching a " << nrows << "x" << ncols << "matrix now"); - - - auto MSG_MATRIX = MSG::DEBUG; - if(msgLvl(MSG_MATRIX)){ - msg() << MSG_MATRIX << "===========" << endmsg; - for(auto& row : matrix){ - msg() << MSG_MATRIX << "|"; - for(auto distance : row){ - msg() << MSG_MATRIX << distance << " , "; - } - msg() << MSG_MATRIX << "|" << endmsg; - } - msg() << MSG_MATRIX << "===========" << endmsg; + + //require that every row contains an entry that is smaller than threshold, otherwise matching will obviously fail + for(auto& row : matrix) { + bool rowOk=false; + for(auto distance : row) { + if( distance < threshold ) { rowOk = true; break; } } - - - //require that every row contains an entry that is smaller than threshold, otherwise matching will obviously fail - for(auto& row : matrix) { - bool rowOk=false; - for(auto distance : row) { - if( distance < threshold ) { rowOk = true; break; } - } - if(!rowOk) { - ATH_MSG_DEBUG("row of matrix does not contain any distance below threshold. Return false"); - return std::make_pair(false,IAssociationStrategy::index_assignment_t()); - } + if(!rowOk) { + ATH_MSG_DEBUG("row of matrix does not contain any distance below threshold. Return false"); return false; } - - auto association_map = m_strategies[strategy]->associate(matrix); - return std::make_pair(assocIsMatched(association_map,matrix,threshold),association_map); } + + auto association_map = m_strategies.at(strategy)->associate(matrix); + return assocIsMatched(association_map,matrix,threshold); +} + } diff --git a/Trigger/TrigAnalysis/TriggerMatchingTool/Root/MatchingTool.cxx b/Trigger/TrigAnalysis/TriggerMatchingTool/Root/MatchingTool.cxx index caed48c8db159fbfc384ebaabe274f4d8a0adffd..5c9a35b01c089b2281134481c084ebfdbd6faed1 100644 --- a/Trigger/TrigAnalysis/TriggerMatchingTool/Root/MatchingTool.cxx +++ b/Trigger/TrigAnalysis/TriggerMatchingTool/Root/MatchingTool.cxx @@ -1,252 +1,187 @@ /* - Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration */ -#include "xAODBase/IParticle.h" -#include "FourMomUtils/xAODP4Helpers.h" - #include "TriggerMatchingTool/MatchingTool.h" -#include "TriggerMatchingTool/MatchResult.h" -#include "TriggerMatchingTool/MatchConfig.h" #include "TriggerMatchingTool/MatchingImplementation.h" +#include "xAODBase/IParticle.h" -typedef std::vector<std::vector<double> > cost_matrix_type; - +#include "FourMomUtils/xAODP4Helpers.h" namespace Trig { - MatchingTool::MatchingTool(const std::string& name) : - asg::AsgTool(name), - m_impl(new Trig::MatchingImplementation(*this)), - m_trigDecTool("Trig::TrigDecisionTool/TrigDecisionTool") - { - declareProperty( "TrigDecisionTool", m_trigDecTool); +MatchingTool::MatchingTool(const std::string& name) : + asg::AsgTool(name), + m_impl(new Trig::MatchingImplementation(*this)), + m_trigDecTool("Trig::TrigDecisionTool/TrigDecisionTool"), + m_matchingThreshold(0) +{ + declareProperty( "TrigDecisionTool", m_trigDecTool); - m_condition = TrigDefs::Physics; +} #ifndef XAOD_STANDALONE - auto props = getProperties(); - for( Property* prop : props ) { - if( prop->name() != "OutputLevel" ) { - continue; - } - prop->declareUpdateHandler( &MatchingTool::updateOutputLevel, this ); - break; - } -#else +void MatchingTool::updateThreshold(Property& /*p*/) { + ATH_MSG_DEBUG("Matching Threshold is updated to:" << m_matchingThreshold); + impl()->setThreshold( m_matchingThreshold ); +} #endif - } - -#ifndef XAOD_STANDALONE - void MatchingTool::updateOutputLevel(Property& /*p*/) { - impl()->msg().setLevel(msgLevel()); //pass on our message level to the matchingimplementation - } -#endif +MatchingTool::~MatchingTool(){ + delete m_impl; +} - MatchingTool::~MatchingTool(){ - delete m_impl; - } +StatusCode MatchingTool::initialize() { + impl()->setThreshold( m_matchingThreshold ); - StatusCode MatchingTool::initialize() { - ATH_CHECK( m_trigDecTool.retrieve() ); - return StatusCode::SUCCESS; - } + ATH_CHECK( m_trigDecTool.retrieve() ); + return StatusCode::SUCCESS; +} - IParticlesByType MatchingTool::separateByType(const std::vector<const xAOD::IParticle*>& recoObjects){ - IParticlesByType type_separated; - //first separate the different types based on the ::type() method of IParticle to get a map {type:[objects]} - for(const auto& obj : recoObjects){ - if(type_separated.find(obj->type()) == type_separated.end()){ - std::vector<const xAOD::IParticle*> typevec; - type_separated[obj->type()] = typevec; - } - type_separated[obj->type()].push_back(obj); - } - - ATH_MSG_DEBUG("found: " << type_separated.size() << " unique objects types to match"); - for(auto& type_vec : type_separated){ - ATH_MSG_DEBUG("type: " << type_vec.first << "(" << type_vec.second.size() << " elements)"); + bool MatchingTool::matchCombination(const std::vector<const xAOD::IParticle*>& recoObjects, Trig::Combination& comb, const std::string& chain, double threshold) const { + std::map<xAOD::Type::ObjectType,std::vector<const xAOD::IParticle*> > typeSeparated; + + for (const auto& obj : recoObjects){ + if(typeSeparated.find(obj->type()) == typeSeparated.end()){ + std::vector<const xAOD::IParticle*> typevec; + typeSeparated[obj->type()] = typevec; } - return type_separated; + typeSeparated[obj->type()].push_back(obj); } - bool MatchingTool::matchCombination(IParticlesByType& recoByType, Trig::Combination& comb, std::unique_ptr<MatchResult>& result, const IMatchConfig* mc){ - Trig::ComboMatch thiscombo; - thiscombo.matched = true; - for(auto& type_vec : recoByType){ - Trig::ComboMatch::SingleTypeMatch single_info; - - - bool status = matchSingleType(type_vec.second, comb, single_info, mc->matchThreshold(type_vec.first)); - - ATH_MSG_DEBUG("type: " << type_vec.first << " status: " << status << " matched: " << single_info.matched); - - thiscombo.singlematch_by_type[type_vec.first] = single_info; - thiscombo.matched = thiscombo.matched && (status && single_info.matched); - } - - ATH_MSG_DEBUG("pushing a comb result with mathed status: " << thiscombo.matched); - result->m_combresults.push_back(thiscombo); - return thiscombo.matched; + ATH_MSG_DEBUG("found: " << typeSeparated.size() << " unique objects types to match"); + for(auto& [objType, recoObjs_thistype] : typeSeparated){ + ATH_MSG_DEBUG("type: " << objType << "(" << recoObjs_thistype.size() << " elements)"); } - bool MatchingTool::matchSingleType(const std::vector<const xAOD::IParticle*>& recoObjects, Trig::Combination& comb, ComboMatch::SingleTypeMatch& result, double threshold){ - auto recoType = recoObjects.at(0)->type(); - ATH_MSG_DEBUG("matching combination with " << comb.tes().size() << " TEs for reco type: " << recoType << " against threshold: " << threshold); - - HLT::class_id_type clid = 0; - std::string container_typename(""); - - if(m_typeMap.isKnown(recoType)){ - auto clid_container = m_typeMap.get(recoType); - clid = clid_container.first; - container_typename = clid_container.second; - ATH_MSG_DEBUG("getting trigger features (clid: " << clid << " and type: " << container_typename << ")"); - } - else{ - ATH_MSG_WARNING("could not find corresponding trigger type, can't match"); - return false; - } - - auto iparticle_feats = comb.getIParticle(clid,container_typename, "", m_condition); - result.features = iparticle_feats; - - - ATH_MSG_DEBUG("found: " << iparticle_feats.size() << " xAOD::IParticle"); - - for(auto& feat : iparticle_feats){ - ATH_MSG_DEBUG(" ==> pt: " << feat.cptr()->pt() << " and eta: " << feat.cptr()->eta() << " address: " << feat.cptr()); - } - - if(recoObjects.size() > iparticle_feats.size()){ - ATH_MSG_WARNING("more reco objects (" << recoObjects.size() << ") than trigger object (" << iparticle_feats.size() << "). no hope of matching!"); - return false; - } + bool overall_status = true; + std::map<xAOD::Type::ObjectType,bool> status; + for(auto& [objType, recoObjs_thistype] : typeSeparated){ + auto single_status = matchSingleType(recoObjs_thistype, comb, chain, threshold); + ATH_MSG_DEBUG("type: " << objType << " status: " << single_status); + status[objType] = single_status; + overall_status = overall_status && single_status; + } + + return overall_status; +} + bool MatchingTool::matchSingleType(const std::vector<const xAOD::IParticle*>& recoObjects, Trig::Combination& comb, const std::string& chain, double threshold) const { + ATH_MSG_DEBUG("matching combination with " << comb.tes().size() << " TEs"); + + auto recoType = recoObjects.at(0)->type(); + ATH_MSG_DEBUG("reco type is " << recoType); - ATH_MSG_DEBUG("now matching: " << recoObjects.size() << " reco objects to " << iparticle_feats.size() << " trigger objects"); - - std::vector<const xAOD::IParticle*> trigObjects; - for(auto& feat : iparticle_feats){trigObjects.push_back(feat.cptr());} - - auto distance_matrix = distanceMatrix(recoObjects,trigObjects); - - ATH_MSG_DEBUG("made distance matrix"); - - auto status_assoc = impl()->matchDistanceMatrix(distance_matrix,threshold); - result.matched = status_assoc.first; - result.assignment = status_assoc.second; - + HLT::class_id_type clid = 0; + std::string container_typename(""); - //record sum of costs - for(size_t i = 0; i < result.assignment.size(); ++i){ - result.total_cost += distance_matrix[i][result.assignment[i]]; - } + // This hack is to make Offline electrons to be matched to online HLT CaloClusters if HLT chain is _etcut type + if (recoType == xAOD::Type::Electron && chain.find("etcut") != std::string::npos && chain.find("trkcut") == std::string::npos){ + ATH_MSG_DEBUG("Electron offline and matching electron etcut chain. Try to match to cluster instead!: " ); + recoType=xAOD::Type::CaloCluster; + } - ATH_MSG_DEBUG("result: " << result.matched << "total cost of best match in this combo for type " << recoType << " is " << result.total_cost); + if(m_typeMap.isKnown(recoType)){ - return true; - } - - bool MatchingTool::match(const xAOD::IParticle& recoObject, const std::string& chain, double matchThreshold) { - std::vector<const xAOD::IParticle*> recoObjects(1,&recoObject); - MatchConfig config({{recoObject.type(), matchThreshold}}); - return match_result(recoObjects,chain,&config)->isMatched(); - } + auto clid_container = m_typeMap.get(recoType); - bool MatchingTool::match(const std::vector<const xAOD::IParticle*>& recoObjects, const std::string& chain, const std::map<xAOD::Type::ObjectType, double>& thresholds) { - MatchConfig config(thresholds); - return match_result(recoObjects,chain,&config)->isMatched(); + clid = clid_container.first; + container_typename = clid_container.second; + ATH_MSG_DEBUG("getting trigger features (clid: " << clid << " and type: " << container_typename << ")"); + } + else{ + ATH_MSG_WARNING("could not find corresponding trigger type, can't match"); + return false; } - bool MatchingTool::match(const std::vector<const xAOD::IParticle*>& recoObjects, const std::string& chain, double matchThreshold) { - //construct a MatchConfig Object - auto separatedReco = separateByType(recoObjects); - std::map<xAOD::Type::ObjectType, double> thr; - for(auto type_objs : separatedReco){ - thr[type_objs.first] = matchThreshold; //all types use same threshold - } - MatchConfig config(thr); - return match_result(recoObjects,chain,&config)->isMatched(); + auto iparticle_feats = comb.getIParticle(clid,container_typename); + + ATH_MSG_DEBUG("found: " << iparticle_feats.size() << " xAOD::IParticle"); + + for(auto& feat : iparticle_feats){ + ATH_MSG_DEBUG(" ==> pt: " << feat.cptr()->pt() << " and eta: " << feat.cptr()->eta() << " address: " << feat.cptr()); } - - bool MatchingTool::match(const std::vector<const xAOD::IParticle*>& recoObjects, const std::string& chain) { - return match_result(recoObjects,chain)->isMatched(); + if(recoObjects.size() > iparticle_feats.size()){ + ATH_MSG_WARNING("more reco objects (" << recoObjects.size() << ") than trigger object (" << iparticle_feats.size() << "). no hope of matching!"); + return false; } - //main matching method - std::unique_ptr<IMatchResult> MatchingTool::match_result(const std::vector<const xAOD::IParticle*>& recoObjects, const std::string& chain, const IMatchConfig* mc) { - std::unique_ptr<MatchResult> match_result(new MatchResult()); - - const MatchConfig defaultconfig; - - if(!mc){ - //defaut config - ATH_MSG_DEBUG("matching using default match configuration"); - mc = &defaultconfig; - } - - match_result->m_original_recolist = recoObjects; - - ATH_MSG_DEBUG("matching " << recoObjects.size() << " reco objects to chain: " << chain ); - - auto chainGroup = impl()->tdt()->getChainGroup(chain); - bool decision = chainGroup->isPassed(); - ATH_MSG_DEBUG(chain << " is passed: " << decision); - if(!decision) return std::unique_ptr<IMatchResult>(); + ATH_MSG_DEBUG("now matching: " << recoObjects.size() << " reco objects to " << iparticle_feats.size() << " trigger objects"); + + std::vector<const xAOD::IParticle*> trigObjects; + for(auto& feat : iparticle_feats){trigObjects.push_back(feat.cptr());} - auto separatedReco = separateByType(recoObjects); - match_result->m_recos_by_type = separatedReco; + auto distance_matrix = distanceMatrix(recoObjects,trigObjects); - auto featureContainer = chainGroup->features(); - auto combinations = featureContainer.getCombinations(); - - ATH_MSG_DEBUG("chain has: " << combinations.size() << " combos"); - - bool result = false; - for(auto& comb : combinations){ + ATH_MSG_DEBUG("made distance matrix"); - bool combResult = matchCombination(separatedReco,comb,match_result,mc); - ATH_MSG_DEBUG("matching result for this combination: " << combResult); - result = result || combResult; - if(result) break; //no need to continue if result is true - } - - ATH_MSG_DEBUG("overall matching result: " << result); - - match_result->m_matched = result; - return match_result; - } + bool match_result = impl()->matchDistanceMatrix(distance_matrix, Trig::MatchingStrategy::MinimalSum,threshold); - void MatchingTool::setCondition(unsigned int condition) { - m_condition = condition; - } - - Trig::MatchingImplementation* MatchingTool::impl(){ - return m_impl; - } - - double MatchingTool::IParticleMetric(const xAOD::IParticle* lhs, const xAOD::IParticle* rhs){ - return xAOD::P4Helpers::deltaR(lhs,rhs,false /*use pseudorapidity to avoid calling p4*/);//return lhs->p4().DeltaR(rhs->p4()); - } + ATH_MSG_DEBUG("got matching result: " << match_result); + + return match_result; +} + + bool MatchingTool::match(const xAOD::IParticle& recoObject, const std::string& chain, double matchThreshold, bool rerun) const { + std::vector<const xAOD::IParticle*> recoObjects(1,&recoObject); + bool out = match(recoObjects, chain, matchThreshold, rerun); + return out; +} + + bool MatchingTool::match(const std::vector<const xAOD::IParticle*>& recoObjects, const std::string& chain, double matchThreshold, bool rerun) const { + ATH_MSG_DEBUG("matching " << recoObjects.size() << " reco objects to chain: " << chain ); + + auto chainGroup = impl()->tdt()->getChainGroup(chain); + bool decision; + if (!rerun) + decision = chainGroup->isPassed(); + else + decision = chainGroup->isPassed(TrigDefs::Physics | TrigDefs::allowResurrectedDecision); + ATH_MSG_DEBUG(chain << " is passed: " << decision); + if(!decision) return false; + + auto featureContainer = chainGroup->features(); + auto combinations = featureContainer.getCombinations(); + + ATH_MSG_DEBUG("chain has: " << combinations.size() << " combos"); - cost_matrix_type MatchingTool::distanceMatrix(const std::vector<const xAOD::IParticle*>& reco, - const std::vector<const xAOD::IParticle*>& trigger){ - - //make distance matrix indexing is matrix[reco_index][trig_index] - std::vector<std::vector<double> > rows; - for(const auto& rec : reco){ - std::vector<double> distances_to_rec; - for(const auto& trig : trigger){ - distances_to_rec.push_back(IParticleMetric(rec,trig)); - } - rows.push_back(distances_to_rec); + return false; + + bool result = false; + for(auto& comb : combinations){ + bool combResult = matchCombination(recoObjects,comb, chain, matchThreshold); + ATH_MSG_DEBUG("matching result for this combination: " << combResult); + result = result || combResult; + if(result) break; //no need to continue if result is true + } + + ATH_MSG_DEBUG("overall matching result: " << result); + + return result; +} + +Trig::MatchingImplementation* MatchingTool::impl() const { + return m_impl; +} + +double MatchingTool::IParticleMetric(const xAOD::IParticle* lhs, const xAOD::IParticle* rhs) const { + return xAOD::P4Helpers::deltaR(lhs,rhs,false /*use pseudorapidity to avoid calling p4*/);//return lhs->p4().DeltaR(rhs->p4()); +} + +std::vector<std::vector<double> > MatchingTool::distanceMatrix(const std::vector<const xAOD::IParticle*>& reco, + const std::vector<const xAOD::IParticle*>& trigger) const { + std::vector<std::vector<double> > rows; + for(const auto& rec : reco){ + std::vector<double> distances_to_rec; + for(const auto& trig : trigger){ + distances_to_rec.push_back(IParticleMetric(rec,trig)); } - return rows; + rows.push_back(distances_to_rec); } + return rows; +} } //Trig namespace diff --git a/Trigger/TrigAnalysis/TriggerMatchingTool/Root/TypeMap.cxx b/Trigger/TrigAnalysis/TriggerMatchingTool/Root/TypeMap.cxx index 1fdb60b06c5d224197dd4294af28bb7d9b88accc..6389c6bc9108eb9490f04312d58425a7462f423a 100644 --- a/Trigger/TrigAnalysis/TriggerMatchingTool/Root/TypeMap.cxx +++ b/Trigger/TrigAnalysis/TriggerMatchingTool/Root/TypeMap.cxx @@ -7,17 +7,18 @@ TypeMap::TypeMap(){ m_typemap[xAOD::Type::Muon] = std::make_pair(1178459224, "xAOD::MuonContainer" ); m_typemap[xAOD::Type::Electron] = std::make_pair(1087532415, "xAOD::ElectronContainer"); + m_typemap[xAOD::Type::CaloCluster] = std::make_pair(1219821989, "xAOD::CaloClusterContainer"); m_typemap[xAOD::Type::Photon] = std::make_pair(1105575213, "xAOD::PhotonContainer"); m_typemap[xAOD::Type::Tau] = std::make_pair(1177172564, "xAOD::TauJetContainer"); m_typemap[xAOD::Type::Jet] = std::make_pair(1244316195, "xAOD::JetContainer"); } -bool TypeMap::isKnown(const xAOD::Type::ObjectType& recoType){ +bool TypeMap::isKnown(const xAOD::Type::ObjectType& recoType) const { auto it = m_typemap.find(recoType); return (it!=m_typemap.end()); } -TypeMap::clid_string_t TypeMap::get(const xAOD::Type::ObjectType& recoType){ +TypeMap::clid_string_t TypeMap::get(const xAOD::Type::ObjectType& recoType) const { auto it = m_typemap.find(recoType); if(it!=m_typemap.end()){ return it->second; diff --git a/Trigger/TrigAnalysis/TriggerMatchingTool/TriggerMatchingTool/IIParticleRetrievalTool.h b/Trigger/TrigAnalysis/TriggerMatchingTool/TriggerMatchingTool/IIParticleRetrievalTool.h new file mode 100644 index 0000000000000000000000000000000000000000..0a2a8e50934c08caf14e0733c07028ebc3745bf7 --- /dev/null +++ b/Trigger/TrigAnalysis/TriggerMatchingTool/TriggerMatchingTool/IIParticleRetrievalTool.h @@ -0,0 +1,32 @@ +/* + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration +*/ + +#ifndef TriggerMatchingTool_IIParticleRetrievalTool_H +#define TriggerMatchingTool_IIParticleRetrievalTool_H + +// Framework includes +#include "AsgTools/IAsgTool.h" +#include "xAODBase/IParticle.h" + +#include <vector> + +namespace Trig { + class IIParticleRetrievalTool : public virtual asg::IAsgTool { + ASG_TOOL_INTERFACE( IIParticleRetrievalTool ) + public: + /** + * @brief Retrieve the particles that caused this trigger to fire + * @param[out] combinations All combinations of particles that could have + * caused the trigger to fire. + * @param chain The name of the chain. + * @param rerun Whether to look at the chain in 'rerun' mode. + */ + virtual StatusCode retrieveParticles( + std::vector<std::vector<const xAOD::IParticle*>>& combinations, + const std::string& chain, + bool rerun = false) const = 0; + }; //> end class IIParticleRetrievalTool +} //> end namespace Trig + +#endif //> !TriggerMatchingTool_IIParticleRetrievalTool_H diff --git a/Trigger/TrigAnalysis/TriggerMatchingTool/TriggerMatchingTool/IMatchConfig.h b/Trigger/TrigAnalysis/TriggerMatchingTool/TriggerMatchingTool/IMatchConfig.h deleted file mode 100644 index f2ad73f2dbd6dfd38eef97614a2688c83e2dd163..0000000000000000000000000000000000000000 --- a/Trigger/TrigAnalysis/TriggerMatchingTool/TriggerMatchingTool/IMatchConfig.h +++ /dev/null @@ -1,25 +0,0 @@ -// Dear emacs, this is -*- c++ -*- - -/* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration -*/ - -#ifndef IMATCHCONFIG_H -#define IMATCHCONFIG_H - -#include <memory> -#include <vector> - -#include "xAODBase/ObjectType.h" - -namespace Trig { - - class IMatchConfig { - public: - virtual ~IMatchConfig(){}; //so we can delete properly via base pointer - virtual double matchThreshold(xAOD::Type::ObjectType) const = 0; - }; - -} - -#endif diff --git a/Trigger/TrigAnalysis/TriggerMatchingTool/TriggerMatchingTool/IMatchResult.h b/Trigger/TrigAnalysis/TriggerMatchingTool/TriggerMatchingTool/IMatchResult.h deleted file mode 100644 index e83d1b9ea03bfe74acc1243c2945be51e682f2e5..0000000000000000000000000000000000000000 --- a/Trigger/TrigAnalysis/TriggerMatchingTool/TriggerMatchingTool/IMatchResult.h +++ /dev/null @@ -1,28 +0,0 @@ -// Dear emacs, this is -*- c++ -*- - -/* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration -*/ - -#ifndef IMATCHRESULT_H -#define IMATCHRESULT_H - -#include <memory> -#include <vector> - -namespace xAOD{ - class IParticle; -} - -namespace Trig { - - class IMatchResult { - public: - virtual ~IMatchResult(){}; //so we can delete properly via base pointer - virtual bool isMatched() = 0; - virtual std::vector<const xAOD::IParticle*> bestMatchedObjects() = 0; - }; - -} - -#endif diff --git a/Trigger/TrigAnalysis/TriggerMatchingTool/TriggerMatchingTool/IMatchingTool.h b/Trigger/TrigAnalysis/TriggerMatchingTool/TriggerMatchingTool/IMatchingTool.h index 82bb5f36d2534d0ca2912aab11e50a632f69424e..39360341f9b178f563ebd9a7321fd760ec62af45 100644 --- a/Trigger/TrigAnalysis/TriggerMatchingTool/TriggerMatchingTool/IMatchingTool.h +++ b/Trigger/TrigAnalysis/TriggerMatchingTool/TriggerMatchingTool/IMatchingTool.h @@ -7,15 +7,10 @@ #ifndef IMATCHINGTOOL_H #define IMATCHINGTOOL_H -#include <map> // Framework include(s): #include "AsgTools/IAsgTool.h" -#include "TriggerMatchingTool/IMatchResult.h" -#include "TriggerMatchingTool/IMatchConfig.h" -#include "TrigDecisionInterface/Conditions.h" - namespace xAOD{ class IParticle; } @@ -31,21 +26,12 @@ class IMatchingTool : virtual public asg::IAsgTool { public: ///single object trigger matching. matchThreshold is typically the deltaR requirement to obtain positive matching - virtual bool match(const xAOD::IParticle& recoObject, const std::string& chain, double matchThreshold=0.1) = 0; - - ///multi-object trigger matching with single threshold - virtual bool match(const std::vector<const xAOD::IParticle*>& recoObjects, const std::string& chain, double matchThreshold=0.1) = 0; - + virtual bool match(const xAOD::IParticle& recoObject, const std::string& chain, double matchThreshold=0.1, bool rerun=false) const = 0; ///multi-object trigger matching - virtual bool match(const std::vector<const xAOD::IParticle*>& recoObjects, const std::string& chain, const std::map<xAOD::Type::ObjectType, double>& thresholds) = 0; - - ///multi-object trigger matching returning a match result object - virtual std::unique_ptr<IMatchResult> match_result(const std::vector<const xAOD::IParticle*>& recoObjects, const std::string& chain, const IMatchConfig* mc = nullptr) = 0; - - virtual void setCondition(unsigned int condition=TrigDefs::Physics)=0; + virtual bool match(const std::vector<const xAOD::IParticle*>& recoObjects, const std::string& chain, double matchThreshold=0.1, bool rerun=false) const = 0; protected: - virtual MatchingImplementation* impl() = 0; + virtual MatchingImplementation* impl() const = 0; }; } diff --git a/Trigger/TrigAnalysis/TriggerMatchingTool/TriggerMatchingTool/IParticleRetrievalTool.h b/Trigger/TrigAnalysis/TriggerMatchingTool/TriggerMatchingTool/IParticleRetrievalTool.h new file mode 100644 index 0000000000000000000000000000000000000000..8be073961d2ce418f6c30a3eda04eb76a9062df5 --- /dev/null +++ b/Trigger/TrigAnalysis/TriggerMatchingTool/TriggerMatchingTool/IParticleRetrievalTool.h @@ -0,0 +1,95 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +#ifndef TriggerMatchingTool_IParticleRetrievalTool_H +#define TriggerMatchingTool_IParticleRetrievalTool_H + +// Framework includes +#include "AsgTools/AsgTool.h" +#include "AsgTools/ToolHandle.h" + +#include "TriggerMatchingTool/IIParticleRetrievalTool.h" +#include "TrigDecisionTool/TrigDecisionTool.h" + +namespace Trig { + class IParticleRetrievalTool final : public virtual IIParticleRetrievalTool, + public asg::AsgTool + { + ASG_TOOL_CLASS( IParticleRetrievalTool, IIParticleRetrievalTool ) + public: + /// Standard constructor + IParticleRetrievalTool(const std::string& name); + + /// Default destructor + ~IParticleRetrievalTool() override; + + /// Initialise the tool + StatusCode initialize() override; + + /** + * @brief Retrieve the particles that caused this trigger to fire + * @param[out] combinations All combinations of particles that could have + * caused the trigger to fire. + * @param chain The name of the chain. + * @param rerun Whether to look at the chain in 'rerun' mode. + * The provided vector will be cleared before use! + * Note that this also only returns electrons, photons, muons, taus or + * (for egamma etcut triggers) calo clusters. This tool will not return + * (b-)jets. For combined (b-)jet+X triggers (where X is one of the above) + * only the X will be returned. + * This tool may not work if too much trigger information has been + * removed. + */ + StatusCode retrieveParticles( + std::vector<std::vector<const xAOD::IParticle*>>& combinations, + const std::string& chain, + bool rerun = false) const override; + + /** + * @brief Retrieve particles that caused this trigger element to pass. + * @param[out] combination All particles that caused this TE to fire. + * @param te The trigger element to be interrogated. + * @param[out] navFailure Use to communicate a failure in the navigation + * without an error. + */ + StatusCode retrieveParticles( + std::vector<const xAOD::IParticle*>& combination, + const HLT::TriggerElement* te, + bool& navFailure) const; + + /** + * @brief Get the type of particle that should be retrieved from this TE. + * @param egammaTE The TE to query + * @return The type of object that caused this TE to fire. + * + * This function should only be called on a TE from a single leg of an + * EGamma trigger. + */ + xAOD::Type::ObjectType getEGammaTEType(const HLT::TriggerElement* te) const; + + /** + * @brief Retrieve an IParticle from a feature + * @param[out] particle The retrieved particle + * @param feature The feature containing the particle + * @param te The trigger element containing this feature + * @param[out] navFailure Use to communicate a failure in the navigation + * without an error. + */ + StatusCode retrieveFeatureParticle( + const xAOD::IParticle*& particle, + const HLT::TriggerElement::FeatureAccessHelper& feature, + const HLT::TriggerElement* te, + bool& navFailure) const; + + private: + // Properties + /// The TrigDecisionTool that will be used to get the navigation + ToolHandle<Trig::TrigDecisionTool> m_tdt { + "Trig::TrigDecisionTool/TrigDecisionTool"}; + /// Be forgiving about the navigation not matching our expectations + bool m_warnOnNavigationFailure; + }; //> end class IParticleRetrievalTool +} //> end namespace Trig + +#endif //> !TriggerMatchingTool_IParticleRetrievalTool_H diff --git a/Trigger/TrigAnalysis/TriggerMatchingTool/TriggerMatchingTool/MatchConfig.h b/Trigger/TrigAnalysis/TriggerMatchingTool/TriggerMatchingTool/MatchConfig.h deleted file mode 100644 index 2b332d0aff0cb32f15e9d4180d67ce88defa974d..0000000000000000000000000000000000000000 --- a/Trigger/TrigAnalysis/TriggerMatchingTool/TriggerMatchingTool/MatchConfig.h +++ /dev/null @@ -1,29 +0,0 @@ -// Dear emacs, this is -*- c++ -*- - -/* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration -*/ - -#ifndef MATCHCONFIG_H -#define MATCHCONFIG_H - -#include "TriggerMatchingTool/IMatchConfig.h" - -#include <map> - -namespace Trig { - - class MatchConfig : public IMatchConfig { - public: - MatchConfig(); - MatchConfig(const std::map<xAOD::Type::ObjectType, double>& thresholds); - ~MatchConfig(); - virtual double matchThreshold(xAOD::Type::ObjectType) const override; - private: - //we'll keep a type_sorted list to the reco particles that initiated this match - std::map<xAOD::Type::ObjectType,double> m_thresholds_by_type; - }; - -} - -#endif diff --git a/Trigger/TrigAnalysis/TriggerMatchingTool/TriggerMatchingTool/MatchFromCompositeTool.h b/Trigger/TrigAnalysis/TriggerMatchingTool/TriggerMatchingTool/MatchFromCompositeTool.h new file mode 100644 index 0000000000000000000000000000000000000000..e591339728987d45710abc9dc15d92fba78d4f98 --- /dev/null +++ b/Trigger/TrigAnalysis/TriggerMatchingTool/TriggerMatchingTool/MatchFromCompositeTool.h @@ -0,0 +1,110 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +#ifndef TriggerMatchingTool_MatchFromCompositeTool_H +#define TriggerMatchingTool_MatchFromCompositeTool_H + +// Framework includes +#include "AsgTools/AsgTool.h" +#include "AthContainers/AuxElement.h" +#include "AthLinks/ElementLink.h" +#include "xAODBase/IParticleContainer.h" +#include "xAODTrigger/TrigCompositeContainer.h" + +// Package includes +#include "TriggerMatchingTool/IMatchingTool.h" + + +namespace Trig { + /** + * @brief Tool to perform matching to selected offline particles using the + * list of candidates created by the DerivationFramework::TriggerMatchingTool. + * @author Jon Burr + */ + class MatchFromCompositeTool final : public virtual IMatchingTool, + public asg::AsgTool + { + ASG_TOOL_CLASS( MatchFromCompositeTool, IMatchingTool ) + public: + /// Standard constructor + MatchFromCompositeTool(const std::string& name); + + /// Default destructor + ~MatchFromCompositeTool() override; + + /// Initialise the tool + StatusCode initialize() override; + + /** + * @brief Match a single object + * @param recoObject The object to match. + * @param chain The chain to match to. + * The final two parameters for this function are inherited from the + * interface but have no effect! + * To follow the implementation of the other tool, the matching returns + * true if all provided offline objects have a corresponding online + * object, not if all online objects match a provided offline object. + */ + bool match( + const xAOD::IParticle& recoObject, + const std::string& chain, + double=0.1, bool=false) const override; + + /** + * @brief Match a multiple objects + * @param recoObjects The objects to match. + * @param chain The chain to match to. + * The final two parameters for this function are inherited from the + * interface but have no effect! + * To follow the implementation of the other tool, the matching returns + * true if all provided offline objects have a corresponding online + * object, not if all online objects match a provided offline object. + */ + bool match( + const std::vector<const xAOD::IParticle*>& recoObject, + const std::string& chain, + double=0.1, bool=false) const override; + + protected: + /// Helper typedefs for accessors/decorators, vectors of ele links + template <typename T> + using constAcc_t = SG::AuxElement::ConstAccessor<T>; + template <typename T> + using dec_t = SG::AuxElement::Decorator<T>; + template <typename T> + using vecLink_t = std::vector<ElementLink<T>>; + + // Properties + /// Allow matching shallow copy to shallow copy + bool m_matchShallow = true; + + /// If greater than 0 then will skip the above check and just check that + /// DR between the two particles is less than this value. + float m_drThreshold = -1; + + /// The prefix to expect at the front of the trig composite container name + std::string m_inputPrefix; + + // Internal functions + /// Inherited from the interface but does nothing + virtual MatchingImplementation* impl() const override { return nullptr; } + + /** + * @brief Test a combination of offline objects against a combination of + * online objects + * @param onlineLinks The online combination + * @param offline The offline combination + */ + bool testCombination( + const vecLink_t<xAOD::IParticleContainer>& onlineLinks, + const std::vector<const xAOD::IParticle*>& offline) const; + + /// Check if two particles are the same. + bool areTheSame( + const xAOD::IParticle& lhs, + const xAOD::IParticle& rhs) const; + }; //> end class MatchFromCompositeTool +} //> end namespace Trig + +#endif //> TriggerMatchingTool_MatchFromCompositeTool_H diff --git a/Trigger/TrigAnalysis/TriggerMatchingTool/TriggerMatchingTool/MatchResult.h b/Trigger/TrigAnalysis/TriggerMatchingTool/TriggerMatchingTool/MatchResult.h deleted file mode 100644 index 8444860837804ac9c34796e228424d8d2baae4ec..0000000000000000000000000000000000000000 --- a/Trigger/TrigAnalysis/TriggerMatchingTool/TriggerMatchingTool/MatchResult.h +++ /dev/null @@ -1,56 +0,0 @@ -// Dear emacs, this is -*- c++ -*- - -/* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration -*/ - -#ifndef MATCHRESULT_H -#define MATCHRESULT_H - -#include "xAODBase/ObjectType.h" - -#include "TriggerMatchingTool/IMatchResult.h" -#include "TriggerMatchingTool/IAssociationStrategy.h" - -#include <map> -#include "xAODBase/IParticle.h" -#include "xAODBase/ObjectType.h" -#include "TrigDecisionTool/Feature.h" - -namespace Trig { - - - struct ComboMatch { - struct SingleTypeMatch { - typedef Feature<xAOD::IParticle> TrigFeature; - IAssociationStrategy::index_assignment_t assignment; - std::vector<TrigFeature> features; - double total_cost; - bool matched; - }; - std::map<xAOD::Type::ObjectType,SingleTypeMatch> singlematch_by_type; - bool matched; - }; - - class MatchingTool; - class MatchResult : public IMatchResult { - public: - friend class MatchingTool; - MatchResult(); - ~MatchResult(); - virtual bool isMatched() override; - std::vector<const xAOD::IParticle*> bestMatchedObjects() override; - private: - bool m_matched; - - //the original list of reco particles - std::vector<const xAOD::IParticle*> m_original_recolist; - - //we'll keep a type_sorted list to the reco particles that initiated this match - std::map<xAOD::Type::ObjectType,std::vector<const xAOD::IParticle*> > m_recos_by_type; - std::vector<ComboMatch> m_combresults; - }; - -} - -#endif diff --git a/Trigger/TrigAnalysis/TriggerMatchingTool/TriggerMatchingTool/MatchingImplementation.h b/Trigger/TrigAnalysis/TriggerMatchingTool/TriggerMatchingTool/MatchingImplementation.h index 3225d4f57ec618a5f7a2ae47af8105e4d932bbf2..bc46c415a6306ac54b8a7fd21a782c045168fbbd 100644 --- a/Trigger/TrigAnalysis/TriggerMatchingTool/TriggerMatchingTool/MatchingImplementation.h +++ b/Trigger/TrigAnalysis/TriggerMatchingTool/TriggerMatchingTool/MatchingImplementation.h @@ -32,13 +32,15 @@ namespace MatchingStrategy { class MatchingImplementation : public asg::AsgMessaging { public: - MatchingImplementation(MatchingTool& mt); + MatchingImplementation(MatchingTool& mt, double threshold=0.4); Trig::TrigDecisionTool* tdt(); - std::pair<bool, IAssociationStrategy::index_assignment_t> matchDistanceMatrix(const std::vector<std::vector<double> >& matrix, double threshold, const Trig::MatchingStrategy::Strategy strategy = Trig::MatchingStrategy::MinimalSum); + bool matchDistanceMatrix(const std::vector<std::vector<double> >& matrix, const Trig::MatchingStrategy::Strategy strategy = Trig::MatchingStrategy::MinimalSum, double threshold = 0.0) const ; + inline void setThreshold(double in) { m_threshold=in; } private: - bool assocIsMatched(IAssociationStrategy::index_assignment_t association, const std::vector<std::vector<double> >& matrix, double threshold); + bool assocIsMatched(IAssociationStrategy::index_assignment_t association, const std::vector<std::vector<double> >& matrix, double threshold) const ; MatchingTool& m_tool; std::map<Trig::MatchingStrategy::Strategy,std::unique_ptr<IAssociationStrategy> > m_strategies; + double m_threshold; //the distance threshold for a match }; } diff --git a/Trigger/TrigAnalysis/TriggerMatchingTool/TriggerMatchingTool/MatchingTool.h b/Trigger/TrigAnalysis/TriggerMatchingTool/TriggerMatchingTool/MatchingTool.h index 5932dcb86b81589ae674d5c5bad4e5d93d8c3055..0f505b108e6219bffbd022c24be038cc83e1a8b5 100644 --- a/Trigger/TrigAnalysis/TriggerMatchingTool/TriggerMatchingTool/MatchingTool.h +++ b/Trigger/TrigAnalysis/TriggerMatchingTool/TriggerMatchingTool/MatchingTool.h @@ -13,21 +13,12 @@ #include "TriggerMatchingTool/IMatchingTool.h" #include "TriggerMatchingTool/TypeMap.h" +#include "TriggerMatchingTool/IMatchingTool.h" #include "TrigDecisionTool/Combination.h" #include "TrigDecisionTool/TrigDecisionTool.h" -#include "TriggerMatchingTool/MatchResult.h" - - - - - namespace Trig { - typedef std::map<xAOD::Type::ObjectType,std::vector<const xAOD::IParticle*> > IParticlesByType; - - - class MatchingTool : public asg::AsgTool, virtual public Trig::IMatchingTool { ASG_TOOL_CLASS(MatchingTool,IMatchingTool) @@ -37,51 +28,33 @@ public: MatchingTool(const std::string& name); ~MatchingTool(); StatusCode initialize() override; - - //convenience method for multi-object method with single threshold - bool match(const std::vector<const xAOD::IParticle*>& recoObjects, const std::string& chain, double matchTreshold) override; - - //convenience method for multi-object method with type-specific threshold - bool match(const std::vector<const xAOD::IParticle*>& recoObjects, const std::string& chain, const std::map<xAOD::Type::ObjectType, double>& thresholds) override; - - //convenience method for single-object method - bool match(const xAOD::IParticle& recoObjects, const std::string& chain, double matchTreshold) override; - - bool match(const std::vector<const xAOD::IParticle*>& recoObjects, const std::string& chain); - //main matching method - std::unique_ptr<IMatchResult> match_result(const std::vector<const xAOD::IParticle*>& recoObjects, const std::string& chain, const IMatchConfig* mc = 0) override; + bool match(const std::vector<const xAOD::IParticle*>& recoObjects, const std::string& chain, double matchTreshold, bool rerun) const override; + bool match(const xAOD::IParticle& recoObjects, const std::string& chain, double matchTreshold, bool rerun) const override; - virtual void setCondition(unsigned int condition=TrigDefs::Physics) override; - protected: - MatchingImplementation* impl() override; + MatchingImplementation* impl() const override; - bool matchSingleType(const std::vector<const xAOD::IParticle*>& subRecoObjects, Trig::Combination& comb, ComboMatch::SingleTypeMatch& result, double threshold); + bool matchSingleType(const std::vector<const xAOD::IParticle*>& subRecoObjects, Trig::Combination& comb, const std::string& chain, double threshold) const; - bool matchCombination(IParticlesByType& recoByType, Trig::Combination& comb, std::unique_ptr<MatchResult>& result, const IMatchConfig* mc = 0); + bool matchCombination(const std::vector<const xAOD::IParticle*>& recoObjects, Trig::Combination& comb, const std::string& chain, double threshold) const; #ifndef XAOD_STANDALONE - void updateOutputLevel(Property& p); void updateThreshold(Property& p); #endif private: - - IParticlesByType separateByType(const std::vector<const xAOD::IParticle*>& recoObjects); - - double IParticleMetric(const xAOD::IParticle* lhs, const xAOD::IParticle* rhs); + double IParticleMetric(const xAOD::IParticle* lhs, const xAOD::IParticle* rhs) const ; std::vector<std::vector<double> > distanceMatrix(const std::vector<const xAOD::IParticle*>& reco, - const std::vector<const xAOD::IParticle*>& trigger); + const std::vector<const xAOD::IParticle*>& trigger)const; MatchingImplementation* m_impl; TypeMap m_typeMap; ToolHandle<Trig::TrigDecisionTool> m_trigDecTool; double m_matchingThreshold; - unsigned int m_condition; }; } diff --git a/Trigger/TrigAnalysis/TriggerMatchingTool/TriggerMatchingTool/TriggerMatchingToolDict.h b/Trigger/TrigAnalysis/TriggerMatchingTool/TriggerMatchingTool/TriggerMatchingToolDict.h index f13aca34eb4a1237280a3a5433700384ffa4fef3..d3ce9275ac78bf168841150c2b279b849f8ffb1d 100644 --- a/Trigger/TrigAnalysis/TriggerMatchingTool/TriggerMatchingTool/TriggerMatchingToolDict.h +++ b/Trigger/TrigAnalysis/TriggerMatchingTool/TriggerMatchingTool/TriggerMatchingToolDict.h @@ -6,6 +6,8 @@ #ifndef TRIGGERMATCHINGTOOL_TRIGGERMATCHINGTOOLDICT_H #define TRIGGERMATCHINGTOOL_TRIGGERMATCHINGTOOLDICT_H -#include "TriggerMatchingTool/IMatchingTool.h" +#include "TriggerMatchingTool/MatchingTool.h" +#include "TriggerMatchingTool/IParticleRetrievalTool.h" +#include "TriggerMatchingTool/MatchFromCompositeTool.h" #endif diff --git a/Trigger/TrigAnalysis/TriggerMatchingTool/TriggerMatchingTool/TypeMap.h b/Trigger/TrigAnalysis/TriggerMatchingTool/TriggerMatchingTool/TypeMap.h index d55a79043a60aac925c634ac1cf18ea9a9718950..ead20117cdd5a63294a9ea919e604214b4f87516 100644 --- a/Trigger/TrigAnalysis/TriggerMatchingTool/TriggerMatchingTool/TypeMap.h +++ b/Trigger/TrigAnalysis/TriggerMatchingTool/TriggerMatchingTool/TypeMap.h @@ -15,8 +15,8 @@ class TypeMap { public: typedef std::pair<HLT::class_id_type,std::string> clid_string_t; TypeMap(); - bool isKnown(const xAOD::Type::ObjectType& recoType); - clid_string_t get(const xAOD::Type::ObjectType& recoType); + bool isKnown(const xAOD::Type::ObjectType& recoType) const; + clid_string_t get(const xAOD::Type::ObjectType& recoType) const; private: std::map<xAOD::Type::ObjectType,clid_string_t> m_typemap; }; diff --git a/Trigger/TrigAnalysis/TriggerMatchingTool/TriggerMatchingTool/selection.xml b/Trigger/TrigAnalysis/TriggerMatchingTool/TriggerMatchingTool/selection.xml index 0050b82367f14554e08578a3ce78df267ddc9c7a..4ceaff3c5b61c7daed88d9f76a51de9f385ba820 100644 --- a/Trigger/TrigAnalysis/TriggerMatchingTool/TriggerMatchingTool/selection.xml +++ b/Trigger/TrigAnalysis/TriggerMatchingTool/TriggerMatchingTool/selection.xml @@ -2,4 +2,7 @@ <lcgdict> <namespace name="Trig" /> <class name="Trig::IMatchingTool" /> + <class name="Trig::IIParticleRetrievalTool" /> + <class name="Trig::IParticleRetrievalTool" /> + <class name="Trig::MatchFromCompositeTool" /> </lcgdict> diff --git a/Trigger/TrigAnalysis/TriggerMatchingTool/src/components/TriggerMatchingTool_entries.cxx b/Trigger/TrigAnalysis/TriggerMatchingTool/src/components/TriggerMatchingTool_entries.cxx index 8c64e8127fb6edbbf6d9284f01d916b1b6d58560..83133a91681f2f26aebdd260588092cc04f456cf 100644 --- a/Trigger/TrigAnalysis/TriggerMatchingTool/src/components/TriggerMatchingTool_entries.cxx +++ b/Trigger/TrigAnalysis/TriggerMatchingTool/src/components/TriggerMatchingTool_entries.cxx @@ -1,8 +1,13 @@ #include "TriggerMatchingTool/MatchingTool.h" +#include "TriggerMatchingTool/IParticleRetrievalTool.h" +#include "TriggerMatchingTool/MatchFromCompositeTool.h" DECLARE_COMPONENT( Trig::MatchingTool ) +DECLARE_COMPONENT( Trig::MatchingTool ) +DECLARE_COMPONENT( Trig::IParticleRetrievalTool ) +DECLARE_COMPONENT( Trig::MatchFromCompositeTool ) #include "../TestMatchingToolAlg.h" DECLARE_COMPONENT( TestMatchingToolAlg ) diff --git a/Trigger/TrigCost/TrigCostRootAnalysis/Root/DataVariable.cxx b/Trigger/TrigCost/TrigCostRootAnalysis/Root/DataVariable.cxx index a805e2993172f4e577b56738d0a54a35720aff1e..593ebd0eb01b34e7f7c24e11ead1b2e2f546b379 100644 --- a/Trigger/TrigCost/TrigCostRootAnalysis/Root/DataVariable.cxx +++ b/Trigger/TrigCost/TrigCostRootAnalysis/Root/DataVariable.cxx @@ -122,11 +122,7 @@ namespace TrigCostRootAnalysis { return; } TH1F* h = getHist(vo); -#if ROOT_VERSION_CODE >= ROOT_VERSION(6, 0, 0) h->SetCanExtend(TH1::kNoAxis); -#else - h->SetBit(TH1::kCanRebin, kFALSE); -#endif h->SetBins((Int_t) titles.size(), 0., (Float_t) titles.size()); for (UInt_t i = 0; i < titles.size(); ++i) { h->GetXaxis()->SetBinLabel((Int_t) i + 1, titles.at(i).c_str()); @@ -473,11 +469,7 @@ namespace TrigCostRootAnalysis { } else { // Standard mode - automatic bin widths data->m_hist = new TH1F(name.c_str(), data->m_histoTitle->c_str(), Config::config().getInt(kHistBins), 0, 0); -#if ROOT_VERSION_CODE >= ROOT_VERSION(6, 0, 0) data->m_hist->SetCanExtend(TH1::kAllAxes); -#else - data->m_hist->SetBit(TH1::kCanRebin, kTRUE); -#endif } MUTEX_OFF delete data->m_histoTitle; //No longer need to keep this title floating about, it's stored in this histogram diff --git a/Trigger/TrigDataAccess/TrigDataAccessMonitoring/src/MonROBDataProviderSvc.cxx b/Trigger/TrigDataAccess/TrigDataAccessMonitoring/src/MonROBDataProviderSvc.cxx index 898bec780b57d0efb99198bc3fcfe2f87edae90f..89c461dd334c346c91f277b94ca26aac9abe54c0 100644 --- a/Trigger/TrigDataAccess/TrigDataAccessMonitoring/src/MonROBDataProviderSvc.cxx +++ b/Trigger/TrigDataAccess/TrigDataAccessMonitoring/src/MonROBDataProviderSvc.cxx @@ -414,11 +414,7 @@ void MonROBDataProviderSvc::handle(const Incident& incident) { m_histProp_requestedROBsPerCall.value().lowEdge(), m_histProp_requestedROBsPerCall.value().highEdge()); if (m_hist_requestedROBsPerCall) { -#if ROOT_VERSION_CODE >= ROOT_VERSION(6,0,0) m_hist_requestedROBsPerCall->SetCanExtend(TH1::kAllAxes); -#else - m_hist_requestedROBsPerCall->SetBit(TH1::kCanRebin); -#endif if( rootHistSvc->regHist(path + m_hist_requestedROBsPerCall->GetName(), m_hist_requestedROBsPerCall).isFailure() ) { logStream() << MSG::WARNING << "Can not register monitoring histogram: " << m_hist_requestedROBsPerCall->GetName() << endmsg; } @@ -431,11 +427,7 @@ void MonROBDataProviderSvc::handle(const Incident& incident) { m_histProp_receivedROBsPerCall.value().lowEdge(), m_histProp_receivedROBsPerCall.value().highEdge()); if (m_hist_receivedROBsPerCall) { -#if ROOT_VERSION_CODE >= ROOT_VERSION(6,0,0) m_hist_receivedROBsPerCall->SetCanExtend(TH1::kAllAxes); -#else - m_hist_receivedROBsPerCall->SetBit(TH1::kCanRebin); -#endif if( rootHistSvc->regHist(path + m_hist_receivedROBsPerCall->GetName(), m_hist_receivedROBsPerCall).isFailure() ) { logStream() << MSG::WARNING << "Can not register monitoring histogram: " << m_hist_receivedROBsPerCall->GetName() << endmsg; } @@ -448,11 +440,7 @@ void MonROBDataProviderSvc::handle(const Incident& incident) { m_histProp_timeROBretrieval.value().lowEdge(), m_histProp_timeROBretrieval.value().highEdge()); if (m_hist_timeROBretrieval) { -#if ROOT_VERSION_CODE >= ROOT_VERSION(6,0,0) m_hist_timeROBretrieval->SetCanExtend(TH1::kAllAxes); -#else - m_hist_timeROBretrieval->SetBit(TH1::kCanRebin); -#endif if( rootHistSvc->regHist(path + m_hist_timeROBretrieval->GetName(), m_hist_timeROBretrieval).isFailure() ) { logStream() << MSG::WARNING << "Can not register monitoring histogram: " << m_hist_timeROBretrieval->GetName() << endmsg; } diff --git a/Trigger/TrigDataAccess/TrigROBDataProviderSvc/src/TrigROBDataProviderSvc.cxx b/Trigger/TrigDataAccess/TrigROBDataProviderSvc/src/TrigROBDataProviderSvc.cxx index e79d53b23c3b92fa4228f0788eb160e0f8f8451d..759aace6abe2b1ea378dfe5541256a1179e1bc16 100755 --- a/Trigger/TrigDataAccess/TrigROBDataProviderSvc/src/TrigROBDataProviderSvc.cxx +++ b/Trigger/TrigDataAccess/TrigROBDataProviderSvc/src/TrigROBDataProviderSvc.cxx @@ -32,12 +32,6 @@ #include <TH1F.h> #include <TH2F.h> -#if ROOT_VERSION_CODE >= ROOT_VERSION(6,0,0) -# define CAN_REBIN(hist) hist->SetCanExtend(TH1::kAllAxes) -#else -# define CAN_REBIN(hist) hist->SetBit(TH1::kCanRebin) -#endif - // Constructor. TrigROBDataProviderSvc::TrigROBDataProviderSvc(const std::string& name, ISvcLocator* svcloc) :ROBDataProviderSvc(name,svcloc), @@ -1281,7 +1275,7 @@ void TrigROBDataProviderSvc::handle(const Incident& incident) { m_histProp_requestedROBsPerCall.value().lowEdge(), m_histProp_requestedROBsPerCall.value().highEdge()); if (m_hist_requestedROBsPerCall) { - CAN_REBIN(m_hist_requestedROBsPerCall); + m_hist_requestedROBsPerCall->SetCanExtend(TH1::kAllAxes); if( rootHistSvc->regHist(path + m_hist_requestedROBsPerCall->GetName(), m_hist_requestedROBsPerCall).isFailure() ) { logStream() << MSG::WARNING << "Can not register monitoring histogram: " << m_hist_requestedROBsPerCall->GetName() << endmsg; } @@ -1294,7 +1288,7 @@ void TrigROBDataProviderSvc::handle(const Incident& incident) { m_histProp_receivedROBsPerCall.value().lowEdge(), m_histProp_receivedROBsPerCall.value().highEdge()); if (m_hist_receivedROBsPerCall) { - CAN_REBIN(m_hist_receivedROBsPerCall); + m_hist_receivedROBsPerCall->SetCanExtend(TH1::kAllAxes); if( rootHistSvc->regHist(path + m_hist_receivedROBsPerCall->GetName(), m_hist_receivedROBsPerCall).isFailure() ) { logStream() << MSG::WARNING << "Can not register monitoring histogram: " << m_hist_receivedROBsPerCall->GetName() << endmsg; } @@ -1307,7 +1301,7 @@ void TrigROBDataProviderSvc::handle(const Incident& incident) { m_histProp_timeROBretrieval.value().lowEdge(), m_histProp_timeROBretrieval.value().highEdge()); if (m_hist_timeROBretrieval) { - CAN_REBIN(m_hist_timeROBretrieval); + m_hist_timeROBretrieval->SetCanExtend(TH1::kAllAxes); if( rootHistSvc->regHist(path + m_hist_timeROBretrieval->GetName(), m_hist_timeROBretrieval).isFailure() ) { logStream() << MSG::WARNING << "Can not register monitoring histogram: " << m_hist_timeROBretrieval->GetName() << endmsg; } @@ -1320,7 +1314,7 @@ void TrigROBDataProviderSvc::handle(const Incident& incident) { m_histProp_retrievedROBsPerAlgo.value().lowEdge(), m_histProp_retrievedROBsPerAlgo.value().highEdge()); if (m_hist_retrievedROBsPerAlgo) { - CAN_REBIN(m_hist_retrievedROBsPerAlgo); + m_hist_retrievedROBsPerAlgo->SetCanExtend(TH1::kAllAxes); if( rootHistSvc->regHist(path + m_hist_retrievedROBsPerAlgo->GetName(), m_hist_retrievedROBsPerAlgo).isFailure() ) { logStream() << MSG::WARNING << "Can not register monitoring histogram: " << m_hist_retrievedROBsPerAlgo->GetName() << endmsg; } @@ -1343,7 +1337,7 @@ void TrigROBDataProviderSvc::handle(const Incident& incident) { n_tmp_bin++; } - CAN_REBIN(m_hist_ROSRequest); + m_hist_ROSRequest->SetCanExtend(TH1::kAllAxes); if( rootHistSvc->regHist(path + m_hist_ROSRequest->GetName(), m_hist_ROSRequest).isFailure() ) { logStream() << MSG::WARNING << "Can not register monitoring histogram: " << m_hist_ROSRequest->GetName() << endmsg; } diff --git a/Trigger/TrigDataAccess/TrigROBDataProviderSvc/src/TrigROBDataProviderSvc_RTT.cxx b/Trigger/TrigDataAccess/TrigROBDataProviderSvc/src/TrigROBDataProviderSvc_RTT.cxx index 93bba4e228a2333fe38f60ed2338d968305ce488..0abb8c7b2e7f97db79a3a9ac39fad0f7bb4f9f8e 100644 --- a/Trigger/TrigDataAccess/TrigROBDataProviderSvc/src/TrigROBDataProviderSvc_RTT.cxx +++ b/Trigger/TrigDataAccess/TrigROBDataProviderSvc/src/TrigROBDataProviderSvc_RTT.cxx @@ -17,13 +17,6 @@ #include <TH1F.h> #include <TH2F.h> -#if ROOT_VERSION_CODE >= ROOT_VERSION(6,0,0) -# define CAN_REBIN(hist) hist->SetCanExtend(TH1::kAllAxes) -#else -# define CAN_REBIN(hist) hist->SetBit(TH1::kCanRebin) -#endif - - TrigROBDataProviderSvc_RTT::TrigROBDataProviderSvc_RTT(const std::string& name, ISvcLocator* svcloc) : TrigROBDataProviderSvc(name,svcloc), m_enablePrefetchingAtAlgoLevel(true), @@ -566,7 +559,7 @@ void TrigROBDataProviderSvc_RTT::handle(const Incident& incident) m_histProp_missingRequestedROBsPerAlgo.value().lowEdge(), m_histProp_missingRequestedROBsPerAlgo.value().highEdge()); if (m_hist_missingRequestedROBsPerAlgo) { - CAN_REBIN(m_hist_missingRequestedROBsPerAlgo); + m_hist_missingRequestedROBsPerAlgo->SetCanExtend(TH1::kAllAxes); if( rootHistSvc->regHist(path + m_hist_missingRequestedROBsPerAlgo->GetName(), m_hist_missingRequestedROBsPerAlgo).isFailure() ) { logStream() << MSG::WARNING << "Can not register monitoring histogram: " << m_hist_missingRequestedROBsPerAlgo->GetName() << endmsg; } @@ -579,7 +572,7 @@ void TrigROBDataProviderSvc_RTT::handle(const Incident& incident) m_histProp_missingRequestPerAlgo.value().lowEdge(), m_histProp_missingRequestPerAlgo.value().highEdge()); if (m_hist_missingRequestPerAlgo) { - CAN_REBIN(m_hist_missingRequestPerAlgo); + m_hist_missingRequestPerAlgo->SetCanExtend(TH1::kAllAxes); if( rootHistSvc->regHist(path + m_hist_missingRequestPerAlgo->GetName(), m_hist_missingRequestPerAlgo).isFailure() ) { logStream() << MSG::WARNING << "Can not register monitoring histogram: " << m_hist_missingRequestPerAlgo->GetName() << endmsg; } @@ -606,7 +599,7 @@ void TrigROBDataProviderSvc_RTT::handle(const Incident& incident) m_histProp_missingRequestedROBsPerAlgoButCached.value().lowEdge(), m_histProp_missingRequestedROBsPerAlgoButCached.value().highEdge()); if (m_hist_missingRequestedROBsPerAlgoButCached) { - CAN_REBIN(m_hist_missingRequestedROBsPerAlgoButCached); + m_hist_missingRequestedROBsPerAlgoButCached->SetCanExtend(TH1::kAllAxes); if( rootHistSvc->regHist(path + m_hist_missingRequestedROBsPerAlgoButCached->GetName(), m_hist_missingRequestedROBsPerAlgoButCached).isFailure() ) { logStream() << MSG::WARNING << "Can not register monitoring histogram: " << m_hist_missingRequestedROBsPerAlgoButCached->GetName() << endmsg; } @@ -619,7 +612,7 @@ void TrigROBDataProviderSvc_RTT::handle(const Incident& incident) m_histProp_missingRequestPerAlgoButCached.value().lowEdge(), m_histProp_missingRequestPerAlgoButCached.value().highEdge()); if (m_hist_missingRequestPerAlgoButCached) { - CAN_REBIN(m_hist_missingRequestPerAlgoButCached); + m_hist_missingRequestPerAlgoButCached->SetCanExtend(TH1::kAllAxes); if( rootHistSvc->regHist(path + m_hist_missingRequestPerAlgoButCached->GetName(), m_hist_missingRequestPerAlgoButCached).isFailure() ) { logStream() << MSG::WARNING << "Can not register monitoring histogram: " << m_hist_missingRequestPerAlgoButCached->GetName() << endmsg; } @@ -645,7 +638,7 @@ void TrigROBDataProviderSvc_RTT::handle(const Incident& incident) m_histProp_requestPerAlgo.value().lowEdge(), m_histProp_requestPerAlgo.value().highEdge()); if (m_hist_requestPerAlgo) { - CAN_REBIN(m_hist_requestPerAlgo); + m_hist_requestPerAlgo->SetCanExtend(TH1::kAllAxes); if( rootHistSvc->regHist(path + m_hist_requestPerAlgo->GetName(), m_hist_requestPerAlgo).isFailure() ) { logStream() << MSG::WARNING << "Can not register monitoring histogram: " << m_hist_requestPerAlgo->GetName() << endmsg; } @@ -658,7 +651,7 @@ void TrigROBDataProviderSvc_RTT::handle(const Incident& incident) m_histProp_callerPerEvent.value().lowEdge(), m_histProp_callerPerEvent.value().highEdge()); if (m_hist_callerPerEvent) { - CAN_REBIN(m_hist_callerPerEvent); + m_hist_callerPerEvent->SetCanExtend(TH1::kAllAxes); if( rootHistSvc->regHist(path + m_hist_callerPerEvent->GetName(), m_hist_callerPerEvent).isFailure() ) { logStream() << MSG::WARNING << "Can not register monitoring histogram: " << m_hist_callerPerEvent->GetName() << endmsg; } @@ -671,7 +664,7 @@ void TrigROBDataProviderSvc_RTT::handle(const Incident& incident) m_histProp_requestedROBsPerAlgo.value().lowEdge(), m_histProp_requestedROBsPerAlgo.value().highEdge()); if (m_hist_requestedROBsPerAlgo) { - CAN_REBIN(m_hist_requestedROBsPerAlgo); + m_hist_requestedROBsPerAlgo->SetCanExtend(TH1::kAllAxes); if( rootHistSvc->regHist(path + m_hist_requestedROBsPerAlgo->GetName(), m_hist_requestedROBsPerAlgo).isFailure() ) { logStream() << MSG::WARNING << "Can not register monitoring histogram: " << m_hist_requestedROBsPerAlgo->GetName() << endmsg; } @@ -680,7 +673,7 @@ void TrigROBDataProviderSvc_RTT::handle(const Incident& incident) // m_hist_requestedROBsPerCallPerAlgo = new TH2F ("RequestedROBsPerCallPerAlgo","RequestedROBsPerCallPerAlgo;", 1, 0., 1., 100, 0., 2000.); if (m_hist_requestedROBsPerCallPerAlgo) { - CAN_REBIN(m_hist_requestedROBsPerCallPerAlgo); + m_hist_requestedROBsPerCallPerAlgo->SetCanExtend(TH1::kAllAxes); if( rootHistSvc->regHist(path + m_hist_requestedROBsPerCallPerAlgo->GetName(), m_hist_requestedROBsPerCallPerAlgo).isFailure() ) { logStream() << MSG::WARNING << "Can not register monitoring histogram: " << m_hist_requestedROBsPerCallPerAlgo->GetName() << endmsg; } @@ -693,7 +686,7 @@ void TrigROBDataProviderSvc_RTT::handle(const Incident& incident) m_histProp_nocachedRequestPerAlgo.value().lowEdge(), m_histProp_nocachedRequestPerAlgo.value().highEdge()); if (m_hist_nocachedRequestPerAlgo) { - CAN_REBIN(m_hist_nocachedRequestPerAlgo); + m_hist_nocachedRequestPerAlgo->SetCanExtend(TH1::kAllAxes); if( rootHistSvc->regHist(path + m_hist_nocachedRequestPerAlgo->GetName(), m_hist_nocachedRequestPerAlgo).isFailure() ) { logStream() << MSG::WARNING << "Can not register monitoring histogram: " << m_hist_nocachedRequestPerAlgo->GetName() << endmsg; } @@ -706,7 +699,7 @@ void TrigROBDataProviderSvc_RTT::handle(const Incident& incident) m_histProp_nocachedRequestedROBsPerAlgo.value().lowEdge(), m_histProp_nocachedRequestedROBsPerAlgo.value().highEdge()); if (m_hist_nocachedRequestedROBsPerAlgo) { - CAN_REBIN(m_hist_nocachedRequestedROBsPerAlgo); + m_hist_nocachedRequestedROBsPerAlgo->SetCanExtend(TH1::kAllAxes); if( rootHistSvc->regHist(path + m_hist_nocachedRequestedROBsPerAlgo->GetName(), m_hist_nocachedRequestedROBsPerAlgo).isFailure() ) { logStream() << MSG::WARNING << "Can not register monitoring histogram: " << m_hist_nocachedRequestedROBsPerAlgo->GetName() << endmsg; } @@ -720,7 +713,7 @@ void TrigROBDataProviderSvc_RTT::handle(const Incident& incident) m_histProp_missingRequestedROBsPerAlgo_pref.value().lowEdge(), m_histProp_missingRequestedROBsPerAlgo_pref.value().highEdge()); if (m_hist_missingRequestedROBsPerAlgo_pref) { - CAN_REBIN(m_hist_missingRequestedROBsPerAlgo_pref); + m_hist_missingRequestedROBsPerAlgo_pref->SetCanExtend(TH1::kAllAxes); if( rootHistSvc->regHist(path + m_hist_missingRequestedROBsPerAlgo_pref->GetName(), m_hist_missingRequestedROBsPerAlgo_pref).isFailure() ) { logStream() << MSG::WARNING << "Can not register monitoring histogram: " << m_hist_missingRequestedROBsPerAlgo_pref->GetName() << endmsg; } @@ -733,7 +726,7 @@ void TrigROBDataProviderSvc_RTT::handle(const Incident& incident) m_histProp_missingRequestPerAlgo_pref.value().lowEdge(), m_histProp_missingRequestPerAlgo_pref.value().highEdge()); if (m_hist_missingRequestPerAlgo_pref) { - CAN_REBIN(m_hist_missingRequestPerAlgo_pref); + m_hist_missingRequestPerAlgo_pref->SetCanExtend(TH1::kAllAxes); if( rootHistSvc->regHist(path + m_hist_missingRequestPerAlgo_pref->GetName(), m_hist_missingRequestPerAlgo_pref).isFailure() ) { logStream() << MSG::WARNING << "Can not register monitoring histogram: " << m_hist_missingRequestPerAlgo_pref->GetName() << endmsg; } @@ -758,7 +751,7 @@ void TrigROBDataProviderSvc_RTT::handle(const Incident& incident) m_histProp_missingRequestedROBsPerAlgoButCached_pref.value().lowEdge(), m_histProp_missingRequestedROBsPerAlgoButCached_pref.value().highEdge()); if (m_hist_missingRequestedROBsPerAlgoButCached_pref) { - CAN_REBIN(m_hist_missingRequestedROBsPerAlgoButCached_pref); + m_hist_missingRequestedROBsPerAlgoButCached_pref->SetCanExtend(TH1::kAllAxes); if( rootHistSvc->regHist(path + m_hist_missingRequestedROBsPerAlgoButCached_pref->GetName(), m_hist_missingRequestedROBsPerAlgoButCached_pref).isFailure() ) { logStream() << MSG::WARNING << "Can not register monitoring histogram: " << m_hist_missingRequestedROBsPerAlgoButCached_pref->GetName() << endmsg; } @@ -771,7 +764,7 @@ void TrigROBDataProviderSvc_RTT::handle(const Incident& incident) m_histProp_missingRequestPerAlgoButCached_pref.value().lowEdge(), m_histProp_missingRequestPerAlgoButCached_pref.value().highEdge()); if (m_hist_missingRequestPerAlgoButCached_pref) { - CAN_REBIN(m_hist_missingRequestPerAlgoButCached_pref); + m_hist_missingRequestPerAlgoButCached_pref->SetCanExtend(TH1::kAllAxes); if( rootHistSvc->regHist(path + m_hist_missingRequestPerAlgoButCached_pref->GetName(), m_hist_missingRequestPerAlgoButCached_pref).isFailure() ) { logStream() << MSG::WARNING << "Can not register monitoring histogram: " << m_hist_missingRequestPerAlgoButCached_pref->GetName() << endmsg; } @@ -798,7 +791,7 @@ void TrigROBDataProviderSvc_RTT::handle(const Incident& incident) m_histProp_declaredROBsPerAlgo.value().lowEdge(), m_histProp_declaredROBsPerAlgo.value().highEdge()); if (m_hist_declaredROBsPerAlgo) { - CAN_REBIN(m_hist_declaredROBsPerAlgo); + m_hist_declaredROBsPerAlgo->SetCanExtend(TH1::kAllAxes); if( rootHistSvc->regHist(path + m_hist_declaredROBsPerAlgo->GetName(), m_hist_declaredROBsPerAlgo).isFailure() ) { logStream() << MSG::WARNING << "Can not register monitoring histogram: " << m_hist_declaredROBsPerAlgo->GetName() << endmsg; } @@ -811,7 +804,7 @@ void TrigROBDataProviderSvc_RTT::handle(const Incident& incident) m_histProp_prefetchedROBsPerAlgo.value().lowEdge(), m_histProp_prefetchedROBsPerAlgo.value().highEdge()); if (m_hist_prefetchedROBsPerAlgo) { - CAN_REBIN(m_hist_prefetchedROBsPerAlgo); + m_hist_prefetchedROBsPerAlgo->SetCanExtend(TH1::kAllAxes); if( rootHistSvc->regHist(path + m_hist_prefetchedROBsPerAlgo->GetName(), m_hist_prefetchedROBsPerAlgo).isFailure() ) { logStream() << MSG::WARNING << "Can not register monitoring histogram: " << m_hist_prefetchedROBsPerAlgo->GetName() << endmsg; } diff --git a/Trigger/TrigDataAccess/TrigSerializeResult/src/TrigTSerializer.cxx b/Trigger/TrigDataAccess/TrigSerializeResult/src/TrigTSerializer.cxx index fb46141410d15f6f38dfcdb409a9b6ea1420ad21..a5f2467491387d5db9a37e11dc2342fe4dbbc32d 100755 --- a/Trigger/TrigDataAccess/TrigSerializeResult/src/TrigTSerializer.cxx +++ b/Trigger/TrigDataAccess/TrigSerializeResult/src/TrigTSerializer.cxx @@ -16,11 +16,7 @@ #include "SerializeCommon.h" #include "AthenaKernel/getMessageSvc.h" #include "TROOT.h" -#if ROOT_VERSION_CODE >= ROOT_VERSION(5,17,6) #include "TBufferFile.h" -#else -#include "TBuffer.h" -#endif #include "TClass.h" #include "TError.h" #include "TMethodCall.h" @@ -364,11 +360,7 @@ void TrigTSerializer::serialize(const std::string &nameOfClass, void* instance, // do_persistify(noc, instance); -#if ROOT_VERSION_CODE >= ROOT_VERSION(5,17,6) TBufferFile *buff = new TBufferFile(TBuffer::kWrite); -#else - TBuffer *buff = new TBuffer(TBuffer::kWrite); -#endif //std::vector<uint32_t> serialized; @@ -539,12 +531,7 @@ void* TrigTSerializer::deserialize(const std::string &nameOfClass, const std::ve */ //common part -#if ROOT_VERSION_CODE >= ROOT_VERSION(5,17,6) TBufferFile *buff = new TBufferFile(TBuffer::kRead, bufsiz, pbuf, kTRUE); -#else - TBuffer *buff = new TBuffer(TBuffer::kRead, bufsiz, pbuf, kTRUE); -#endif - std::string noc= TrigSerializeResult::remapToDictName(nameOfClass); TClass *pclass = gROOT->GetClass(noc.c_str()); diff --git a/Trigger/TrigEvent/TrigSteeringEventTPCnv/src/HLTResultCnv_p1.cxx b/Trigger/TrigEvent/TrigSteeringEventTPCnv/src/HLTResultCnv_p1.cxx index 6b2c7014ea08ec56e24acd312b2b456cdb263507..23550ebdee3874a4b3dbe791eca66bab9713311b 100755 --- a/Trigger/TrigEvent/TrigSteeringEventTPCnv/src/HLTResultCnv_p1.cxx +++ b/Trigger/TrigEvent/TrigSteeringEventTPCnv/src/HLTResultCnv_p1.cxx @@ -1,10 +1,14 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ #include "TrigSteeringEvent/HLTResult.h" #include "TrigSteeringEventTPCnv/HLTResult_p1.h" #include "TrigSteeringEventTPCnv/HLTResultCnv_p1.h" +#include "AthenaKernel/getThinningCache.h" +#include "AthenaKernel/ThinningCache.h" +#include "AthenaKernel/ITrigNavigationThinningSvc.h" +#include "GaudiKernel/ThreadLocalContext.h" using namespace HLT; @@ -16,7 +20,19 @@ void HLTResultCnv_p1::transToPers(const HLT::HLTResult* trans, pers->m_headerResult = trans->m_headerResult ; pers->m_chainsResult = trans->m_chainsResult ; - pers->m_navigationResult = trans->m_navigationResult ; + + const SG::ThinningCache* cache = SG::getThinningCache(); + if (cache && cache->trigNavigationThinningSvc()) { + const EventContext& ctx = Gaudi::Hive::currentContext(); + std::vector< unsigned int > temp; + if (cache->trigNavigationThinningSvc()->doSlimming (ctx, temp).isFailure()) { + log << MSG::ERROR << "HLTReultCnv_p1::transToPers: doSlimming failed." << endmsg; + } + pers->m_navigationResult = temp; + } + else { + pers->m_navigationResult = trans->m_navigationResult; + } } diff --git a/Trigger/TrigHypothesis/TrigHIHypo/src/CreateHIUEEstimate.cxx b/Trigger/TrigHypothesis/TrigHIHypo/src/CreateHIUEEstimate.cxx index 1aa20fa0d936407d423f1710cd875b1408f57ad7..407f28f9e998b2bf1f03b3c784e9406484a0b0bb 100644 --- a/Trigger/TrigHypothesis/TrigHIHypo/src/CreateHIUEEstimate.cxx +++ b/Trigger/TrigHypothesis/TrigHIHypo/src/CreateHIUEEstimate.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ #include "xAODHIEvent/HIEventShapeAuxContainer.h" @@ -7,13 +7,11 @@ #include "CreateHIUEEstimate.h" -CreateHIUEEstimate::CreateHIUEEstimate(const std::string& name, ISvcLocator* pSvcLocator) +CreateHIUEEstimate::CreateHIUEEstimate(const std::string& name, ISvcLocator* pSvcLocator) : HLT::AllTEAlgo(name, pSvcLocator), - m_fillerTool("HIEventShapeFillerTool"), + m_fillerTool("HIEventShapeFillerTool"), m_hasRun(false) { - - declareProperty("HIEventShapeContainerKey", m_HIEventShapeContainerKey ="HIUE", "Nmae of the output HIUE container"); declareProperty("CaloCellContainerKey", m_CaloCellContainerKey="HLT_CaloCellContainer_TrigCaloCellMaker", "CaloCellContainer to work on"); declareProperty("FillerTool", m_fillerTool, "Filler tool to use"); @@ -36,7 +34,7 @@ HLT::ErrorCode CreateHIUEEstimate::hltExecute(std::vector<std::vector<HLT::Trigg unsigned int type_out) { HLT::TEVec empty; - HLT::TriggerElement* outputTE = config()->getNavigation()->addNode(empty, type_out); + HLT::TriggerElement* outputTE = config()->getNavigation()->addNode(empty, type_out); if ( m_hasRun ) { return HLT::OK; } @@ -48,36 +46,35 @@ HLT::ErrorCode CreateHIUEEstimate::hltExecute(std::vector<std::vector<HLT::Trigg // xAOD::HIEventShapeAuxContainer* aux = new xAOD::HIEventShapeAuxContainer(); // theUEContainer->setStore(aux); - // ATH_MSG_INFO( evtStore()->dump() ); + // ATH_MSG_INFO( evtStore()->dump() ); xAOD::HIEventShapeContainer* shape = new xAOD::HIEventShapeContainer(); xAOD::HIEventShapeAuxContainer shapeAux = xAOD::HIEventShapeAuxContainer(); shape->setStore(&shapeAux); - if( m_fillerTool->InitializeCollection(shape).isFailure() ) { + if( m_fillerTool->initializeCollection(shape).isFailure() ) { return HLT::ERROR; } - - if( m_fillerTool->FillCollectionFromCells(m_CaloCellContainerKey).isFailure() ) { + + if( m_fillerTool->fillCollectionFromCells(m_CaloCellContainerKey).isFailure() ) { return HLT::ERROR; } { - - // ATH_MSG_DEBUG( "UE Container size" << theUEContainer->size() ); + + // ATH_MSG_DEBUG( "UE Container size" << theUEContainer->size() ); // for ( auto eshape: *theUEContainer ) { // ATH_MSG_INFO("Eshape layer " << eshape->layer() << " etamin: " << eshape->etaMin() << " etamax: " << eshape->etaMax() << " energy " << eshape->Et() << " area " << eshape->area() ); // } - + auto status = attachFeature(outputTE, shape, m_HIEventShapeContainerKey); if ( status != HLT::OK ) { - return status; + return status; } } - + return HLT::OK; } - diff --git a/Trigger/TrigHypothesis/TrigMultiVarHypo/python/TrigL2CaloRingerHypoTool.py b/Trigger/TrigHypothesis/TrigMultiVarHypo/python/TrigL2CaloRingerHypoTool.py index cb61d14a28a0a2c6365d165341e5d14eeb454d9b..dea77fc55d375af333dec65241b4cbfe3c8c88e6 100644 --- a/Trigger/TrigHypothesis/TrigMultiVarHypo/python/TrigL2CaloRingerHypoTool.py +++ b/Trigger/TrigHypothesis/TrigMultiVarHypo/python/TrigL2CaloRingerHypoTool.py @@ -10,12 +10,13 @@ _possibleSel = { 'tight':'Tight', 'medium':'Medium', 'loose':'Loose', 'vloose': 'lhtight':'Tight', 'lhmedium':'Medium', 'lhloose':'Loose', 'lhvloose':'VeryLoose'} from AthenaCommon.SystemOfUnits import GeV +from TriggerJobOpts.TriggerFlags import TriggerFlags +#from AthenaMonitoring.GenericMonitoringTool import GenericMonitoringTool,defineHistogram +# Just because the TriggerFlags Online and doValidation doen't work +from AthenaCommon.AthenaCommonFlags import athenaCommonFlags - - - -def _GetPath( cand, sel, basepath = 'RingerSelectorTools/TrigL2_20170221_v6' ): +def _GetPath( cand, sel, basepath = 'RingerSelectorTools/TrigL2_20180903_v9' ): from AthenaCommon.Logging import logging logger = logging.getLogger("TrigMultiVarHypo.GetPath") @@ -36,24 +37,20 @@ def _GetPath( cand, sel, basepath = 'RingerSelectorTools/TrigL2_20170221_v6' ): return constant, threshold - - - - - - - - -def _HypoTool(name, cand, threshold, sel): +def _IncTool(name, cand, threshold, sel): from TrigMultiVarHypo.TrigMultiVarHypoConf import TrigL2CaloRingerHypoToolMT + tool = TrigL2CaloRingerHypoToolMT( name ) tool.AcceptAll = False tool.MonTool = "" tool.EtCut = (float(threshold)-3.)*GeV - + + # monitoring part from TriggerJobOpts.TriggerFlags import TriggerFlags - if 'Validation' in TriggerFlags.enableMonitoring() or 'Online' in TriggerFlags.enableMonitoring(): + if (('Validation' in TriggerFlags.enableMonitoring()) or + ('Online' in TriggerFlags.enableMonitoring()) or + (athenaCommonFlags.isOnline)): from AthenaMonitoringKernel.GenericMonitoringTool import GenericMonitoringTool,defineHistogram monTool = GenericMonitoringTool('MonTool'+name) @@ -64,15 +61,12 @@ def _HypoTool(name, cand, threshold, sel): defineHistogram('Eta', type='TH1F', path='EXPERT',title="#eta of Clusters; #eta; number of RoIs", xbins=50,xmin=-2.5,xmax=2.5), defineHistogram('Phi',type='TH1F', path='EXPERT',title="#phi of Clusters; #phi; number of RoIs", xbins=64,xmin=-3.2,xmax=3.2), defineHistogram('Et',type='TH1F', path='EXPERT',title="E_{T} of Clusters; E_{T} [MeV]; number of RoIs", xbins=60,xmin=0,xmax=5e4), - defineHistogram('RnnOut',type='TH1F', path='EXPERT',title="E_{T} of Clusters; E_{T} [MeV]; number of RoIs", xbins=100,xmin=-10,xmax=10), + defineHistogram('RnnOut',type='TH1F', path='EXPERT',title="Neural Network output; NN output; number of RoIs", xbins=100,xmin=-10,xmax=10), ] monTool.HistPath='L2CaloHypo_Ringer/'+monTool.name() tool.MonTool=monTool - - - if sel == 'nocut': tool.AcceptAll = True elif sel == "etcut": @@ -85,60 +79,50 @@ def _HypoTool(name, cand, threshold, sel): return tool -def _AlgTool(name): - from TrigMultiVarHypo.TrigMultiVarHypoConf import TrigL2CaloRingerHypoAlgMT - return TrigL2CaloRingerHypoAlgMT( name ) -def decodeThreshold( threshold ): - """ decodes the thresholds of the form e10, 2e10, e10e15, ... """ - print ("TrigL2CaloHypoToolFromName: decoding threshold ", threshold) - if threshold[0].isdigit(): # is if the from NeX, return as list [X,X,X...N times...] - assert threshold[1] == 'e', "Two digit multiplicity not supported" - return [ threshold[2:] ] * int( threshold[0] ) - if threshold.count('e') > 1: # is of the form eXeYeZ, return as [X, Y, Z] - return threshold.strip('e').split('e') - if threshold.count('g') > 1: # us of the form gXgYgZ, return as [X, Y, Z] - return threshold.strip('g').split('g') - # inclusive, return as 1 element list - return [ threshold[1:] ] , threshold[0] +# Just need to modify the in order to construct the hypo +def _MultTool(name): + from TrigMultiVarHypo.TrigMultiVarHypoConf import TrigL2CaloRingerHypoToolMTMult + return TrigL2CaloRingerHypoToolMTMult( name ) -def createRingerDecisions( name, chains, ClustersKey="CaloClusters",RingerKey="CaloRings" ): - # set the name of the HypoTool (name=chain) and figure out the threshold and selection from conf """ - from AthenaCommon.Constants import INFO - tool = _AlgTool(name) - from AthenaCommon.AppMgr import ToolSvc +def TrigL2CaloRingerHypoToolFromDict( d ): + """ Use menu decoded chain dictionary to configure the tool """ + cparts = [i for i in d['chainParts'] if ((i['signature']=='Electron') or (i['signature']=='Photon'))] + from LumiBlockComps.LuminosityCondAlgDefault import LuminosityCondAlgOnlineDefault LuminosityCondAlgOnlineDefault() - if not type(chains) is list: - chains=[chains] - - hypotools = [] - for c in chains: - #print ("Configuring ", name) - bname = c.split('_') - threshold = bname[1] - sel = bname[2] - dt, cand = decodeThreshold( threshold ) - hypotools.append(_HypoTool( c, cand, dt[0], sel )) + def __mult(cpart): + return int( cpart['multiplicity'] ) + + def __th(cpart): + return cpart['threshold'] - for t in tool.HypoTools: - t.OutputLevel=INFO + def __sel(cpart): + return cpart['addInfo'][0] if cpart['addInfo'] else cpart['IDinfo'] - tool.HypoTools = hypotools - tool.ClustersKey = ClustersKey - tool.RingerKey = RingerKey - return tool - - + def __cand(cpart): + return cpart['trigType'] + name = d['chainName'] + + # do we need to configure high multiplicity selection, either NeX or ex_ey_ez etc...? + if len(cparts) > 1 or __mult(cparts[0]) > 1: + tool = _MultTool(name) + for cpart in cparts: + for cutNumber in range( __mult( cpart ) ): + tool.SubTools += [ _IncTool( cpart['chainPartName']+"_"+str(cutNumber), __cand(cpart), __th(cpart), __sel(cpart) ) ] + + return tool + else: + return _IncTool( name, __cand(cparts[0]), __th(cparts[0]), __sel(cparts[0]) ) diff --git a/Trigger/TrigHypothesis/TrigMultiVarHypo/src/ITrigL2CaloRingerHypoToolMT.h b/Trigger/TrigHypothesis/TrigMultiVarHypo/src/ITrigL2CaloRingerHypoToolMT.h new file mode 100644 index 0000000000000000000000000000000000000000..377ccb2a8f358f92dde44471f3311653446d2dc8 --- /dev/null +++ b/Trigger/TrigHypothesis/TrigMultiVarHypo/src/ITrigL2CaloRingerHypoToolMT.h @@ -0,0 +1,69 @@ +/* + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration +*/ +#ifndef TRIGMULTIVARHYPO_ITRIGL2CALORINGERHYPOTOOLMT_H +#define TRIGMULTIVARHYPO_ITRIGL2CALORINGERHYPOTOOLMT_H 1 + +#include "GaudiKernel/IAlgTool.h" + + + +#include "AthenaBaseComps/AthAlgTool.h" +#include "DecisionHandling/HLTIdentifier.h" +#include "DecisionHandling/TrigCompositeUtils.h" +#include "xAODTrigRinger/TrigRingerRings.h" +#include "TrigSteeringEvent/TrigRoiDescriptorCollection.h" + + +/** + * @class Base for tools dooing L2 Calo Hypo selection + * @brief + **/ + +class ITrigL2CaloRingerHypoToolMT + : virtual public ::IAlgTool +{ + + public: + DeclareInterfaceID(ITrigL2CaloRingerHypoToolMT, 1, 0); + virtual ~ITrigL2CaloRingerHypoToolMT(){} + + + struct RingerInfo { + RingerInfo( TrigCompositeUtils::Decision* d, + const TrigRoiDescriptor* k, + const xAOD::TrigRingerRings* r, + const TrigCompositeUtils::Decision* previousDecision ) + : decision( d ), + roi( k ), + ringerShape( r ), + previousDecisionIDs( TrigCompositeUtils::decisionIDs( previousDecision ).begin(), + TrigCompositeUtils::decisionIDs( previousDecision ).end() ) + {} + TrigCompositeUtils::Decision* decision; + const TrigRoiDescriptor* roi; + const xAOD::TrigRingerRings* ringerShape; + const TrigCompositeUtils::DecisionIDContainer previousDecisionIDs; + }; + + /** + * @brief decides upon all clusters + * Note it is for a reason a non-virtual method, it is an interface in gaudi sense and implementation. + * There will be many tools called often to perform this quick operation and we do not want to pay for polymorphism which we do not need to use. + * Will actually see when N obj hypos will enter the scene + **/ + virtual StatusCode decide( std::vector<RingerInfo>& input ) const = 0; + + /** + * @brief Makes a decision for a single object + * The decision needs to be returned + **/ + virtual bool decide( const RingerInfo& i ) const = 0; + + protected: + + +}; + + +#endif //> !TRIGMULTIVARHYPO_ITRIGL2CALORINGERHYPOTOOLMT_H diff --git a/Trigger/TrigHypothesis/TrigMultiVarHypo/src/TrigL2CaloRingerHypoAlgMT.cxx b/Trigger/TrigHypothesis/TrigMultiVarHypo/src/TrigL2CaloRingerHypoAlgMT.cxx index 73d7a67a688108c6b395885135d6c88a98d58fbf..8051b4a7b3abb5731ac91fb3d387eb8708a15ce4 100644 --- a/Trigger/TrigHypothesis/TrigMultiVarHypo/src/TrigL2CaloRingerHypoAlgMT.cxx +++ b/Trigger/TrigHypothesis/TrigMultiVarHypo/src/TrigL2CaloRingerHypoAlgMT.cxx @@ -1,25 +1,17 @@ /* - Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ #include <map> #include "GaudiKernel/Property.h" #include "TrigL2CaloRingerHypoAlgMT.h" +#include "ITrigL2CaloRingerHypoToolMT.h" #include "AthViews/ViewHelper.h" #include "TrigCompositeUtils/HLTIdentifier.h" #include "TrigCompositeUtils/TrigCompositeUtils.h" #include "AthViews/ViewHelper.h" -using TrigCompositeUtils::DecisionContainer; -using TrigCompositeUtils::DecisionAuxContainer; -using TrigCompositeUtils::DecisionIDContainer; -using TrigCompositeUtils::decisionIDs; -using TrigCompositeUtils::newDecisionIn; -using TrigCompositeUtils::linkToPrevious; -using TrigCompositeUtils::createAndStore; -using TrigCompositeUtils::viewString; -using TrigCompositeUtils::featureString; -using TrigCompositeUtils::findLink; +using namespace TrigCompositeUtils; TrigL2CaloRingerHypoAlgMT::TrigL2CaloRingerHypoAlgMT( const std::string& name, ISvcLocator* pSvcLocator ) : @@ -52,29 +44,49 @@ StatusCode TrigL2CaloRingerHypoAlgMT::execute( const EventContext& context ) con SG::WriteHandle<DecisionContainer> outputHandle = createAndStore(decisionOutput(), context ); auto decisions = outputHandle.ptr(); // input for decision - std::vector<TrigL2CaloRingerHypoToolMT::RingerInfo> hypoToolInput; + std::vector<ITrigL2CaloRingerHypoToolMT::RingerInfo> hypoToolInput; // loop over previous decisions size_t counter=0; for ( auto previousDecision: *previousDecisionsHandle ) { - + //get RoI + + auto roiELInfo = findLink<TrigRoiDescriptorCollection>( previousDecision, initialRoIString() ); + ATH_CHECK( roiELInfo.isValid() ); + const TrigRoiDescriptor* roi = *(roiELInfo.link); + // get View const auto view = previousDecision->objectLink<ViewContainer>( viewString() ); ATH_CHECK( view.isValid() ); + auto ringerShapeHandle = ViewHelper::makeHandle( *(view), m_ringsKey, context); ATH_CHECK( ringerShapeHandle.isValid() ); + ATH_MSG_DEBUG ( "Ringer handle size: " << ringerShapeHandle->size() << "..." ); + + // add cluster + auto clusterHandle = ViewHelper::makeHandle( *view, m_clustersKey, context); + ATH_CHECK( clusterHandle.isValid() ); + // create new decision auto d = newDecisionIn( decisions, name() ); - hypoToolInput.emplace_back( TrigL2CaloRingerHypoToolMT::RingerInfo{ d, ringerShapeHandle.cptr()->at(0) } ); + hypoToolInput.emplace_back( d, roi, ringerShapeHandle.cptr()->at(0), previousDecision ); + // link the rings { auto el = ViewHelper::makeLink( *(view), ringerShapeHandle, 0 ); ATH_CHECK( el.isValid() ); d->setObjectLink( featureString(), el ); } - - TrigCompositeUtils::linkToPrevious( d, decisionInput().key(), counter ); + // link the cluster + { + auto clus = ViewHelper::makeLink( *(view), clusterHandle, 0 ); + ATH_CHECK( clus.isValid() ); + d->setObjectLink( featureString(), clus ); + } + d->setObjectLink( roiString(), roiELInfo.link ); + + TrigCompositeUtils::linkToPrevious( d, previousDecision, context ); counter++; } diff --git a/Trigger/TrigHypothesis/TrigMultiVarHypo/src/TrigL2CaloRingerHypoAlgMT.h b/Trigger/TrigHypothesis/TrigMultiVarHypo/src/TrigL2CaloRingerHypoAlgMT.h index 0ff083bc101f8677cd06cac401c23b415649f69d..3c8e0f1ad9e3e1518cc0aa5631ddfffa60e78a98 100644 --- a/Trigger/TrigHypothesis/TrigMultiVarHypo/src/TrigL2CaloRingerHypoAlgMT.h +++ b/Trigger/TrigHypothesis/TrigMultiVarHypo/src/TrigL2CaloRingerHypoAlgMT.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ #ifndef TRIGL2CALORINGERHYPOALGMT_H #define TRIGL2CALORINGERHYPOALGMT_H 1 @@ -12,31 +12,30 @@ #include "TrigCompositeUtils/TrigCompositeUtils.h" #include "DecisionHandling/HypoBase.h" #include "AthViews/View.h" +#include "TrigSteeringEvent/TrigRoiDescriptorCollection.h" -#include "TrigL2CaloRingerHypoToolMT.h" +#include "ITrigL2CaloRingerHypoToolMT.h" class TrigL2CaloRingerHypoAlgMT : public ::HypoBase -{ - public: +{ + public: TrigL2CaloRingerHypoAlgMT( const std::string& name, ISvcLocator* pSvcLocator ); virtual StatusCode initialize() override; virtual StatusCode execute(const EventContext& context) const override; - - private: - TrigL2CaloRingerHypoAlgMT(); - ToolHandleArray< TrigL2CaloRingerHypoToolMT > m_hypoTools {this, "HypoTools", {}, "Tools to perfrom selection"}; - SG::ReadHandleKey<xAOD::TrigRingerRingsContainer> m_ringsKey { this, "RingerKey","CaloRings",""}; - SG::ReadHandleKey<xAOD::TrigEMClusterContainer> m_clustersKey { this,"ClustersKey","CaloClusters",""}; + private: + ToolHandleArray< ITrigL2CaloRingerHypoToolMT > m_hypoTools {this, "HypoTools", {}, "Tools to perfrom selection"}; + SG::ReadHandleKey<xAOD::TrigRingerRingsContainer> m_ringsKey { this, "RingerKey","HLT_FastCaloRinger","Point to RingerKey"}; + SG::ReadHandleKey<xAOD::TrigEMClusterContainer> m_clustersKey { this,"ClustersKey","ClustersKey","ClustersKey in view"}; -}; +}; //DECLARE_ALGORITHM_FACTORY( TrigL2CaloRingerHypoAlgMT ) #endif //> !MULTIVARHYPO_TRIGL2CALORINGERHYPOALG_H diff --git a/Trigger/TrigHypothesis/TrigMultiVarHypo/src/TrigL2CaloRingerHypoToolMT.cxx b/Trigger/TrigHypothesis/TrigMultiVarHypo/src/TrigL2CaloRingerHypoToolMT.cxx index 7678bb8d7b48c8e930c2788e8c4c2e53e509d598..1a49bfda2e526dae293711d8aedd8001efa10be3 100644 --- a/Trigger/TrigHypothesis/TrigMultiVarHypo/src/TrigL2CaloRingerHypoToolMT.cxx +++ b/Trigger/TrigHypothesis/TrigMultiVarHypo/src/TrigL2CaloRingerHypoToolMT.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ @@ -19,7 +19,7 @@ TrigL2CaloRingerHypoToolMT::TrigL2CaloRingerHypoToolMT( const std::string& type, const std::string& name, const IInterface* parent ) - : AthAlgTool( type, name, parent ), + : base_class( type, name, parent ), m_selectorTool(), m_lumiBlockMuTool("LumiBlockMuTool/LumiBlockMuTool"), m_decisionId( HLT::Identifier::fromToolName( name ) ) @@ -64,7 +64,7 @@ StatusCode TrigL2CaloRingerHypoToolMT::finalize() { TrigL2CaloRingerHypoToolMT::~TrigL2CaloRingerHypoToolMT() {} -bool TrigL2CaloRingerHypoToolMT::decideOnSingleObject( const xAOD::TrigRingerRings* ringerShape) const { +bool TrigL2CaloRingerHypoToolMT::decide( const RingerInfo & decision) const { auto etMon = Monitored::Scalar("Et",-100); @@ -81,14 +81,12 @@ bool TrigL2CaloRingerHypoToolMT::decideOnSingleObject( const xAOD::TrigRingerRin total_time.start(); - - if(m_acceptAll){ ATH_MSG_DEBUG("AcceptAll property is set: taking all events"); return true; } - + auto ringerShape = decision.ringerShape; const xAOD::TrigEMCluster *emCluster = 0; if(ringerShape){ emCluster = ringerShape->emCluster(); @@ -105,18 +103,19 @@ bool TrigL2CaloRingerHypoToolMT::decideOnSingleObject( const xAOD::TrigRingerRin float et = emCluster->et() / Gaudi::Units::GeV; float avgmu = m_lumiBlockMuTool->averageInteractionsPerCrossing(); - etaMon = emCluster->eta(); - etMon = emCluster->et(); - phiMon = emCluster->phi(); - if(eta>2.50) eta=2.50;///fix for events out of the ranger + // make sure that monitoring histogram will plotting only the events of chain. ///Et threshold if(et < m_emEtCut/Gaudi::Units::GeV){ ATH_MSG_DEBUG( "Event reproved by Et threshold. Et = " << et << ", EtCut = " << m_emEtCut/Gaudi::Units::GeV); return false; } + etaMon = emCluster->eta(); + etMon = emCluster->et(); + phiMon = emCluster->phi(); + const std::vector<float> rings = ringerShape->rings(); std::vector<float> refRings(rings.size()); refRings.assign(rings.begin(), rings.end()); @@ -137,13 +136,15 @@ bool TrigL2CaloRingerHypoToolMT::decideOnSingleObject( const xAOD::TrigRingerRin } -StatusCode TrigL2CaloRingerHypoToolMT::decide( std::vector<RingerInfo>& input ) const { +StatusCode TrigL2CaloRingerHypoToolMT::decide( std::vector<RingerInfo>& input ) const { for ( auto i: input ) { - auto objDecision = decideOnSingleObject( i.ringerShape ); + if ( passed ( m_decisionId.numeric(), i.previousDecisionIDs ) ) { + auto objDecision = decide( i ); if ( objDecision == true ) { addDecisionID( m_decisionId.numeric(), i.decision ); } + } } return StatusCode::SUCCESS; } diff --git a/Trigger/TrigHypothesis/TrigMultiVarHypo/src/TrigL2CaloRingerHypoToolMT.h b/Trigger/TrigHypothesis/TrigMultiVarHypo/src/TrigL2CaloRingerHypoToolMT.h index 0ded116a88468796a07c90640e9cd3255e12b9b0..4403fbdbd185c6508bc3a9840034fcf2bf8ea2ea 100644 --- a/Trigger/TrigHypothesis/TrigMultiVarHypo/src/TrigL2CaloRingerHypoToolMT.h +++ b/Trigger/TrigHypothesis/TrigMultiVarHypo/src/TrigL2CaloRingerHypoToolMT.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ #ifndef TRIGL2CALORINGERHYPOTOOLMT_H @@ -13,9 +13,11 @@ #include "TrigCompositeUtils/TrigCompositeUtils.h" #include "xAODTrigRinger/TrigRingerRings.h" #include "TrigMultiVarHypo/tools/RingerSelectorTool.h" +#include "ITrigL2CaloRingerHypoToolMT.h" #include "LumiBlockComps/ILumiBlockMuTool.h" -class TrigL2CaloRingerHypoToolMT : virtual public ::AthAlgTool + +class TrigL2CaloRingerHypoToolMT : virtual public extends<AthAlgTool, ITrigL2CaloRingerHypoToolMT> { public: TrigL2CaloRingerHypoToolMT( const std::string& type, @@ -27,17 +29,8 @@ class TrigL2CaloRingerHypoToolMT : virtual public ::AthAlgTool virtual StatusCode initialize() override; virtual StatusCode finalize() override; - - - bool decideOnSingleObject( const xAOD::TrigRingerRings* ringerShape ) const; - - - struct RingerInfo { - TrigCompositeUtils::Decision* decision; - const xAOD::TrigRingerRings* ringerShape; - }; - - StatusCode decide( std::vector<RingerInfo>& decisions ) const; + bool decide( const RingerInfo & decision ) const override; + StatusCode decide( std::vector<RingerInfo>& decisions ) const override; private: diff --git a/Trigger/TrigHypothesis/TrigMultiVarHypo/src/TrigL2CaloRingerHypoToolMTMult.cxx b/Trigger/TrigHypothesis/TrigMultiVarHypo/src/TrigL2CaloRingerHypoToolMTMult.cxx new file mode 100644 index 0000000000000000000000000000000000000000..98a357bb710fbb159b25756d721fa2ca5284af45 --- /dev/null +++ b/Trigger/TrigHypothesis/TrigMultiVarHypo/src/TrigL2CaloRingerHypoToolMTMult.cxx @@ -0,0 +1,56 @@ +/* + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration +*/ +#include "DecisionHandling/Combinators.h" +#include "DecisionHandling/TrigCompositeUtils.h" +#include "TrigL2CaloRingerHypoToolMTMult.h" + +using namespace TrigCompositeUtils; + +TrigL2CaloRingerHypoToolMTMult::TrigL2CaloRingerHypoToolMTMult( const std::string& type, + const std::string& name, + const IInterface* parent ) + : base_class( type, name, parent ), + m_decisionId( HLT::Identifier::fromToolName( name ) ) {} + +TrigL2CaloRingerHypoToolMTMult::~TrigL2CaloRingerHypoToolMTMult() {} + + +StatusCode TrigL2CaloRingerHypoToolMTMult::initialize() { + if( m_subTools.size() <= 1 ) { + ATH_MSG_ERROR( "Number of sub tools " << m_subTools.size() << ", while it has to be > 1, otherwise this is not a multiplicity selection" ); + return StatusCode::FAILURE; + } + CHECK( m_subTools.retrieve() ); + return StatusCode::SUCCESS; +} + +StatusCode TrigL2CaloRingerHypoToolMTMult::decide( std::vector<ITrigL2CaloRingerHypoToolMT::RingerInfo>& input ) const { + HLT::Index2DVec passingSelection( m_subTools.size() ); + ATH_MSG_DEBUG( "Applying Ringer selection of multiplicity " << m_subTools.size() ); + + size_t cutIndex{ 0 }; + for ( auto& tool: m_subTools ) { + size_t clusterIndex{ 0 }; + for ( auto iIter = input.begin(); iIter != input.end(); ++iIter, ++clusterIndex ) { + if ( passed( m_decisionId.numeric(), iIter->previousDecisionIDs ) ) { + if ( tool->decide( *iIter ) ) + passingSelection[ cutIndex ].push_back( clusterIndex ); + } + } + + if ( passingSelection[cutIndex].empty() ) { + ATH_MSG_DEBUG( "No object passed selection " << cutIndex << " rejecting" ); + return StatusCode::SUCCESS; + } + cutIndex++; + } + + std::set<size_t> passingIndices; + HLT::elementsInUniqueCombinations( passingSelection, passingIndices ); + + for ( auto idx: passingIndices ) + addDecisionID( m_decisionId.numeric(), input[idx].decision ); + + return StatusCode::SUCCESS; +} diff --git a/Trigger/TrigHypothesis/TrigMultiVarHypo/src/TrigL2CaloRingerHypoToolMTMult.h b/Trigger/TrigHypothesis/TrigMultiVarHypo/src/TrigL2CaloRingerHypoToolMTMult.h new file mode 100644 index 0000000000000000000000000000000000000000..9657db931cd82b0685c58b46b91c8e8d7395a6eb --- /dev/null +++ b/Trigger/TrigHypothesis/TrigMultiVarHypo/src/TrigL2CaloRingerHypoToolMTMult.h @@ -0,0 +1,47 @@ +/* + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration +*/ +#ifndef TRIGMULTIVARHYPO_TRIGL2CALORINGERHYPOTOOLMULT_H +#define TRIGMULTIVARHYPO_TRIGL2CALORINGERHYPOTOOLMULT_H 1 + +//#include "GaudiKernel/IAlgTool.h" +#include "CLHEP/Units/SystemOfUnits.h" +#include "xAODTrigCalo/TrigEMCluster.h" +#include "TrigSteeringEvent/TrigRoiDescriptor.h" +#include "AthenaBaseComps/AthAlgTool.h" +#include "AthenaMonitoringKernel/GenericMonitoringTool.h" +#include "DecisionHandling/HLTIdentifier.h" +#include "DecisionHandling/TrigCompositeUtils.h" +#include "ITrigL2CaloRingerHypoToolMT.h" + + + +/** + * @class Implementation of the Egamma selection for CaloClusters with multiplicity + * @brief + **/ + +class TrigL2CaloRingerHypoToolMTMult : public extends<AthAlgTool, ITrigL2CaloRingerHypoToolMT> { + public: + TrigL2CaloRingerHypoToolMTMult( const std::string& type, + const std::string& name, + const IInterface* parent ); + + virtual ~TrigL2CaloRingerHypoToolMTMult(); + virtual StatusCode initialize() override; + + virtual StatusCode decide( std::vector<ITrigL2CaloRingerHypoToolMT::RingerInfo>& input ) const override; + + virtual bool decide( const ITrigL2CaloRingerHypoToolMT::RingerInfo& ) const override { + REPORT_MESSAGE(MSG::ERROR) << "this method should never be called"; + return false; + } + + private: + HLT::Identifier m_decisionId; + + ToolHandleArray<ITrigL2CaloRingerHypoToolMT> m_subTools { this, "SubTools", {}, "Sub tools performing cuts" }; + +}; + +#endif //> !TRIGEGAMMAHYPO_TRIGL2CALOHYPOTOOLMULT_H diff --git a/Trigger/TrigHypothesis/TrigMultiVarHypo/src/components/TrigMultiVarHypo_entries.cxx b/Trigger/TrigHypothesis/TrigMultiVarHypo/src/components/TrigMultiVarHypo_entries.cxx index 124b9c4d6e3175ed27e99c42c029deeb6bf2db03..2bbb9113a21017bcf8a8d0e9270bba15f5f57f4c 100755 --- a/Trigger/TrigHypothesis/TrigMultiVarHypo/src/components/TrigMultiVarHypo_entries.cxx +++ b/Trigger/TrigHypothesis/TrigMultiVarHypo/src/components/TrigMultiVarHypo_entries.cxx @@ -6,12 +6,14 @@ #include "TrigMultiVarHypo/TrigL2CaloRingerFex.h" #include "TrigMultiVarHypo/TrigL2CaloRingerHypo.h" #include "../TrigL2CaloRingerHypoToolMT.h" +#include "../TrigL2CaloRingerHypoToolMTMult.h" #include "../TrigL2CaloRingerHypoAlgMT.h" DECLARE_COMPONENT( TrigL2CaloRingerFex ) DECLARE_COMPONENT( TrigL2CaloRingerHypo ) DECLARE_COMPONENT( TrigL2CaloRingerHypoToolMT ) +DECLARE_COMPONENT( TrigL2CaloRingerHypoToolMTMult ) DECLARE_COMPONENT( TrigL2CaloRingerHypoAlgMT ) diff --git a/Trigger/TrigMonitoring/TrigSteerMonitor/src/TrigROBMoni.cxx b/Trigger/TrigMonitoring/TrigSteerMonitor/src/TrigROBMoni.cxx index 7a9e1a901de16f9123aee2c7a292e046d2eb8850..4272ee95efa6516dd3a400586927f0b89c14d223 100644 --- a/Trigger/TrigMonitoring/TrigSteerMonitor/src/TrigROBMoni.cxx +++ b/Trigger/TrigMonitoring/TrigSteerMonitor/src/TrigROBMoni.cxx @@ -291,11 +291,7 @@ StatusCode HistSet<HTYPE>::book(TrigMonitorToolBase::TrigMonGroup& monGroup, hist[SUBDET]->SetBins(montool->m_subDetNames.size(), 0, montool->m_subDetNames.size()); hist[SDGROUP]->SetBins(montool->m_subDetGroupNames.size(), 0, montool->m_subDetGroupNames.size()); hist[ALGO]->SetBins(1, 0, 1); -#if ROOT_VERSION_CODE >= ROOT_VERSION(6,0,0) hist[ALGO]->SetCanExtend(TH1::kAllAxes); -#else - hist[ALGO]->SetBit(TH1::kCanRebin); -#endif } else if ( hist[SUBDET]->GetDimension()==2 ) { @@ -309,11 +305,7 @@ StatusCode HistSet<HTYPE>::book(TrigMonitorToolBase::TrigMonGroup& monGroup, yBins, 0, yBins); hist[ALGO]->SetBins(1, 0, 1,yBins, 0, yBins); -#if ROOT_VERSION_CODE >= ROOT_VERSION(6,0,0) hist[ALGO]->SetCanExtend(TH2::kAllAxes); -#else - hist[ALGO]->SetBit(TH2::kCanRebin); -#endif // Set y-labels if given if ( yLabels ) { diff --git a/Trigger/TrigSteer/L1Decoder/python/L1DecoderMonitoring.py b/Trigger/TrigSteer/L1Decoder/python/L1DecoderMonitoring.py index d380ab5d864c9e626f11475abb9688eb17bd8372..e4a21e28fd2ec5b3c8ae00c28f7e07c4b6f820a5 100644 --- a/Trigger/TrigSteer/L1Decoder/python/L1DecoderMonitoring.py +++ b/Trigger/TrigSteer/L1Decoder/python/L1DecoderMonitoring.py @@ -33,5 +33,5 @@ def PrescalingMonitoring(): tool.HistPath="HLTFramework/L1Decoder" tool.defineHistogram('LB,HLTPSK', path='EXPERT', type='TH2I', opt='kAddBinsDynamically', title='HLT prescale key used in LB;Lumiblock;HLTPSK', - xbins=10, xmin=0, xmax=10, ybins=1, ymin=0, ymax=1) + xbins=100, xmin=0, xmax=100, ybins=5, ymin=0, ymax=5) return tool diff --git a/Trigger/TrigSteer/TrigOutputHandling/src/HLTEDMCreator.cxx b/Trigger/TrigSteer/TrigOutputHandling/src/HLTEDMCreator.cxx index 5df2c6eb9043a32937d804763c2dece533be6103..5e6d421213f59c0ed9d202a08fab7893f2ac8338 100644 --- a/Trigger/TrigSteer/TrigOutputHandling/src/HLTEDMCreator.cxx +++ b/Trigger/TrigSteer/TrigOutputHandling/src/HLTEDMCreator.cxx @@ -110,28 +110,40 @@ StatusCode HLTEDMCreator::initialize() template<class T> struct plainGenerator { std::unique_ptr<T> data; - void create() { - data = std::make_unique<T>(); + bool doRecord{true}; + void create( bool create, bool record ) { + doRecord = record; + if ( create ) + data = std::make_unique<T>(); + } + + StatusCode record( SG::WriteHandle<T>& h ) { + if ( doRecord ) + return h.record( std::move( data ) ); + return StatusCode::SUCCESS; } - StatusCode record( SG::WriteHandle<T>& h ) { - return h.record( std::move( data ) ); - } }; template<class T, class STORE> struct xAODGenerator { std::unique_ptr<T> data; std::unique_ptr<STORE> store; - - void create() { - data = std::make_unique<T>(); - store = std::make_unique<STORE>(); - data->setStore( store.get() ); + bool doRecord{true}; + + void create( bool create, bool record ) { + doRecord = record; + if ( create ) { + data = std::make_unique<T>(); + store = std::make_unique<STORE>(); + data->setStore( store.get() ); + } } StatusCode record ( SG::WriteHandle<T>& h ) { - return h.record( std::move( data ), std::move( store ) ); - } + if ( doRecord ) + return h.record( std::move( data ), std::move( store ) ); + return StatusCode::SUCCESS; + } }; template<typename T> @@ -241,40 +253,59 @@ StatusCode HLTEDMCreator::fixLinks() const { return StatusCode::SUCCESS; } + template<typename T, typename G, typename M> StatusCode HLTEDMCreator::createIfMissing( const EventContext& context, const ConstHandlesGroup<T>& handles, G& generator, M merger ) const { for (size_t i = 0; i < handles.out.size(); ++i) { - SG::WriteHandleKey<T> writeHandleKey = handles.out.at(i); - - // Note: This is correct. We are testing if we can read, and if we cannot then we write. - // What we write will either be a dummy (empty) container, or be populated from N in-View collections. - SG::ReadHandle<T> readHandle( writeHandleKey.key() ); + SG::WriteHandleKey<T> writeHandleKey = handles.out.at(i); + + if ( handles.views.size() == 0 ) { // no merging will be needed + // Note: This is correct. We are testing if we can read, and if we cannot then we write. + // What we write will either be a dummy (empty) container, or be populated from N in-View collections. + SG::ReadHandle<T> readHandle( writeHandleKey.key() ); + if ( readHandle.isValid() ) { + ATH_MSG_DEBUG( "The " << writeHandleKey.key() << " already present" ); + generator.create(false, false); + } else { + ATH_MSG_DEBUG( "The " << writeHandleKey.key() << " was absent, creating it" ); + generator.create(true, true); + } - if ( readHandle.isValid() ) { - ATH_MSG_DEBUG( "The " << writeHandleKey.key() << " already present" ); } else { - ATH_MSG_DEBUG( "The " << writeHandleKey.key() << " was absent, creating it" ); - generator.create(); - if ( handles.views.size() != 0 ) { - - SG::ReadHandleKey<ViewContainer> viewsReadHandleKey = handles.views.at(i); - ATH_MSG_DEBUG("Will be trying to merge from the " << viewsReadHandleKey.key() << " view container into that output"); - - auto viewsHandle = SG::makeHandle( viewsReadHandleKey, context ); - if ( viewsHandle.isValid() ) { - SG::ReadHandleKey<T> inViewReadHandleKey = handles.in.at(i); - ATH_MSG_DEBUG("Will be merging from " << viewsHandle->size() << " views using in-view key " << inViewReadHandleKey.key() ); - CHECK( (this->*merger)( *viewsHandle, inViewReadHandleKey , context, *generator.data.get() ) ); - } else { - ATH_MSG_DEBUG("Views " << viewsReadHandleKey.key() << " are missing. Will leave " << writeHandleKey.key() << " output collection empty."); - } + // there are views, we assume that in the main store collection of given type#name is absent, else it will not work anyways + // simplest case, only one set of views is handled first + // below is handled the cases when the configuration of output keys is for example: A A B C C C D D E + // which means the first two collections come from first two views and because the names are the same they should end up in the same output collection + // thefore generators need to instructed to: + // - create new collection when a new name is handled (or for the first key) + // - and record when it is last identical name in the row (or it is last handled collection) + if ( handles.out.size() == 1 ) { + generator.create(true, true); + } else { + const bool doCreate = i == 0 or handles.out.at(i-1).key() != handles.out.at(i).key(); + const bool doRecord = i == handles.out.size()-1 or handles.out.at(i+1).key() != handles.out.at(i).key(); + ATH_MSG_DEBUG( "Instrucring generator " << (doCreate ? "to" : "NOT TO") << " create collection and " << (doRecord ? "to" : "NOT TO") << " record collection in this iteration"); + generator.create(doCreate, doRecord); + } + SG::ReadHandleKey<ViewContainer> viewsReadHandleKey = handles.views.at(i); + ATH_MSG_DEBUG("Will be trying to merge from the " << viewsReadHandleKey.key() << " view container into that output"); + + auto viewsHandle = SG::makeHandle( viewsReadHandleKey, context ); + if ( viewsHandle.isValid() ) { + SG::ReadHandleKey<T> inViewReadHandleKey = handles.in.at(i); + ATH_MSG_DEBUG("Will be merging from " << viewsHandle->size() << " views using in-view key " << inViewReadHandleKey.key() ); + CHECK( (this->*merger)( *viewsHandle, inViewReadHandleKey , context, *generator.data.get() ) ); + } else { + ATH_MSG_DEBUG("Views " << viewsReadHandleKey.key() << " are missing. Will leave " << writeHandleKey.key() << " output collection empty."); } - auto writeHandle = SG::makeHandle( writeHandleKey, context ); - CHECK( generator.record( writeHandle ) ); } + + auto writeHandle = SG::makeHandle( writeHandleKey, context ); + CHECK( generator.record( writeHandle ) ); } + return StatusCode::SUCCESS; } @@ -342,6 +373,6 @@ StatusCode HLTEDMCreator::createOutput(const EventContext& context) const { if ( m_dumpSGAfter ) ATH_MSG_DEBUG( evtStore()->dump() ); - + ATH_MSG_DEBUG("Done"); return StatusCode::SUCCESS; } diff --git a/Trigger/TrigTools/TrigInDetToolInterfaces/TrigInDetToolInterfaces/ITrigDkfTrackMakerTool.h b/Trigger/TrigTools/TrigInDetToolInterfaces/TrigInDetToolInterfaces/ITrigDkfTrackMakerTool.h index 230bbba74ef01a977f3c8b5f1e1e24f7b208a329..008c52425630d6a093013a31122baafe81fdab59 100644 --- a/Trigger/TrigTools/TrigInDetToolInterfaces/TrigInDetToolInterfaces/ITrigDkfTrackMakerTool.h +++ b/Trigger/TrigTools/TrigInDetToolInterfaces/TrigInDetToolInterfaces/ITrigDkfTrackMakerTool.h @@ -15,8 +15,6 @@ namespace Trk { class Track; } -class TrigSiSpacePoint; - static const InterfaceID IID_ITrigDkfTrackMakerTool("ITrigDkfTrackMakerTool",1,0); @@ -37,7 +35,6 @@ static const InterfaceID IID_ITrigDkfTrackMakerTool("ITrigDkfTrackMakerTool",1,0 static const InterfaceID& interfaceID () //!< the Tool's interface { return IID_ITrigDkfTrackMakerTool; } - virtual bool createDkfTrack(std::vector<const TrigSiSpacePoint*>&, std::vector<Trk::TrkBaseNode*>&, double) const = 0; virtual bool createDkfTrack(const Trk::Track&, std::vector<Trk::TrkBaseNode*>&, double) const = 0; }; diff --git a/Trigger/TrigTools/TrigInDetTrackFitter/CMakeLists.txt b/Trigger/TrigTools/TrigInDetTrackFitter/CMakeLists.txt index ca04cb85a622808250548865d61b7ea234b190dd..704285db16ad147533f8a0f31fa64ed2b98f13fc 100644 --- a/Trigger/TrigTools/TrigInDetTrackFitter/CMakeLists.txt +++ b/Trigger/TrigTools/TrigInDetTrackFitter/CMakeLists.txt @@ -10,13 +10,11 @@ atlas_depends_on_subdirs( PUBLIC Control/AthenaBaseComps GaudiKernel InnerDetector/InDetDetDescr/InDetIdentifier - InnerDetector/InDetDetDescr/InDetReadoutGeometry MagneticField/MagFieldInterfaces Tracking/TrkEvent/TrkTrack Tracking/TrkExtrapolation/TrkExInterfaces Tracking/TrkFitter/TrkDistributedKalmanFilter Tracking/TrkFitter/TrkFitterInterfaces - Tracking/TrkFitter/TrkFitterUtils Tracking/TrkTools/TrkToolInterfaces Trigger/TrigTools/TrigInDetToolInterfaces PRIVATE @@ -34,7 +32,7 @@ atlas_depends_on_subdirs( PUBLIC atlas_add_component( TrigInDetTrackFitter src/*.cxx src/components/*.cxx - LINK_LIBRARIES AthenaBaseComps GaudiKernel InDetIdentifier InDetReadoutGeometry MagFieldInterfaces TrkTrack TrkExInterfaces TrkDistributedKalmanFilterLib TrkFitterInterfaces TrkFitterUtils TrkToolInterfaces AtlasDetDescr InDetPrepRawData InDetRIO_OnTrack TrkSurfaces TrkEventPrimitives TrkParameters TrkPrepRawData TrkRIO_OnTrack TrigTimeAlgsLib ) + LINK_LIBRARIES AthenaBaseComps GaudiKernel InDetIdentifier MagFieldInterfaces TrkTrack TrkExInterfaces TrkDistributedKalmanFilterLib TrkFitterInterfaces TrkToolInterfaces AtlasDetDescr InDetPrepRawData InDetRIO_OnTrack TrkSurfaces TrkEventPrimitives TrkParameters TrkPrepRawData TrkRIO_OnTrack TrigTimeAlgsLib ) # Install files from the package: atlas_install_headers( TrigInDetTrackFitter ) diff --git a/Trigger/TrigTools/TrigInDetTrackFitter/TrigInDetTrackFitter/TrigDkfTrackMakerTool.h b/Trigger/TrigTools/TrigInDetTrackFitter/TrigInDetTrackFitter/TrigDkfTrackMakerTool.h index 98f43a0354d42889f5a4d7a3ffc1963bb2096aed..c628d72c02f1d6dc99af8649a04010a7fa3b0909 100644 --- a/Trigger/TrigTools/TrigInDetTrackFitter/TrigInDetTrackFitter/TrigDkfTrackMakerTool.h +++ b/Trigger/TrigTools/TrigInDetTrackFitter/TrigInDetTrackFitter/TrigDkfTrackMakerTool.h @@ -8,7 +8,6 @@ #include "AthenaBaseComps/AthAlgTool.h" #include "TrigInDetToolInterfaces/ITrigDkfTrackMakerTool.h" -#include "InDetReadoutGeometry/SiDetectorElementCollection.h" #include "StoreGate/ReadCondHandleKey.h" #include "TrkDistributedKalmanFilter/TrkBaseNode.h" #include "TrkDistributedKalmanFilter/TrkPlanarSurface.h" @@ -29,7 +28,6 @@ class TrigDkfTrackMakerTool : virtual public ITrigDkfTrackMakerTool, public AthA // standard Athena methods StatusCode initialize(); - bool createDkfTrack(std::vector<const TrigSiSpacePoint*>&, std::vector<Trk::TrkBaseNode*>&, double) const; bool createDkfTrack(const Trk::Track& track, std::vector<Trk::TrkBaseNode*>& vpTrkNodes, double DChi2) const; @@ -38,10 +36,6 @@ class TrigDkfTrackMakerTool : virtual public ITrigDkfTrackMakerTool, public AthA const SCT_ID* m_sctId; const AtlasDetectorID* m_idHelper; - SG::ReadCondHandleKey<InDetDD::SiDetectorElementCollection> m_pixelDetEleCollKey{this, "PixelDetEleCollKey", "PixelDetectorElementCollection", "Key of SiDetectorElementCollection for Pixel"}; - SG::ReadCondHandleKey<InDetDD::SiDetectorElementCollection> m_SCTDetEleCollKey{this, "SCTDetEleCollKey", "SCT_DetectorElementCollection", "Key of SiDetectorElementCollection for SCT"}; - const InDetDD::SiDetectorElement* getPixelDetectorElement(const IdentifierHash& waferHash) const; - const InDetDD::SiDetectorElement* getSCTDetectorElement(const IdentifierHash& waferHash) const; }; #endif diff --git a/Trigger/TrigTools/TrigInDetTrackFitter/src/TrigDkfTrackMakerTool.cxx b/Trigger/TrigTools/TrigInDetTrackFitter/src/TrigDkfTrackMakerTool.cxx index 3d96c3bdba271efd48e670a3c0c576466b674632..3568612e0a86b56d63f7dcabfd44739a5a89e3f3 100644 --- a/Trigger/TrigTools/TrigInDetTrackFitter/src/TrigDkfTrackMakerTool.cxx +++ b/Trigger/TrigTools/TrigInDetTrackFitter/src/TrigDkfTrackMakerTool.cxx @@ -14,8 +14,6 @@ // //////////////////////////////////////////////////////////////////////////////// -#include "TrigInDetEvent/TrigSiSpacePoint.h" - #include "AtlasDetDescr/AtlasDetectorID.h" #include "InDetIdentifier/PixelID.h" #include "InDetIdentifier/SCT_ID.h" @@ -29,6 +27,7 @@ #include "TrkSurfaces/Surface.h" #include "TrkSurfaces/TrapezoidBounds.h" #include "AthenaBaseComps/AthMsgStreamMacros.h" +#include "AthenaBaseComps/AthCheckMacros.h" #include "StoreGate/ReadCondHandle.h" @@ -48,207 +47,10 @@ TrigDkfTrackMakerTool::TrigDkfTrackMakerTool(const std::string& t, StatusCode TrigDkfTrackMakerTool::initialize() { - ATH_MSG_INFO("In initialize..."); - - - if (detStore()->retrieve(m_idHelper, "AtlasID").isFailure()) { - ATH_MSG_FATAL("Could not get AtlasDetectorID helper AtlasID"); - return StatusCode::FAILURE; - } - - // Get SCT & pixel Identifier helpers - - if (detStore()->retrieve(m_pixelId, "PixelID").isFailure()) { - ATH_MSG_FATAL("Could not get Pixel ID helper"); - return StatusCode::FAILURE; - } - if (detStore()->retrieve(m_sctId, "SCT_ID").isFailure()) { - ATH_MSG_FATAL("Could not get SCT ID helper"); - return StatusCode::FAILURE; - } - - ATH_CHECK(m_pixelDetEleCollKey.initialize()); - ATH_CHECK(m_SCTDetEleCollKey.initialize()); - - ATH_MSG_INFO("TrigDkfTrackMakerTool constructed "); + ATH_CHECK(detStore()->retrieve(m_idHelper, "AtlasID")); return StatusCode::SUCCESS; } -bool TrigDkfTrackMakerTool::createDkfTrack(std::vector<const TrigSiSpacePoint*>& siSpacePoints, - std::vector<Trk::TrkBaseNode*>& vpTrkNodes, - double DChi2) const -{ - const double radLength=0.022; - - std::vector<const TrigSiSpacePoint*>::iterator pSPIt,lastSPIt; - - double C[3],N[3],M[3][3];int i; - Amg::Vector3D mx,my,mz; - - vpTrkNodes.clear(); - - if(siSpacePoints.size()==0) - { - ATH_MSG_WARNING("Cannot create a DKF track -- TrigInDetTrack has no hits"); - return false; - } - pSPIt=siSpacePoints.begin();lastSPIt=siSpacePoints.end(); - for(; pSPIt != lastSPIt; pSPIt++) - { - const TrigSiSpacePoint* pSP=(*pSPIt); - - // std::cout<<"SP layer="<<pSP->layer()<<" r="<<pSP->r()<<" phi="<<pSP->phi()<<" z="<<pSP->z()<<std::endl; - - Identifier ID=pSP->identify(); - if(m_idHelper->is_sct(ID)) - { - const InDet::SiCluster *pCL[2]; - pCL[0] = pSP->clusters().first; - pCL[1] = pSP->clusters().second; - if((pCL[0]==NULL)||(pCL[1]==NULL)) continue; - - IdentifierHash idHash[2]; - const InDetDD::SiDetectorElement* pEL[2]; - double RadVec[2]; - int index[2]; - for(i=0;i<2;i++) - { - idHash[i]=m_sctId->wafer_hash(m_sctId->wafer_id(pCL[i]->identify())); - pEL[i]=getSCTDetectorElement(idHash[i]); - const Trk::Surface& rSurf=pEL[i]->surface(); - - // const Trk::Surface& rSurf=pCL[i]->detectorElement()->surface(); - RadVec[i]=rSurf.center().mag(); - index[i]=i; - } - if(RadVec[0]>RadVec[1]) - { - index[0]=1;index[1]=0; - } - for (int iClusInSP=0; iClusInSP<2; iClusInSP++) - { - const Trk::Surface& rSurf=pEL[index[iClusInSP]]->surface(); - //const Trk::Surface& rSurf=pCL[i]->detectorElement()->surface(); - N[0]=rSurf.normal().x(); - N[1]=rSurf.normal().y(); - N[2]=rSurf.normal().z(); - C[0]=rSurf.center().x(); - C[1]=rSurf.center().y(); - C[2]=rSurf.center().z(); - - mx=rSurf.transform().rotation().block(0,0,3,1); - my=rSurf.transform().rotation().block(0,1,3,1); - mz=rSurf.transform().rotation().block(0,2,3,1); - for(i=0;i<3;i++) - { - M[i][0]=mx[i];M[i][1]=my[i];M[i][2]=mz[i]; - } - Trk::TrkPlanarSurface* pS = new Trk::TrkPlanarSurface(C,N,M,radLength, - &(pEL[index[iClusInSP]]->surface())); - //std::cout<<"created SCT surface"<<std::endl;pS->m_report(); - /* - double locCov; - try { - const Trk::ErrorMatrix& errMatRef=pCL[index[iClusInSP]]->localErrorMatrix(); - locCov=errMatRef.covariance()[0][0]; - } - catch(Trk::PrepRawDataUndefinedVariable) { - locCov=pEL[index[iClusInSP]]->phiPitch(); - locCov=locCov*locCov/12.0; - } - // override - - locCov=pEL[index[iClusInSP]]->phiPitch(); - locCov=locCov*locCov/12.0; - */ - - if(pEL[index[iClusInSP]]->design().shape()!=InDetDD::Trapezoid) - { - //vpTrkNodes.push_back(new Trk::TrkClusterNode(pS,DChi2,pCL[index[iClusInSP]]->localPosition()[0],locCov)); - vpTrkNodes.push_back(new Trk::TrkClusterNode(pS,DChi2,pCL[index[iClusInSP]])); - } - else - { - const Trk::SurfaceBounds& rBounds=rSurf.bounds(); - const Trk::TrapezoidBounds& ecBounds= - dynamic_cast<const Trk::TrapezoidBounds&>(rBounds); - double R=(ecBounds.maxHalflengthX()+ecBounds.minHalflengthX())* - ecBounds.halflengthY()/ - (ecBounds.maxHalflengthX()-ecBounds.minHalflengthX()); - vpTrkNodes.push_back(new Trk::TrkEndCapClusterNode(pS,DChi2,pCL[index[iClusInSP]],R)); - - // vpTrkNodes.push_back(new Trk::TrkEndCapClusterNode(pS,DChi2,R,pCL[index[iClusInSP]]->localPosition()[0],locCov)); - } - } - } - else if(m_idHelper->is_pixel(ID)) - { - const InDet::SiCluster* pCL=pSP->clusters().first; - - if(pCL) - { - - const IdentifierHash idHash= - m_pixelId->wafer_hash(m_pixelId->wafer_id(pCL->identify())); - const InDetDD::SiDetectorElement* pEL=getPixelDetectorElement(idHash); - const Trk::Surface& rSurf=pEL->surface(); - - //const Trk::Surface& rSurf=pCL->detectorElement()->surface(); - - N[0]=rSurf.normal().x(); - N[1]=rSurf.normal().y(); - N[2]=rSurf.normal().z(); - C[0]=rSurf.center().x(); - C[1]=rSurf.center().y(); - C[2]=rSurf.center().z(); - mx=rSurf.transform().rotation().block(0,0,3,1); - my=rSurf.transform().rotation().block(0,1,3,1); - mz=rSurf.transform().rotation().block(0,2,3,1); - for(i=0;i<3;i++) - { - M[i][0]=mx[i];M[i][1]=my[i];M[i][2]=mz[i]; - } - Trk::TrkPlanarSurface* pS = new Trk::TrkPlanarSurface(C,N,M,radLength,&(pEL->surface())); - /* - std::cout<<"created PIX surface"<<std::endl; - std::cout<<"local position: "<<pCL->localPosition()[0]<<" "<<pCL->localPosition()[1]<<std::endl; - pS->m_report(); - */ - // double locPos[2]; - /* - double locCov[4]; - try { - const Trk::ErrorMatrix& errMatRef=pCL->localErrorMatrix(); - locCov[0]=errMatRef.covariance()[0][0]; - locCov[1]=errMatRef.covariance()[0][1]; - locCov[2]=errMatRef.covariance()[1][0]; - locCov[3]=errMatRef.covariance()[1][1]; - } - catch(Trk::PrepRawDataUndefinedVariable) { - //locCov[0]=pEL->phiPitch()*pEL->phiPitch()/12.0; - locCov[1]=0.0;locCov[2]=0.0; - //locCov[3]=pEL->etaPitch()*pEL->etaPitch()/12.0; - locCov[3]=0.3*0.3;locCov[0]=0.012*0.012; - } - */ - // override - /* - locCov[0]=pEL->phiPitch()*pEL->phiPitch()/12.0; - locCov[1]=0.0;locCov[2]=0.0; - locCov[3]=pEL->etaPitch()*pEL->etaPitch()/12.0; - locPos[0]=pCL->localPosition()[0]; - locPos[1]=pCL->localPosition()[1]; - */ - //vpTrkNodes.push_back(new Trk::TrkPixelNode(pS,DChi2,locPos,locCov)); - vpTrkNodes.push_back(new Trk::TrkPixelNode(pS,DChi2,pCL)); - } - } - } - ATH_MSG_DEBUG(vpTrkNodes.size()); - - return true; -} - bool TrigDkfTrackMakerTool::createDkfTrack(const Trk::Track& track, std::vector<Trk::TrkBaseNode*>& vpTrkNodes, double DChi2) const { @@ -328,14 +130,3 @@ bool TrigDkfTrackMakerTool::createDkfTrack(const Trk::Track& track, return true; } -const InDetDD::SiDetectorElement* TrigDkfTrackMakerTool::getPixelDetectorElement(const IdentifierHash& waferHash) const { - SG::ReadCondHandle<InDetDD::SiDetectorElementCollection> condData{m_pixelDetEleCollKey}; - if (not condData.isValid()) return nullptr; - return condData->getDetectorElement(waferHash); -} - -const InDetDD::SiDetectorElement* TrigDkfTrackMakerTool::getSCTDetectorElement(const IdentifierHash& waferHash) const { - SG::ReadCondHandle<InDetDD::SiDetectorElementCollection> condData{m_SCTDetEleCollKey}; - if (not condData.isValid()) return nullptr; - return condData->getDetectorElement(waferHash); -} diff --git a/Trigger/TrigTools/TrigInDetTrackFitter/src/TrigInDetTrackFitter.cxx b/Trigger/TrigTools/TrigInDetTrackFitter/src/TrigInDetTrackFitter.cxx index 86df80626a6b77e6f35f211ee899d841bf7df776..b866fe0d2ffa2f556836654310d01422c6df2015 100755 --- a/Trigger/TrigTools/TrigInDetTrackFitter/src/TrigInDetTrackFitter.cxx +++ b/Trigger/TrigTools/TrigInDetTrackFitter/src/TrigInDetTrackFitter.cxx @@ -39,6 +39,7 @@ #include "TrigInDetTrackFitter/TrigInDetTrackFitter.h" #include "TrkToolInterfaces/IRIO_OnTrackCreator.h" #include "AthenaBaseComps/AthMsgStreamMacros.h" +#include "AthenaBaseComps/AthCheckMacros.h" #include "TrkRIO_OnTrack/RIO_OnTrack.h" @@ -73,29 +74,12 @@ TrigInDetTrackFitter::TrigInDetTrackFitter(const std::string& t, StatusCode TrigInDetTrackFitter::initialize() { - StatusCode sc = AthAlgTool::initialize(); - - ATH_MSG_INFO("Using Athena magnetic field service"); - sc = m_MagFieldSvc.retrieve(); - if(sc.isFailure()) - { - ATH_MSG_ERROR("Unable to retrieve Athena MagFieldService"); - return StatusCode::FAILURE; - } - sc=m_trackMaker.retrieve(); - if(sc.isFailure()) - { - ATH_MSG_ERROR("Could not retrieve "<<m_trackMaker); - return sc; - } + ATH_CHECK(m_MagFieldSvc.retrieve()); + ATH_CHECK(m_trackMaker.retrieve()); if (m_correctClusterPos) { - sc = m_ROTcreator.retrieve(); - if (sc.isFailure()) { - ATH_MSG_ERROR("Could not get ROTcreator "<<m_ROTcreator); - return sc; - } + ATH_CHECK(m_ROTcreator.retrieve()); } - return sc; + return StatusCode::SUCCESS; } StatusCode TrigInDetTrackFitter::finalize() diff --git a/Trigger/TrigValidation/TrigAnalysisTest/share/ref_RDOtoRDOTrig_mt1_build.ref b/Trigger/TrigValidation/TrigAnalysisTest/share/ref_RDOtoRDOTrig_mt1_build.ref index 1bd0aee89433c2822eee7e5a750886b63d197fdd..fab0e36c888dfb7721eb207d5b47bbd330391468 100644 --- a/Trigger/TrigValidation/TrigAnalysisTest/share/ref_RDOtoRDOTrig_mt1_build.ref +++ b/Trigger/TrigValidation/TrigAnalysisTest/share/ref_RDOtoRDOTrig_mt1_build.ref @@ -136,6 +136,9 @@ TrigSignatureMoniMT INFO -- #385248610 Features TrigSignatureMoniMT INFO HLT_g5_tight_L1EM3 #3280865118 TrigSignatureMoniMT INFO -- #3280865118 Events 20 20 16 16 16 9 - 9 TrigSignatureMoniMT INFO -- #3280865118 Features 45 45 84 9 - +TrigSignatureMoniMT INFO HLT_j0_perf_L1J12_EMPTY #1341875780 +TrigSignatureMoniMT INFO -- #1341875780 Events 0 0 0 - - - - 0 +TrigSignatureMoniMT INFO -- #1341875780 Features 0 - - - - TrigSignatureMoniMT INFO HLT_j0_vbenfSEP30etSEP34mass35SEP50fbet_L1J20 #4034799151 TrigSignatureMoniMT INFO -- #4034799151 Events 19 19 15 - - - - 15 TrigSignatureMoniMT INFO -- #4034799151 Features 425 - - - - @@ -177,7 +180,7 @@ TrigSignatureMoniMT INFO -- #868405538 Events TrigSignatureMoniMT INFO -- #868405538 Features 50 - - - - TrigSignatureMoniMT INFO HLT_j45_ftf_pf_L1J20 #1335156103 TrigSignatureMoniMT INFO -- #1335156103 Events 19 19 16 - - - - 16 -TrigSignatureMoniMT INFO -- #1335156103 Features 33 - - - - +TrigSignatureMoniMT INFO -- #1335156103 Features 31 - - - - TrigSignatureMoniMT INFO HLT_j45_ftf_pf_nojcalib_L1J20 #3658890913 TrigSignatureMoniMT INFO -- #3658890913 Events 19 19 15 - - - - 15 TrigSignatureMoniMT INFO -- #3658890913 Features 29 - - - - @@ -201,13 +204,13 @@ TrigSignatureMoniMT INFO -- #1961149049 Events TrigSignatureMoniMT INFO -- #1961149049 Features 50 50 50 - - TrigSignatureMoniMT INFO HLT_j45_ftf_subjesgscIS_pf_L1J20 #761060030 TrigSignatureMoniMT INFO -- #761060030 Events 19 19 16 - - - - 16 -TrigSignatureMoniMT INFO -- #761060030 Features 33 - - - - +TrigSignatureMoniMT INFO -- #761060030 Features 31 - - - - TrigSignatureMoniMT INFO HLT_j45_ftf_subresjesgscIS_L1J15 #1509925407 -TrigSignatureMoniMT INFO -- #1509925407 Events 20 20 19 - - - - 19 -TrigSignatureMoniMT INFO -- #1509925407 Features 51 - - - - +TrigSignatureMoniMT INFO -- #1509925407 Events 20 20 18 - - - - 18 +TrigSignatureMoniMT INFO -- #1509925407 Features 44 - - - - TrigSignatureMoniMT INFO HLT_j45_ftf_subresjesgscIS_pf_L1J20 #4012311417 TrigSignatureMoniMT INFO -- #4012311417 Events 19 19 16 - - - - 16 -TrigSignatureMoniMT INFO -- #4012311417 Features 33 - - - - +TrigSignatureMoniMT INFO -- #4012311417 Features 31 - - - - TrigSignatureMoniMT INFO HLT_j45_nojcalib_L1J20 #2042444294 TrigSignatureMoniMT INFO -- #2042444294 Events 19 19 17 - - - - 17 TrigSignatureMoniMT INFO -- #2042444294 Features 39 - - - - @@ -245,8 +248,8 @@ TrigSignatureMoniMT INFO HLT_j85_ftf_L1J20 #87704 TrigSignatureMoniMT INFO -- #877042532 Events 19 19 13 - - - - 13 TrigSignatureMoniMT INFO -- #877042532 Features 21 - - - - TrigSignatureMoniMT INFO HLT_j85_ftf_pf_L1J20 #1538535401 -TrigSignatureMoniMT INFO -- #1538535401 Events 19 19 10 - - - - 10 -TrigSignatureMoniMT INFO -- #1538535401 Features 16 - - - - +TrigSignatureMoniMT INFO -- #1538535401 Events 19 19 8 - - - - 8 +TrigSignatureMoniMT INFO -- #1538535401 Features 13 - - - - TrigSignatureMoniMT INFO HLT_mu0_muoncalib_L1MU20 #997163309 TrigSignatureMoniMT INFO -- #997163309 Events 8 8 0 - - - - 0 TrigSignatureMoniMT INFO -- #997163309 Features 0 - - - - diff --git a/Trigger/TrigValidation/TrigValTools/CMakeLists.txt b/Trigger/TrigValidation/TrigValTools/CMakeLists.txt index 7de8d1bd4da7b19b56508492c7a2069fd8907bad..f49eff884a76c1a30ddff94a14d819dbabc236da 100644 --- a/Trigger/TrigValidation/TrigValTools/CMakeLists.txt +++ b/Trigger/TrigValidation/TrigValTools/CMakeLists.txt @@ -26,7 +26,7 @@ atlas_add_dictionary( TrigValToolsDict # Install files from the package: atlas_install_python_modules( python/*.py python/TrigValSteering bin/chainDump.py ) atlas_install_data( share/*.json share/*.conf ) -atlas_install_runtime( macros/*.C bin/chainDump.py ) +atlas_install_runtime( bin/chainDump.py ) atlas_install_scripts( bin/*.py bin/*.pl bin/*.sh test/*.py ) atlas_install_generic( html/root2html/*.html DESTINATION share/TrigValTools/root2html diff --git a/Trigger/TrigValidation/TrigValTools/bin/trigtest_checkcounts.sh b/Trigger/TrigValidation/TrigValTools/bin/trigtest_checkcounts.sh deleted file mode 100755 index 882e9504f9668f294b96850460bea82795682221..0000000000000000000000000000000000000000 --- a/Trigger/TrigValidation/TrigValTools/bin/trigtest_checkcounts.sh +++ /dev/null @@ -1,18 +0,0 @@ -#!/bin/sh -# syntax: trigtest_checkcounts.C <tolerance> <reference file> <level: BOTH, EF, L2, HLT> -tol=$1 -ref=$2 -if [ $# -eq 3 ]; then - level=$3 -else - level="BOTH" -fi -get_files -data TrigTest_CheckCounts.C -echo -e ".x TrigTest_CheckCounts.C($tol,\042${ref}\042,\042${level}\042) \n .q " | root -b >TrigTest_CheckCounts.log -# print the log file -cat TrigTest_CheckCounts.log -if [ `grep "outside tolerance" TrigTest_CheckCounts.log | wc -l ` -gt 0 ]; then - echo 'count compare failed' - exit 127 -fi -exit 0 diff --git a/Trigger/TrigValidation/TrigValTools/macros/TrigTest_CheckCounts.C b/Trigger/TrigValidation/TrigValTools/macros/TrigTest_CheckCounts.C deleted file mode 100644 index 6ab66ed019ee621190820775c0821e2365823035..0000000000000000000000000000000000000000 --- a/Trigger/TrigValidation/TrigValTools/macros/TrigTest_CheckCounts.C +++ /dev/null @@ -1,476 +0,0 @@ -/* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration -*/ - -/* checks differences in chains - between two sets of expert monitoring files - - Original version from N. Sinev - - Upated by Strom, 05-10-09 - Upated by czodrows 08-05-14 - to ensure merged HLT compatibility - Upated by czodrows 12-12-14 - add the L1 Chains added by Joerg - - - Compare both total chain acceptance and results - of individual TEs - - #to test "offline" do: - tol=10 - - ref=/path/to/a/refence/expert/monitoring/file.root - #in my local case - ref=r.root - level="HLT" - echo -e ".x TrigTest_CheckCounts.C($tol,\042${ref}\042,\042${level}\042) \n .q " | root -b - */ - - - -#include <TTree.h> -#include <TFile.h> -#include <TMath.h> -#include <TH1.h> -#include <iostream> -#include <iomanip> -#include <Riostream.h> -#include <RVersion.h> - -void TrigTest_CheckCounts(Int_t toler, const std::string& reffile, std::string level) -{ - Bool_t debug = 0; - Int_t ncheck = 0; - TString *hnames[5]; - TString *hanames[5]; - TString *fnames[5]; - Int_t EXT_BNS = 500; - - if(!(level=="L2"||level=="EF"||level=="BOTH"||level=="HLT")){ - cout << "checkcounts: ERROR : Invalid trigger level given as input: " << level << endl; - cout << "Next time please choose between: L2,EF,HLT and BOTH - goodbye! "<< endl; - exit(-1); - } - - TFile *rf = new TFile("expert-monitoring.root"); - if(rf->IsZombie()){ - cout << "checkcounts: ERROR : Unable to open expert-monitoring.root" << endl; - exit(-1); - } - - cout << "using reference file: " << reffile << endl; - TFile *ref = new TFile(reffile.c_str()); - if(ref->IsZombie()){ - cout << "checkcounts: ERROR : Unable to open reference file: " << reffile << endl; - exit(-1); - } - - TDirectory *l1_dir_cur = rf->GetDirectory("../CTPSimulation");///L1ItemsAV"); - TDirectory *l1_dir_ref = ref->GetDirectory("../CTPSimulation");///L1ItemsAV"); - bool run_l1=0; - if((l1_dir_cur)&&(l1_dir_ref)) run_l1=1; - - - - ///this is option for possible direct calls of levels - if(level=="L2"||level=="EF"||level=="HLT"){ - hnames[0] =new TString("ChainAcceptance"); - // look for alternate names : hanames - hanames[0]=new TString("SignatureAcceptance_runsummary"); - //hanames[0]=new TString("ChainAcceptance_runsummary"); - fnames[0] =new TString("TrigSteer_"+level); - - hnames[1] =new TString("NumberOfActiveTEs"); - // look for alternate names : hanames - hanames[1]=new TString("NumberOfActiveTEsPerEvent"); - //hanames[1]=new TString("NumberOfActiveTEs_runsummary"); - fnames[1] =new TString("TrigSteer_"+level); - ncheck =2; - - if(run_l1) { - hnames[2] =new TString("L1ItemsAV"); - hanames[2]=new TString("L1ItemsAV"); - fnames[2] =new TString("CTPSimulation"); - ncheck =3; - } - cout << "Checking " << level << " trigger counts" << endl; - } - - if(level=="BOTH"){ // "BOTH" - TDirectory *hlt_dir = rf->GetDirectory("TrigSteer_HLT"); - if(hlt_dir){ - level = "HLT"; - //cout << "LEVEL: " << level << endl; - hnames[0] =new TString("ChainAcceptance"); - // look for alternate names : hanames - hanames[0]=new TString("SignatureAcceptance_runsummary"); - fnames[0] =new TString("TrigSteer_HLT"); - - // look at TE details - hnames[1] =new TString("NumberOfActiveTEs"); - // look for alternate names : hanames - hanames[1]=new TString("NumberOfActiveTEsPerEvent"); - fnames[1] =new TString("TrigSteer_HLT"); - ncheck =2; - if(run_l1) { - hnames[2] =new TString("L1ItemsAV"); - hanames[2]=new TString("L1ItemsAV"); - fnames[2] =new TString("CTPSimulation"); - ncheck =3; - } - cout << "Checking HLT trigger counts" << endl; - } else { - //cout << "TrigLevel BOTH was given -- please ignore the following info line if this is a release < 18 "<< endl; - //cout << "TrigSteer_HLT does not exist in expert-monitoring.root --> falling back to L2 and EF check" << endl; - hnames[0] =new TString("ChainAcceptance"); - hanames[0]=new TString("SignatureAcceptance_runsummary"); - //hanames[0]=new TString("ChainAcceptance_runsummary"); - fnames[0] =new TString("TrigSteer_L2"); - - hnames[1] =new TString("ChainAcceptance"); - // look for alternate names : hanames - hanames[1]=new TString("SignatureAcceptance_runsummary"); - //hanames[1]=new TString("ChainAcceptance_runsummary"); - fnames[1] =new TString("TrigSteer_EF"); - - // look at TE details - hnames[2] =new TString("NumberOfActiveTEs"); - // look for alternate names : hanames - hanames[2]=new TString("NumberOfActiveTEsPerEvent"); - //hanames[2]=new TString("NumberOfActiveTEs_runsummary"); - fnames[2] =new TString("TrigSteer_L2"); - - hnames[3] =new TString("NumberOfActiveTEs"); - // look for alternate names : hanames - hanames[3]=new TString("NumberOfActiveTEsPerEvent"); - //hanames[3]=new TString("NumberOfActiveTEs_runsummary"); - fnames[3] =new TString("TrigSteer_EF"); - ncheck =4; - if(run_l1) { - hnames[4] =new TString("L1ItemsAV"); - hanames[4]=new TString("L1ItemsAV"); - fnames[4] =new TString("CTPSimulation"); - ncheck =5; - } - cout << "Checking L2 and EF trigger counts " << endl; - } - } //end if(level=="BOTH") - - if(ncheck==0){ - cout << "checkcounts: ERROR : This should never happen some config error involving ncheck and *level - please contact/assign a TrigValTools developer - exiting CheckCounts!" << endl; - exit(-1); - } - - Bool_t DIRERROR=0; - //check if any TrigSteer directory exists - and also if they are the correct one(s) - TDirectory *hlt_dir_ref = ref->GetDirectory("TrigSteer_HLT"); - TDirectory *hlt_dir_cur = rf->GetDirectory("TrigSteer_HLT"); - - TDirectory *ef_dir_ref = ref->GetDirectory("TrigSteer_EF"); - TDirectory *ef_dir_cur = rf->GetDirectory("TrigSteer_EF"); - TDirectory *l2_dir_ref = ref->GetDirectory("TrigSteer_L2"); - TDirectory *l2_dir_cur = rf->GetDirectory("TrigSteer_L2"); - // TDirectory *l1_dir_cur = rf->GetDirectory("../CTPSimulation");///L1ItemsAV"); - // TDirectory *l1_dir_ref = ref->GetDirectory("../CTPSimulation");///L1ItemsAV"); - - if(level=="L2"){ - if(!(l2_dir_ref)) cout << "Bad reference file: " << reffile << " : Does not contain the directory: TrigSteer_L2 " << endl; - if(!(l2_dir_cur)) cout << "Bad expert-monitoring.root file: Does not contain the directory: TrigSteer_L2 " << endl; - if(!(l2_dir_ref)||!(l2_dir_cur)) DIRERROR=1; - } - if(level=="EF"){ - if(!(ef_dir_ref)) cout << "Bad reference file: " << reffile << " : Does not contain the directory: TrigSteer_EF " << endl; - if(!(ef_dir_cur)) cout << "Bad expert-monitoring.root file: Does not contain the directory: TrigSteer_EF " << endl; - if(!(ef_dir_ref)||!(ef_dir_cur)) DIRERROR=1; - } - if(level=="HLT"){ - // if(!(l1_dir_cur)) cout << "Bad reference file: " << reffile << " : Does not contain the directory: CTPSimulation " << endl; - // if((l1_dir_cur)) cout << "good reference file: " << reffile << " : Does contain the directory: CTPSimulation " << endl; - if(!(hlt_dir_ref)) cout << "Bad reference file: " << reffile << " : Does not contain the directory: TrigSteer_HLT " << endl; - if(!(hlt_dir_cur)) cout << "Bad expert-monitoring.root file: Does not contain the directory: TrigSteer_HLT " << endl; - if(!(hlt_dir_ref)||!(hlt_dir_cur)) DIRERROR=1; - } - if(level=="BOTH"){ - // if(!(l1_dir_cur)) cout << "Bad reference file: " << reffile << " : Does not contain the directory: CTPSimulation " << endl; - // if((l1_dir_cur)) cout << "good reference file: " << reffile << " : Does contain the directory: CTPSimulation " << endl; - //check for existence of TrigSteer_HLT in either of the 2 files - if(!(hlt_dir_ref)||!(hlt_dir_cur)){ //not found -> check for L2 and EF TrigSteer_ directories - if(!(l2_dir_ref)) cout << "Bad reference file: " << reffile << " : Does not contain the directory: TrigSteer_L2 " << endl; - if(!(l2_dir_cur)) cout << "Bad expert-monitoring.root file: Does not contain the directory: TrigSteer_L2 " << endl; - if(!(l2_dir_ref)||!(l2_dir_cur)) DIRERROR=1; - if(!(ef_dir_ref)) cout << "Bad reference file: " << reffile << " : Does not contain the directory: TrigSteer_EF " << endl; - if(!(ef_dir_cur)) cout << "Bad expert-monitoring.root file: Does not contain the directory: TrigSteer_EF " << endl; - if(!(ef_dir_ref)||!(ef_dir_cur)) DIRERROR=1; - } - //check for existence of L2 and EF TrigSteer_ directories in either of the 2 files - if(!(ef_dir_ref)||!(ef_dir_cur)||!(l2_dir_ref)||!(l2_dir_cur)){ //not found -> check for TrigSteer_HLT dirs - if(!(hlt_dir_ref)) cout << "Bad reference file: " << reffile << " : Does not contain the directory: TrigSteer_HLT " << endl; - if(!(hlt_dir_cur)) cout << "Bad expert-monitoring.root file: Does not contain the directory: TrigSteer_HLT " << endl; - if(!(hlt_dir_ref)||!(hlt_dir_cur)) DIRERROR=1; - } - } - - if(DIRERROR){ - cout << "checkcounts: ERROR : Inconsitency/Problem with the TrigSteer_ directories in the reference and/or expert-monitoring.root file detected - exiting CheckCounts!" << endl; - exit(-1); - } - // all seems fine with the 2 files lets go on then ... - - - TString **xlabels; - Double_t *newbc; - Double_t *oldbc; - Double_t *newbct; - Double_t *oldbct; - Bool_t *manam; - Int_t nbins = 0; - Double_t nrnnew = 0.; - Double_t nrnold = 0.; - for(Int_t index=0; index<ncheck; index++) - { - - rf = new TFile("expert-monitoring.root"); - if( rf->IsZombie()){ - cout << "checkcounts test warning: Unable to open expert-monitoring.root file" << endl; - exit(-1); - } - TString *fname = fnames[index]; - rf->cd(*fname); - TH1 *tchain; - TString* hname = hnames[index]; - if(debug){ - cout << "looking for " << *hname << endl; - } - gDirectory->GetObject(*hname,tchain); - if(tchain==0) - { - //look for alternate names - hname = hanames[index]; - if(debug){ - cout << "looking for alternate " << *hname << endl; - } - gDirectory->GetObject(*hname,tchain); - if(tchain==0) - { - cout << "checkcounts test info : no " << *hname - << " in expert-monitoring.root" << endl; - continue; - } - } - cout << endl << *hname << " in directory " << *fname << endl << endl; - nbins = tchain->GetNbinsX()+1; - - if(debug) - { - cout << "bins in test: " << nbins << endl; - } - newbc = new Double_t[nbins+EXT_BNS]; - oldbc = new Double_t[nbins+EXT_BNS]; - - #if ROOT_VERSION_CODE >= ROOT_VERSION(5,99,0) - //new code for root 6 - TString* xlabels[nbins+EXT_BNS]; - #else - //old code for root 5 - TString* xlabels= new TString[nbins+EXT_BNS]; - #endif - - manam = new Bool_t[nbins]; - for(Int_t i=0; i<nbins+EXT_BNS; i++) - { - if(i<nbins) - { - xlabels[i] = new TString(tchain->GetXaxis()->GetBinLabel(i)); - while (xlabels[i]->Contains(" ")) xlabels[i]->Chop(); - manam[i]=false; - } - } - for(Int_t i=0; i<nbins+EXT_BNS; i++) - { - - newbc[i]=0.; - oldbc[i]=0.; - } - - for(Int_t i=0; i<nbins; i++) newbc[i]=tchain->GetBinContent(i); - TH1 *echist; - gDirectory->GetObject("NInitialRoIsPerEvent",echist); - if (*fname=="CTPSimulation"){ - const char * olddir ; - olddir = gDirectory->GetPath() ; - gDirectory->GetObject("../"+(*fnames[0])+"/NInitialRoIsPerEvent",echist); - gDirectory->cd(olddir); - } - // look for old sytle names if new one is not there - // if(echist == 0 ){ - // ` if(fname->Contains("_EF")) - // ` { - // gDirectory->GetObject("N_Initial_RoI_in_Event_EF",echist); - // } - // if(fname->Contains("_L2")) - // { - // gDirectory->GetObject("N_Initial_RoI_in_Event_L2",echist); - // } - if(echist==0) - { - cout << "checkcounts FAILURE : can't determine number of events processed" << endl; - continue; - } - // } - nrnnew=echist->GetEntries(); - cout << "Number of events processed in test: " << nrnnew << endl; - rf->Close(); - TFile *orf = new TFile(reffile.c_str()); - if( orf->IsZombie()){ - cout << "checkcounts test warning: Unable to open reference file" - << reffile << endl; - exit(-1); - } - - // allow for different names in old root file - orf->cd(*fname); - TH1 *otchain; - TString *honame = hnames[index]; - if(debug){cout << "looking for " << *honame << endl; } - gDirectory->GetObject(*honame,otchain); - if(otchain==0) - { - // look for alternate names - honame = hanames[index]; - if(debug){ cout << "looking for alternate " << *honame << endl; } - gDirectory->GetObject(*honame,otchain); - if(otchain==0) - { - cout << "checkcounts test info : no " << *honame << " in " - << reffile << endl; - continue; - } - } - Int_t onbins = otchain->GetNbinsX()+1; - if(debug){ cout << "bins in reference: " << onbins << endl; } - if(nbins != onbins) - { - cout << "Different number of bins in histos! Test: " << nbins << " ref: " << onbins << endl; - } - Int_t nexlb=0; - for(Int_t i=0; i<onbins; i++) - { - Int_t bi = -1; - TString *obna = new TString(otchain->GetXaxis()->GetBinLabel(i)); - while (obna->Contains(" ")) obna->Chop(); - if( debug ){ cout << i << "reference bin label: " << *obna << endl; } - for(Int_t si=0; si<nbins+nexlb; si++) - { - if(xlabels[si]->CompareTo(*obna) == 0) bi=si; - } - if(bi!=-1) - { - oldbc[bi]=otchain->GetBinContent(i); - if(bi < nbins) manam[bi]=true; - } - if(bi==-1) - { - cout << "ref chain name " << *obna << " does not exist in test" << endl; - xlabels[nbins+nexlb] = obna; - oldbc[nbins+nexlb]=otchain->GetBinContent(i); - nexlb++; - if(nexlb > EXT_BNS-1) - { - nexlb = EXT_BNS-1; - cout << "need more bins for new labels" << endl; - } - } - } - gDirectory->GetObject("NInitialRoIsPerEvent",echist); - if (*fname=="CTPSimulation"){ - const char * olddir ; - olddir = gDirectory->GetPath() ; - gDirectory->GetObject("../"+(*fnames[0])+"/NInitialRoIsPerEvent",echist); - gDirectory->cd(olddir); - } - - // look for old sytle names if new one is not there - // if(echist == 0 ){ - // if(fname->Contains("_EF")) - // { - // gDirectory->GetObject("N_Initial_RoI_in_Event_EF",echist); - // } - // if(fname->Contains("_L2")) - // { - // gDirectory->GetObject("N_Initial_RoI_in_Event_L2",echist); - // } - if(echist==0){ - cout << "failed to find number of events in reference" << endl; - continue; - } - // } - nrnold=echist->GetEntries(); - cout << "Number of events in reference: " << nrnold << endl; - orf->Close(); - if(abs(nrnnew-nrnold) < toler + 1) - { - Int_t ngood=0; - Int_t nbad=0; - for(Int_t i=0; i<nbins; i++) - { - Int_t cndif = 0; - if(debug){ cout << i << "reference: " << oldbc[i] << "test: " << newbc[i] << endl; } - cndif = newbc[i]-oldbc[i]; - if((cndif < -toler) || (cndif > toler)) nbad++; - else ngood++; - } - if(nbad !=0) - { - cout << "checkcounts test warning : trigger counts outside tolerance: " << endl; - // set label width to 50 -- a compromise between reading the differences and allowing the full name - cout << "Label" << setw(50) << - "Ref n" << setw(10) << "Test" << setw(15) << "test-ref" << endl; - for(Int_t i=1; i<nbins+nexlb; i++) - { - TString *label = xlabels[i]; - label->Resize(50); - Int_t cndif = 0; - if(i<nbins) - { - cndif = newbc[i]-oldbc[i]; - if(debug){cout << *label << "reference: " << oldbc[i] << "test: " << newbc[i] << endl; } - if((cndif < -toler) || (cndif > toler)) - { - if(manam[i]) - { - cout << *label<< setw(10) << oldbc[i] << setw(10) << newbc[i] << setw(15) << cndif << endl; - } - else - { - cout << *label << setw(10) << "no_ref" << setw(10) << newbc[i] << endl; - } - } - } - else - { - cout << *label<< setw(10) << oldbc[i] << setw(10) << "no data" << endl; - } - } // end for(Int_t i=1; i<nbins+nexlb; i++) - //if(toler > 0 ){ - if( hname->Contains("TE") ){ - cout << "TE (trigger element)" << endl; - cout << "Fraction inside tolerance: " - << " " << ngood << "/" - << ngood+nbad << endl; - } else { - cout << "RAW counts" << endl; - cout << "Fraction inside tolerance: " - << " " << ngood << "/" - << ngood+nbad << endl; - } - cout << "----------------------------------------------------------------" << endl; - //} - }// end if(nbad !=0) - else - { - cout << " checkcounts: SUCCESS : all "<< nbins << " trigger counts within tolerance" << endl; - } - } else { - cout<< " checkcounts: number of events in reference and test different by more than tolerance" << endl; - } // end if(abs(nrnnew-nrnold) < 2.) - } // end for(Int_t index=0; index<2; index++) -} // end of function diff --git a/Trigger/TrigValidation/TriggerTest/share/ref_data_v1Dev_build.ref b/Trigger/TrigValidation/TriggerTest/share/ref_data_v1Dev_build.ref index 0907a8ecac46f782f51b9b278a93eddb7665346c..3ee0d82e7c61854eaecf11327e3405e3fad30208 100644 --- a/Trigger/TrigValidation/TriggerTest/share/ref_data_v1Dev_build.ref +++ b/Trigger/TrigValidation/TriggerTest/share/ref_data_v1Dev_build.ref @@ -68,8 +68,8 @@ TrigSignatureMoniMT INFO HLT_beamspot_allTE_trkf TrigSignatureMoniMT INFO -- #3989372080 Events 20 20 20 20 - - - 20 TrigSignatureMoniMT INFO -- #3989372080 Features 20 20 - - - TrigSignatureMoniMT INFO HLT_costmonitor_CostMonDS_L1All #843341480 -TrigSignatureMoniMT INFO -- #843341480 Events 20 20 20 20 - - - 20 -TrigSignatureMoniMT INFO -- #843341480 Features 20 20 - - - +TrigSignatureMoniMT INFO -- #843341480 Events 20 20 20 - - - - 20 +TrigSignatureMoniMT INFO -- #843341480 Features 20 - - - - TrigSignatureMoniMT INFO HLT_e140_lhloose_L1EM24VHI #2512605388 TrigSignatureMoniMT INFO -- #2512605388 Events 20 20 0 0 0 0 - 0 TrigSignatureMoniMT INFO -- #2512605388 Features 0 0 0 0 - @@ -142,6 +142,9 @@ TrigSignatureMoniMT INFO -- #385248610 Features TrigSignatureMoniMT INFO HLT_g5_tight_L1EM3 #3280865118 TrigSignatureMoniMT INFO -- #3280865118 Events 20 20 9 9 9 1 - 1 TrigSignatureMoniMT INFO -- #3280865118 Features 13 13 30 1 - +TrigSignatureMoniMT INFO HLT_j0_perf_L1J12_EMPTY #1341875780 +TrigSignatureMoniMT INFO -- #1341875780 Events 20 20 8 - - - - 8 +TrigSignatureMoniMT INFO -- #1341875780 Features 174 - - - - TrigSignatureMoniMT INFO HLT_j0_vbenfSEP30etSEP34mass35SEP50fbet_L1J20 #4034799151 TrigSignatureMoniMT INFO -- #4034799151 Events 20 20 2 - - - - 2 TrigSignatureMoniMT INFO -- #4034799151 Features 34 - - - - @@ -406,6 +409,9 @@ TrigSignatureMoniMT INFO -- #1275052132 Features TrigSignatureMoniMT INFO HLT_tau35_mediumRNN_tracktwoMVA_L1TAU12IM #2456480859 TrigSignatureMoniMT INFO -- #2456480859 Events 20 20 3 3 - - - 1 TrigSignatureMoniMT INFO -- #2456480859 Features 4 3 - - - +TrigSignatureMoniMT INFO HLT_timeburner_L1All #819160059 +TrigSignatureMoniMT INFO -- #819160059 Events 20 20 0 - - - - 0 +TrigSignatureMoniMT INFO -- #819160059 Features 0 - - - - TrigSignatureMoniMT INFO HLT_xe100_mht_L1XE50 #532175988 TrigSignatureMoniMT INFO -- #532175988 Events 20 20 2 - - - - 2 TrigSignatureMoniMT INFO -- #532175988 Features 2 - - - - diff --git a/Trigger/TriggerCommon/TriggerJobOpts/python/TriggerConfig.py b/Trigger/TriggerCommon/TriggerJobOpts/python/TriggerConfig.py index 7d9a13d2a090a8792d49cfe5265a19c119d2b64c..efd9578b0ac2862335b61df37bace7d90f98ea1b 100644 --- a/Trigger/TriggerCommon/TriggerJobOpts/python/TriggerConfig.py +++ b/Trigger/TriggerCommon/TriggerJobOpts/python/TriggerConfig.py @@ -440,30 +440,23 @@ def triggerMergeViewsAndAddMissingEDMCfg( edmSet, hypos, viewMakers, decObj, dec # configure views merging needMerging = [x for x in TriggerHLTListRun3 if len(x) >= 4 and x[3].startswith("inViews:")] __log.info("These collections need merging: {}".format( " ".join([ c[0] for c in needMerging ])) ) - # group by the view collection name/(the view maker algorithm in practice) - from collections import defaultdict - groupedByView = defaultdict(list) - [ groupedByView[c[3]].append( c ) for c in needMerging ] - - for view, colls in six.iteritems (groupedByView): - viewCollName = view.split(":")[1] - tool = HLTEDMCreator( "{}Merger".format( viewCollName ) ) - for coll in colls: # see the content in TrigEDMConfigRun3 - collType, collName = coll[0].split("#") - collType = collType.split(":")[-1] - viewsColl = coll[3].split(":")[-1] - # Get existing property, or return empty list if not set. - attrView = getattr(tool, collType+"Views", []) - attrInView = getattr(tool, collType+"InViews", []) - attrName = getattr(tool, collType, []) + mergingTool = HLTEDMCreator( "ViewsMergingTool") + for coll in needMerging: + collType, collName = coll[0].split("#") + collType = collType.split(":")[-1] + possibleViews = coll[3].split(":")[-1].split(",") + for viewsColl in possibleViews: + attrView = getattr(mergingTool, collType+"Views", []) + attrInView = getattr(mergingTool, collType+"InViews", []) + attrName = getattr(mergingTool, collType, []) # attrView.append( viewsColl ) attrInView.append( collName ) attrName.append( collName ) # - setattr(tool, collType+"Views", attrView ) - setattr(tool, collType+"InViews", attrInView ) - setattr(tool, collType, attrName ) + setattr(mergingTool, collType+"Views", attrView ) + setattr(mergingTool, collType+"InViews", attrInView ) + setattr(mergingTool, collType, attrName ) producer = [ maker for maker in viewMakers if maker.Views == viewsColl ] if len(producer) == 0: __log.warning("The producer of the {} not in the menu, it's outputs won't ever make it out of the HLT".format( str(coll) ) ) @@ -473,7 +466,7 @@ def triggerMergeViewsAndAddMissingEDMCfg( edmSet, hypos, viewMakers, decObj, dec if pr != producer[0]: __log.error("Several View making algorithms produce the same output collection {}: {}".format( viewsColl, ' '.join([p.getName() for p in producer ]) ) ) continue - alg.OutputTools += [ tool ] + alg.OutputTools += [mergingTool] tool = HLTEDMCreator( "GapFiller" ) if len(edmSet) != 0: diff --git a/Trigger/TriggerCommon/TriggerJobOpts/share/runHLT_standalone.py b/Trigger/TriggerCommon/TriggerJobOpts/share/runHLT_standalone.py index 053135ea9d27769dadc50ded3a4286283f11c60a..b5f22bfccb79d0712b9a1bce9d25e9e5425f50b7 100644 --- a/Trigger/TriggerCommon/TriggerJobOpts/share/runHLT_standalone.py +++ b/Trigger/TriggerCommon/TriggerJobOpts/share/runHLT_standalone.py @@ -612,6 +612,11 @@ if opt.reverseViews or opt.filterViews: #------------------------------------------------------------- include("TriggerTest/disableChronoStatSvcPrintout.py") +#------------------------------------------------------------- +# Enable xAOD::EventInfo decorations for pileup values +#------------------------------------------------------------- +include ("LumiBlockComps/LumiBlockMuWriter_jobOptions.py") + #------------------------------------------------------------- # Print top sequence #------------------------------------------------------------- diff --git a/Trigger/TriggerCommon/TriggerMenu/python/calibcosmicmon/MonitorDef.py b/Trigger/TriggerCommon/TriggerMenu/python/calibcosmicmon/MonitorDef.py index d0dfe7264a034766343856db41ca88c712179037..e483ef863bb6a0f0c4584124f29d5cb73383fbd3 100644 --- a/Trigger/TriggerCommon/TriggerMenu/python/calibcosmicmon/MonitorDef.py +++ b/Trigger/TriggerCommon/TriggerMenu/python/calibcosmicmon/MonitorDef.py @@ -1,4 +1,4 @@ -# Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration +# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration ########################################################################### # Configure L2 and EF monitoring chains @@ -82,7 +82,7 @@ class L2EFChain_Monitoring(L2EFChainDef): #################################### #################################### def setupL1BCCorrMonChains(self,chainname): - from TrigGenericAlgs.TrigGenericAlgsConfig import L1CorrelationAlgoConfig + from TrigGenericAlgs.TrigGenericAlgsLegacyConfig import L1CorrelationAlgoConfig l1correlation_output = '' if 'mistimemonj400' in chainname: L1CorrAlgo = L1CorrelationAlgoConfig("L1CorrAlgoNoMuonCBCIncl") @@ -154,7 +154,7 @@ class L2EFChain_Monitoring(L2EFChainDef): # self.EFsignatureList += [ [[output0]] ] # self.EFsignatureList += [ [[output1]] ] - from TrigGenericAlgs.TrigGenericAlgsConfig import DetectorTimingAlgoConfig + from TrigGenericAlgs.TrigGenericAlgsLegacyConfig import DetectorTimingAlgoConfig ### Now also retrieve triggertowers from TrigCaloRec.TrigCaloRecConf import TrigL1BSTowerMaker diff --git a/Trigger/TriggerCommon/TriggerMenu/python/egamma/generatePhotonChainDefs.py b/Trigger/TriggerCommon/TriggerMenu/python/egamma/generatePhotonChainDefs.py index 8cfea7bda432142dae70ea6ff5105f933956e8e3..911feabda3272a383cea26f3cfde2275b9c34d58 100755 --- a/Trigger/TriggerCommon/TriggerMenu/python/egamma/generatePhotonChainDefs.py +++ b/Trigger/TriggerCommon/TriggerMenu/python/egamma/generatePhotonChainDefs.py @@ -1,4 +1,4 @@ -# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration ########################################################################################## ########################################################################################## @@ -52,7 +52,7 @@ def _addTopoInfo(theChainDef,chainDict,doAtL2AndEF=True): if 'dPhi15' in chainDict['topo']: EFChainName = 'EF_2g_OvlRem_dPhi15' - from TrigGenericAlgs.TrigGenericAlgsConfig import OverlapRemovalConfig + from TrigGenericAlgs.TrigGenericAlgsLegacyConfig import OverlapRemovalConfig OverlapRemoval_algo = OverlapRemovalConfig('OvlRem', MinPhiDist = 1.5, MinEtaDist = 0) theChainDef.addSequence([OverlapRemoval_algo],inputTEsEF,EFChainName) diff --git a/Trigger/TriggerCommon/TriggerMenu/python/menu/MenuUtils.py b/Trigger/TriggerCommon/TriggerMenu/python/menu/MenuUtils.py index 014172e85dc4fc0780b21cdc401ecfe1cdcb0394..4b8bb3cf784a7254d6d7ba0458c687331b85f272 100644 --- a/Trigger/TriggerCommon/TriggerMenu/python/menu/MenuUtils.py +++ b/Trigger/TriggerCommon/TriggerMenu/python/menu/MenuUtils.py @@ -1,4 +1,4 @@ -# Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration +# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration from collections import Counter from copy import deepcopy @@ -402,7 +402,7 @@ def setupTopoStartFrom(topoThresholds, theChainDef): from TrigGenericAlgs.TrigGenericAlgsConf import MergeTopoStarts if len(topoThresholds) > 1: - from TrigGenericAlgs.TrigGenericAlgsConfig import MergeTopoStartsConfig + from TrigGenericAlgs.TrigGenericAlgsLegacyConfig import MergeTopoStartsConfig m = MergeTopoStartsConfig("testInstance") log.debug(m) diff --git a/Trigger/TriggerCommon/TriggerMenu/python/muon/MuonDef.py b/Trigger/TriggerCommon/TriggerMenu/python/muon/MuonDef.py index 3a02ee91fa57752cf6403bd2fd925f0c17684784..474041517efcae50cc5a6f9e41fcc088eed2f778 100755 --- a/Trigger/TriggerCommon/TriggerMenu/python/muon/MuonDef.py +++ b/Trigger/TriggerCommon/TriggerMenu/python/muon/MuonDef.py @@ -1,4 +1,4 @@ -# Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration +# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration from __future__ import print_function @@ -1281,7 +1281,7 @@ class L2EFChain_mu(L2EFChainDef): def setup_muXX_dR(self): - from TrigGenericAlgs.TrigGenericAlgsConfig import OverlapRemovalConfig + from TrigGenericAlgs.TrigGenericAlgsLegacyConfig import OverlapRemovalConfig OverlapRemoval_algo = OverlapRemovalConfig('OvlRem', MinCentDist = 1) self.L2sequenceList += [[self.L2InputTE, diff --git a/Trigger/TriggerCommon/TriggerMenuMT/CMakeLists.txt b/Trigger/TriggerCommon/TriggerMenuMT/CMakeLists.txt index 1729d6cf9e1ee3a2c744639694729a5e3fce8e42..1a23c5bb63ea542b2fb7d9383d613de3edff4356 100644 --- a/Trigger/TriggerCommon/TriggerMenuMT/CMakeLists.txt +++ b/Trigger/TriggerCommon/TriggerMenuMT/CMakeLists.txt @@ -13,7 +13,7 @@ atlas_depends_on_subdirs( PRIVATE find_package( six ) atlas_add_test( flake8 - SCRIPT flake8 --select=ATL,F,E7,E9,W6 --enable-extension=ATL900,ATL901 + SCRIPT flake8 --select=ATL,F,E7,E9,W6,E101 --enable-extension=ATL900,ATL901,ATL902 ${CMAKE_CURRENT_SOURCE_DIR}/python ${CMAKE_CURRENT_SOURCE_DIR}/scripts POST_EXEC_SCRIPT nopost.sh ) @@ -108,7 +108,7 @@ atlas_install_python_modules( python/*.py python/LVL1MenuConfig python/L1 python/HLTMenuConfig - ) + POST_BUILD_CMD ${ATLAS_FLAKE8}) atlas_install_joboptions( share/*.py ) atlas_install_scripts( scripts/generateMenuMT.py ) diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Bjet/BjetTrackingConfiguration.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Bjet/BjetTrackingConfiguration.py index a0f95d98d7dc78e8f4c04e0f860b936ed30b3ac2..d0852ba73f3ee5f7dec5de2f0e9802d86a19b861 100644 --- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Bjet/BjetTrackingConfiguration.py +++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Bjet/BjetTrackingConfiguration.py @@ -1,3 +1,4 @@ +# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration from AthenaCommon.CFElements import seqAND #from AthenaCommon.Constants import DEBUG diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/CalibCosmicMon/GenerateMonitorChainDefs.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/CalibCosmicMon/GenerateMonitorChainDefs.py index e116b00c2c8a6dc1048fe33a3e809d7ccdbe54c2..92f5d2710322d0c8c526cb77a18c0e103ba0f5b7 100644 --- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/CalibCosmicMon/GenerateMonitorChainDefs.py +++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/CalibCosmicMon/GenerateMonitorChainDefs.py @@ -1,4 +1,4 @@ -# Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration +# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration from TriggerMenuMT.HLTMenuConfig.Menu.ChainDictTools import splitChainDict from TriggerMenuMT.HLTMenuConfig.CalibCosmicMon.MonitorChainConfiguration import MonitorChainConfiguration as MonitorChainConfiguration @@ -14,7 +14,7 @@ log.info("Importing %s",__name__) def generateChainConfigs( chainDict ): listOfChainDicts = splitChainDict(chainDict) - log.debug("Will generate Config for streamer: %s", chainDict['chainName']) + log.debug("Will generate Config for monitor chain: %s", chainDict['chainName']) listOfChainDefs = [] diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/CalibCosmicMon/MonitorChainConfiguration.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/CalibCosmicMon/MonitorChainConfiguration.py index 5531b43ffb8c04398d719d3fc7ec2a1c8010d1f4..615dd21fd63edd8cec8ca6c143ed1504342c23b4 100644 --- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/CalibCosmicMon/MonitorChainConfiguration.py +++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/CalibCosmicMon/MonitorChainConfiguration.py @@ -1,10 +1,15 @@ -# Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration +# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration from AthenaCommon.Logging import logging logging.getLogger().info("Importing %s",__name__) log = logging.getLogger("TriggerMenuMT.HLTMenuConfig.CalibCosmicMon.MonitorChainConfiguration") from TriggerMenuMT.HLTMenuConfig.Menu.ChainConfigurationBase import ChainConfigurationBase +from TriggerMenuMT.HLTMenuConfig.Menu.MenuComponents import ChainStep, MenuSequence +from DecisionHandling.DecisionHandlingConf import InputMakerForRoI +from AthenaCommon.CFElements import seqAND +from TrigGenericAlgs.TrigGenericAlgsConfig import TimeBurnerCfg, TimeBurnerHypoToolGen +from AthenaConfiguration.ComponentAccumulator import conf2toConfigurable #---------------------------------------------------------------- # fragments generating configuration will be functions in New JO, @@ -25,26 +30,33 @@ class MonitorChainConfiguration(ChainConfigurationBase): def assembleChain(self): chainSteps = [] log.debug("Assembling chain for " + self.chainName) - # -------------------- - # define here the names of the steps and obtain the chainStep configuration - # -------------------- - stepDictionary = { - "costmonitor":[self.getNoalgStep()], - } - - #key = self.chainPart['EFrecoAlg'] - key = 'costmonitor' - steps=stepDictionary[key] - for step in steps: - chainSteps+=[step] - - myChain = self.buildChain(chainSteps) - return myChain - + + if self.chainPartName == 'costmonitor': + pass # costmonitor is a streamer so has no steps + elif self.chainPartName == 'timeburner': + chainSteps.append(self.getTimeBurnerStep()) + else: + raise RuntimeError('Unexpected chainPartName '+self.chainPartName+' in MonitorChainConfiguration') + + return self.buildChain(chainSteps) + # -------------------- - # Configuration of costmonitor + # TimeBurner configuration # -------------------- - def getNoalgStep(self): - from TriggerMenuMT.HLTMenuConfig.CalibCosmicMon.StreamingChainConfiguration import StreamingSequenceCfg - return self.getStep(1,"noalg", [StreamingSequenceCfg] ) + def getTimeBurnerStep(self): + # Input maker - required by the framework, but inputs don't matter for TimeBurner + inputMaker = InputMakerForRoI("IM_TimeBurner") + inputMaker.RoIs="TimeBurnerInputRoIs" + inputMakerSeq = seqAND("TimeBurnerSequence", [inputMaker]) + + # TimeBurner alg works as a reject-all hypo + hypoAlg = conf2toConfigurable(TimeBurnerCfg()) + hypoAlg.SleepTimeMillisec = 200 + + seq = MenuSequence( + Sequence = inputMakerSeq, + Maker = inputMaker, + Hypo = hypoAlg, + HypoToolGen = TimeBurnerHypoToolGen) + return ChainStep(name='Step1_TimeBurner', Sequences=[seq]) diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/CommonSequences/CaloSequenceSetup.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/CommonSequences/CaloSequenceSetup.py index ef0f50cc69fcacd42675bd731b991b647bb3fe6b..1c27db59896a9cdb6f09966a0d41827a34323a86 100644 --- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/CommonSequences/CaloSequenceSetup.py +++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/CommonSequences/CaloSequenceSetup.py @@ -18,7 +18,7 @@ def fastCaloSequence(doRinger): from TrigT2CaloCommon.CaloDef import fastCaloEVCreator (fastCaloViewsMaker, InViewRoIs) = fastCaloEVCreator() - # reco sequence + # reco sequence always build the rings from TrigT2CaloCommon.CaloDef import fastCaloRecoSequence (fastCaloInViewSequence, sequenceOut) = fastCaloRecoSequence(InViewRoIs, doRinger=doRinger) @@ -27,21 +27,34 @@ def fastCaloSequence(doRinger): return (fastCaloSequence, fastCaloViewsMaker, sequenceOut) -def fastCaloMenuSequence(name, doRinger=True): +def fastCaloMenuSequence(name, doRinger): """ Creates L2 Fast Calo MENU sequence The Hypo name changes depending on name, so for different implementations (Electron, Gamma,....) + The doRinger flag is to use or not the Ringer hypo """ - (sequence, fastCaloViewsMaker, sequenceOut) = RecoFragmentsPool.retrieve(fastCaloSequence, doRinger) - - # hypo - from TrigEgammaHypo.TrigEgammaHypoConf import TrigL2CaloHypoAlgMT - theFastCaloHypo = TrigL2CaloHypoAlgMT(name+"L2CaloHypo") - theFastCaloHypo.CaloClusters = sequenceOut - CaloMenuDefs.L2CaloClusters = sequenceOut - - - from TrigEgammaHypo.TrigL2CaloHypoTool import TrigL2CaloHypoToolFromDict - return MenuSequence( Sequence = sequence, - Maker = fastCaloViewsMaker, - Hypo = theFastCaloHypo, - HypoToolGen = TrigL2CaloHypoToolFromDict ) + (sequence, fastCaloViewsMaker, sequenceOut) = RecoFragmentsPool.retrieve(fastCaloSequence, {'doRinger' : doRinger}) + # check if use Ringer and are electron because there aren't ringer for photons yet + if doRinger: + # Ringer hypo + from TrigMultiVarHypo.TrigMultiVarHypoConf import TrigL2CaloRingerHypoAlgMT + theFastCaloHypo = TrigL2CaloRingerHypoAlgMT( name + "L2CaloRingerHypo") + theFastCaloHypo.ClustersKey = sequenceOut + CaloMenuDefs.L2CaloClusters = sequenceOut + + from TrigMultiVarHypo.TrigL2CaloRingerHypoTool import TrigL2CaloRingerHypoToolFromDict + return MenuSequence( Sequence = sequence, + Maker = fastCaloViewsMaker, + Hypo = theFastCaloHypo, + HypoToolGen = TrigL2CaloRingerHypoToolFromDict ) + else: + # hypo + from TrigEgammaHypo.TrigEgammaHypoConf import TrigL2CaloHypoAlgMT + theFastCaloHypo = TrigL2CaloHypoAlgMT(name+"L2CaloHypo") + theFastCaloHypo.CaloClusters = sequenceOut + CaloMenuDefs.L2CaloClusters = sequenceOut + + from TrigEgammaHypo.TrigL2CaloHypoTool import TrigL2CaloHypoToolFromDict + return MenuSequence( Sequence = sequence, + Maker = fastCaloViewsMaker, + Hypo = theFastCaloHypo, + HypoToolGen = TrigL2CaloHypoToolFromDict ) diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Egamma/EgammaDefs.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Egamma/EgammaDefs.py index 4e8d318d4bffe6145d856b5600166a44fd097829..b2d39cebc3f0007d11de5058edc7fa9cf6b03b41 100644 --- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Egamma/EgammaDefs.py +++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Egamma/EgammaDefs.py @@ -1,3 +1,4 @@ +# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration #---------------------------------------------------------------- # Static classes to configure photon chain container names diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Egamma/ElectronDef.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Egamma/ElectronDef.py index e2f4a6063aa2891da063885a73e6cde4705dc055..7cf22d9c06a1c04ca2dbe6f81740e53ed733faad 100644 --- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Egamma/ElectronDef.py +++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Egamma/ElectronDef.py @@ -19,8 +19,12 @@ from TriggerMenuMT.HLTMenuConfig.Egamma.PrecisionElectronSequenceSetup import pr # so let's make them functions already now #---------------------------------------------------------------- -def electronFastCaloCfg( doRinger=True ): - return fastCaloMenuSequence("Electron", doRinger) + +def electronFastCaloCfg( flags ): + return fastCaloMenuSequence("Electron", doRinger=False) + +def electronFastCaloRingerCfg( flags ): + return fastCaloMenuSequence("Electron", doRinger=True) def fastElectronSequenceCfg( flags ): return fastElectronMenuSequence() @@ -38,18 +42,19 @@ class ElectronChainConfiguration(ChainConfigurationBase): def __init__(self, chainDict): ChainConfigurationBase.__init__(self,chainDict) - + # ---------------------- # Assemble the chain depending on information from chainName # ---------------------- def assembleChain(self): chainSteps = [] log.debug("Assembling chain for " + self.chainName) + # -------------------- # define here the names of the steps and obtain the chainStep configuration # -------------------- - etcut1step = [ self.getFastCalo() ] - etcut_sequence = [ self.getFastCalo(), self.getFastElectron(), self.getPrecisionCaloElectron()] + etcut1step = [ self.getFastCalo(doRinger=False) ] + etcut_sequence = [ self.getFastCalo(doRinger=False), self.getFastElectron(), self.getPrecisionCaloElectron()] electron_sequence = [ self.getFastCalo(), self.getFastElectron(), self.getPrecisionCaloElectron(), self.getPrecisionElectron()] etcut_noringer_sequence = [ self.getFastCalo(doRinger=False), self.getFastElectron(), self.getPrecisionCaloElectron()] electron_noringer_sequence = [ self.getFastCalo(doRinger=False), self.getFastElectron(), self.getPrecisionCaloElectron(), self.getPrecisionElectron()] @@ -68,25 +73,27 @@ class ElectronChainConfiguration(ChainConfigurationBase): 'lhtightnoringer' : electron_noringer_sequence, } - log.debug('electron chain part = ' + str(self.chainPart)) key = self.chainPart['extra'] + self.chainPart['IDinfo'] + self.chainPart['L2IDAlg'] + self.chainPart['isoInfo'] + for addInfo in self.chainPart['addInfo']: key+=addInfo - + log.debug('electron key = ' + key) if key in stepDictionary: steps=stepDictionary[key] else: raise RuntimeError("Chain configuration unknown for electron chain with key: " + key ) + chainSteps = [] for step in steps: log.debug('Adding electron trigger step ' + str(step)) chainSteps+=[step] - - myChain = self.buildChain(chainSteps) + + myChain = self.buildChain(chainSteps) + return myChain # -------------------- @@ -94,9 +101,14 @@ class ElectronChainConfiguration(ChainConfigurationBase): # -------------------- def getFastCalo(self, doRinger=True): - stepName = "Step1_FastCalo_electron" + if doRinger: + stepName = "Step1_FastCaloRinger_electron" + fastCaloCfg = electronFastCaloRingerCfg + else: + stepName = "Step1_FastCalo_electron" + fastCaloCfg = electronFastCaloCfg log.debug("Configuring step " + stepName) - fastCalo = RecoFragmentsPool.retrieve( electronFastCaloCfg, doRinger ) # the None will be used for flags in future + fastCalo = RecoFragmentsPool.retrieve(fastCaloCfg , None ) return ChainStep(stepName, [fastCalo], [self.mult], [self.dict]) def getFastElectron(self): @@ -110,7 +122,7 @@ class ElectronChainConfiguration(ChainConfigurationBase): stepName = "Step3_precisionCalo_electron" log.debug("Configuring step " + stepName) precisionReco = RecoFragmentsPool.retrieve( precisionCaloSequenceCfg, None ) - return ChainStep(stepName, [precisionReco], [self.mult], [self.dict]) + return ChainStep(stepName, [precisionReco], [self.mult], [self.dict]) def getPrecisionElectron(self): diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Egamma/PhotonDef.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Egamma/PhotonDef.py index 00db5900216705cc825cef163257eaab96d1f8d8..328521d27d670e5141073babc0c9250932acb7a0 100644 --- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Egamma/PhotonDef.py +++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Egamma/PhotonDef.py @@ -20,7 +20,7 @@ from TriggerMenuMT.HLTMenuConfig.Egamma.PrecisionCaloSequenceSetup import precis # so let's make them functions already now #---------------------------------------------------------------- def fastPhotonCaloSequenceCfg( flags ): - return fastCaloMenuSequence('Photon') + return fastCaloMenuSequence('Photon', doRinger=False) def fastPhotonSequenceCfg( flags ): return fastPhotonMenuSequence() diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/ChainDictTools.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/ChainDictTools.py index 8edf28a5f766d69c99b63200be6b0fa84a613363..3dd2db8533559edaaad8134438514d3c18521751 100644 --- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/ChainDictTools.py +++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/ChainDictTools.py @@ -1,4 +1,4 @@ -# Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration +# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration from copy import deepcopy @@ -118,7 +118,7 @@ def setupTopoStartFrom(topoThresholds, theChainDef): from TrigGenericAlgs.TrigGenericAlgsConf import MergeTopoStarts if len(topoThresholds) > 1: - from TrigGenericAlgs.TrigGenericAlgsConfig import MergeTopoStartsConfig + from TrigGenericAlgs.TrigGenericAlgsLegacyConfig import MergeTopoStartsConfig m = MergeTopoStartsConfig("testInstance") log.debug(m) diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/LS2_v1.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/LS2_v1.py index 5d401ba88d776ba24452468d2c857f0f49134f61..f8aebc77b26820423edf0c131a2f5130f6fadffe 100644 --- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/LS2_v1.py +++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/LS2_v1.py @@ -163,6 +163,8 @@ def setupMenu(): ChainProp(name='HLT_3j200_L1J20', groups=MultiJetGroup), ChainProp(name='HLT_j0_vbenfSEP30etSEP34mass35SEP50fbet_L1J20', groups=SingleJetGroup), + # ATR-20624 + ChainProp(name='HLT_j0_perf_L1J12_EMPTY', stream=['Main'], groups=SingleJetGroup), ] TriggerFlags.BjetSlice.signatures = TriggerFlags.BjetSlice.signatures() + [ diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/PhysicsP1_pp_run3_v1.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/PhysicsP1_pp_run3_v1.py index cdd4ad401422f7da3aa83b9875aac5563105e6cf..fc893500a34dedbbd87dcc3fa9135b54d495e444 100644 --- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/PhysicsP1_pp_run3_v1.py +++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/PhysicsP1_pp_run3_v1.py @@ -1,4 +1,4 @@ -# Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration +# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration #------------------------------------------------------------------------# # PhysicsP1_pp_run3_v1.py menu for the long shutdown development @@ -64,6 +64,7 @@ def addP1Signatures(): ] TriggerFlags.MonitorSlice.signatures = TriggerFlags.MonitorSlice.signatures() + [ ChainProp(name='HLT_costmonitor_CostMonDS_L1All', l1SeedThresholds=['FSNOSEED'], stream=['CostMonitoring'], groups=['RATE:Monitoring','BW:Other']), + ChainProp(name='HLT_timeburner_L1All', l1SeedThresholds=['FSNOSEED'], stream=['DISCARD'], groups=['RATE:DISCARD','BW:DISCARD']), ] # Random Seeded EB chains which select at the HLT based on L1 TBP bits diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/StreamInfo.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/StreamInfo.py index d2f281c199a2eb830c604acef3fbf46f894b57a9..9383a3396e053b06c5dd52d7801ffa8d3aecf9ea 100644 --- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/StreamInfo.py +++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/StreamInfo.py @@ -1,4 +1,4 @@ -# Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration +# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration from future.moves.collections import UserList from AthenaCommon.Logging import logging @@ -48,6 +48,8 @@ _all_streams = [ StreamInfo('CC', 'physics', True, True), StreamInfo('PCPEB', 'calibration', False, False), StreamInfo('CCPEB', 'calibration', False, False), + # Special stream to be used only for special chains rejecting all events like timeburner + StreamInfo('DISCARD', 'unknown', False, False) ] diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Muon/MuonSequenceSetup.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Muon/MuonSequenceSetup.py index 0b082c48c36d9bd072715a795a70de228bc4845f..d2d533dd1a78c5983e9a873cbb09c73080552642 100644 --- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Muon/MuonSequenceSetup.py +++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Muon/MuonSequenceSetup.py @@ -122,7 +122,7 @@ def muCombAlgSequence(ConfigFlags): ### get ID tracking and muComb reco sequences ### from TriggerMenuMT.HLTMenuConfig.Muon.MuonSetup import muCombRecoSequence, muonIDFastTrackingSequence muFastIDRecoSequence = muonIDFastTrackingSequence( l2muCombViewsMaker.InViewRoIs , "") - muCombRecoSequence, sequenceOut = muCombRecoSequence( l2muCombViewsMaker.InViewRoIs ) + muCombRecoSequence, sequenceOut = muCombRecoSequence( l2muCombViewsMaker.InViewRoIs, "FTF" ) #Filter algorithm to run muComb only if non-Bphysics muon chains are active from TrigMuonEF.TrigMuonEFConfig import MuonChainFilterAlg diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Muon/MuonSetup.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Muon/MuonSetup.py index d2d116517e074ce569a20d35f5b66cf5bd9a701c..71c9e67f31db3fea738d83ae5470bbc5a0920f34 100644 --- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Muon/MuonSetup.py +++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Muon/MuonSetup.py @@ -138,6 +138,8 @@ def makeMuonPrepDataAlgs(RoIs="MURoIs", forFullScan=False): DoSeededDecoding = not forFullScan, RoIs = RoIs) + from RegionSelector.RegSelToolConfig import makeRegSelTool_MDT + MdtRdoToMdtPrepData.RegSel_MDT = makeRegSelTool_MDT() from MuonByteStream.MuonByteStreamConf import Muon__MdtRawDataProvider MdtRawDataProvider = Muon__MdtRawDataProvider(name = "MdtRawDataProvider" + postFix, @@ -336,20 +338,13 @@ def muonIDFastTrackingSequence( RoIs, name ): from TrigInDetConfig.InDetSetup import makeInDetAlgs viewAlgs = makeInDetAlgs(whichSignature="Muon"+name, rois = RoIs) - global TrackParticlesName - global theFTF_name - #TrackParticlesName = "" for viewAlg in viewAlgs: muonIDFastTrackingSequence += viewAlg - if "InDetTrigTrackParticleCreatorAlg" in viewAlg.name(): - TrackParticlesName = viewAlg.TrackParticlesName - if "TrigFastTrackFinder" in viewAlg.name(): - theFTF_name = viewAlg.getName() return muonIDFastTrackingSequence -def muCombRecoSequence( RoIs ): +def muCombRecoSequence( RoIs, name ): from AthenaCommon.CFElements import parOR muCombRecoSequence = parOR("l2muCombViewNode") @@ -363,7 +358,7 @@ def muCombRecoSequence( RoIs ): ### please read out TrigmuCombMTConfig file ### ### and set up to run muCombMT algorithm ### from TrigmuComb.TrigmuCombMTConfig import TrigmuCombMTConfig - muCombAlg = TrigmuCombMTConfig("Muon", theFTF_name) + muCombAlg = TrigmuCombMTConfig("Muon", name) muCombAlg.L2StandAloneMuonContainerName = muNames.L2SAName muCombAlg.TrackParticlesContainerName = TrackParticlesName muCombAlg.L2CombinedMuonContainerName = muNames.L2CBName @@ -375,7 +370,6 @@ def muCombRecoSequence( RoIs ): def l2muisoRecoSequence( RoIs ): - global TrackParticlesName import AthenaCommon.CfgMgr as CfgMgr from AthenaCommon.CFElements import parOR @@ -479,7 +473,6 @@ def muEFSARecoSequence( RoIs, name ): def muEFCBRecoSequence( RoIs, name ): - global TrackParticlesName from AthenaCommon import CfgMgr from AthenaCommon.CFElements import parOR @@ -502,11 +495,9 @@ def muEFCBRecoSequence( RoIs, name ): from TrigInDetConfig.InDetSetup import makeInDetAlgs viewAlgs = makeInDetAlgs(whichSignature = "MuonFS", rois = RoIs) - #TrackParticlesName = "" for viewAlg in viewAlgs: muEFCBRecoSequence += viewAlg if "InDetTrigTrackParticleCreatorAlg" in viewAlg.name(): - TrackParticlesName = viewAlg.TrackParticlesName # noqa: F841 TrackCollection = viewAlg.TrackName else: @@ -704,11 +695,9 @@ def efmuisoRecoSequence( RoIs, Muons ): from TrigInDetConfig.InDetSetup import makeInDetAlgs viewAlgs = makeInDetAlgs(whichSignature="MuonIso",rois = RoIs) - #TrackParticlesName = "" for viewAlg in viewAlgs: efmuisoRecoSequence += viewAlg if "InDetTrigTrackParticleCreatorAlg" in viewAlg.name(): - TrackParticlesName = viewAlg.TrackParticlesName # noqa: F841 TrackCollection = viewAlg.TrackName #Precision Tracking diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/L1/Base/BunchGroupSet.py b/Trigger/TriggerCommon/TriggerMenuMT/python/L1/Base/BunchGroupSet.py index 91e4646821f199b7e77ea0d613c23317df121483..5ad746d31f14980caba4bd6ef1af3a0dc5db38f2 100644 --- a/Trigger/TriggerCommon/TriggerMenuMT/python/L1/Base/BunchGroupSet.py +++ b/Trigger/TriggerCommon/TriggerMenuMT/python/L1/Base/BunchGroupSet.py @@ -1,10 +1,9 @@ -# Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration +# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration from collections import OrderedDict as odict from itertools import groupby from AthenaCommon.Logging import logging -from TriggerJobOpts.TriggerFlags import TriggerFlags from .Limits import Limits from .L1MenuFlags import L1MenuFlags @@ -12,7 +11,7 @@ from .L1MenuFlags import L1MenuFlags log = logging.getLogger("Menu.L1.Base.BunchGroupSet") -def createMCDefaultBunchGroupSet(): +def createDefaultBunchGroupSetMC(): """ create BunchGroupSet for simulation @@ -24,14 +23,13 @@ def createMCDefaultBunchGroupSet(): return bgs -def setDefaultBunchGroupDefinition(bgs): +def createDefaultBunchGroupSet(): """ sets default bunchgroups for all menus, needed for simulation. """ - if L1MenuFlags.BunchGroupNames.statusOn: # if flag has been set # if menu defines bunchgroup names, then we generate a bunchgroup set from that - name = TriggerFlags.triggerMenuSetup().partition('_')[0] + name = L1MenuFlags.MenuSetup().partition('_')[0] bgs = BunchGroupSet(name) bgs.addBunchGroup( BunchGroupSet.BunchGroup(name = 'BCRVeto', internalNumber = 0).addRange(0,3539).addRange(3561,3563).normalize() )\ .addBunchGroup( BunchGroupSet.BunchGroup(name = 'Paired', internalNumber = 1).addTrain(0,3564).normalize() ) @@ -41,7 +39,9 @@ def setDefaultBunchGroupDefinition(bgs): for i,bgname in enumerate(bunchgroupnames): bgs.bunchGroups[i].name = bgname else: - bgs = createMCDefaultBunchGroupSet() + bgs = createDefaultBunchGroupSetMC() + + return bgs class BunchGroupSet(object): @@ -99,6 +99,7 @@ class BunchGroupSet(object): def __len__(self): return len(self.bunchGroups) + @classmethod def partitioning(cls): first = L1MenuFlags.BunchGroupPartitioning() @@ -107,10 +108,6 @@ class BunchGroupSet(object): return partitioning - def setDefaultBunchGroupDefinition(self): - setDefaultBunchGroupDefinition(self) - - def resize(self, newsize): if type(self.bunchGroups) != list: self.bunchGroups = [] @@ -136,11 +133,7 @@ class BunchGroupSet(object): def json(self): confObj = odict() for bg in self.bunchGroups: - if bg: - confObj["BGRP%i" % bg.internalNumber] = bg.json() - else: - confObj["BGRP%i" % bg.internalNumber] = bg.json() - + confObj["BGRP%i" % bg.internalNumber] = bg.json() return confObj def writeJSON(self, outputFile, destdir="./", pretty=True): diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/L1/Base/L1Menu.py b/Trigger/TriggerCommon/TriggerMenuMT/python/L1/Base/L1Menu.py index ec5ddd605fdc385854904f391c8f3742a885d6ee..645350d48005bd71e24c4a48d978dd70d4f4e160 100644 --- a/Trigger/TriggerCommon/TriggerMenuMT/python/L1/Base/L1Menu.py +++ b/Trigger/TriggerCommon/TriggerMenuMT/python/L1/Base/L1Menu.py @@ -43,9 +43,6 @@ class L1Menu(object): self.items.menuName = smk_psk_Name["smkName"] self.items.pssName = smk_psk_Name["pskName"] - - - @staticmethod def partitioning(): from Lvl1Flags import Lvl1Flags @@ -71,6 +68,7 @@ class L1Menu(object): def addTopoAlgo(self, algo, category): + algo.setThresholds( self.thresholds ) self.topoAlgos.addAlgo(algo, category) diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/L1/Base/L1MenuFlags.py b/Trigger/TriggerCommon/TriggerMenuMT/python/L1/Base/L1MenuFlags.py index 17751fa6545a07bd17d10bdea77b42b9e9e44081..cdaa6760a538d7b54d25d70c29773b3407a21008 100644 --- a/Trigger/TriggerCommon/TriggerMenuMT/python/L1/Base/L1MenuFlags.py +++ b/Trigger/TriggerCommon/TriggerMenuMT/python/L1/Base/L1MenuFlags.py @@ -1,135 +1,81 @@ -# Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration +# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration -""" -Lvl1 menu specific flags -""" - -from AthenaCommon.JobProperties import JobProperty, JobPropertyContainer -from AthenaCommon.Logging import logging +__doc__="Level 1 specific configuration for L1 Run 3" from .Limits import Limits +from collections import Iterable, OrderedDict +import six -__doc__="Level 1 specific flags for Run 3" - -log = logging.getLogger('Menu.L1.Base.L1MenuFlags') - -_flags = [] - -class CTPVersion(JobProperty): +class FlagWrapper: """ - Version of the CTP configuration - Run 2: version 4 (and 5 for a short period in 2015) - Run 3: version 4 + this is to support the old functionality of calling and setting statusOn for flags """ - statusOn = True - allowedTypes = [int] - allowedValues = [0,1,2,3,4,5,6] - StoredValue = 4 - Limits.setLimits(4) - - def _do_action(self): - """Load the limits""" - Limits.setLimits(self.get_Value()) - -_flags.append(CTPVersion) - - -class items(JobProperty): - """Names of items enabled in the selected L1 menu""" - statusOn=True - allowedTypes=['list'] - StoredValue=[] - -_flags.append(items) - - - -class boards(JobProperty): - from collections import OrderedDict as odict - """Names of thresholds enabled in selected L1 menu """ - statusOn=True - allowedTypes=['OrderDict'] - StoredValue = odict() - -_flags.append(boards) - - -class legacyBoards(JobProperty): - from collections import OrderedDict as odict - """Names of thresholds enabled in selected L1 menu """ - statusOn=True - allowedTypes=['OrderDict'] - StoredValue = odict() - -_flags.append(legacyBoards) - - -class prescales(JobProperty): - """Maps prescales to items that are different from 1""" - statusOn=True - allowedTypes=['dict'] - StoredValue = {} - -_flags.append(prescales) - -class RemapThresholdsAsListed(JobProperty): - statusOn = True - allowedTypes = ['bool'] - StoredValue = False - -_flags.append(RemapThresholdsAsListed) - -class CtpIdMap(JobProperty): - statusOn = True - allowedTypes = ['dict'] - StoredValue = {} - -_flags.append(CtpIdMap) - -class BunchGroupPartitioning(JobProperty): - statusOn = True - allowedTypes = ['list'] - StoredValue = [] - -_flags.append(BunchGroupPartitioning) - -class BunchGroupNames(JobProperty): - statusOn = False - allowedTypes = ['list'] - StoredValue = [] - -_flags.append(BunchGroupNames) - -class MenuPartitioning(JobProperty): - statusOn = True - allowedTypes = ['list'] - StoredValue = [] - -_flags.append(MenuPartitioning) - - - - - - -class L1MenuFlags(JobPropertyContainer): - """ L1 flags used in menu generation """ - - -# execute - -from TriggerJobOpts.TriggerFlags import TriggerFlags -TriggerFlags.add_Container(L1MenuFlags) - -for flag in _flags: - TriggerFlags.L1MenuFlags.add_JobProperty(flag) -del _flags - - -# make an alias -L1MenuFlags = TriggerFlags.L1MenuFlags - - + def __init__(self, name, value, cls): + self.name = name + self.value = value + self.cls = cls + def __call__(self): + return self.value + def statusOn(self): + return self.name in self.cls.statusOn + def setStatusOn(self, on = True): + if on: + self.cls.statusOn.add(self.name) + else: + self.cls.statusOn.remove(self.name) + +class L1MenuFlagsCont(object): + + class FlagArgs: + def __init__( self, val_type, val_default = None, val_check = None, action = None ): + self.val_type = val_type + self.val_default = val_default + self.val_check = val_check + self.action = action + + statusOn = set() + + __slots__ = { + "MenuSetup" : FlagArgs( six.string_types ), + "CTPVersion" : FlagArgs( int, 4, val_check = lambda x: x in range(5), action = lambda x: Limits.setLimits(x) ), + "BunchGroupPartitioning" : FlagArgs( Iterable, val_check = lambda x: len(filter(lambda y: y not in range(16), x))==0 ), + "BunchGroupNames" : FlagArgs( Iterable, val_check = lambda x: len(filter(lambda y: not isinstance(y, six.string_types), x))==0), + "MenuPartitioning" : FlagArgs( Iterable, val_check = lambda x: len(filter(lambda y: y not in range(512), x))==0 ), + "items" : FlagArgs( Iterable, val_check = lambda x: len(filter(lambda y: not isinstance(y, six.string_types), x))==0), + "boards" : FlagArgs( OrderedDict, OrderedDict() ), + "legacyBoards" : FlagArgs( OrderedDict, OrderedDict() ), + "prescales" : FlagArgs( dict, dict() ), + "RemapThresholdsAsListed" : FlagArgs( bool, False ), + "CtpIdMap" : FlagArgs( dict, dict() ), + } + + def __setattr__(self, attr, value): + # set the object + object.__setattr__(self, attr, value) + d = L1MenuFlagsCont.__slots__[attr] + # check the type + if not isinstance(value, d.val_type): + raise TypeError("L1MenuFlags.%s type check failed for %r. Type needs to be '%s'" % ( attr, value, d.valtype.__name__)) + # check the values + if d.val_check and not d.val_check(value): + raise ValueError("L1MenuFlags.%s value check failed for %r" % ( attr, value)) + + if d.action: + d.action(value) + L1MenuFlagsCont.statusOn.add(attr) + + def __getattribute__(self,attr): + if attr in L1MenuFlagsCont.__slots__: + try: + object.__getattribute__(self,attr) + except AttributeError: + if L1MenuFlagsCont.__slots__[attr].val_default is not None: + object.__setattr__(self, attr, L1MenuFlagsCont.__slots__[attr].val_default) + return FlagWrapper(attr, object.__getattribute__(self,attr), L1MenuFlagsCont) + else: + return object.__getattribute__(self,attr) + + +L1MenuFlags = L1MenuFlagsCont() - diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/L1/Base/MenuConfObj.py b/Trigger/TriggerCommon/TriggerMenuMT/python/L1/Base/MenuConfObj.py index e0e9a255e6e3483a9f61b91d75ce6981cfbe9a1c..c8a591d92c4760ae998b9088bf09095eb8a6a6bd 100644 --- a/Trigger/TriggerCommon/TriggerMenuMT/python/L1/Base/MenuConfObj.py +++ b/Trigger/TriggerCommon/TriggerMenuMT/python/L1/Base/MenuConfObj.py @@ -20,5 +20,8 @@ class TopoMenuDef: self.outputlines = outputlines self.outputbits = outputbits + def __repr__(self): + return self.algoname + def isMultiplicityDefinition(self): return self.algoname.startswith("Mult") diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/L1/Base/Thresholds.py b/Trigger/TriggerCommon/TriggerMenuMT/python/L1/Base/Thresholds.py index c4cd7c7b10cfda02f27c36ed51f2c8a0311dec9a..9a73f33e0b13962000180cfe12417cfe40ba13f2 100644 --- a/Trigger/TriggerCommon/TriggerMenuMT/python/L1/Base/Thresholds.py +++ b/Trigger/TriggerCommon/TriggerMenuMT/python/L1/Base/Thresholds.py @@ -60,6 +60,9 @@ class MenuThresholdsCollection( object ): return set([thr.name for thr in self if thr.ttype == ttype]) + def typeWideThresholdConfig(self, ttype): + return getTypeWideThresholdConfig(ttype) + def json(self): confObj = odict() for ttype in (ThrType.Run3Types() + ThrType.NIMTypes() + [ThrType.TOPO, ThrType.MUTOPO, ThrType.MULTTOPO ]): @@ -75,7 +78,7 @@ class MenuThresholdsCollection( object ): raise RuntimeError("Run 3 threshold %s is of unsupported type %s" % (thr.name, thr.ttype.name)) # add extra information to each type of threshold (e.g. isolation definition, min pt for objects, etc.) for ttype in ThrType.Run3Types(): - confObj[ttype.name].update( getTypeWideThresholdConfig(ttype) ) + confObj[ttype.name].update( self.typeWideThresholdConfig(ttype) ) return confObj @@ -91,7 +94,7 @@ class MenuThresholdsCollection( object ): if thr.ttype.name in confObj: confObj[thr.ttype.name]["thresholds"][thr.name] = thr.json() for ttype in ThrType.LegacyTypes(): - confObj[ttype.name].update( getTypeWideThresholdConfig(ttype) ) + confObj[ttype.name].update( self.typeWideThresholdConfig(ttype) ) return confObj @@ -112,7 +115,7 @@ class Threshold( object ): self.mapping = int(mapping) self.run = int(run) self.thresholdValues = [] - + if Threshold.l1configForRegistration: Threshold.l1configForRegistration.registerThreshold(self) diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/L1/Base/TopoAlgos.py b/Trigger/TriggerCommon/TriggerMenuMT/python/L1/Base/TopoAlgos.py index 2336bc84779050958c9ea416a455719f150aee71..9dbf59dfbf449d626c72553e173cbbf251c3793b 100644 --- a/Trigger/TriggerCommon/TriggerMenuMT/python/L1/Base/TopoAlgos.py +++ b/Trigger/TriggerCommon/TriggerMenuMT/python/L1/Base/TopoAlgos.py @@ -4,6 +4,8 @@ from AthenaCommon.Logging import logging from TriggerJobOpts.TriggerFlags import TriggerFlags import re +from .ThresholdType import ThrType + log = logging.getLogger("Menu.L1.Base.TopoAlgos") class TopoAlgo(object): @@ -30,6 +32,9 @@ class TopoAlgo(object): def isMultiplicityAlg(self): return False + def setThresholds(self, thresholds): + # link to all thresholds in the menu need for configuration + self.menuThr = thresholds def addvariable(self, name, value, selection = -1): if name in self._availableVars: @@ -52,12 +57,8 @@ class TopoAlgo(object): return confObj def getEnergyScaleEM(self): - emscale=2 - if hasattr(TriggerFlags, 'useRun1CaloEnergyScale'): - if TriggerFlags.useRun1CaloEnergyScale : - emscale=1 - log.info("Trigger flag useRun1CaloEnergyScale was set to true. Using EM energy scale %i", emscale) - return emscale + tw = self.menuThr.typeWideThresholdConfig(ThrType["EM"]) + return tw["emscale"] class Variable(object): def __init__(self, name, selection, value): diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/L1/Config/ItemDef.py b/Trigger/TriggerCommon/TriggerMenuMT/python/L1/Config/ItemDef.py index 02a93afae728fc7c3b3303e1263fef47148859a9..55703e7679e1be114911abae12a11c701eb61f67 100644 --- a/Trigger/TriggerCommon/TriggerMenuMT/python/L1/Config/ItemDef.py +++ b/Trigger/TriggerCommon/TriggerMenuMT/python/L1/Config/ItemDef.py @@ -9,7 +9,7 @@ from collections import defaultdict as ddict import re, sys import traceback -from TriggerJobOpts.TriggerFlags import TriggerFlags +from ..Base.L1MenuFlags import L1MenuFlags from AthenaCommon.Logging import logging log = logging.getLogger('Menu.L1.Config.ItemDef') @@ -32,16 +32,16 @@ class ItemDef: @staticmethod - def registerItems(tc): + def registerItems(tc, menuName): """Register L1 items for further use""" # define local flag for menu version - isV6 = '_v6' in TriggerFlags.triggerMenuSetup() - isV7 = '_v7' in TriggerFlags.triggerMenuSetup() - isV8 = '_v8' in TriggerFlags.triggerMenuSetup() or 'LS2_v1'==TriggerFlags.triggerMenuSetup() or 'run3_v1' in TriggerFlags.triggerMenuSetup() - isHI = '_HI' in TriggerFlags.triggerMenuSetup() and 'HI_run3_v1' not in TriggerFlags.triggerMenuSetup() - isHIV5 = 'HI_v5' in TriggerFlags.triggerMenuSetup() - isPhaseII = '_PhaseII' in TriggerFlags.triggerMenuSetup() + isV6 = '_v6' in menuName + isV7 = '_v7' in menuName + isV8 = '_v8' in menuName or 'LS2_v1'==menuName or 'run3_v1' in menuName + isHI = '_HI' in menuName and 'HI_run3_v1' not in menuName + isHIV5 = 'HI_v5' in menuName + isPhaseII = '_PhaseII' in menuName class d: pass @@ -712,7 +712,7 @@ class ItemDef: MenuItem('L1_3jJ15.0ETA25_gXERHO40' ).setLogic( d.jJ150ETA25.x(3) & d.gXERHO40 & physcond).setTriggerType(TT.calo) # MenuItem('L1_ZB_J20').setLogic(d.ZB_EM15 & d.J20 & physcond).setTriggerType(TT.zerobs) - if ('Physics_HI_v' in TriggerFlags.triggerMenuSetup() or 'MC_HI_v' in TriggerFlags.triggerMenuSetup()): + if ('Physics_HI_v' in menuName or 'MC_HI_v' in menuName): MenuItem('L1_ZB', ctpid=240).setLogic(d.ZB_J75 & physcond).setTriggerType(TT.zerobs) else: MenuItem('L1_ZB', ctpid=240).setLogic(d.ZB_EM15 & physcond).setTriggerType(TT.zerobs) diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/L1/Config/ThresholdDef.py b/Trigger/TriggerCommon/TriggerMenuMT/python/L1/Config/ThresholdDef.py index 0de6feb71d129e2b0b7cc4075a93ff709f2233fc..1ffd30c77f9d02d76edcf5669e88097139a0a488 100644 --- a/Trigger/TriggerCommon/TriggerMenuMT/python/L1/Config/ThresholdDef.py +++ b/Trigger/TriggerCommon/TriggerMenuMT/python/L1/Config/ThresholdDef.py @@ -1,9 +1,5 @@ # Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration -from TriggerJobOpts.TriggerFlags import TriggerFlags -from AthenaCommon.Logging import logging -log = logging.getLogger('Menu.L1.Config.ThresholdDef') - from ..Base.Thresholds import Threshold, MuonThreshold, EMThreshold, TauThreshold, JetThreshold, XEThreshold, MBTSThreshold, MBTSSIThreshold, NimThreshold, ThresholdValue class ThresholdDef: @@ -11,7 +7,9 @@ class ThresholdDef: alreadyExecuted = False @staticmethod - def registerThresholds(tc): + def registerThresholds(tc, menuName): + + isV6 = '_v6' in menuName if ThresholdDef.alreadyExecuted: raise RuntimeError("Calling ThresholdDef.registerThresholds twice") @@ -228,7 +226,7 @@ class ThresholdDef: ## AFP - if '_v6' in TriggerFlags.triggerMenuSetup(): + if isV6: NimThreshold('AFP_NSC', 'NIM', mapping=2) NimThreshold('AFP_FSC', 'NIM', mapping=3) NimThreshold('AFP_NSA', 'NIM', mapping=4) diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/L1/Config/ThresholdDefLegacy.py b/Trigger/TriggerCommon/TriggerMenuMT/python/L1/Config/ThresholdDefLegacy.py index 94cf55abfc63b2fa44ac9e48c22ac26fd88bfa68..255f1e677e5499779ec2caaa1f2dee8edd60c303 100644 --- a/Trigger/TriggerCommon/TriggerMenuMT/python/L1/Config/ThresholdDefLegacy.py +++ b/Trigger/TriggerCommon/TriggerMenuMT/python/L1/Config/ThresholdDefLegacy.py @@ -1,25 +1,19 @@ # Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration -from TriggerJobOpts.TriggerFlags import TriggerFlags -from AthenaCommon.Logging import logging - from ..Base.Thresholds import LegacyThreshold, ZeroBiasThreshold, ThresholdValue from ..Base.Limits import CaloLimits as CL -log = logging.getLogger('Menu.L1.Config.ThresholdDefLegacy') - - class ThresholdDefLegacy: alreadyExecuted = False @staticmethod - def registerThresholds(tc): + def registerThresholds(tc, menuName): - isV6 = '_v6' in TriggerFlags.triggerMenuSetup() - isV8 = '_v8' in TriggerFlags.triggerMenuSetup() or 'LS2_v1'==TriggerFlags.triggerMenuSetup() or 'run3_v1' in TriggerFlags.triggerMenuSetup() - isHI = '_HI' in TriggerFlags.triggerMenuSetup() and 'HI_run3_v1' not in TriggerFlags.triggerMenuSetup() + isV6 = '_v6' in menuName + isV8 = '_v8' in menuName or 'LS2_v1' == menuName or 'run3_v1' in menuName + isHI = '_HI' in menuName and 'HI_run3_v1' not in menuName if ThresholdDefLegacy.alreadyExecuted: @@ -371,7 +365,7 @@ class ThresholdDefLegacy: for thrV in [30, 35, 40, 45, 50, 55, 60, 70, 80]: LegacyThreshold('XE%i.0ETA%i' % (thrV, etamax), 'XE').addThrValue(CL.EtMissOff).addThrValue( thrV, etamin = -etamax, etamax = etamax, priority=1) - # Restricted range TE |eta|<4.9 + # Restricted range TE |eta|<4.9 etamax = 49 for thrV in [3, 7, 500, 600, 1500, 3000, 3500, 5000, 6500, 8000, 9000]: LegacyThreshold('TE%i.0ETA%i' % (thrV, etamax), 'TE').addThrValue(CL.EtSumOff).addThrValue( thrV, etamin = -etamax, etamax = etamax, priority=1) diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/L1/Config/TopoAlgoDef.py b/Trigger/TriggerCommon/TriggerMenuMT/python/L1/Config/TopoAlgoDef.py index e00477a920678f93a207e1a73fceadc446e3f7ed..3718d0784c9ef483df58dd2b9259975d00b58047 100644 --- a/Trigger/TriggerCommon/TriggerMenuMT/python/L1/Config/TopoAlgoDef.py +++ b/Trigger/TriggerCommon/TriggerMenuMT/python/L1/Config/TopoAlgoDef.py @@ -1,6 +1,6 @@ # Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration -from TriggerJobOpts.TriggerFlags import TriggerFlags +from .TypeWideThresholdConfig import getTypeWideThresholdConfig # algorithm python base classes generated from C++ code import L1TopoAlgorithms.L1TopoAlgConfig as AlgConf @@ -25,11 +25,7 @@ class TopoAlgoDef: log.debug("usev7 %r", usev7) log.debug("usev8 %r", usev8) - _emscale_for_decision = 2 # global scale for EM, TAU - if hasattr(TriggerFlags, 'useRun1CaloEnergyScale'): - if TriggerFlags.useRun1CaloEnergyScale : - _emscale_for_decision=1 - log.debug("Changed mscale_for_decision %s for Run1CaloEnergyScale", _emscale_for_decision) + _emscale_for_decision = getTypeWideThresholdConfig("EM")["emscale"] alg = AlgConf.ClusterNoSort( name = 'EMall', inputs = 'ClusterTobArray', outputs = 'EMall', algoId = currentAlgoId) currentAlgoId += 1 @@ -395,7 +391,7 @@ class TopoAlgoDef: pass for k in x: setattr (d, k, x[k]) - + inputList = d.otype + d.olist toponames=[] @@ -585,7 +581,7 @@ class TopoAlgoDef: algolist=[ {"minDr": 0, "maxDr": 28, "otype1" : "MU" ,"ocut1": 10, "olist1" : "ab", "nleading1": HW.OutputWidthSelectMU, "inputwidth1": HW.OutputWidthSelectMU, "otype2" : "TAU", "ocut2": 12, "olist2" : "abi", "nleading2": HW.OutputWidthSelectTAU, "inputwidth2": HW.OutputWidthSelectTAU}, # 0DR28-MU10ab-TAU12abi {"minDr": 0, "maxDr": 28, "otype1" : "TAU" ,"ocut1": 20, "olist1" : "abi","nleading1": HW.OutputWidthSelectTAU, "inputwidth1": HW.OutputWidthSelectTAU,"otype2" : "TAU", "ocut2": 12, "olist2" : "abi", "nleading2": HW.OutputWidthSelectTAU, "inputwidth2": HW.OutputWidthSelectTAU}, # 0DR28-TAU20abi-TAU12abi - {"minDr": 0, "maxDr": 25, "otype1" : "TAU" ,"ocut1": 20, "olist1" : "abi","nleading1": HW.OutputWidthSelectTAU, "inputwidth1": HW.OutputWidthSelectTAU,"otype2" : "TAU", "ocut2": 12, "olist2" : "abi", "nleading2": HW.OutputWidthSelectTAU, "inputwidth2": HW.OutputWidthSelectTAU}, # 0DR25-TAU20abi-TAU12abi + {"minDr": 0, "maxDr": 25, "otype1" : "TAU" ,"ocut1": 20, "olist1" : "abi","nleading1": HW.OutputWidthSelectTAU, "inputwidth1": HW.OutputWidthSelectTAU,"otype2" : "TAU", "ocut2": 12, "olist2" : "abi", "nleading2": HW.OutputWidthSelectTAU, "inputwidth2": HW.OutputWidthSelectTAU}, # 0DR25-TAU20abi-TAU12abi ] @@ -1771,7 +1767,7 @@ class TopoAlgoDef: pass for k in x: setattr (d, k, x[k]) - + inputList = d.otype + d.olist toponame = "%iINVM%i-%s%s%s-%s%s" % (d.minInvm, d.maxInvm, d.otype, str(d.ocut1) , d.olist, @@ -1835,7 +1831,7 @@ class TopoAlgoDef: pass for k in x: setattr (d, k, x[k]) - + inputList = [d.otype1 + d.olist1, d.otype2 + d.olist1] toponames=[] diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/L1/Config/TopoAlgoDefLegacy.py b/Trigger/TriggerCommon/TriggerMenuMT/python/L1/Config/TopoAlgoDefLegacy.py index 78e34df36d13e79e2503bd1afb557a7a780de1f7..7668c27306d1bc360bd602462f52b56e28ee94e0 100644 --- a/Trigger/TriggerCommon/TriggerMenuMT/python/L1/Config/TopoAlgoDefLegacy.py +++ b/Trigger/TriggerCommon/TriggerMenuMT/python/L1/Config/TopoAlgoDefLegacy.py @@ -1,6 +1,6 @@ # Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration -from TriggerJobOpts.TriggerFlags import TriggerFlags +from .TypeWideThresholdConfig import getTypeWideThresholdConfig # algorithm python base classes generated from C++ code import L1TopoAlgorithms.L1TopoAlgConfig as AlgConf @@ -23,11 +23,7 @@ class TopoAlgoDefLegacy: log.debug("usev7 %r", usev7) log.debug("usev8 %r", usev8) - _emscale_for_decision = 2 # global scale for EM, TAU - if hasattr(TriggerFlags, 'useRun1CaloEnergyScale'): - if TriggerFlags.useRun1CaloEnergyScale : - _emscale_for_decision=1 - log.debug("Changed mscale_for_decision %s for Run1CaloEnergyScale", _emscale_for_decision) + _emscale_for_decision = getTypeWideThresholdConfig("EM")["emscale"] alg = AlgConf.ClusterNoSort( name = 'EMall', inputs = 'ClusterTobArray', outputs = 'EMall', algoId = currentAlgoId) currentAlgoId += 1 @@ -394,7 +390,7 @@ class TopoAlgoDefLegacy: pass for k in x: setattr (d, k, x[k]) - + inputList = d.otype + d.olist toponames=[] @@ -584,7 +580,7 @@ class TopoAlgoDefLegacy: algolist=[ {"minDr": 0, "maxDr": 28, "otype1" : "MU" ,"ocut1": 10, "olist1" : "ab", "nleading1": HW.OutputWidthSelectMU, "inputwidth1": HW.OutputWidthSelectMU, "otype2" : "TAU", "ocut2": 12, "olist2" : "abi", "nleading2": HW.OutputWidthSelectTAU, "inputwidth2": HW.OutputWidthSelectTAU}, # 0DR28-MU10ab-TAU12abi {"minDr": 0, "maxDr": 28, "otype1" : "TAU" ,"ocut1": 20, "olist1" : "abi","nleading1": HW.OutputWidthSelectTAU, "inputwidth1": HW.OutputWidthSelectTAU,"otype2" : "TAU", "ocut2": 12, "olist2" : "abi", "nleading2": HW.OutputWidthSelectTAU, "inputwidth2": HW.OutputWidthSelectTAU}, # 0DR28-TAU20abi-TAU12abi - {"minDr": 0, "maxDr": 25, "otype1" : "TAU" ,"ocut1": 20, "olist1" : "abi","nleading1": HW.OutputWidthSelectTAU, "inputwidth1": HW.OutputWidthSelectTAU,"otype2" : "TAU", "ocut2": 12, "olist2" : "abi", "nleading2": HW.OutputWidthSelectTAU, "inputwidth2": HW.OutputWidthSelectTAU}, # 0DR25-TAU20abi-TAU12abi + {"minDr": 0, "maxDr": 25, "otype1" : "TAU" ,"ocut1": 20, "olist1" : "abi","nleading1": HW.OutputWidthSelectTAU, "inputwidth1": HW.OutputWidthSelectTAU,"otype2" : "TAU", "ocut2": 12, "olist2" : "abi", "nleading2": HW.OutputWidthSelectTAU, "inputwidth2": HW.OutputWidthSelectTAU}, # 0DR25-TAU20abi-TAU12abi ] @@ -1794,7 +1790,7 @@ class TopoAlgoDefLegacy: pass for k in x: setattr (d, k, x[k]) - + inputList = d.otype + d.olist toponame = "%iINVM%i-%s%s%s-%s%s" % (d.minInvm, d.maxInvm, d.otype, str(d.ocut1) , d.olist, @@ -1860,7 +1856,7 @@ class TopoAlgoDefLegacy: pass for k in x: setattr (d, k, x[k]) - + inputList = [d.otype1 + d.olist1, d.otype2 + d.olist1] toponames=[] diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/L1/Config/TypeWideThresholdConfig.py b/Trigger/TriggerCommon/TriggerMenuMT/python/L1/Config/TypeWideThresholdConfig.py index d443ce9cd20dec175edd45cb08a14674b67ddd7d..14c5443d379bc965865281f142937f8612eefc5e 100644 --- a/Trigger/TriggerCommon/TriggerMenuMT/python/L1/Config/TypeWideThresholdConfig.py +++ b/Trigger/TriggerCommon/TriggerMenuMT/python/L1/Config/TypeWideThresholdConfig.py @@ -1,5 +1,6 @@ # Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration +import six from collections import OrderedDict as odict from AthenaCommon.Logging import logging @@ -8,6 +9,9 @@ log = logging.getLogger('Menu.L1.Config.TypeWideThresholdConfig') from ..Base.ThresholdType import ThrType def getTypeWideThresholdConfig(ttype): + if isinstance(ttype,six.string_types): + ttype = ThrType[ttype] + if ttype == ThrType.MU: return getConfig_MU() if ttype == ThrType.eEM: diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/L1/L1MenuConfig.py b/Trigger/TriggerCommon/TriggerMenuMT/python/L1/L1MenuConfig.py index 36bef4c52eb5ab1795b05b151cbfdc5999417524..10715faf01bc9b8706dcf1cd385da8abd1f4901f 100644 --- a/Trigger/TriggerCommon/TriggerMenuMT/python/L1/L1MenuConfig.py +++ b/Trigger/TriggerCommon/TriggerMenuMT/python/L1/L1MenuConfig.py @@ -1,9 +1,8 @@ -# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration +6# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration import re from collections import defaultdict as ddict -from TriggerJobOpts.TriggerFlags import TriggerFlags from AthenaCommon.Logging import logging from .Base.L1MenuFlags import L1MenuFlags @@ -33,12 +32,14 @@ log = logging.getLogger("Menu.L1.L1MenuConfig") class L1MenuConfig(object): - def __init__(self, menuName = None, outputFile = None , inputFile = None ): + def __init__(self, menuName, inputFile = None ): + + L1MenuFlags.MenuSetup = menuName + + self.menuFullName = L1MenuFlags.MenuSetup() - self.menuFullName = menuName if menuName else TriggerFlags.triggerMenuSetup() self.menuName = self._getMenuBaseName(self.menuFullName) self.inputFile = inputFile - self.outputFile = outputFile if outputFile else TriggerFlags.inputLVL1configFile() self.l1menuFromFile = (self.inputFile is not None) self.generated = False @@ -56,6 +57,7 @@ class L1MenuConfig(object): self._definedTopoAlgos[cat] = {} # menu + L1MenuFlags.CTPVersion = 4 # this needs to be done here already, since L1Menu depends on it during init self.l1menu = L1Menu(self.menuName) self.l1menu.setBunchGroupSplitting() # I like this much more, but let's see what the menu group says @@ -329,14 +331,14 @@ class L1MenuConfig(object): log.info("Reading TriggerMenuMT.Config.ThreholdDef") from .Config.ThresholdDef import ThresholdDef - ThresholdDef.registerThresholds(self) + ThresholdDef.registerThresholds(self, self.menuFullName) log.info("... registered %i calo thresholds", self._definedThresholdsStats["calo"]) log.info("... registered %i muon thresholds", self._definedThresholdsStats["muon"]) log.info("... registered %i nim thresholds", self._definedThresholdsStats["nim"]) log.info("Reading TriggerMenuMT.Config.ThreholdDefLegacy") from .Config.ThresholdDefLegacy import ThresholdDefLegacy - ThresholdDefLegacy.registerThresholds(self) + ThresholdDefLegacy.registerThresholds(self, self.menuFullName) log.info("... registered %i legacy calo thresholds", self._definedThresholdsStats["legacy"]) log.info("Turning topo algo outputs into thresholds (except multiplicity counters)") @@ -347,7 +349,7 @@ class L1MenuConfig(object): log.info("Reading TriggerMenuMT.Config.ItemDef") from .Config.ItemDef import ItemDef - ItemDef.registerItems(self) + ItemDef.registerItems(self, self.menuFullName) log.info("... registered %i defined items", len(self.registeredItems)) @@ -486,8 +488,8 @@ class L1MenuConfig(object): # ------------------ # Bunchgroups # ------------------ - - self.l1menu.ctp.bunchGroupSet.setDefaultBunchGroupDefinition() + from .Base.BunchGroupSet import createDefaultBunchGroupSet + self.l1menu.ctp.bunchGroupSet = createDefaultBunchGroupSet() # ------------------ @@ -496,6 +498,7 @@ class L1MenuConfig(object): # build list of items for the menu from the list of requested names itemsForMenu = [] + ctpIdMap = L1MenuFlags.CtpIdMap() for itemName in L1MenuFlags.items(): registeredItem = self.getRegisteredItem(itemName) if registeredItem is None: @@ -503,8 +506,8 @@ class L1MenuConfig(object): log.error(msg) raise RuntimeError(msg) - if itemName in L1MenuFlags.CtpIdMap(): - newCTPID = L1MenuFlags.CtpIdMap()[itemName] + if itemName in ctpIdMap: + newCTPID = ctpIdMap[itemName] registeredItem.setCtpid(newCTPID) itemsForMenu += [ registeredItem ] diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/L1/Menu/MenuMapping.py b/Trigger/TriggerCommon/TriggerMenuMT/python/L1/Menu/MenuMapping.py index 01a9710bff6b72e336b5e3d7a745eb5bdb9a5759..56e590f3c1ea90fd333d727d05113dd01264cd56 100644 --- a/Trigger/TriggerCommon/TriggerMenuMT/python/L1/Menu/MenuMapping.py +++ b/Trigger/TriggerCommon/TriggerMenuMT/python/L1/Menu/MenuMapping.py @@ -1,3 +1,11 @@ +# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration + +""" +This map specifies with menu to load from TriggerMenuMT/python/L1/Menu + +The mapping takes precedence over the existence of the menu definition file in the above directory +The resolved name is also being used in the L1/Config/ItemDef.py and L1/Config/ThresholdDef*.py files +""" menuMap = { "LS2_v1" : "MC_pp_v8", diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/L1/Menu/Menu_MC_pp_v8.py b/Trigger/TriggerCommon/TriggerMenuMT/python/L1/Menu/Menu_MC_pp_v8.py index eb86eb2d30f1e5c8b3d3ee1d9b8ac23fcf5da967..3989732ab3bd87a3ca45fe43d573652f2d4e0406 100644 --- a/Trigger/TriggerCommon/TriggerMenuMT/python/L1/Menu/Menu_MC_pp_v8.py +++ b/Trigger/TriggerCommon/TriggerMenuMT/python/L1/Menu/Menu_MC_pp_v8.py @@ -52,7 +52,7 @@ def defineMenu(): # multi lepton e+mu ## 'L1_2EM3', 'L1_2EM7', 'L1_2EM10VH', 'L1_2EM15', 'L1_2EM15VH', - 'L1_2EM20VH', 'L1_EM7_2EM3', 'L1_EM12_2EM3', 'L1_EM15VH_3EM7', 'L1_EM20VH_3EM10VH', + 'L1_2EM20VH', 'L1_EM7_2EM3', 'L1_EM12_2EM3', 'L1_EM15VH_3EM7', 'L1_EM20VH_3EM10VH', 'L1_EM7_MU10', 'L1_2MU4', 'L1_2MU6', 'L1_2MU10', 'L1_2MU20_OVERLAY', 'L1_MU10_2MU6', 'L1_MU11_2MU6', 'L1_3MU4', 'L1_MU6_2MU4', 'L1_3MU6', 'L1_4MU4', 'L1_MU6_3MU4', 'L1_2MU6_3MU4', 'L1_2MU11', 'L1_MU11_2MU10', 'L1_2EM8VH_MU10', 'L1_EM15VH_MU10', 'L1_EM7_MU20', 'L1_EM8VH_MU20', 'L1_EM8I_MU10', @@ -143,8 +143,8 @@ def defineMenu(): # multi jet - 'L1_J45.0ETA20_3J15.0ETA25', - 'L1_J50_2J40.0ETA25_3J15.0ETA25', + 'L1_J45.0ETA20_3J15.0ETA25', + 'L1_J50_2J40.0ETA25_3J15.0ETA25', 'L1_3J15', 'L1_3J40', 'L1_3J50', 'L1_4J15', 'L1_4J20', 'L1_4J20.0ETA49', 'L1_3J15.0ETA25_XE40', @@ -436,7 +436,7 @@ def defineMenu(): 'L1_EM7_2EM3' : 29, 'L1_EM12_2EM3' : 30, 'L1_EM15VH_3EM7' : 31, - 'L1_2EM20VH':400, + 'L1_2EM20VH':400, 'L1_EM20VH_3EM10VH':431, 'L1_2MU4' : 32, 'L1_2MU6' : 33, diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/LVL1MenuConfig/LVL1Menu/L1Seeds.py b/Trigger/TriggerCommon/TriggerMenuMT/python/LVL1MenuConfig/LVL1Menu/L1Seeds.py index 34bc76d2c0d48685ad2a3d6f8d5359d9e03965f7..e0b9ff63e96f9ff06defe8ff2cb59951d41fca76 100644 --- a/Trigger/TriggerCommon/TriggerMenuMT/python/LVL1MenuConfig/LVL1Menu/L1Seeds.py +++ b/Trigger/TriggerCommon/TriggerMenuMT/python/LVL1MenuConfig/LVL1Menu/L1Seeds.py @@ -406,7 +406,7 @@ def getInputTEfromL1Item(l1item): 'L1_TAU8_FIRSTEMPTY': ['HA8'], 'L1_TAU8_UNPAIRED_ISO': ['HA8'], 'L1_TAU8_UNPAIRED_NONISO': ['HA8'], - 'L1_TAU12_EMPTY': ['HA12'], + 'L1_TAU12_EMPTY': ['HA12'], 'L1_TAU12_FIRSTEMPTY': ['HA12'], 'L1_TAU12_UNPAIRED_ISO': ['HA12'], 'L1_RD0_FIRSTEMPTY': [''], diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/LVL1MenuConfig/LVL1Menu/Menu_LS2_v1.py b/Trigger/TriggerCommon/TriggerMenuMT/python/LVL1MenuConfig/LVL1Menu/Menu_LS2_v1.py index 636dbc90d2617ee460c5787bd003d6a4fddf744b..18683a84cca46e40f472562586f275f4e57da2ad 100644 --- a/Trigger/TriggerCommon/TriggerMenuMT/python/LVL1MenuConfig/LVL1Menu/Menu_LS2_v1.py +++ b/Trigger/TriggerCommon/TriggerMenuMT/python/LVL1MenuConfig/LVL1Menu/Menu_LS2_v1.py @@ -383,7 +383,7 @@ def defineMenu(): # multi lepton "L1_2EM3", "L1_2EM7", "L1_2EM10VH", "L1_2EM13VH", "L1_2EM15", "L1_2EM15VH", "L1_EM7_2EM3", "L1_EM12_2EM3", "L1_EM15VH_3EM7", "L1_EM15VH_3EM8VH", "L1_EM15VH_2EM10VH_3EM7", - "L1_2EM18VH", "L1_2EM20VH", "L1_EM15VH_3EM10VH", "L1_EM18VH_3EM8VH", "L1_EM18VH_2EM10VH_3EM7", "L1_EM20VH_3EM10VH", "L1_EM20VH_2EM10VH_3EM8VH", + "L1_2EM18VH", "L1_2EM20VH", "L1_EM15VH_3EM10VH", "L1_EM18VH_3EM8VH", "L1_EM18VH_2EM10VH_3EM7", "L1_EM20VH_3EM10VH", "L1_EM20VH_2EM10VH_3EM8VH", "L1_EM7_MU10", "L1_2MU4", "L1_2MU6", "L1_2MU10", "L1_2MU20_OVERLAY", "L1_MU10_2MU6", "L1_MU11_2MU6", "L1_3MU4", "L1_MU6_2MU4", "L1_3MU6", "L1_4MU4", "L1_MU6_3MU4", "L1_2MU6_3MU4", @@ -401,14 +401,14 @@ def defineMenu(): # combined tau - lepton "L1_EM15HI_2TAU12IM", "L1_EM15HI_2TAU12IM_J25_3J12", - "L1_EM15HI_TAU40_2TAU15", + "L1_EM15HI_TAU40_2TAU15", "L1_MU10_TAU12IM", "L1_MU10_TAU12IM_J25_2J12", # "L1_MU10_TAU12_J25_2J12", # "L1_MU10_TAU20", "L1_MU10_TAU20IM", "L1_MU11_TAU20IM", - "L1_MU10_TAU20IM_J25_2J20", + "L1_MU10_TAU20IM_J25_2J20", # combined tau - jet # "L1_TAU25IT_2TAU12IT_2J25_3J12", @@ -426,7 +426,7 @@ def defineMenu(): #"L1_EM15HI_2TAU12I_XE35", "L1_EM15HI_2TAU12IM_XE35", - "L1_EM15HI_TAU20IM_2TAU15_J25_2J20_3J15", + "L1_EM15HI_TAU20IM_2TAU15_J25_2J20_3J15", 'L1_EM20VHI_TAU20IM_2TAU20_J25_3J20', @@ -901,11 +901,11 @@ def defineMenu(): 'L1_EM7_2EM3' : 29, 'L1_EM12_2EM3' : 30, 'L1_EM15VH_3EM7' : 31, - 'L1_2EM18VH':398, - 'L1_2EM20VH':400, - 'L1_EM15VH_3EM10VH':401, - 'L1_EM18VH_3EM8VH':406, - 'L1_EM18VH_2EM10VH_3EM7':408, + 'L1_2EM18VH':398, + 'L1_2EM20VH':400, + 'L1_EM15VH_3EM10VH':401, + 'L1_EM18VH_3EM8VH':406, + 'L1_EM18VH_2EM10VH_3EM7':408, 'L1_EM20VH_3EM10VH':431, 'L1_EM20VH_2EM10VH_3EM8VH':432, 'L1_2MU4' : 32, @@ -1078,7 +1078,7 @@ def defineMenu(): 'L1_J40_XE60' : 176, 'L1_J40.0ETA25_XE50' : 177, 'L1_MU10_2J20' : 278, - 'L1_TAU40_2TAU20IM' : 254, + 'L1_TAU40_2TAU20IM' : 254, 'L1_MU10_2J15_J20' : 255, # freeing some CTPIDs # 'L1_MBTSA0' : 170, diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/LVL1MenuConfig/LVL1Menu/ThresholdDef.py b/Trigger/TriggerCommon/TriggerMenuMT/python/LVL1MenuConfig/LVL1Menu/ThresholdDef.py index f9b4b9b25d064729d4ca9438d2fac16a86497af3..adb3918da11d38f9562e3d3396105cac479a779d 100644 --- a/Trigger/TriggerCommon/TriggerMenuMT/python/LVL1MenuConfig/LVL1Menu/ThresholdDef.py +++ b/Trigger/TriggerCommon/TriggerMenuMT/python/LVL1MenuConfig/LVL1Menu/ThresholdDef.py @@ -302,7 +302,7 @@ class ThresholdDef(object): for thrV in [35, 40, 45, 50, 55, 60, 70, 80]: tc.registerThr('XE%i.0ETA%i' % (thrV, etamax), 'XE').addThrValue(EtMissOff).addThrValue( thrV, etamin = -etamax, etamax = etamax, priority=1) - # Restricted range TE |eta|<4.9 + # Restricted range TE |eta|<4.9 etamax = 49 for thrV in [500, 1500, 3000, 3500, 5000, 6500, 8000, 9000]: tc.registerThr('TE%i.0ETA%i' % (thrV, etamax), 'TE').addThrValue(EtSumOff).addThrValue( thrV, etamin = -etamax, etamax = etamax, priority=1) diff --git a/Trigger/TriggerCommon/TriggerMenuMT/scripts/generateL1MenuRun3.py b/Trigger/TriggerCommon/TriggerMenuMT/scripts/generateL1MenuRun3.py index 07e2163d20a48262d28b8cc8d5d4e35cb2bd6966..ef15de84de698b7e0d43e63bd10fe0e8076e51ec 100755 --- a/Trigger/TriggerCommon/TriggerMenuMT/scripts/generateL1MenuRun3.py +++ b/Trigger/TriggerCommon/TriggerMenuMT/scripts/generateL1MenuRun3.py @@ -2,7 +2,7 @@ # Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration -import sys,os +import sys def parseCmdLine(possibleMenus): @@ -11,13 +11,11 @@ def parseCmdLine(possibleMenus): # mandatory argument is the menu parser.add_argument("menu", help="the menu to generate (possible menus: %s)" % ', '.join(possibleMenus), nargs='?', default="mc8") parser.add_argument("-v", "--verbose", help="increase output verbosity", action="count", default=0) - parser.add_argument("-x", "--xml", dest="writeXML", help="enable xml file creation (currently not implemented)", action="store_true", default=False) parser.add_argument("--destdir", dest="dest", help="directory for output files", default = "./") return parser.parse_args() -def generateL1Menu(menu, cmdline): - +def generateL1Menu(menu, cmdline): # logging from AthenaCommon.Logging import logging log = logging.getLogger(sys.argv[0].split('/')[-1]) @@ -25,26 +23,16 @@ def generateL1Menu(menu, cmdline): logging.getLogger("TriggerMenuMT.LVL1.Lvl1Menu").setLevel(logging.INFO) # setup - from TriggerJobOpts.TriggerFlags import TriggerFlags - TriggerFlags.triggerMenuSetup = menu # L1 menu generation from TriggerMenuMT.L1.L1MenuConfig import L1MenuConfig - l1cfg = L1MenuConfig() + l1cfg = L1MenuConfig( menu ) from TrigConfigSvc.TrigConfigSvcCfg import getL1MenuFileName + from TriggerJobOpts.TriggerFlags import TriggerFlags + TriggerFlags.triggerMenuSetup = menu l1cfg.writeJSON( outputFile = getL1MenuFileName(), destdir = cmdline.dest) - if cmdline.writeXML: - outfilename = l1cfg.writeXML() - # consistency checker - checkResult = os.system("get_files -xmls -symlink LVL1config.dtd > /dev/null") - checkResult = os.system("xmllint --noout --dtdvalid LVL1config.dtd %s" % outfilename) - if checkResult == 0: - log.info("XML file %s is conform with LVL1config.dtd", outfilename) - else: - log.error("The XML does not follow the document type definition LVL1config.dtd") - return l1cfg.l1menu diff --git a/Trigger/TriggerCommon/TriggerMenuMT/scripts/menu_config_tests.py b/Trigger/TriggerCommon/TriggerMenuMT/scripts/menu_config_tests.py index 5038fb6f08884142123e54d33f3834c1e8e58bcf..0e389ee785c537cc27dd1c99f581dc605b7d72b7 100644 --- a/Trigger/TriggerCommon/TriggerMenuMT/scripts/menu_config_tests.py +++ b/Trigger/TriggerCommon/TriggerMenuMT/scripts/menu_config_tests.py @@ -1,3 +1,5 @@ +# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration + ''' Tests to verify generated menus are valid. diff --git a/Trigger/TriggerCommon/TriggerMenuMT/scripts/verify_menu_config.py b/Trigger/TriggerCommon/TriggerMenuMT/scripts/verify_menu_config.py index 37858e2520cecf32b31240e4dc1e01f78150e741..d4e512a10bf513be1681a032f5abf4de3762bf9e 100755 --- a/Trigger/TriggerCommon/TriggerMenuMT/scripts/verify_menu_config.py +++ b/Trigger/TriggerCommon/TriggerMenuMT/scripts/verify_menu_config.py @@ -1,5 +1,7 @@ #!/bin/env python +# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration + ''' Script for verifying menu configurations. diff --git a/graphics/VP1/VP1Systems/VP1TrackSystems/src/VP1TrackSystem.cxx b/graphics/VP1/VP1Systems/VP1TrackSystems/src/VP1TrackSystem.cxx index 878133b3c2c9c8c8652f514ee927bb1a8daaa2e5..e4ed3633e90397ecd54348cca1cd560b2df8f536 100644 --- a/graphics/VP1/VP1Systems/VP1TrackSystems/src/VP1TrackSystem.cxx +++ b/graphics/VP1/VP1Systems/VP1TrackSystems/src/VP1TrackSystem.cxx @@ -1,8 +1,7 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ - //////////////////////////////////////////////////////////////// // // // Implementation of class VP1TrackSystem // @@ -40,13 +39,10 @@ #include "VP1TrackSystems/TrackCollHandle_TrkTrack.h" #include "VP1TrackSystems/TrackCollHandle_TrkSegment.h" -// #include "VP1TrackSystems/TrackCollHandle_FatrasTruthTracks.h" #include "VP1TrackSystems/TrackCollHandle_TruthTracks.h" #include "VP1TrackSystems/TrackCollHandle_SimulationTracks.h" #include "VP1TrackSystems/TrackCollHandle_TrackParticle.h" #include "VP1TrackSystems/TrackCollHandle_xAODTrackParticle.h" -// #include "VP1TrackSystems/TrackCollHandle_Muon.h" -// #include "VP1TrackSystems/TrackCollHandle_Egamma.h" #include "VP1TrackSystems/TrackHandle_TrkTrack.h" #include "VP1TrackSystems/TrackCollHandle_RefittedTracks.h" @@ -73,8 +69,6 @@ #include <Inventor/SoPath.h> #include <Inventor/nodes/SoFont.h> -//#include "TrkEventPrimitives/GlobalPosition.h" -//#include "TrkEventPrimitives/GlobalMomentum.h" #include "TrkEventPrimitives/FitQuality.h" #include <sstream> @@ -101,13 +95,6 @@ #include "VP1Utils/VP1AvailableToolsHelper.h" //////////////////////////////////////////////////////// - -// FOR DEBUG -//#include "MuonIdHelpers/MdtIdHelper.h" -//#include "MuonIdHelpers/MuonIdHelper.h" - - - //____________________________________________________________________ class VP1TrackSystem::Imp { public: