diff --git a/AtlasGeometryCommon/BeamPipeGeoModel/CMakeLists.txt b/AtlasGeometryCommon/BeamPipeGeoModel/CMakeLists.txt index e0da236a7b5beea3a3c0ea317e5ab533011bf514..79f44dd4299094297a34af1ba664973ad1b8a22d 100644 --- a/AtlasGeometryCommon/BeamPipeGeoModel/CMakeLists.txt +++ b/AtlasGeometryCommon/BeamPipeGeoModel/CMakeLists.txt @@ -1,43 +1,27 @@ -################################################################################ -# Package: BeamPipeGeoModel -################################################################################ +# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration # Declare the package name: atlas_subdir( BeamPipeGeoModel ) -# Declare the package's dependencies: -atlas_depends_on_subdirs( PUBLIC - Database/RDBAccessSvc - DetectorDescription/GeoModel/GeoModelUtilities - PRIVATE - Control/SGTools - Control/StoreGate - Control/AthenaKernel - DetectorDescription/GeoModel/GeoModelInterfaces - GaudiKernel ) - # External dependencies: -find_package( Boost COMPONENTS filesystem thread system ) -find_package( CORAL COMPONENTS CoralBase CoralKernel RelationalAccess ) find_package( GeoModelCore ) # Component(s) in the package: atlas_add_library( BeamPipeGeoModelLib src/*.cxx PUBLIC_HEADERS BeamPipeGeoModel - INCLUDE_DIRS ${Boost_INCLUDE_DIRS} ${CORAL_INCLUDE_DIRS} - LINK_LIBRARIES ${Boost_LIBRARIES} ${CORAL_LIBRARIES} ${GEOMODELCORE_LIBRARIES} GeoModelUtilities StoreGateLib - PRIVATE_LINK_LIBRARIES SGTools AthenaKernel GaudiKernel RDBAccessSvcLib ) + LINK_LIBRARIES ${GEOMODELCORE_LIBRARIES} AthenaKernel GeoModelUtilities + PRIVATE_LINK_LIBRARIES GaudiKernel GeoModelInterfaces RDBAccessSvcLib SGTools StoreGateLib ) atlas_add_component( BeamPipeGeoModel src/components/*.cxx - INCLUDE_DIRS ${Boost_INCLUDE_DIRS} ${CORAL_INCLUDE_DIRS} - LINK_LIBRARIES ${Boost_LIBRARIES} ${CORAL_LIBRARIES} ${GEOMODELCORE_LIBRARIES} GeoModelUtilities SGTools StoreGateLib GaudiKernel BeamPipeGeoModelLib ) + LINK_LIBRARIES BeamPipeGeoModelLib ) +# Test(s) in the package: atlas_add_test( BeamPipeGMConfig_test SCRIPT test/BeamPipeGMConfig_test.py PROPERTIES TIMEOUT 300 ) # Install files from the package: -atlas_install_python_modules( python/*.py ) -atlas_install_scripts( test/*.py ) +atlas_install_python_modules( python/*.py POST_BUILD_CMD ${ATLAS_FLAKE8} ) +atlas_install_scripts( test/*.py POST_BUILD_CMD ${ATLAS_FLAKE8} ) diff --git a/AtlasGeometryCommon/BeamPipeGeoModel/test/BeamPipeGMConfig_test.py b/AtlasGeometryCommon/BeamPipeGeoModel/test/BeamPipeGMConfig_test.py index f4c8be55e0f21374ad6410a2358b1aa301376b12..84c291c30302c07b271904cf7111f7f687d23e78 100755 --- a/AtlasGeometryCommon/BeamPipeGeoModel/test/BeamPipeGMConfig_test.py +++ b/AtlasGeometryCommon/BeamPipeGeoModel/test/BeamPipeGMConfig_test.py @@ -1,7 +1,7 @@ #!/usr/bin/env python """Run tests on BeamPipeGeoModel configuration -Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration +Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration """ if __name__ == "__main__": from AthenaCommon.Configurable import Configurable @@ -16,7 +16,6 @@ if __name__ == "__main__": ConfigFlags.GeoModel.Align.Dynamic = False ConfigFlags.lock() - from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator from BeamPipeGeoModel.BeamPipeGMConfig import BeamPipeGeometryCfg acc = BeamPipeGeometryCfg(ConfigFlags) f=open('BeamPipeGeometryCfg.pkl','wb') diff --git a/AtlasGeometryCommon/CavernInfraGeoModel/CMakeLists.txt b/AtlasGeometryCommon/CavernInfraGeoModel/CMakeLists.txt index a68a99eef304603d9f67ea3e1f209b9e1d262e9e..36874b3a25187abe91abf750d390f836e0ef082f 100644 --- a/AtlasGeometryCommon/CavernInfraGeoModel/CMakeLists.txt +++ b/AtlasGeometryCommon/CavernInfraGeoModel/CMakeLists.txt @@ -1,33 +1,20 @@ -################################################################################ -# Package: CavernInfraGeoModel -################################################################################ +# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration # Declare the package name: atlas_subdir( CavernInfraGeoModel ) -# Declare the package's dependencies: -atlas_depends_on_subdirs( PUBLIC - Control/AthenaKernel - Database/RDBAccessSvc - DetectorDescription/GeoModel/GeoModelUtilities - PRIVATE - Control/StoreGate - DetectorDescription/GeoModel/GeoModelInterfaces - GaudiKernel ) - # External dependencies: -find_package( Boost COMPONENTS filesystem thread system ) -find_package( Eigen ) -find_package( CORAL COMPONENTS CoralBase CoralKernel RelationalAccess ) find_package( GeoModelCore ) # Component(s) in the package: +atlas_add_library( CavernInfraGeoModelLib + CavernInfraGeoModel/*.h + INTERFACE + PUBLIC_HEADERS CavernInfraGeoModel + INCLUDE_DIRS ${GEOMODELCORE_INCLUDE_DIRS} + LINK_LIBRARIES ${GEOMODELCORE_LIBRARIES} AthenaKernel ) + atlas_add_component( CavernInfraGeoModel src/*.cxx src/components/*.cxx - INCLUDE_DIRS ${Boost_INCLUDE_DIRS} ${CORAL_INCLUDE_DIRS} - LINK_LIBRARIES ${Boost_LIBRARIES} ${CORAL_LIBRARIES} ${GEOMODELCORE_LIBRARIES} GeoModelUtilities StoreGateLib SGtests GaudiKernel RDBAccessSvcLib ) - -# Install files from the package: -atlas_install_headers( CavernInfraGeoModel ) - + LINK_LIBRARIES CavernInfraGeoModelLib GaudiKernel GeoModelInterfaces GeoModelUtilities RDBAccessSvcLib StoreGateLib ) diff --git a/AtlasGeometryCommon/GeoModelEnvelopes/CMakeLists.txt b/AtlasGeometryCommon/GeoModelEnvelopes/CMakeLists.txt index 87a6e90f79e8ea6dc74321ffdd436a370c0832e8..6b7cb572c892511ac6d1a9b98f0779083b15efe0 100644 --- a/AtlasGeometryCommon/GeoModelEnvelopes/CMakeLists.txt +++ b/AtlasGeometryCommon/GeoModelEnvelopes/CMakeLists.txt @@ -1,28 +1,13 @@ -################################################################################ -# Package: GeoModelEnvelopes -################################################################################ +# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration # Declare the package name: atlas_subdir( GeoModelEnvelopes ) -# Declare the package's dependencies: -atlas_depends_on_subdirs( PUBLIC - Control/AthenaKernel - DetectorDescription/GeoModel/GeoModelUtilities - PRIVATE - Control/SGTools - Control/StoreGate - DetectorDescription/GeoModel/GeoModelInterfaces - GaudiKernel ) - +# External dependencies: find_package( GeoModelCore ) # Component(s) in the package: atlas_add_component( GeoModelEnvelopes src/*.cxx src/components/*.cxx - LINK_LIBRARIES ${GEOMODELCORE_LIBRARIES} GeoModelUtilities SGTools StoreGateLib GaudiKernel ) - -# Install files from the package: -atlas_install_headers( GeoModelEnvelopes ) - + LINK_LIBRARIES ${GEOMODELCORE_LIBRARIES} AthenaKernel GaudiKernel GeoModelInterfaces GeoModelUtilities SGTools StoreGateLib ) diff --git a/AtlasGeometryCommon/Interpreters/CMakeLists.txt b/AtlasGeometryCommon/Interpreters/CMakeLists.txt index 240f10f29e695758b41a1e32ea0eff11110b77d7..0593e3bbbf43ca71abdb57343b7a711bfc6f56a3 100644 --- a/AtlasGeometryCommon/Interpreters/CMakeLists.txt +++ b/AtlasGeometryCommon/Interpreters/CMakeLists.txt @@ -1,10 +1,7 @@ -################################################################################ -# Package: Interpreters -################################################################################ +# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration # Declare the package name: atlas_subdir( Interpreters ) # Install files from the package: atlas_install_scripts( share/physh share/totalphysh share/athenash.py ) - diff --git a/AtlasGeometryCommon/SubDetectorEnvelopes/CMakeLists.txt b/AtlasGeometryCommon/SubDetectorEnvelopes/CMakeLists.txt index d2a2df6240e8340d22d4e9bb42fa488619dac56f..d186c2168089d1ba473e56aed6f41410e9d0589d 100644 --- a/AtlasGeometryCommon/SubDetectorEnvelopes/CMakeLists.txt +++ b/AtlasGeometryCommon/SubDetectorEnvelopes/CMakeLists.txt @@ -1,36 +1,22 @@ -################################################################################ -# Package: SubDetectorEnvelopes -################################################################################ +# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration # Declare the package name: atlas_subdir( SubDetectorEnvelopes ) -# Declare the package's dependencies: -atlas_depends_on_subdirs( PUBLIC - DetectorDescription/AtlasDetDescr - GaudiKernel - PRIVATE - Control/AthenaBaseComps - Database/RDBAccessSvc - DetectorDescription/GeoModel/GeoModelInterfaces ) - # External dependencies: -find_package( Boost COMPONENTS filesystem thread system ) find_package( CLHEP ) -find_package( CORAL COMPONENTS CoralBase CoralKernel RelationalAccess ) +# Component(s) in the package: atlas_add_library( SubDetectorEnvelopesLib INTERFACE PUBLIC_HEADERS SubDetectorEnvelopes LINK_LIBRARIES GaudiKernel AtlasDetDescr ) -# Component(s) in the package: atlas_add_component( SubDetectorEnvelopes src/*.cxx src/components/*.cxx - INCLUDE_DIRS ${Boost_INCLUDE_DIRS} ${CORAL_INCLUDE_DIRS} ${CLHEP_INCLUDE_DIRS} - LINK_LIBRARIES ${Boost_LIBRARIES} ${CORAL_LIBRARIES} ${CLHEP_LIBRARIES} AtlasDetDescr GaudiKernel AthenaBaseComps RDBAccessSvcLib GeoModelInterfaces ) + INCLUDE_DIRS ${CLHEP_INCLUDE_DIRS} + LINK_LIBRARIES ${CLHEP_LIBRARIES} AthenaBaseComps GeoModelInterfaces RDBAccessSvcLib SubDetectorEnvelopesLib ) # Install files from the package: -atlas_install_python_modules( python/*.py ) - +atlas_install_python_modules( python/*.py POST_BUILD_CMD ${ATLAS_FLAKE8} ) diff --git a/AtlasGeometryCommon/SubDetectorEnvelopes/python/SubDetectorEnvelopesConfig.py b/AtlasGeometryCommon/SubDetectorEnvelopes/python/SubDetectorEnvelopesConfig.py index 1ef5aae53aac54a0482b4d1cf4990ea86d3ffc2f..dc5ebc16d704a764146cc85aaaeda1aa327cf140 100644 --- a/AtlasGeometryCommon/SubDetectorEnvelopes/python/SubDetectorEnvelopesConfig.py +++ b/AtlasGeometryCommon/SubDetectorEnvelopes/python/SubDetectorEnvelopesConfig.py @@ -1,17 +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 """ SubDetectorEnvelopes configurations for AtlasGeometryCommon Elmar Ritsch, 27/09/2013 """ -from AthenaCommon.CfgGetter import getPrivateTool,getPrivateToolClone,getPublicTool,getPublicToolClone,\ - getService,getServiceClone,getAlgorithm,getAlgorithmClone - -from AthenaCommon.Constants import * # FATAL,ERROR etc. -from AthenaCommon.SystemOfUnits import * -from AthenaCommon.DetFlags import DetFlags - def getEnvelopeDefSvc(name="AtlasGeometry_EnvelopeDefSvc", **kwargs): kwargs.setdefault("DBInDetNode" , 'InDetEnvelope' ) kwargs.setdefault("DBBeamPipeNode" , 'BeamPipeEnvelope' ) @@ -273,7 +266,6 @@ def EnvelopeDefSvc(flags, **kwargs): Cavern.addRZ( 0.0 , 26046.0 ) # # the outer dimesions differ between collision and cosmics jobs - from AthenaCommon.BeamFlags import jobproperties if flags.Beam.Type != 'cosmics': # -> for collision jobs the 'cavern' envelope is much smaller Cavern.addRZ( 0.0 , 500000.0 ) # z= +500m diff --git a/AtlasGeometryCommon/SubDetectorEnvelopes/python/SubDetectorEnvelopesConfigDb.py b/AtlasGeometryCommon/SubDetectorEnvelopes/python/SubDetectorEnvelopesConfigDb.py index 2e876b0445172293dc1592bd7937713c348380b7..1cd1d7567350c7c6ee2873a0c75af6c18826067b 100644 --- a/AtlasGeometryCommon/SubDetectorEnvelopes/python/SubDetectorEnvelopesConfigDb.py +++ b/AtlasGeometryCommon/SubDetectorEnvelopes/python/SubDetectorEnvelopesConfigDb.py @@ -1,18 +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 """ Configuration database for SubDetectorEnvelopes Elmar Ritsch, 27/09/2013 """ -from AthenaCommon.CfgGetter import addTool, addToolClone, addService, addAlgorithm, \ - addTypesToExcludeIfDefaultValue, addNamesToExcludeIfDefaultValue, addFullNamesToExcludeIfDefaultValue, \ - addPropertiesToExcludeIfDefault, \ - addTypesToSkipIfNotAvailable, addNamesToSkipIfNotAvailable, addFullNamesToSkipIfNotAvailable, \ - addTypesOnlyToSkip - -from AthenaCommon.Constants import * # FATAL,ERROR etc. -import AthenaCommon.SystemOfUnits as Units +from AthenaCommon.CfgGetter import addService # Common tools, services and algorithms used by jobs: addService("SubDetectorEnvelopes.SubDetectorEnvelopesConfig.getEnvelopeDefSvc", "AtlasGeometry_EnvelopeDefSvc") diff --git a/AtlasTest/DatabaseTest/AthenaPoolTest/CMakeLists.txt b/AtlasTest/DatabaseTest/AthenaPoolTest/CMakeLists.txt index 7b8b914ac8a36a3aaa1a4e8dfc575dc586c099e0..5d0c581411c3c8749a8df8e15b8d0363bfe4d038 100644 --- a/AtlasTest/DatabaseTest/AthenaPoolTest/CMakeLists.txt +++ b/AtlasTest/DatabaseTest/AthenaPoolTest/CMakeLists.txt @@ -36,7 +36,7 @@ function (athenapooltest_run_test testName jo pattern) @ONLY ) atlas_add_test( ${testName} SCRIPT ${CMAKE_CURRENT_BINARY_DIR}/athenapooltest_${testName}.sh - ENVIRONMENT "ATLAS_REFERENCE_TAG=AthenaPoolTest/AthenaPoolTest-01-00-06" + ENVIRONMENT "ATLAS_REFERENCE_TAG=AthenaPoolTest/AthenaPoolTest-01-00-08" POST_EXEC_SCRIPT "${CMAKE_CURRENT_SOURCE_DIR}/test/post_check_with_select.sh ${testName} ${pattern}" PROPERTIES TIMEOUT 900 ) diff --git a/Calorimeter/CaloUtils/CaloUtils/xAODClusterCompressor.h b/Calorimeter/CaloUtils/CaloUtils/xAODClusterCompressor.h index 1d62605758efb05d52c94bdb9fc4bea7da7450d5..2b66e05edbd5b932107d37b667d384154ff2c1a7 100644 --- a/Calorimeter/CaloUtils/CaloUtils/xAODClusterCompressor.h +++ b/Calorimeter/CaloUtils/CaloUtils/xAODClusterCompressor.h @@ -13,9 +13,9 @@ #include "AthenaBaseComps/AthService.h" #include "CaloInterface/IxAODClusterCompressor.h" #include "xAODCaloEvent/CaloClusterContainer.h" -#include "xAODCore/tools/FloatCompressor.h" #include "CxxUtils/checker_macros.h" +#include "CxxUtils/FloatCompressor.h" class ATLAS_CHECK_THREAD_SAFETY xAODClusterCompressor : virtual public IxAODClusterCompressor, public AthService { @@ -45,8 +45,8 @@ class ATLAS_CHECK_THREAD_SAFETY xAODClusterCompressor : typedef std::array< xAOD::CaloCluster::MomentType,60> momentList_t; momentList_t m_allMoments; - //Use Float compressor from xAODCore - xAOD::FloatCompressor m_compressor; + //Use Float compressor from CxxUtils + CxxUtils::FloatCompressor m_compressor; //JobO-driven flag to turn compression on/off bool m_isEnabled; diff --git a/Control/AthLinksSA/CMakeLists.txt b/Control/AthLinksSA/CMakeLists.txt index 1cc272e6c182fcb637230678ae5fb02c87427cfb..29e3a5247ecb42038b7a9cb359e34623412310a3 100644 --- a/Control/AthLinksSA/CMakeLists.txt +++ b/Control/AthLinksSA/CMakeLists.txt @@ -1,14 +1,8 @@ -# -# Build configuration for the standalone AthLinksSA package. -# +# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration # Declare the name of this package: atlas_subdir( AthLinks ) -# This package depends on other packages: -atlas_depends_on_subdirs( - PUBLIC Control/xAODRootAccessInterfaces ) - # This package uses ROOT: find_package( ROOT COMPONENTS Core ) diff --git a/Control/AthToolSupport/AsgDataHandles/AsgDataHandles/ReadDecorHandle.h b/Control/AthToolSupport/AsgDataHandles/AsgDataHandles/ReadDecorHandle.h new file mode 100644 index 0000000000000000000000000000000000000000..029456fede58318621bef7000273b05961686966 --- /dev/null +++ b/Control/AthToolSupport/AsgDataHandles/AsgDataHandles/ReadDecorHandle.h @@ -0,0 +1,261 @@ +// This file's extension implies that it's C, but it's really -*- C++ -*-. + +/* + * Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration. + */ + +/** + * @file AsgDataHandles/ReadDecorHandle.h + * @author Nils Krumnack <Nils.Erik.Krumnack@cern.h> + * @author scott snyder <snyder@bnl.gov> (for original) + * @brief Handle class for reading a decoration on an object. + */ + + +#ifndef ASG_DATA_HANDLES_READ_DECOR_HANDLE_H +#define ASG_DATA_HANDLES_READ_DECOR_HANDLE_H + +#ifndef XAOD_STANDALONE +#include <StoreGate/ReadDecorHandle.h> +#else + +#include "AsgDataHandles/ReadDecorHandleKey.h" +#include "AsgDataHandles/ReadHandle.h" +// #include "AsgDataHandles/tools/DecorKeyHelpers.h" +// #include "AthContainers/AuxElement.h" +// #include "GaudiKernel/EventContext.h" +// #include <type_traits> + + +namespace SG { + + +/** + * @brief Handle class for reading a decoration on an object. + * + * See StoreGate/ReadDecorHandle for details. + * + * This currently (31 Jul 20) contains a number of commented out + * members that were part of the original handle implementation, but + * have not yet been implemented in the standalone version. The plan + * is to either implement or remove them, depending on what is needed + * in AnalysisBase as we add more packages. + * + */ +template <class T, class D> +class ReadDecorHandle + : public ReadHandle<T> +{ +public: + /// Base class. + typedef ReadHandle<T> Base; + + /// Accessor type for aux data. + typedef SG::AuxElement::ConstAccessor<D> accessor_t; + + /// Type referencing an aux data item. + typedef typename accessor_t::const_reference_type + const_reference_type; + + /// Pointer into the vector holding an aux data item. + typedef typename accessor_t::const_container_pointer_type + const_container_pointer_type; + + + /** + * @brief Constructor from a ReadDecorHandleKey. + * @param key The key object holding the clid/key/store/attr. + * + * This will raise an exception if the StoreGate key is blank, + * or if the event store cannot be found. + */ + explicit ReadDecorHandle (const ReadDecorHandleKey<T>& key); + + +// /** +// * @brief Constructor from a ReadDecorHandleKey and an explicit event context. +// * @param key The key object holding the clid/key. +// * @param ctx The event context. +// * +// * This will raise an exception if the StoreGate key is blank, +// * or if the event store cannot be found. +// * +// * If the default event store has been requested, then the thread-specific +// * store from the event context will be used. +// */ +// explicit ReadDecorHandle (const ReadDecorHandleKey<T>& key, +// const EventContext& ctx); + + +// /** +// * @brief Copy constructor. +// */ +// ReadDecorHandle (const ReadDecorHandle& rhs); + + +// /** +// * @brief Move constructor. +// */ +// ReadDecorHandle (ReadDecorHandle&& rhs); + + +// /** +// * @brief Assignment operator. +// */ +// ReadDecorHandle& operator= (const ReadDecorHandle& rhs); + + +// /** +// * @brief Move operator. +// */ +// ReadDecorHandle& operator= (ReadDecorHandle&& rhs); + + + /** + * @brief Is the referenced container present in SG? + * + * Note that this tests for the presence of the _container_, + * not for the decoration. + * + * Const method; the handle does not change as a result of this. + */ + bool isPresent() const; + + + /** + * @brief Fetch the variable for one element, as a const reference. + * @param e The element for which to fetch the variable. + */ + const_reference_type operator() (const AuxElement& e) const; + + + /** + * @brief Fetch the variable for one element, as a const reference. + * @param index The index of the desired element. + * + * This looks up the variable in the object referenced by this handle. + * For a standalone object, pass an index of 0. + */ + const_reference_type operator() (size_t index); + + +// /** +// * @brief Get a pointer to the start of the auxiliary data array, +// * for the referenced object. +// */ +// const_container_pointer_type +// getDataArray(); + + +// /** +// * @brief Test to see if this variable exists in the store, +// * for the referenced object. +// */ +// bool isAvailable(); + + +// /** +// * @brief Return the aux id for this variable. +// */ +// SG::auxid_t auxid() const; + + +private: + /** + * @brief Return the referenced object as a @c SG::AuxVectorData. + * Specialization for the case of a standalone object + * (@c T derives from @c SG::AuxElement). + */ + const SG::AuxVectorData* vectorData (std::true_type); + + + /** + * @brief Return the referenced object as a @c SG::AuxVectorData. + * Specialization for the case of a container + * (@c T does not derive from @c SG::AuxElement). + */ + const SG::AuxVectorData* vectorData (std::false_type); + + + /** + * @brief Return the referenced object as a @c SG::AuxVectorData. + * + * If @c T is a container object, then this should be the object itself. + * But if it is a standalone object, deriving from @c SG::AuxElement, + * then we need to call container() on the object. + */ + const SG::AuxVectorData* vectorData(); + + + /// Accessor for the aux data item. + accessor_t m_acc; +}; + + +// /** +// * @brief Return a @c ReadDecorHandle referencing @c key. +// * @param key The key object holding the clid/key/store. +// * +// * This will raise an exception if the StoreGate key is blank, +// * or if the event store cannot be found. +// * +// * The type of the decoration must be included as an explicit template parameter: +// * +// *@code +// * auto handle = SG::makeHandle<float> (key); +// @endcode +// * +// * Note that @c D comes first in the argument list. It's given explicitly, +// * while @c T is inferred from @c key. +// */ +// template <class D, class T> +// ReadDecorHandle<T, D> makeHandle (const ReadDecorHandleKey<T>& key); + + +// /** +// * @brief Return a @c ReadDecorHandle referencing @c key for an explicit context. +// * @param key The key object holding the clid/key/store. +// * @param ctx The event context. +// * +// * This will raise an exception if the StoreGate key is blank, +// * or if the event store cannot be found. +// * +// * If the default event store has been requested, then the thread-specific +// * store from the event context will be used. +// * +// * The type of the decoration must be included as an explicit template parameter: +// * +// *@code +// * auto handle = SG::makeHandle<float> (key, ctx); +// @endcode +// * +// * Note that @c D comes first in the argument list. It's given explicitly, +// * while @c T is inferred from @c key. +// */ +// template <class D, class T> +// ReadDecorHandle<T, D> makeHandle (const ReadDecorHandleKey<T>& key, +// const EventContext& ctx); + + +// /** +// * @brief These two signatures are to catch cases where the explicit +// * template argument is omitted from the @c makeHandle call +// * and give an error tailored to that. Otherwise, the @c makeHandle +// * call for @c ReadHandle would match, potentially giving a much +// * more confusing error. +// */ +// template <class T> +// void makeHandle (const ReadDecorHandleKey<T>& key); +// template <class T> +// void makeHandle (const ReadDecorHandleKey<T>& key, +// const EventContext& ctx); + + +} // namespace SG + + +#include "AsgDataHandles/ReadDecorHandle.icc" + +#endif + +#endif // not STOREGATE_READDECORHANDLE_READDECORHANDLE_H diff --git a/Control/AthToolSupport/AsgDataHandles/AsgDataHandles/ReadDecorHandle.icc b/Control/AthToolSupport/AsgDataHandles/AsgDataHandles/ReadDecorHandle.icc new file mode 100644 index 0000000000000000000000000000000000000000..4448a16104b5d71ebb6d873ea64c1d23362737e7 --- /dev/null +++ b/Control/AthToolSupport/AsgDataHandles/AsgDataHandles/ReadDecorHandle.icc @@ -0,0 +1,317 @@ +/* + * Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration. + */ + +/** + * @file AsgDataHandles/ReadDecorHandle.icc + * @author Nils Krumnack <Nils.Erik.Krumnack@cern.h> + * @author scott snyder <snyder@bnl.gov> (for original) + * @brief Handle class for reading a decoration on an object. + */ + + +namespace SG { + +inline std::string contKeyFromKey (const std::string& key) +{ + const auto split = key.rfind ('.'); + if (split == std::string::npos) + throw std::runtime_error ("decor key does not contain a .: " + key); + return key.substr (0, split); +} + +inline std::string decorKeyFromKey (const std::string& key) +{ + const auto split = key.rfind ('.'); + if (split == std::string::npos) + throw std::runtime_error ("decor key does not contain a .: " + key); + return key.substr (split + 1); +} + +/** + * @brief Constructor from a ReadDecorHandleKey. + * @param key The key object holding the clid/key/store/attr. + * + * This will raise an exception if the StoreGate key is blank, + * or if the event store cannot be found. + */ +template <class T, class D> +ReadDecorHandle<T, D>::ReadDecorHandle (const ReadDecorHandleKey<T>& key) + : Base (key), + m_acc (SG::decorKeyFromKey (key.key())) +{ +} + + +// /** +// * @brief Constructor from a ReadDecorHandleKey and an explicit event context. +// * @param key The key object holding the clid/key. +// * @param ctx The event context. +// * +// * This will raise an exception if the StoreGate key is blank, +// * or if the event store cannot be found. +// * +// * If the default event store has been requested, then the thread-specific +// * store from the event context will be used. +// */ +// template <class T, class D> +// ReadDecorHandle<T, D>::ReadDecorHandle (const ReadDecorHandleKey<T>& key, +// const EventContext& ctx) +// : Base (key, ctx), +// m_acc (SG::decorKeyFromKey (key.key())) +// { +// } + + +// /** +// * @brief Copy constructor. +// */ +// template <class T, class D> +// ReadDecorHandle<T, D>::ReadDecorHandle (const ReadDecorHandle& rhs) +// : Base (rhs), +// m_acc (rhs.m_acc) +// { +// } + + +// /** +// * @brief Move constructor. +// */ +// template <class T, class D> +// ReadDecorHandle<T, D>::ReadDecorHandle (ReadDecorHandle&& rhs) +// : Base (std::move (rhs)), +// m_acc (std::move (rhs.m_acc)) +// { +// } + + +// /** +// * @brief Assignment operator. +// */ +// template <class T, class D> +// ReadDecorHandle<T, D>& ReadDecorHandle<T, D>::operator= (const ReadDecorHandle& rhs) +// { +// if (this != &rhs) { +// *static_cast<Base*>(this) = rhs; +// m_acc = rhs.m_acc; +// } +// return *this; +// } + + +// /** +// * @brief Move operator. +// */ +// template <class T, class D> +// ReadDecorHandle<T, D>& ReadDecorHandle<T, D>::operator= (ReadDecorHandle&& rhs) +// { +// if (this != &rhs) { +// *static_cast<Base*>(this) = std::move (rhs); +// m_acc = std::move (rhs.m_acc); +// } +// return *this; +// } + + +/** + * @brief Is the referenced container present in SG? + * + * Note that this tests for the presence of the _container_, + * not for the decoration. + * + * Const method; the handle does not change as a result of this. + */ +template <class T, class D> +bool ReadDecorHandle<T, D>::isPresent() const +{ + return this->isPresent_impl (contKeyFromKey (this->key())); +} + + +/** + * @brief Fetch the variable for one element, as a const reference. + * @param e The element for which to fetch the variable. + */ +template <class T, class D> +inline +typename ReadDecorHandle<T, D>::const_reference_type +ReadDecorHandle<T, D>::operator() (const AuxElement& e) const +{ + return m_acc (e); +} + + +/** + * @brief Fetch the variable for one element, as a const reference. + * @param index The index of the desired element. + * + * This looks up the variable in the object referenced by this handle. + * For a standalone object, pass an index of 0. + */ +template <class T, class D> +inline +typename ReadDecorHandle<T, D>::const_reference_type +ReadDecorHandle<T, D>::operator() (size_t i) +{ + return m_acc (*this->vectorData(), i); +} + + +// /** +// * @brief Get a pointer to the start of the auxiliary data array. +// * for the referenced object. +// */ +// template <class T, class D> +// typename ReadDecorHandle<T, D>::const_container_pointer_type +// ReadDecorHandle<T, D>::getDataArray() +// { +// return reinterpret_cast<const_container_pointer_type> +// (this->vectorData()->getDataArray (m_acc.auxid())); +// } + + +// /** +// * @brief Test to see if this variable exists in the store, +// * for the referenced object. +// */ +// template <class T, class D> +// inline +// bool ReadDecorHandle<T, D>::isAvailable() +// { +// const SG::AuxVectorData* vec = this->vectorData(); +// return vec && vec->isAvailable (m_acc.auxid()); +// } + + +// /** +// * @brief Return the aux id for this variable. +// */ +// template <class T, class D> +// inline +// SG::auxid_t ReadDecorHandle<T, D>::auxid() const +// { +// return m_acc.auxid(); +// } + + +/** + * @brief Return the referenced object as a @c SG::AuxVectorData. + * Specialization for the case of a standalone object + * (@c T derives from @c SG::AuxElement). + */ +template <class T, class D> +inline +const SG::AuxVectorData* ReadDecorHandle<T, D>::vectorData (std::true_type) +{ + return (*this)->container(); +} + + +/** + * @brief Return the referenced object as a @c SG::AuxVectorData. + * Specialization for the case of a container + * (@c T does not derive from @c SG::AuxElement). + */ +template <class T, class D> +inline +const SG::AuxVectorData* ReadDecorHandle<T, D>::vectorData (std::false_type) +{ + return this->cptr(); +} + + +/** + * @brief Return the referenced object as a @c SG::AuxVectorData. + * + * If @c T is a container object, then this should be the object itself. + * But if it is a standalone object, deriving from @c SG::AuxElement, + * then we need to call container() on the object. + */ +template <class T, class D> +inline +const SG::AuxVectorData* ReadDecorHandle<T, D>::vectorData() +{ + // Dispatch to the appropriate specialization, depending on whether or not + // @c T derives from @c SG::AuxElement. + return vectorData (typename std::is_base_of<SG::AuxElement, T>::type()); +} + + +// /** +// * @brief Return a @c ReadDecorHandle referencing @c key. +// * @param key The key object holding the clid/key/store. +// * +// * This will raise an exception if the StoreGate key is blank, +// * or if the event store cannot be found. +// * +// * The type of the decoration must be included as an explicit template parameter: +// * +// *@code +// * auto handle = SG::makeHandle<float> (key); +// @endcode +// * +// * Note that @c D comes first in the argument list. It's given explicitly, +// * while @c T is inferred from @c key. +// */ +// template <class D, class T> +// ReadDecorHandle<T, D> makeHandle (const ReadDecorHandleKey<T>& key) +// { +// return ReadDecorHandle<T, D> (key); +// } + + +// /** +// * @brief Return a @c ReadDecorHandle referencing @c key for an explicit context. +// * @param key The key object holding the clid/key/store. +// * @param ctx The event context. +// * +// * This will raise an exception if the StoreGate key is blank, +// * or if the event store cannot be found. +// * +// * If the default event store has been requested, then the thread-specific +// * store from the event context will be used. +// * +// * The type of the decoration must be included as an explicit template parameter: +// * +// *@code +// * auto handle = SG::makeHandle<float> (key, ctx); +// @endcode +// * +// * Note that @c D comes first in the argument list. It's given explicitly, +// * while @c T is inferred from @c key. +// */ +// template <class D, class T> +// ReadDecorHandle<T, D> makeHandle (const ReadDecorHandleKey<T>& key, +// const EventContext& ctx) +// { +// return ReadDecorHandle<T, D> (key, ctx); +// } + + +// /** +// * @brief These two signatures are to catch cases where the explicit +// * template argument is omitted from the @c makeHandle call +// * and give an error tailored to that. Otherwise, the @c makeHandle +// * call for @c ReadHandle would match, potentially giving a much +// * more confusing error. +// */ +// template <class T> +// void makeHandle (const ReadDecorHandleKey<T>& /*key*/) +// { +// // If you see an error from here, you've forgotten the explicit template +// // argument to @c makeHandle giving the decoration type. +// // See the examples of @c makeHandle above. +// return T::makeHandleForDecorationsRequiresExplicitTemplateArgument(); +// } +// template <class T> +// void makeHandle (const ReadDecorHandleKey<T>& /*key*/, +// const EventContext& /*ctx*/) +// { +// // If you see an error from here, you've forgotten the explicit template +// // argument to @c makeHandle giving the decoration type. +// // See the examples of @c makeHandle above. +// return T::makeHandleForDecorationsRequiresExplicitTemplateArgument(); +// } + + +} // namespace SG diff --git a/Control/AthToolSupport/AsgDataHandles/AsgDataHandles/ReadDecorHandleKey.h b/Control/AthToolSupport/AsgDataHandles/AsgDataHandles/ReadDecorHandleKey.h new file mode 100644 index 0000000000000000000000000000000000000000..6dad76d54ceb92b6575c298d7b03a4c2190ea46b --- /dev/null +++ b/Control/AthToolSupport/AsgDataHandles/AsgDataHandles/ReadDecorHandleKey.h @@ -0,0 +1,105 @@ +// This file's extension implies that it's C, but it's really -*- C++ -*-. + +/* + * Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration. + */ + +/** + * @file AsgDataHandles/ReadDecorHandleKey.h + * @author Nils Krumnack <Nils.Erik.Krumnack@cern.h> + * @author scott snyder <snyder@bnl.gov> (for original) + * @brief Property holding a SG store/key/clid/attr name from which a + * ReadDecorHandle is made. + */ + + +#ifndef ASG_DATA_HANDLES_READ_DECOR_HANDLE_KEY_H +#define ASG_DATA_HANDLES_READ_DECOR_HANDLE_KEY_H + +#ifndef XAOD_STANDALONE +#include <StoreGate/ReadDecorHandleKey.h> +#else + +#include "AsgDataHandles/ReadHandleKey.h" + +namespace SG { + +/* + * @brief Property holding a SG store/key/clid/attr name from which a + * ReadDecorHandle is made. + * + * See StoreGate/ReadDecorHandleKey for details. + * + * This currently (31 Jul 20) contains a number of commented out + * members that were part of the original handle implementation, but + * have not yet been implemented in the standalone version. The plan + * is to either implement or remove them, depending on what is needed + * in AnalysisBase as we add more packages. + * + */ +template <class T> +class ReadDecorHandleKey + : public ReadHandleKey<T> +{ +public: + /// Base class. + typedef ReadHandleKey<T> Base; + +// /// Class for which we set the CLID. See above. +// typedef typename SG::TopBase<T>::type topbase_t; + + +// /** +// * @brief Constructor. +// * @param key The StoreGate key for the object. +// * @param storeName Name to use for the store, if it's not encoded in sgkey. +// * +// * The provided key may actually start with the name of the store, +// * separated by a "+": "MyStore+Obj". If no "+" is present +// * the store named by @c storeName is used. +// */ +// ReadDecorHandleKey (const std::string& key = "", +// const std::string& storeName = StoreID::storeName(StoreID::EVENT_STORE)); + + + /** + * @brief auto-declaring Property Constructor. + * @param owner Owning component. + * @param name name of the Property + * @param key default StoreGate key for the object. + * @param doc Documentation string. + * + * will associate the named Property with this RHK via declareProperty + * + * The provided key may actually start with the name of the store, + * separated by a "+": "MyStore+Obj". If no "+" is present + * the store named by @c storeName is used. + */ + template <class OWNER, class K> + ReadDecorHandleKey( OWNER* owner, + const std::string& name, + const K& key = {}, + const std::string& doc = ""); + + +// /// Can get this from the base class. +// using Base::operator=; + + +// /** +// * @brief Return the class ID for the referenced object. +// * +// * Overridden here to return the CLID for @c T instead of @c topbase_t. +// */ +// CLID clid() const; +}; + + +} // namespace SG + + +#include "AsgDataHandles/ReadDecorHandleKey.icc" + +#endif + +#endif // not STOREGATE_READDECORHANDLEKEY_H diff --git a/Control/AthToolSupport/AsgDataHandles/AsgDataHandles/ReadDecorHandleKey.icc b/Control/AthToolSupport/AsgDataHandles/AsgDataHandles/ReadDecorHandleKey.icc new file mode 100644 index 0000000000000000000000000000000000000000..457db4d3ade831a0fbe13d13f07c9f4228d61c54 --- /dev/null +++ b/Control/AthToolSupport/AsgDataHandles/AsgDataHandles/ReadDecorHandleKey.icc @@ -0,0 +1,73 @@ +/* + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration +*/ + +/** + * @file AsgDataHandles/ReadDecorHandleKey.icc + * @author Nils Krumnack <Nils.Erik.Krumnack@cern.h> + * @author scott snyder <snyder@bnl.gov> (for original) + * @brief Property holding a SG store/key/clid/attr name from which a + * ReadDecorHandle is made. + */ + + +namespace SG { + + +// /** +// * @brief Constructor. +// * @param key The StoreGate key for the object. +// * @param storeName Name to use for the store, if it's not encoded in sgkey. +// * +// * The provided key may actually start with the name of the store, +// * separated by a "+": "MyStore+Obj". If no "+" is present +// * the store named by @c storeName is used. +// */ +// template <class T> +// inline +// ReadDecorHandleKey<T>::ReadDecorHandleKey (const std::string& key /*= ""*/, +// const std::string& storeName /*= StoreID::storeName(StoreID::EVENT_STORE)*/) +// : Base (ClassID_traits<topbase_t>::ID(), key, storeName) +// { +// } + + +/** + * @brief auto-declaring Property Constructor. + * @param owner Owning component. + * @param name name of the Property + * @param key default StoreGate key for the object. + * @param doc Documentation string. + * + * will associate the named Property with this RHK via declareProperty + * + * The provided key may actually start with the name of the store, + * separated by a "+": "MyStore+Obj". If no "+" is present + * the store named by @c storeName is used. + */ +template <class T> +template <class OWNER, class K> +inline +ReadDecorHandleKey<T>::ReadDecorHandleKey( OWNER* owner, + const std::string& name, + const K& key /*={}*/, + const std::string& doc /*=""*/) + : Base (owner, name, key, doc) +{ +} + + +// /** +// * @brief Return the class ID for the referenced object. +// * +// * Overridden here to return the CLID for @c T instead of @c topbase_t. +// */ +// template <class T> +// inline +// CLID ReadDecorHandleKey<T>::clid() const +// { +// return ClassID_traits<T>::ID(); +// } + + +} // namespace SG diff --git a/Control/AthToolSupport/AsgDataHandles/AsgDataHandles/ReadHandle.h b/Control/AthToolSupport/AsgDataHandles/AsgDataHandles/ReadHandle.h index ae9f7e1721087ce68480a5bff361ece79fcd3fe5..de53f22450117dcbb087af8722f5eaa462092699 100644 --- a/Control/AthToolSupport/AsgDataHandles/AsgDataHandles/ReadHandle.h +++ b/Control/AthToolSupport/AsgDataHandles/AsgDataHandles/ReadHandle.h @@ -134,6 +134,15 @@ public: const_pointer_type get (const EventContext& ctx) const; + /** + * @brief Is the referenced object present in SG? + * @param key SG key to test. + * + * Const method; the handle does not change as a result of this. + */ + bool isPresent_impl (const std::string& key) const; + + private: /** * @brief Helper: dereference the pointer. diff --git a/Control/AthToolSupport/AsgDataHandles/AsgDataHandles/ReadHandle.icc b/Control/AthToolSupport/AsgDataHandles/AsgDataHandles/ReadHandle.icc index e3aba5c8546b47db65ae95f8932a8b7cca6180ea..f35c97693e2b7378288eeb824940d6f5870ff352 100644 --- a/Control/AthToolSupport/AsgDataHandles/AsgDataHandles/ReadHandle.icc +++ b/Control/AthToolSupport/AsgDataHandles/AsgDataHandles/ReadHandle.icc @@ -145,8 +145,7 @@ template <class T> inline bool ReadHandle<T>::isValid() { - const T *result = nullptr; - return xAOD::TActiveEvent::event()->retrieve (result, key(), true); + return isPresent_impl(key()); } @@ -175,6 +174,20 @@ ReadHandle<T>::get (const EventContext& /*ctx*/) const } +/** + * @brief Is the referenced object present in SG? + * @param key SG key to test. + * + * Const method; the handle does not change as a result of this. + */ +template <class T> +bool ReadHandle<T>::isPresent_impl (const std::string& key) const +{ + const T *result = nullptr; + return xAOD::TActiveEvent::event()->retrieve (result, key, true); +} + + /** * @brief Helper: dereference the pointer. * Throws ExcNullReadHandle on failure. diff --git a/Control/AthToolSupport/AsgDataHandles/CMakeLists.txt b/Control/AthToolSupport/AsgDataHandles/CMakeLists.txt index b4ede025d7f41522e40e237ea4d3b485df206615..704ebcb25f506d05cdb4a121a82cfc3a4e9881de 100644 --- a/Control/AthToolSupport/AsgDataHandles/CMakeLists.txt +++ b/Control/AthToolSupport/AsgDataHandles/CMakeLists.txt @@ -1,16 +1,10 @@ -################################################################################ -# Package: AsgDataHandles -################################################################################ - +# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration # Declare the package name: atlas_subdir( AsgDataHandles ) if( NOT XAOD_STANDALONE ) -# Declare the package's dependencies: -atlas_depends_on_subdirs( PUBLIC Control/StoreGate ) - # Component(s) in the package: atlas_add_library( AsgDataHandlesLib INTERFACE AsgDataHandles/*.h AsgDataHandles/*.icc @@ -20,11 +14,6 @@ atlas_add_library( AsgDataHandlesLib INTERFACE else() -# Declare the package's dependencies: -atlas_depends_on_subdirs( - PUBLIC Control/AthToolSupport/AsgMessaging - Control/xAODRootAccessInterfaces ) - # Component(s) in the package: atlas_add_library( AsgDataHandlesLib AsgDataHandles/*.h AsgDataHandles/*.icc Root/*.cxx diff --git a/Control/AthToolSupport/AsgExampleTools/AsgExampleTools/DataHandleTestTool.h b/Control/AthToolSupport/AsgExampleTools/AsgExampleTools/DataHandleTestTool.h index cf592fab88e8e1a3401199bb5eff994495b19ab4..a10f05a70c138edbdeaf1212848d503efd951731 100644 --- a/Control/AthToolSupport/AsgExampleTools/AsgExampleTools/DataHandleTestTool.h +++ b/Control/AthToolSupport/AsgExampleTools/AsgExampleTools/DataHandleTestTool.h @@ -12,6 +12,7 @@ #include <AsgTools/AsgTool.h> #include <AsgExampleTools/IDataHandleTestTool.h> #include <AsgDataHandles/ReadHandleKey.h> +#include <AsgDataHandles/ReadDecorHandleKey.h> // AthSimulation doesn't contain the muon-container, so we can't // really build the tool, but it is simpler to build an empty tool @@ -49,8 +50,10 @@ namespace asg public: #ifndef SIMULATIONBASE SG::ReadHandleKey<xAOD::MuonContainer> m_readKey {this, "readKey", "Muons", "regular read key"}; + SG::ReadDecorHandleKey<xAOD::MuonContainer> m_readDecorKey {this, "readDecorKey", "Muons.pt", "read decor key"}; #endif bool m_readFailure {false}; + bool m_readDecorFailure {false}; }; } diff --git a/Control/AthToolSupport/AsgExampleTools/CMakeLists.txt b/Control/AthToolSupport/AsgExampleTools/CMakeLists.txt index cb7fec41ad7ed5cf27731e6677be7f3381e3fe92..96e3f8515f2ee86df5d1de93d6455e6ca0cf38e9 100644 --- a/Control/AthToolSupport/AsgExampleTools/CMakeLists.txt +++ b/Control/AthToolSupport/AsgExampleTools/CMakeLists.txt @@ -1,26 +1,14 @@ -################################################################################ -# Package: AsgExampleTools -################################################################################ +# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration # Declare the package name: atlas_subdir( AsgExampleTools ) if (SIMULATIONBASE) - set (extra_dep ) set (extra_lib ) else() - set (extra_dep Event/xAOD/xAODMuon) set (extra_lib xAODMuon) endif() -# Declare the package's dependencies: -atlas_depends_on_subdirs( - PUBLIC - Control/AthToolSupport/AsgDataHandles - Control/AthToolSupport/AsgTools - Control/AthToolSupport/AsgTesting - ${extra_dep}) - # External dependencies: find_package( GTest ) find_package( GMock ) @@ -101,15 +89,22 @@ if( XAOD_STANDALONE ) LINK_LIBRARIES ${GTEST_LIBRARIES} AsgTools AsgExampleToolsLib AsgTestingLib ) set_tests_properties (AsgExampleTools_gt_asgtools_toolhandle_test_ctest PROPERTIES LABELS "AsgTools;AsgExampleTools" ) +endif() + +if (NOT SIMULATIONBASE) + if (NOT XAOD_STANDALONE) + set (extra_libs POOLRootAccessLib) + else() + set (extra_libs ) + endif() + atlas_add_test( gt_DataHandlesTest SOURCES test/gt_DataHandlesTest.cxx INCLUDE_DIRS ${GTEST_INCLUDE_DIRS} - LINK_LIBRARIES ${GTEST_LIBRARIES} AsgTools AsgExampleToolsLib AsgTestingLib ) + LINK_LIBRARIES ${GTEST_LIBRARIES} AsgTools AsgExampleToolsLib AsgTestingLib ${extra_libs}) set_tests_properties (AsgExampleTools_gt_DataHandlesTest_ctest PROPERTIES LABELS "AsgDataHandles;AsgExampleTools" ) - endif() - atlas_add_test( gt_AnaCheck SOURCES test/gt_AnaCheck.cxx INCLUDE_DIRS ${GTEST_INCLUDE_DIRS} diff --git a/Control/AthToolSupport/AsgExampleTools/Root/DataHandleTestTool.cxx b/Control/AthToolSupport/AsgExampleTools/Root/DataHandleTestTool.cxx index 18778a38bad3f6b6bcf1b16326b1a036d45d22a1..19aeb4ef3a6457546e07d44915fa40291a0efe2c 100644 --- a/Control/AthToolSupport/AsgExampleTools/Root/DataHandleTestTool.cxx +++ b/Control/AthToolSupport/AsgExampleTools/Root/DataHandleTestTool.cxx @@ -13,6 +13,7 @@ #include <AsgExampleTools/DataHandleTestTool.h> #include <AsgDataHandles/ReadHandle.h> +#include <AsgDataHandles/ReadDecorHandle.h> #include <AsgTesting/UnitTest.h> #include <gtest/gtest.h> #include <map> @@ -28,6 +29,7 @@ namespace asg : AsgTool (val_name) { declareProperty ("readFailure", m_readFailure, "whether to expect a read failure"); + declareProperty ("readDecorFailure", m_readDecorFailure, "whether to expect a read decoration failure"); } @@ -44,6 +46,7 @@ namespace asg { #ifndef SIMULATIONBASE ANA_CHECK (m_readKey.initialize ()); + ANA_CHECK (m_readDecorKey.initialize ()); #endif return StatusCode::SUCCESS; } @@ -56,12 +59,29 @@ namespace asg #ifndef SIMULATIONBASE const xAOD::MuonContainer *muonsStore {nullptr}; ASSERT_SUCCESS (evtStore()->retrieve (muonsStore, "Muons")); + ASSERT_NE (0u, muonsStore->size()); + const xAOD::Muon *testMuon = (*muonsStore)[0]; auto readHandle = makeHandle (m_readKey); - if (m_readFailure == false) - EXPECT_EQ (muonsStore, readHandle.get()); - else + if (m_readFailure == true) + { EXPECT_EQ (nullptr, readHandle.get()); + EXPECT_FALSE (readHandle.isValid()); + } else + { + EXPECT_EQ (muonsStore, readHandle.get()); + EXPECT_TRUE (readHandle.isValid()); + } + + SG::ReadDecorHandle<xAOD::MuonContainer,float> readDecorHandle (m_readDecorKey); + if (m_readDecorFailure == true) + { + EXPECT_ANY_THROW (readDecorHandle (*testMuon)); + } else + { + SG::AuxElement::ConstAccessor<float> acc ("pt"); + EXPECT_EQ (acc (*testMuon), readDecorHandle (*testMuon)); + } #endif } } diff --git a/Control/AthToolSupport/AsgExampleTools/test/gt_AnaToolHandle_test.cxx b/Control/AthToolSupport/AsgExampleTools/test/gt_AnaToolHandle_test.cxx index 77f01de40de9c531335b74e4336ce8ad7a2a95cb..247f8eedfcc452171fcf7068c646a34a80a21bab 100644 --- a/Control/AthToolSupport/AsgExampleTools/test/gt_AnaToolHandle_test.cxx +++ b/Control/AthToolSupport/AsgExampleTools/test/gt_AnaToolHandle_test.cxx @@ -412,7 +412,11 @@ namespace asg } // check setProperty<int>() +#ifdef XAOD_STANDALONE TEST_F (AnaToolHandleMakeTest, setPropertyInt_failure) +#else + TEST_F (AnaToolHandleMakeTest, DISABLED_setPropertyInt_failure) +#endif { ASSERT_SUCCESS (tool.setProperty<int> ("UNKNOWN_PROPERTY", 42)); ASSERT_FAILURE (tool.initialize ()); @@ -437,7 +441,11 @@ namespace asg } // check setProperty(const char*) +#ifdef XAOD_STANDALONE TEST_F (AnaToolHandleMakeTest, setPropertyString_failure) +#else + TEST_F (AnaToolHandleMakeTest, DISABLED_setPropertyString_failure) +#endif { ASSERT_SUCCESS (tool.setProperty ("UNKNOWN_PROPERTY", "42")); ASSERT_FAILURE (tool.initialize ()); @@ -841,7 +849,7 @@ namespace asg EXPECT_EQ (57, handle->getPropertyInt ()); } - TEST (AnaToolHandleTest, athena_job_options_misspelled) + TEST (AnaToolHandleTest, DISABLED_athena_job_options_misspelled) { std::string name = makeUniqueName(); ServiceHandle<IJobOptionsSvc> joSvc("JobOptionsSvc",""); diff --git a/Control/AthToolSupport/AsgExampleTools/test/gt_DataHandlesTest.cxx b/Control/AthToolSupport/AsgExampleTools/test/gt_DataHandlesTest.cxx index 9b01506da3aa42edef4e7dafa2fc378d0e0f4259..f8b86c3c2d87617e2ec8f9d61dcec88b79c17e03 100644 --- a/Control/AthToolSupport/AsgExampleTools/test/gt_DataHandlesTest.cxx +++ b/Control/AthToolSupport/AsgExampleTools/test/gt_DataHandlesTest.cxx @@ -14,13 +14,18 @@ #include <AsgMessaging/MessageCheck.h> #include <AsgTesting/UnitTest.h> #include <AsgExampleTools/IDataHandleTestTool.h> -#include <xAODRootAccess/TEvent.h> -#include <xAODRootAccess/TStore.h> #include <TFile.h> #include <cmath> #include <gtest/gtest.h> #include <sstream> +#ifdef XAOD_STANDALONE +#include <xAODRootAccess/TEvent.h> +#include <xAODRootAccess/TStore.h> +#else +#include <POOLRootAccess/TEvent.h> +#endif + #pragma GCC diagnostic ignored "-Wdeprecated-declarations" // @@ -39,18 +44,23 @@ namespace asg ASSERT_NE (nullptr, test_file); file.reset (TFile::Open (test_file, "READ")); ASSERT_NE (nullptr, file); +#ifdef XAOD_STANDALONE + event = std::make_unique<xAOD::TEvent>(); +#else + event = std::make_unique<POOL::TEvent>(); +#endif + ASSERT_SUCCESS (event->readFrom (file.get())); + ASSERT_TRUE (event->getEntry (0) >= 0); } static void TearDownTestCase () { + event.reset (); file.reset (); } virtual void SetUp () override { - ASSERT_NE (nullptr, file); - ASSERT_SUCCESS (event.readFrom (file.get())); - ASSERT_TRUE (event.getEntry (0) >= 0); } /// \brief make a unique tool name to be used in unit tests @@ -63,8 +73,12 @@ namespace asg } static inline std::unique_ptr<TFile> file; - xAOD::TEvent event; +#ifdef XAOD_STANDALONE + static inline std::unique_ptr<xAOD::TEvent> event; xAOD::TStore store; +#else + static inline std::unique_ptr<POOL::TEvent> event; +#endif AsgToolConfig config {"asg::DataHandleTestTool/" + makeUniqueName()}; std::shared_ptr<void> cleanup; ToolHandle<IDataHandleTestTool> tool; @@ -89,6 +103,17 @@ namespace asg ASSERT_SUCCESS (config.makeTool (tool, cleanup)); tool->runTest (); } + + + + // just test that reading unknown objects fails as it should + TEST_F (DataHandlesTest, read_decor_failure) + { + config.setPropertyFromString ("readDecorFailure", "1"); + config.setPropertyFromString ("readDecorKey", "Muons.MISSING_PROPERTY"); + ASSERT_SUCCESS (config.makeTool (tool, cleanup)); + tool->runTest (); + } } ATLAS_GOOGLE_TEST_MAIN diff --git a/Control/AthToolSupport/AsgTools/CMakeLists.txt b/Control/AthToolSupport/AsgTools/CMakeLists.txt index 6e0a8e1393c009b4140b4b7d112215dd44fceb50..377bf6bec91a896e5b0a3d5c117c3f933feba265 100644 --- a/Control/AthToolSupport/AsgTools/CMakeLists.txt +++ b/Control/AthToolSupport/AsgTools/CMakeLists.txt @@ -1,25 +1,15 @@ -# $Id: CMakeLists.txt 804698 2017-05-11 16:03:27Z krumnack $ -################################################################################ -# Package: AsgTools -################################################################################ - +# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration # Declare the package name: atlas_subdir( AsgTools ) # Dependencies are taken based on what environment we are in: if( XAOD_STANDALONE ) - set( deps Control/AthToolSupport/AsgMessaging Control/xAODRootAccessInterfaces Control/xAODRootAccess ) set( libs AsgMessagingLib xAODRootAccessInterfaces xAODRootAccess ) else() - set( deps Control/AthToolSupport/AsgMessaging Control/xAODRootAccess Control/AthenaBaseComps Control/AthenaKernel - GaudiKernel ) set( libs AsgMessagingLib AthenaBaseComps AthenaKernel GaudiKernel ) endif() -# Declare the package's dependencies: -atlas_depends_on_subdirs( PUBLIC ${deps} ) - # Decide which sources to use: if( XAOD_STANDALONE ) set( sources Root/*.cxx ) diff --git a/Control/AthenaCommon/python/ChapPy.py b/Control/AthenaCommon/python/ChapPy.py index dfa81fd723794888e8fe9f7b2477a8c5b1e3e3d1..2a11b1bf555cf21f8f56f01cd25eea294726dcc0 100755 --- a/Control/AthenaCommon/python/ChapPy.py +++ b/Control/AthenaCommon/python/ChapPy.py @@ -32,7 +32,6 @@ def dump( buf, stdout = sys.stdout ): fname = None if isinstance(buf, str): fname = buf - from builtins import file if six.PY3: import io file = io.IOBase # noqa: F811 diff --git a/Control/AthenaCommon/share/ThinCAWrapper.sh b/Control/AthenaCommon/share/ThinCAWrapper.sh index 83c1c43fd63fef487287e45d73d638349bb6cafe..07ac06c05467c278454e245bab76e9726dd5e879 100755 --- a/Control/AthenaCommon/share/ThinCAWrapper.sh +++ b/Control/AthenaCommon/share/ThinCAWrapper.sh @@ -28,7 +28,7 @@ done #Check if we got a top-level script #Improve: Check if there is exactly one! -if [ -z ${topscriptfile} ] +if [ -z "$topscriptfile" ] then echo "ERROR: No top-level python script given" exit 1 @@ -60,7 +60,7 @@ do done -if [[ -z $topscript ]]; +if [ -z "$topscript" ]; then echo "Could not find python script $topscriptfile" exit 1 @@ -68,6 +68,7 @@ fi #Finally: Execute it! python $topscript $scriptargs - - - +status=$? +if [ ! $status -eq 0 ]; then + exit $status +fi diff --git a/Control/AthenaCommon/share/bootstrap.pkl b/Control/AthenaCommon/share/bootstrap.pkl index bb6abbf7935ecc2f778793ca9ee5a3d665637e35..f47ca3833841c2222ba5eff3774e56b02fa40232 100644 Binary files a/Control/AthenaCommon/share/bootstrap.pkl and b/Control/AthenaCommon/share/bootstrap.pkl differ diff --git a/Control/AthenaCommon/share/bootstrap_threaded.pkl b/Control/AthenaCommon/share/bootstrap_threaded.pkl index d68b0a5c4337e57afe0d4123578822a5487fbdda..d5cf4a78df80454ca1d06794a68f2994c2bcc026 100644 Binary files a/Control/AthenaCommon/share/bootstrap_threaded.pkl and b/Control/AthenaCommon/share/bootstrap_threaded.pkl differ diff --git a/Control/AthenaKernel/AthenaKernel/ISecondaryEventSelector.h b/Control/AthenaKernel/AthenaKernel/ISecondaryEventSelector.h index 24569734d5f3ad278fd80f8c1aa531596eb9af78..fc95e7949533c42df62c6acfe7e2df0767cd16f4 100644 --- a/Control/AthenaKernel/AthenaKernel/ISecondaryEventSelector.h +++ b/Control/AthenaKernel/AthenaKernel/ISecondaryEventSelector.h @@ -38,7 +38,7 @@ public: /// Fill AttributeList with specific items from the selector and a suffix virtual StatusCode fillAttributeList(coral::AttributeList *attrList, const std::string &suffix, bool copySource) const = 0; // Disconnect DB if all events from the source FID were processed and the Selector moved to another file - virtual bool disconnectIfFinished(SG::SourceID fid) const = 0; + virtual bool disconnectIfFinished(const SG::SourceID &fid) const = 0; }; #endif // ATHENAKERNEL_ISECONDARYEVENTSELECTOR_H diff --git a/Control/AthenaKernel/AthenaKernel/ThinningCache.h b/Control/AthenaKernel/AthenaKernel/ThinningCache.h index e577bc110c0e7962478b63f697ac2fadfdcb5b68..eed9b3d96cde364b1f6b486d9b9ca1ca7d517197 100644 --- a/Control/AthenaKernel/AthenaKernel/ThinningCache.h +++ b/Control/AthenaKernel/AthenaKernel/ThinningCache.h @@ -122,6 +122,14 @@ public: void setVetoed (const std::string& key, const CxxUtils::ConcurrentBitset& vetoed); + /** + * @brief Set lossy float compression information for the object. + * @param key SG string key of the object being added. + * @param compression Map of compression levels to variables + * for this object. + */ + void setCompression(const std::string& key, + const ThinningInfo::compression_map_t& compression); /** * @brief Return thinning information for @c key. diff --git a/Control/AthenaKernel/AthenaKernel/ThinningInfo.h b/Control/AthenaKernel/AthenaKernel/ThinningInfo.h index 5814f94afd63ed59ab1a96039f25f0cfd54607f7..6c4da32f97aada58e08bef44ff4d2f0b6e06315e 100644 --- a/Control/AthenaKernel/AthenaKernel/ThinningInfo.h +++ b/Control/AthenaKernel/AthenaKernel/ThinningInfo.h @@ -16,6 +16,7 @@ #include "CxxUtils/ConcurrentBitset.h" +#include <map> namespace SG { @@ -51,6 +52,30 @@ public: { return m_vetoed.test (id); } + + /// This map holds a set of auxids to be lossy compressed + /// for each compression level (nmantissa). + /// Same comment above for the SG::auxid_set_t applies here. + /// Keeping compression level as the key allows us to use + /// the set as the value, which eases the look up. + /// Maybe it would be more natural to have auxid => compression level + /// but that might have complicated things a bit. + /// If an auxid exists in multiple compression levels, + /// always pick the most strict one (lowest) for space savings. + typedef std::map<unsigned int, + CxxUtils::ConcurrentBitset> compression_map_t; + compression_map_t m_compression; + + /// Test if a variable is asked to be compressed. + /// If it is, return the compression level (nmantissa). + /// 0 means no compression is asked for. + unsigned int compression (size_t id) const + { + for (const auto &entry : m_compression) { + if (entry.second.test(id)) return entry.first; + } + return 0; + } }; diff --git a/Control/AthenaKernel/src/ThinningCache.cxx b/Control/AthenaKernel/src/ThinningCache.cxx index d417dd5a62e534263681b296bc75381d6eb87050..37d3ba06de86d0bfa1eed97013bdcede34695a5c 100644 --- a/Control/AthenaKernel/src/ThinningCache.cxx +++ b/Control/AthenaKernel/src/ThinningCache.cxx @@ -151,6 +151,17 @@ void ThinningCache::setVetoed (const std::string& key, m_map[key].m_vetoed = vetoed; } +/** + * @brief Set lossy float compression information for the object. + * @param key SG string key of the object being added. + * @param compression Map of compression levels to variables + * for this object. + */ +void ThinningCache::setCompression(const std::string& key, + const ThinningInfo::compression_map_t& compression) +{ + m_map[key].m_compression = compression; +} /** * @brief Return thinning information for @c key. diff --git a/Control/AthenaKernel/test/ThinningCache_test.cxx b/Control/AthenaKernel/test/ThinningCache_test.cxx index 39d49ae73c02d79f70bbf6e4ef865c3488a47bbf..2991ff96563acd4cd826123a388b1879c985c326 100644 --- a/Control/AthenaKernel/test/ThinningCache_test.cxx +++ b/Control/AthenaKernel/test/ThinningCache_test.cxx @@ -116,6 +116,27 @@ void test1() assert (cache.thinningInfo ("foo")->vetoed(13)); assert (!cache.thinningInfo ("foo")->vetoed(14)); + assert (cache.thinningInfo ("foo")->m_compression.empty()); + SG::ThinningInfo::compression_map_t compression1; + CxxUtils::ConcurrentBitset cbs1 (64); + cbs1.set (13); + compression1[7] = cbs1; + cache.setCompression("foo", compression1); + assert (cache.thinningInfo ("foo")->m_compression == compression1); + assert (cache.thinningInfo ("foo")->compression(13) == 7); + assert (cache.thinningInfo ("foo")->compression(14) == 0); + + assert (cache.thinningInfo ("bar")->m_compression.empty()); + SG::ThinningInfo::compression_map_t compression2; + CxxUtils::ConcurrentBitset cbs2 (42); + cbs2.set (8); + compression2[7] = cbs2; + compression2[15] = cbs2; + cache.setCompression("bar", compression2); + assert (cache.thinningInfo ("bar")->m_compression == compression2); + assert (cache.thinningInfo ("bar")->compression(8) == 7); + assert (cache.thinningInfo ("bar")->compression(8) != 15); + cache.clear(); assert (cache.empty()); assert (cache.trigNavigationThinningSvc() == nullptr); diff --git a/Control/AthenaServices/CMakeLists.txt b/Control/AthenaServices/CMakeLists.txt index 0ff3c5f1a5fa2875dbfedbac6e914d902ddeec8d..a819a04b318dad06223e8398ebf089c0e3813a70 100644 --- a/Control/AthenaServices/CMakeLists.txt +++ b/Control/AthenaServices/CMakeLists.txt @@ -16,7 +16,7 @@ atlas_add_component( AthenaServices src/*.cxx src/components/*.cxx LINK_LIBRARIES ${Boost_LIBRARIES} ${Python_LIBRARIES} ${YAMPL_LIBRARIES} ${CLHEP_LIBRARIES} z TestTools AsgTools AthenaBaseComps AthenaKernel RootUtils CxxUtils AthContainers AthContainersInterfaces DataModelRoot Navigation PerfMonEvent PerfMonKernel SGTools - StoreGateLib SGtests PersistentDataModel EventInfo xAODEventInfo EventInfoUtils GaudiKernel ) + StoreGateLib SGtests PersistentDataModel EventInfo xAODCore xAODEventInfo EventInfoUtils GaudiKernel ) # Test library checking the ability to build T/P converters: atlas_add_tpcnv_library( AthenaServicesTest src/test/*.cxx @@ -29,7 +29,7 @@ atlas_add_test( AthenaOutputStream_test src/OutputStreamSequencerSvc.cxx src/MetaDataSvc.cxx INCLUDE_DIRS ${Boost_INCLUDE_DIRS} LINK_LIBRARIES TestTools AsgTools AthenaKernel SGTools StoreGateLib GaudiKernel AthenaBaseComps PersistentDataModel - LOG_IGNORE_PATTERN "^AthenaRootStrea... +(INFO|DEBUG)|^SGAudSvc +(INFO|DEBUG)|of type DataHistory|DEBUG Recorded object|object modifiable when retrieved|^ToolSvc +DEBUG Service base class initialized|^ServiceManager +DEBUG Initializing service|^IncidentSvc *DEBUG Adding .* listener|DecisionSvc +DEBUG|^IoComponentMgr +(INFO|DEBUG)|DBReplicaSvc|^HistogramPersis.*DEBUG|^ItemListSvc +(INFO|DEBUG)|Info File PoolFileCatalog.xml does not exist|DataModelCompatSvc::initialize|^ProxyProviderSvc +DEBUG|^DataModelCompatSvc +DEBUG|^AthenaOutputStreamVERBOSE|^AthenaOutputStream +DEBUG|^TimelineSvc +DEBUG" ) + LOG_IGNORE_PATTERN "^AthenaRootStrea... +(INFO|DEBUG)|^SGAudSvc +(INFO|DEBUG)|of type DataHistory|DEBUG Recorded object|object modifiable when retrieved|^ToolSvc +DEBUG Service base class initialized|^ServiceManager +DEBUG Initializing service|^IncidentSvc *DEBUG Adding .* listener|DecisionSvc +DEBUG|^IoComponentMgr +(INFO|DEBUG)|DBReplicaSvc|^HistogramPersis.*DEBUG|^ItemListSvc +(INFO|DEBUG)|Info File PoolFileCatalog.xml does not exist|DataModelCompatSvc::initialize|^ProxyProviderSvc +DEBUG|^DataModelCompatSvc +DEBUG|^AthenaOutputStreamVERBOSE|^AthenaOutputStream +DEBUG|^TimelineSvc +DEBUG|CLIDRegistry entries" ) # Avoid spurious ubsan warnings. set_target_properties( AthenaServices_AthenaOutputStream_test PROPERTIES ENABLE_EXPORTS True ) diff --git a/Control/AthenaServices/share/AthenaOutputStream_test.ref b/Control/AthenaServices/share/AthenaOutputStream_test.ref index 84bf2c7262a4b6d0c7e644ad6e602c6ddf09f69a..a52c1c87c779a786b39432dd15239a424f7db458 100644 --- a/Control/AthenaServices/share/AthenaOutputStream_test.ref +++ b/Control/AthenaServices/share/AthenaOutputStream_test.ref @@ -1,20 +1,20 @@ *** AthenaOutputStream_test starts *** -Initializing Gaudi ApplicationMgr using job opts /build2/amete/athena-workspace/athena/Control/AthenaServices/share/AthenaOutputStream_test.txt -JobOptionsSvc INFO # =======> /build2/amete/athena-workspace/athena/Control/AthenaServices/share/AthenaOutputStream_test.txt +Initializing Gaudi ApplicationMgr using job opts /afs/cern.ch/user/s/ssnyder/atlas-work3h/build-x86_64-centos7-gcc8-opt/x86_64-centos7-gcc8-opt/jobOptions/AthenaServices/AthenaOutputStream_test.txt +JobOptionsSvc INFO # =======> /afs/cern.ch/user/s/ssnyder/atlas-work3h/build-x86_64-centos7-gcc8-opt/x86_64-centos7-gcc8-opt/jobOptions/AthenaServices/AthenaOutputStream_test.txt JobOptionsSvc INFO # (5,1): MessageSvc.OutputLevel = 2 JobOptionsSvc INFO # (6,1): StoreGateSvc.OutputLevel = 2 JobOptionsSvc INFO # (8,1): AthenaOutputStream.OutputLevel = 1 -JobOptionsSvc INFO # (10,1): AthenaOutputStream.ItemList = ["Bar#uno", "Bar#due", "Bar#tre", "8101#*", "Fee#quattro", "Fee!#cinque", "13#*"] -JobOptionsSvc INFO # (15,1): AthenaOutputStream.AcceptAlgs = ["AthenaOutputStream", "aSFQS"] -JobOptionsSvc INFO Job options successfully read in from /build2/amete/athena-workspace/athena/Control/AthenaServices/share/AthenaOutputStream_test.txt +JobOptionsSvc INFO # (10,1): AthenaOutputStream.ItemList = ["Bar#uno", "Bar#due", "Bar#tre", "8101#*", "Fee#quattro", "Fee!#cinque", "Baz#sei", "BazAuxContainer#seiAux.aaa.ccc", "13#*"] +JobOptionsSvc INFO # (17,1): AthenaOutputStream.AcceptAlgs = ["AthenaOutputStream", "aSFQS"] +JobOptionsSvc INFO Job options successfully read in from /afs/cern.ch/user/s/ssnyder/atlas-work3h/build-x86_64-centos7-gcc8-opt/x86_64-centos7-gcc8-opt/jobOptions/AthenaServices/AthenaOutputStream_test.txt MessageSvc DEBUG Service base class initialized successfully ApplicationMgr DEBUG Getting my own properties ApplicationMgr SUCCESS ==================================================================================================================================== - Welcome to ApplicationMgr (GaudiCoreSvc v33r0) - running on aibuild001.cern.ch on Tue Jan 21 20:44:45 2020 + Welcome to ApplicationMgr (GaudiCoreSvc v33r1) + running on lxplus706.cern.ch on Thu Jul 30 17:07:50 2020 ==================================================================================================================================== ApplicationMgr INFO Application Manager Configured successfully ServiceManager DEBUG Initializing service AppMgrRunable @@ -35,16 +35,22 @@ ApplicationMgr INFO Application Manager Initialized successfully ApplicationMgr Ready ClassIDSvc DEBUG Service base class initialized successfully IncidentSvc DEBUG Adding [ModuleLoaded] listener 'ClassIDSvc' with priority 100 -ClassIDSvc INFO getRegistryEntries: read 1564 CLIDRegistry entries for module ALL -ClassIDSvc DEBUG processCLIDDB: read 1710 entries from CLIDDB file: /build2/amete/athena-workspace/build/build/Athena/x86_64-centos7-gcc8-opt/share/clid.db +ClassIDSvc INFO getRegistryEntries: read 1579 CLIDRegistry entries for module ALL +ClassIDSvc FATAL uncheckedSetTypePackageForID: StoreGate-00-00-00 can not set type name <B1> for CLID 8111: Known name for this ID <Baz> It was set by AthenaServices-00-00-00 +ClassIDSvc FATAL uncheckedSetTypePackageForID: StoreGate-00-00-00 can not set type name <D1> for CLID 8112: Known name for this ID <BazAuxContainer> It was set by AthenaServices-00-00-00 +ClassIDSvc FATAL uncheckedSetTypePackageForID: AthenaServices-00-00-00 can not set type name <SG::SelectionVetoesRef> for CLID 3789442: Known name for this ID <SG::SelectionVetoes> It was set by AthenaServices-00-00-00 +ClassIDSvc DEBUG processCLIDDB: read 1745 entries from CLIDDB file: /afs/cern.ch/user/s/ssnyder/atlas-work3h/build-x86_64-centos7-gcc8-opt/x86_64-centos7-gcc8-opt/share/clid.db +ClassIDSvc FATAL uncheckedSetTypePackageForID: StoreGate-00-00-00 can not set type name <B1> for CLID 8111: Known name for this ID <Baz> It was set by AthenaServices-00-00-00 +ClassIDSvc FATAL uncheckedSetTypePackageForID: StoreGate-00-00-00 can not set type name <D1> for CLID 8112: Known name for this ID <BazAuxContainer> It was set by AthenaServices-00-00-00 +ClassIDSvc DEBUG processCLIDDB: read 1745 entries from CLIDDB file: /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2020-07-28T2136/Athena/22.0.16/InstallArea/x86_64-centos7-gcc8-opt/share/clid.db StoreGateSvc DEBUG Service base class initialized successfully StoreGateSvc DEBUG trying to create store SGImplSvc/StoreGateSvc_Impl StoreGateSvc_Impl DEBUG Service base class initialized successfully ProxyProviderSvc DEBUG Service base class initialized successfully IncidentSvc DEBUG Adding [EndEvent] listener 'StoreGateSvc' with priority 100 IncidentSvc DEBUG Adding [BeginEvent] listener 'StoreGateSvc' with priority 100 +ClassIDSvc INFO getRegistryEntries: read 2385 CLIDRegistry entries for module ALL ToolSvc DEBUG Service base class initialized successfully -ClassIDSvc INFO getRegistryEntries: read 2536 CLIDRegistry entries for module ALL AthenaOutputStream DEBUG Property update for OutputLevel : new value = 1 AthenaOutputStreamVERBOSE ServiceLocatorHelper::service: found service EventDataSvc TimelineSvc DEBUG Service base class initialized successfully @@ -61,18 +67,8 @@ AthenaOutputStream DEBUG Found StoreGateSvc store. ItemListSvc DEBUG ItemListSvc initialize OutputStreamSeq... INFO Initializing OutputStreamSequencerSvc - package version AthenaServices-00-00-00 OutputStreamSeq... DEBUG Service base class initialized successfully -MetaDataSvc INFO Initializing MetaDataSvc - package version AthenaServices-00-00-00 -MetaDataSvc DEBUG Service base class initialized successfully -InputMetaDataStore DEBUG Service base class initialized successfully -InputMetaDataStore DEBUG trying to create store SGImplSvc/InputMetaDataStore_Impl -InputMetaDataSt... DEBUG Service base class initialized successfully -IncidentSvc DEBUG Adding [EndEvent] listener 'InputMetaDataStore' with priority 100 -IncidentSvc DEBUG Adding [BeginEvent] listener 'InputMetaDataStore' with priority 100 -MetaDataStore DEBUG Service base class initialized successfully -MetaDataStore DEBUG trying to create store SGImplSvc/MetaDataStore_Impl -MetaDataStore_Impl DEBUG Service base class initialized successfully -IncidentSvc DEBUG Adding [EndEvent] listener 'MetaDataStore' with priority 100 -IncidentSvc DEBUG Adding [BeginEvent] listener 'MetaDataStore' with priority 100 +AthenaOutputStr... DEBUG Property update for OutputLevel : new value = 1 +AthenaOutputStr... INFO Initializing AthenaOutputStream.AthenaOutputStreamTool - package version AthenaServices-00-00-00 AthenaPoolCnvSvc INFO Initializing AthenaPoolCnvSvc - package version AthenaPoolCnvSvc-00-00-00 DataModelCompatSvc DEBUG Service base class initialized successfully DataModelCompatSvc DEBUG FILE:LINE (StatusCode DataModelCompatSvc::initialize()): running @@ -91,7 +87,7 @@ PoolSvc INFO Set connectionsvc retry/timeout/IDLE timeout to 'Conn PoolSvc INFO Frontier compression level set to 5 DBReplicaSvc DEBUG Service base class initialized successfully 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 /build2/amete/athena-workspace/build/build/Athena/x86_64-centos7-gcc8-opt/share/dbreplica.config +DBReplicaSvc INFO Read replica configuration from /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2020-07-28T2136/Athena/22.0.16/InstallArea/x86_64-centos7-gcc8-opt/share/dbreplica.config DBReplicaSvc DEBUG Candidate server ATLF (priority -2700) DBReplicaSvc DEBUG Candidate server ATLAS_COOLPROD (priority -695) DBReplicaSvc DEBUG Candidate server atlas_dd (priority -690) @@ -102,7 +98,7 @@ DBReplicaSvc DEBUG Candidate server ATONR_COOL (priority -670) DBReplicaSvc DEBUG Candidate server ATONR_CONF (priority -665) DBReplicaSvc DEBUG Candidate server DEVDB11 (priority -660) DBReplicaSvc DEBUG Candidate server ATLF (priority -2200) -DBReplicaSvc INFO Total of 10 servers found for host aibuild001.cern.ch [ATLF ATLAS_COOLPROD atlas_dd ATLAS_CONFIG INT8R INTR ATONR_COOL ATONR_CONF DEVDB11 ATLF ] +DBReplicaSvc INFO Total of 10 servers found for host lxplus706.cern.ch [ATLF ATLAS_COOLPROD atlas_dd ATLAS_CONFIG INT8R INTR ATONR_COOL ATONR_CONF DEVDB11 ATLF ] PoolSvc INFO Successfully setup replica sorting algorithm PoolSvc DEBUG OutputLevel is 2 PoolSvc INFO Setting up APR FileCatalog and Streams @@ -111,18 +107,6 @@ PoolSvc INFO POOL WriteCatalog is xmlcatalog_file:PoolFileCatalog.x DbSession INFO Open DbSession Domain[ROOT_All] INFO > Access DbDomain READ [ROOT_All] ChronoStatSvc DEBUG Service base class initialized successfully -FileMgr DEBUG Service base class initialized successfully -FileMgr DEBUG Successfully registered handler for tech "ROOT" -FileMgr DEBUG Successfully registered handler for tech "POSIX" -MetaDataSvc INFO Found MetaDataTools = PublicToolHandleArray([]) -IncidentSvc DEBUG Adding [FirstInputFile] listener 'MetaDataSvc' with priority 80 -IncidentSvc DEBUG Adding [BeginInputFile] listener 'MetaDataSvc' with priority 80 -IncidentSvc DEBUG Adding [EndInputFile] listener 'MetaDataSvc' with priority 10 -IoComponentMgr DEBUG --> io_register(MetaDataSvc) -IoComponentMgr DEBUG registering IoComponent "MetaDataSvc" -AthenaOutputStr... DEBUG Property update for OutputLevel : new value = 1 -ClassIDSvc INFO getRegistryEntries: read 1140 CLIDRegistry entries for module ALL -AthenaOutputStr... INFO Initializing AthenaOutputStream.AthenaOutputStreamTool - package version AthenaServices-00-00-00 ServiceManager FATAL No Service factory for DetectorStore available. AthenaOutputStr... ERROR ServiceLocatorHelper::service: can not locate service DetectorStore AthenaOutputStream INFO Found HelperTools = PrivateToolHandleArray([]) @@ -134,39 +118,69 @@ IoComponentMgr DEBUG --> io_hasitem() AthenaOutputStream INFO I/O reinitialization... IncidentSvc DEBUG Adding [MetaDataStop] listener 'AthenaOutputStream' with priority 50 AthenaOutputStr... DEBUG Property update for OutputLevel : new value = 1 +AthenaOutputStreamVERBOSE Both high and low float compression lists are empty. Float compression will NOT be applied. AthenaOutputStream DEBUG End initialize AthenaOutputStreamVERBOSE ServiceLocatorHelper::service: found service AlgExecStateSvc AlgExecStateSvc DEBUG preInit: will add Alg AthenaOutputStream later AthenaOutputStream DEBUG input handles: 0 -AthenaOutputStream DEBUG output handles: 0 +AthenaOutputStream DEBUG output handles: 1 AthenaOutputStream DEBUG Registering all Tools in ToolHandleArray HelperTools AthenaOutputStream DEBUG Adding private ToolHandle tool AthenaOutputStream.AthenaOutputStreamTool (AthenaOutputStreamTool) AthenaOutputStream DEBUG Data Deps for AthenaOutputStream + INPUT IGNORED ( 'AthenaAttributeList' , '' ) -StoreGateSvc DEBUG Recorded object @0x35b82f0 with key uno of type Foo(CLID 8101) - in DataObject @0x3276770 + + OUTPUT ( 'SG::SelectionVetoes' , 'StoreGateSvc+SelectionVetoes_AthenaOutputStream' ) +StoreGateSvc DEBUG Recorded object @0x631dc70 with key uno of type Foo(CLID 8101) + in DataObject @0x631dd20 + object modifiable when retrieved +StoreGateSvc DEBUG Recorded object @0x631c990 with key due of type Foo(CLID 8101) + in DataObject @0x631d830 + object modifiable when retrieved +StoreGateSvc DEBUG Recorded object @0x640ec60 with key uno of type Bar(CLID 8107) + in DataObject @0x631c8d0 object modifiable when retrieved -StoreGateSvc DEBUG Recorded object @0x35b8410 with key due of type Foo(CLID 8101) - in DataObject @0x35b8290 +StoreGateSvc DEBUG Recorded object @0x631c9b0 with key due of type Bar(CLID 8107) + in DataObject @0x640ef60 object modifiable when retrieved -StoreGateSvc DEBUG Recorded object @0x35b8650 with key uno of type Bar(CLID 8107) - in DataObject @0x35e9e00 +StoreGateSvc DEBUG Recorded object @0x640f2f0 with key quattro of type Bar(CLID 8107) + in DataObject @0x640f260 object modifiable when retrieved -StoreGateSvc DEBUG Recorded object @0x35b83f0 with key due of type Bar(CLID 8107) - in DataObject @0x35b88c0 +StoreGateSvc DEBUG Recorded object @0x640f650 with key cinque of type Bar(CLID 8107) + in DataObject @0x640f5a0 object modifiable when retrieved -StoreGateSvc DEBUG Recorded object @0x30a07f0 with key quattro of type Bar(CLID 8107) - in DataObject @0x35b8bc0 +StoreGateSvc DEBUG Recorded object @0x640fc80 with key sei of type Baz(CLID 8111) + in DataObject @0x64165a0 object modifiable when retrieved -StoreGateSvc DEBUG Recorded object @0x35b8f70 with key cinque of type Bar(CLID 8107) - in DataObject @0x35b8ee0 +StoreGateSvc DEBUG Recorded object @0x640fcb0 with key seiAux. of type BazAuxContainer(CLID 8112) + in DataObject @0x631c820 object modifiable when retrieved +ClassIDSvc INFO getRegistryEntries: read 724 CLIDRegistry entries for module ALL AthenaOutputStr...WARNING add: can not find clid 13 in clid db AthenaOutputStream DEBUG addItemObjects(13,"*") called AthenaOutputStream DEBUG Key:* AthenaOutputStr... DEBUG Property update for OutputLevel : new value = 1 AthenaOutputStream DEBUG Comp Attr High: 0 with 7 mantissa bits. AthenaOutputStream DEBUG Comp Attr Low: 0 with 15 mantissa bits. +MetaDataSvc INFO Initializing MetaDataSvc - package version AthenaServices-00-00-00 +MetaDataSvc DEBUG Service base class initialized successfully +InputMetaDataStore DEBUG Service base class initialized successfully +InputMetaDataStore DEBUG trying to create store SGImplSvc/InputMetaDataStore_Impl +InputMetaDataSt... DEBUG Service base class initialized successfully +IncidentSvc DEBUG Adding [EndEvent] listener 'InputMetaDataStore' with priority 100 +IncidentSvc DEBUG Adding [BeginEvent] listener 'InputMetaDataStore' with priority 100 +MetaDataStore DEBUG Service base class initialized successfully +MetaDataStore DEBUG trying to create store SGImplSvc/MetaDataStore_Impl +MetaDataStore_Impl DEBUG Service base class initialized successfully +IncidentSvc DEBUG Adding [EndEvent] listener 'MetaDataStore' with priority 100 +IncidentSvc DEBUG Adding [BeginEvent] listener 'MetaDataStore' with priority 100 +FileMgr DEBUG Service base class initialized successfully +FileMgr DEBUG Successfully registered handler for tech "ROOT" +FileMgr DEBUG Successfully registered handler for tech "POSIX" +MetaDataSvc INFO Found MetaDataTools = PublicToolHandleArray([]) +IncidentSvc DEBUG Adding [FirstInputFile] listener 'MetaDataSvc' with priority 80 +IncidentSvc DEBUG Adding [BeginInputFile] listener 'MetaDataSvc' with priority 80 +IncidentSvc DEBUG Adding [EndInputFile] listener 'MetaDataSvc' with priority 10 +IoComponentMgr DEBUG --> io_register(MetaDataSvc) +IoComponentMgr DEBUG registering IoComponent "MetaDataSvc" AthenaOutputStream DEBUG Failed to receive proxy iterators from StoreGate for 13,"*". Skipping AthenaOutputStream DEBUG addItemObjects(8101,"*") called AthenaOutputStream DEBUG Key:* @@ -247,10 +261,30 @@ AthenaOutputStreamVERBOSE Calling matchKey( [quattro], cinque) AthenaOutputStreamVERBOSE Couldn't match every sub-string... return: 0 AthenaOutputStreamVERBOSE Done calling matchKey( [quattro], cinque) with result: 0 AthenaOutputStream DEBUG Added object 8108,"quattro" +AthenaOutputStream DEBUG addItemObjects(8111,"sei") called +AthenaOutputStream DEBUG Key:sei +AthenaOutputStream DEBUG Comp Attr High: 0 with 7 mantissa bits. +AthenaOutputStream DEBUG Comp Attr Low: 0 with 15 mantissa bits. +AthenaOutputStreamVERBOSE Calling tokenizeAtStep( [], sei, *) +AthenaOutputStreamVERBOSE Done calling tokenizeAtStep( [sei], sei, *) +AthenaOutputStream DEBUG Added object 8111,"sei" +AthenaOutputStream DEBUG addItemObjects(8112,"seiAux.") called +AthenaOutputStream DEBUG Key:seiAux. +AthenaOutputStream DEBUG Aux Attr:aaa.ccc +AthenaOutputStr... DEBUG Property update for OutputLevel : new value = 1 +AthenaOutputStr... DEBUG Property update for OutputLevel : new value = 1 +AthenaOutputStream DEBUG Comp Attr High: 0 with 7 mantissa bits. +AthenaOutputStream DEBUG Comp Attr Low: 0 with 15 mantissa bits. +AthenaOutputStreamVERBOSE Calling tokenizeAtStep( [], seiAux., *) +AthenaOutputStreamVERBOSE Done calling tokenizeAtStep( [seiAux.], seiAux., *) +AthenaOutputStream DEBUG Added object 8112,"seiAux." +8112 seiAux. 8101 due 8101 uno 8107 due 8107 uno 8108 cinque 8107 quattro +8111 sei +StoreGateSvc DEBUG Retrieved const pointer to object SelectionVetoes_AthenaOutputStream of type SG::SelectionVetoes(CLID 3789442) *** AthenaOutputStream_test OK *** diff --git a/Control/AthenaServices/share/AthenaOutputStream_test.txt b/Control/AthenaServices/share/AthenaOutputStream_test.txt index 59495616f12d3c76622113bf56d7069843dfc851..f93bafc781012ed1152bb328119ffc40d32d933b 100644 --- a/Control/AthenaServices/share/AthenaOutputStream_test.txt +++ b/Control/AthenaServices/share/AthenaOutputStream_test.txt @@ -11,5 +11,7 @@ AthenaOutputStream.ItemList={"Bar#uno", "Bar#due", "Bar#tre" , "8101#*", "Fee#quattro", "Fee!#cinque", + "Baz#sei", + "BazAuxContainer#seiAux.aaa.ccc", "13#*"}; AthenaOutputStream.AcceptAlgs={"AthenaOutputStream", "aSFQS"}; diff --git a/Control/AthenaServices/src/AthenaOutputStream.cxx b/Control/AthenaServices/src/AthenaOutputStream.cxx index 09cf7a3e3407b4f12b176a7403747cf594e197d3..7de904ec9c20a686e6962752026261267e383a35 100644 --- a/Control/AthenaServices/src/AthenaOutputStream.cxx +++ b/Control/AthenaServices/src/AthenaOutputStream.cxx @@ -22,17 +22,20 @@ #include "AthenaKernel/IItemListSvc.h" #include "StoreGate/StoreGateSvc.h" +#include "StoreGate/WriteHandle.h" #include "SGTools/DataProxy.h" #include "SGTools/TransientAddress.h" #include "SGTools/ProxyMap.h" #include "SGTools/SGIFolder.h" #include "AthenaKernel/CLIDRegistry.h" +#include "xAODCore/AuxSelection.h" #include "AthContainersInterfaces/IAuxStore.h" #include "AthContainersInterfaces/IAuxStoreIO.h" #include "AthContainersInterfaces/IAuxStoreCompression.h" #include "OutputStreamSequencerSvc.h" #include "MetaDataSvc.h" +#include "SelectionVetoes.h" #include <boost/tokenizer.hpp> #include <cassert> @@ -306,6 +309,16 @@ StatusCode AthenaOutputStream::initialize() { "low compression will use " << m_compressionBitsLow << " mantissa bits."); } + /// Set SG key for selected variable information. + // For CreateOutputStream.py, the algorithm name is the same as the stream + // name. But OutputStreamConfig.py adds `OutputStream' to the front. + std::string streamName = this->name(); + if (streamName.substr (0, 12) == "OutputStream") { + streamName.erase (0, 12); + } + m_selVetoesKey = "SelectionVetoes_" + streamName; + ATH_CHECK( m_selVetoesKey.initialize() ); + ATH_MSG_DEBUG("End initialize"); return StatusCode::SUCCESS; } @@ -516,7 +529,7 @@ StatusCode AthenaOutputStream::write() { // Clear any previously existing item list clearSelection(); - collectAllObjects(); + ATH_CHECK( collectAllObjects() ); // keep a local copy of the object lists so they are not overwritten when we release the lock IDataSelector objects = std::move( m_objects ); @@ -602,18 +615,21 @@ void AthenaOutputStream::clearSelection() { m_altObjects.clear(); } -void AthenaOutputStream::collectAllObjects() { +StatusCode AthenaOutputStream::collectAllObjects() { if (m_itemListFromTool) { if (!m_streamer->getInputItemList(&*m_p2BWritten).isSuccess()) { ATH_MSG_WARNING("collectAllObjects() could not get ItemList from Tool."); } } + + auto vetoes = std::make_unique<SG::SelectionVetoes>(); + m_p2BWritten->updateItemList(true); std::vector<CLID> folderclids; // Collect all objects that need to be persistified: //FIXME refactor: move this in folder. Treat as composite for (SG::IFolder::const_iterator i = m_p2BWritten->begin(), iEnd = m_p2BWritten->end(); i != iEnd; i++) { - addItemObjects(*i); + addItemObjects(*i, *vetoes); folderclids.push_back(i->id()); } @@ -639,10 +655,18 @@ void AthenaOutputStream::collectAllObjects() { m_objects.push_back(*it); // then copy others new into previous } } + + // If there were any variable selections, record the information in SG. + if (!vetoes->empty()) { + ATH_CHECK( SG::makeHandle (m_selVetoesKey).record (std::move (vetoes)) ); + } + + return StatusCode::SUCCESS; } //FIXME refactor: move this in folder. Treat as composite -void AthenaOutputStream::addItemObjects(const SG::FolderItem& item) +void AthenaOutputStream::addItemObjects(const SG::FolderItem& item, + SG::SelectionVetoes& vetoes) { // anything after a dot is a list of dynamic Aux attrubutes, separated by dots size_t dotpos = item.key().find('.'); @@ -856,11 +880,7 @@ void AthenaOutputStream::addItemObjects(const SG::FolderItem& item) tns << tn; } - // Make the decision whether to try to call - // SG::IAuxStoreIO::selectAux(...) based on the SG key of the - // object. Because even if aux_attr is empty, we may need to - // reset an auxiliary store back to not being slimmed, after - // a previous stream slimmed it. + /// Handle variable selections. if (item_key.find( "Aux." ) == ( item_key.size() - 4 )) { SG::IAuxStoreIO* auxio(nullptr); try { @@ -871,29 +891,13 @@ void AthenaOutputStream::addItemObjects(const SG::FolderItem& item) << itemProxy->clID() << " to SG::IAuxStoreIO*" ); auxio = nullptr; } - if( auxio ) { - // collect dynamic Aux selection (parse the line, attributes separated by dot) - std::set<std::string> attributes; - if( aux_attr.size() ) { - std::stringstream ss(aux_attr); - std::string attr; - while( std::getline(ss, attr, '.') ) { - attributes.insert(attr); - std::stringstream temp; - temp << tns.str() << attr; - if (m_itemSvc->addStreamItem(this->name(),temp.str()).isFailure()) { - ATH_MSG_WARNING("Unable to record item " << temp.str() << " in Svc"); - } - } - // don't let keys with wildcard overwrite existing selections - // MN: TODO: this condition was always true - need a better check - //if( auxio->getSelectedAuxIDs().size() == auxio->getDynamicAuxIDs().size() - // || item_key.find('*') == string::npos ) - // auxio->selectAux(attributes); - } - // Reset selection even if empty - in case we write multiple streams - auxio->selectAux( attributes ); + + if (auxio) { + handleVariableSelection (*auxio, *itemProxy, + tns.str(), aux_attr, + vetoes); } + // Here comes the compression logic using SG::IAuxStoreCompression // similar to that of SG::IAuxStoreIO above SG::IAuxStoreCompression* auxcomp( nullptr ); @@ -942,6 +946,53 @@ void AthenaOutputStream::addItemObjects(const SG::FolderItem& item) } } + +void AthenaOutputStream::handleVariableSelection (SG::IAuxStoreIO& auxio, + SG::DataProxy& itemProxy, + const std::string& tns, + const std::string& aux_attr, + SG::SelectionVetoes& vetoes) const +{ + // collect dynamic Aux selection (parse the line, attributes separated by dot) + std::set<std::string> attributes; + if( aux_attr.size() ) { + std::stringstream ss(aux_attr); + std::string attr; + while( std::getline(ss, attr, '.') ) { + attributes.insert(attr); + std::stringstream temp; + temp << tns << attr; + if (m_itemSvc->addStreamItem(this->name(),temp.str()).isFailure()) { + ATH_MSG_WARNING("Unable to record item " << temp.str() << " in Svc"); + } + } + } + + // Return early if there's no selection. + if (attributes.empty()) { + return; + } + + std::string key = itemProxy.name(); + if (key.size() >= 4 && key.substr (key.size()-4, 4) == "Aux.") + { + key.erase (key.size()-4, 4); + } + + SG::auxid_set_t dynVars = auxio.getSelectedAuxIDs(); + + // Find the entry for the selection. + SG::auxid_set_t& vset = vetoes[key]; + + // Form the veto mask for this object. + xAOD::AuxSelection sel; + sel.selectAux (attributes); + vset = sel.getSelectedAuxIDs (dynVars); + + vset.flip(); +} + + void AthenaOutputStream::itemListHandler(Property& /* theProp */) { // Assuming concrete SG::Folder also has an itemList property IProperty *pAsIProp(nullptr); diff --git a/Control/AthenaServices/src/AthenaOutputStream.h b/Control/AthenaServices/src/AthenaOutputStream.h index e0fd7883212b4dd36d1f1c23ca45fc2425e05977..21806fcabd02823d7351cebbe091d384434474d5 100644 --- a/Control/AthenaServices/src/AthenaOutputStream.h +++ b/Control/AthenaServices/src/AthenaOutputStream.h @@ -23,8 +23,11 @@ #include "GaudiKernel/IIncidentListener.h" #include "AthenaBaseComps/FilteredAlgorithm.h" +#include "StoreGate/WriteHandleKey.h" #include "GaudiKernel/IIoComponent.h" +#include "SelectionVetoes.h" + // forward declarations class IClassIDSvc; class OutputStreamSequencerSvc; @@ -37,6 +40,7 @@ class MetaDataSvc; namespace SG { class DataProxy; class IFolder; + class IAuxStoreIO; class FolderItem; } @@ -148,6 +152,12 @@ protected: typedef std::recursive_mutex mutex_t; mutex_t m_mutex; +private: + /// Key used for recording selected dynamic variable information + /// to the event store. + SG::WriteHandleKey<SG::SelectionVetoes> m_selVetoesKey + { this, "SelVetoesKey", "" }; + protected: /// Handler for ItemNames Property void itemListHandler(Property& /* theProp */); @@ -178,7 +188,7 @@ public: /// Clear list of selected objects void clearSelection(); /// Collect data objects for output streamer list - void collectAllObjects(); + StatusCode collectAllObjects(); /// Return the list of selected objects IDataSelector* selectedObjects() { return &m_objects; @@ -191,7 +201,13 @@ public: private: /// Add item data objects to output streamer list - void addItemObjects(const SG::FolderItem&); + void addItemObjects(const SG::FolderItem&, SG::SelectionVetoes& vetoes); + + void handleVariableSelection (SG::IAuxStoreIO& auxio, + SG::DataProxy& itemProxy, + const std::string& tns, + const std::string& aux_attr, + SG::SelectionVetoes& vetoes) const; /// tokenize a string based on a substring void tokenizeAtSep( std::vector<std::string>&, const std::string&, const std::string& ) const; diff --git a/Control/AthenaServices/src/SelectionVetoes.h b/Control/AthenaServices/src/SelectionVetoes.h new file mode 100644 index 0000000000000000000000000000000000000000..752cf0be3e09c737b2871b880c824c8128be43ef --- /dev/null +++ b/Control/AthenaServices/src/SelectionVetoes.h @@ -0,0 +1,59 @@ +// This file's extension implies that it's C, but it's really -*- C++ -*-. +/* + * Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration. + */ +/** + * @file AthenaServices/SelectionVetoes.h + * @author scott snyder <snyder@bnl.gov> + * @date Jul, 2020 + * @brief Communicate between AthenaOuptutStream and ThinningCacheTool. + * + * AthenaOutputStream processes ItemList entries, including the selections + * of which dynamic variables to write. This last information is then used + * by ThinningCacheTool to populate the ThinningCache. To convey + * this information, AthenaOutputStream records in the event store + * a SelectionVetoes object with a key of `SelectionVetoes_STREAM', + * for stream STREAM. SelectionVetoes then contains a + * map from object names to sets of vetoed variables. + * + * We record the list of vetoed + * variables, rather than selected, since that leads to a natural handling + * of the common case where there is no selection made; we can just + * omit any entry in that case. + * + * But note that the selection mechanism only applies to dynamic variables, + * so static variables will be flagged as vetoed. + */ + + +#ifndef ATHENASERVICES_SELECTIONVETOES_H +#define ATHENASERVICES_SELECTIONVETOES_H + + +#include "AthContainersInterfaces/AuxTypes.h" +#include "AthenaKernel/sgkey_t.h" +#include "AthenaKernel/CLASS_DEF.h" +#include <vector> +#include <unordered_map> +#include <tuple> +#include <string> + + +namespace SG { + + +/** + * @brief Map of vetoed variables. + * + * Map from object SG names to a mask of vetoed variables for that object. + */ +using SelectionVetoes = std::unordered_map<std::string, SG::auxid_set_t>; + + +} // namespace SG + + +CLASS_DEF( SG::SelectionVetoes, 3789442, 1 ) + + +#endif // not ATHENASERVICES_SELECTIONVETOES_H diff --git a/Control/AthenaServices/src/ThinningCacheTool.cxx b/Control/AthenaServices/src/ThinningCacheTool.cxx index 2f9377662934bf900a0a55852c6033bcc7b8c8f9..f48816028bfd6c0bfe4c211088b46a3dcbd2463f 100644 --- a/Control/AthenaServices/src/ThinningCacheTool.cxx +++ b/Control/AthenaServices/src/ThinningCacheTool.cxx @@ -15,6 +15,7 @@ #include "AthenaKernel/IProxyDict.h" #include "AthenaKernel/ExtendedEventContext.h" #include "GaudiKernel/ThreadLocalContext.h" +#include "SelectionVetoes.h" namespace Athena { @@ -95,6 +96,16 @@ StatusCode ThinningCacheTool::preStream() } } + // Look for any selection vetoes. + const std::string selVetoesKey = "SelectionVetoes_" + m_streamName; + const SG::SelectionVetoes* vetoes = nullptr; + if (evtStore()->contains<SG::SelectionVetoes> (selVetoesKey)) { + ATH_CHECK( evtStore()->retrieve (vetoes, selVetoesKey) ); + for (const auto& p : *vetoes) { + m_cache.setVetoed (p.first, p.second); + } + } + // Set the TrigNavigation thinning tool if needed. if (!m_trigNavigationThinningSvc.empty()) { m_cache.setTrigNavigationThinningSvc (m_trigNavigationThinningSvc.get()); diff --git a/Control/AthenaServices/test/AthenaOutputStream_test.cxx b/Control/AthenaServices/test/AthenaOutputStream_test.cxx index ed398a82172b7bd360fad70c90c748e3b39355e6..ca384f81d8650c5f29fe0c47b6e19e90025b20be 100644 --- a/Control/AthenaServices/test/AthenaOutputStream_test.cxx +++ b/Control/AthenaServices/test/AthenaOutputStream_test.cxx @@ -28,6 +28,7 @@ #include "CxxUtils/ubsan_suppress.h" #include "../src/AthenaOutputStream.h" +#include "../src/SelectionVetoes.h" #include "TInterpreter.h" using std::cerr; @@ -73,18 +74,30 @@ int main() { assert( (pStore->record(new Bar(), "cinque")).isSuccess() ); assert( (pStore->symLink(8107, "quattro", 8108)).isSuccess() ); assert( (pStore->symLink(8107, "cinque", 8108)).isSuccess() ); + + auto baz = std::make_unique<Baz>(); + auto bazaux = std::make_unique<BazAuxContainer>(); + baz->setStore (bazaux.get()); + SG::AuxElement::Accessor<int> aaa ("aaa"); + SG::AuxElement::Accessor<int> bbb ("bbb"); + SG::AuxElement::Accessor<int> ccc ("ccc"); + aaa (*baz); + bbb (*baz); + ccc (*baz); + assert( (pStore->record(std::move(baz), "sei")).isSuccess() ); + assert( (pStore->record(std::move(bazaux), "seiAux.")).isSuccess() ); AthenaOutputStream* pStream(dynamic_cast<AthenaOutputStream*>(pAlg)); assert( pStream ); //fill the vector of selected objects - pStream->collectAllObjects(); + assert( pStream->collectAllObjects().isSuccess() ); // cout << pStream->selectedObjects()->end() - // pStream->selectedObjects()->begin() <<endl; // verify that we got the right objects in the list // this of course depends on AthenaOutputStream_test.txt - assert( 6 == (pStream->selectedObjects()->end() - + assert( 8 == (pStream->selectedObjects()->end() - pStream->selectedObjects()->begin()) ); for (DataObject* obj : *pStream->selectedObjects()) { @@ -93,6 +106,15 @@ int main() { const SG::DataProxy* proxy = pStore->proxy (dbb->object()); std::cout << dbb->clID() << " " << proxy->name() << "\n"; } + + const SG::SelectionVetoes* selvetoes = nullptr; + assert (pStore->retrieve (selvetoes, "SelectionVetoes_AthenaOutputStream").isSuccess()); + assert (selvetoes->size() == 1); + auto it = selvetoes->find("sei"); + assert (it != selvetoes->end()); + assert (!it->second.test (aaa.auxid())); + assert ( it->second.test (bbb.auxid())); + assert (!it->second.test (ccc.auxid())); pStream->clearSelection(); assert( 0 == (pStream->selectedObjects()->end() - diff --git a/Control/AthenaServices/test/FooBar.h b/Control/AthenaServices/test/FooBar.h index 06d388e1f492b4006ed2892e9482f54c5fd9cc91..7f26d8c656cad43faa400db88d5c778bdb90194a 100644 --- a/Control/AthenaServices/test/FooBar.h +++ b/Control/AthenaServices/test/FooBar.h @@ -1,11 +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 */ #ifndef TEST_FOOBAR_H # define TEST_FOOBAR_H +#include "xAODCore/AuxContainerBase.h" +#include "AthContainers/AuxElement.h" #include "AthenaKernel/CLASS_DEF.h" + + class Foo{ private: double m_a; @@ -32,6 +36,22 @@ CLASS_DEF( Bar, 8107, 0) struct Fee{ void doNothing() const {}; }; -CLASS_DEF( Fee, 8108, 0) +CLASS_DEF( Fee, 8108, 0) + +class Baz + : public SG::AuxElement +{ +}; +SG_BASE (Baz, SG::AuxElement); +CLASS_DEF( Baz, 8111, 0) + + +class BazAuxContainer + : public xAOD::AuxContainerBase +{ +}; +SG_BASE (BazAuxContainer, xAOD::AuxContainerBase); +CLASS_DEF( BazAuxContainer, 8112, 0) + #endif // TEST_FOOBAR_H diff --git a/Control/AthenaServices/test/ThinningCacheTool_test.cxx b/Control/AthenaServices/test/ThinningCacheTool_test.cxx index 25af545c5d583efd25d1d51aaa9edf9cc488b6d5..e16bbf18dcd0cf7a42d1d8d7a2ff9f73009c6285 100644 --- a/Control/AthenaServices/test/ThinningCacheTool_test.cxx +++ b/Control/AthenaServices/test/ThinningCacheTool_test.cxx @@ -10,6 +10,7 @@ #undef NDEBUG +#include "../src/SelectionVetoes.h" #include "StoreGate/StoreGateSvc.h" #include "AthenaBaseComps/AthService.h" #include "AthContainers/DataVector.h" @@ -122,8 +123,40 @@ void test1() assert (SG::getThinningCache()->trigNavigationThinningSvc() == nullptr); + auto vetoes = std::make_unique<SG::SelectionVetoes>(); + SG::auxid_set_t s1; + s1.set (10); + s1.set (11); + SG::auxid_set_t s3; + s3.set (11); + s3.set (12); + (*vetoes).emplace ("v1", s1); + (*vetoes).emplace ("v3", s3); + assert (sg->record (std::move (vetoes), "SelectionVetoes_MyStream").isSuccess()); + + assert (tool->preStream().isSuccess()); + assert (SG::getThinningCache() != nullptr); + + assert (SG::getThinningInfo ("v1") != nullptr); + assert (SG::getThinningInfo ("v2") != nullptr); + assert (SG::getThinningInfo ("v3") != nullptr); + assert (SG::getThinningInfo ("xx") == nullptr); + + assert (SG::getThinningInfo ("v1")->m_vetoed.size() == 2); + assert (SG::getThinningInfo ("v2")->m_vetoed.size() == 0); + assert (SG::getThinningInfo ("v3")->m_vetoed.size() == 2); + + assert (SG::getThinningInfo ("v1")->vetoed (10)); + assert (SG::getThinningInfo ("v1")->vetoed (11)); + assert (!SG::getThinningInfo ("v1")->vetoed (12)); + assert (!SG::getThinningInfo ("v3")->vetoed (10)); + assert (SG::getThinningInfo ("v3")->vetoed (11)); + assert (SG::getThinningInfo ("v3")->vetoed (12)); + assert (tool->postExecute().isSuccess()); assert (SG::getThinningCache() == nullptr); + + assert (sg->clearStore().isSuccess()); } diff --git a/Control/CxxUtils/CMakeLists.txt b/Control/CxxUtils/CMakeLists.txt index c585cbf5741a87da9a2041e5523aaffceb147df6..a7f27efe66cba3d21e5ced9472d9fb1946294022 100644 --- a/Control/CxxUtils/CMakeLists.txt +++ b/Control/CxxUtils/CMakeLists.txt @@ -72,6 +72,10 @@ atlas_add_test( bitscan_test_portable SOURCES test/bitscan_test.cxx LINK_LIBRARIES CxxUtils ) +atlas_add_test( ut_cxxutils_floatcompression_test + SOURCES test/ut_cxxutils_floatcompression_test.cxx + LINK_LIBRARIES CxxUtils ) + if( TARGET CxxUtils_bitscan_test_portable ) target_compile_definitions(CxxUtils_bitscan_test_portable PRIVATE "-DTEST_PORTABLE" ) diff --git a/Event/xAOD/xAODCore/xAODCore/tools/FloatCompressor.h b/Control/CxxUtils/CxxUtils/FloatCompressor.h similarity index 90% rename from Event/xAOD/xAODCore/xAODCore/tools/FloatCompressor.h rename to Control/CxxUtils/CxxUtils/FloatCompressor.h index 06f144f2fcec9fb18dd48d3f66f430b249e51bda..472373cb38dcdbf4b0ae1c61abeca431073193de 100644 --- a/Event/xAOD/xAODCore/xAODCore/tools/FloatCompressor.h +++ b/Control/CxxUtils/CxxUtils/FloatCompressor.h @@ -5,15 +5,15 @@ */ // $Id: FloatCompressor.h 789425 2016-12-13 10:50:12Z krasznaa $ -#ifndef XAODCORE_TOOLS_FLOATCOMPRESSOR_H -#define XAODCORE_TOOLS_FLOATCOMPRESSOR_H +#ifndef CXXUTILS_FLOATCOMPRESSOR_H +#define CXXUTILS_FLOATCOMPRESSOR_H // System include(s): extern "C" { # include <stdint.h> } -namespace xAOD { +namespace CxxUtils { /// Class implementing a lossy float compression /// @@ -60,6 +60,6 @@ namespace xAOD { }; // class FloatCompressor -} // namespace xAOD +} // namespace CxxUtils -#endif // XAODCORE_TOOLS_FLOATCOMPRESSOR_H +#endif // CXXUTILS_FLOATCOMPRESSOR_H diff --git a/Control/CxxUtils/CxxUtils/vec.h b/Control/CxxUtils/CxxUtils/vec.h index 0f536c8d43770204b4e86bdddbc16f66f3a51afb..057d386e8603205089405364cb75fa36d316b23f 100644 --- a/Control/CxxUtils/CxxUtils/vec.h +++ b/Control/CxxUtils/CxxUtils/vec.h @@ -24,7 +24,7 @@ * attribute is supported or a fallback C++ class intended to be * (mostly) functionally equivalent. * - * We also support additional operations. + * We also support some additional operations. * * Deducing useful types: * - @c CxxUtils::vec_type_t<VEC> is the element type of @c VEC. @@ -35,7 +35,7 @@ * - @c CxxUtils::vec_size<VEC>() is the number of elements in @c VEC. * - @c CxxUtils::vec_size(const VEC&) is the number of elements in @c VEC. * - * Methods providing similar functionality to certain x86-64 SIMD intrinics + * Methods providing similar functionality to certain x86-64 SIMD intrinsics: * - @c CxxUtils::vbroadcast (VEC& v, T x) initializes each element of * @c v with @c x. * - @c CxxUtils::vload (VEC& dst, vec_type_t<VEC>* mem_addr) @@ -46,11 +46,13 @@ * to @c mem_addr * - @c CxxUtils::vselect (VEC& dst, const VEC& a, const VEC& b, const * mask_type_t<VEC>& mask) - * copies elements from @c a or @b, depending - * on the value @c of mask to @c dst. + * copies elements from @c a or @c b, depending + * on the value of @c mask to @c dst. + * dst[i] = mask[i] ? a[i] : b[i] * - @c CxxUtils::vmin (VEC& dst, const VEC& a, const VEC& b) * copies to @c dst[i] the min(a[i],b[i]) - * + * - @c CxxUtils::vmax (VEC& dst, const VEC& a, const VEC& b) + * copies to @c dst[i] the max(a[i],b[i]) */ #ifndef CXXUTILS_VEC_H @@ -289,20 +291,16 @@ ivec<T, N> operator|| (const vec_fb<T, N>& a, const vec_fb<T, N>& b) #if HAVE_VECTOR_SIZE_ATTRIBUTE - /// Define a nice alias for a built-in vectorized type. template <typename T, size_t N> using vec __attribute__ ((vector_size(N*sizeof(T)))) = T; - #else - /// Define alias for the vectorized fallback type. template <typename T, size_t N> using vec = vec_fb<T, N>; - #endif @@ -375,12 +373,18 @@ template<typename VEC, typename T> inline void vbroadcast(VEC& v, T x) { +#if !HAVE_VECTOR_SIZE_ATTRIBUTE || WANT_VECTOR_FALLBACK // This may look inefficient, but the loop goes away when we // compile with optimization. - const size_t N = CxxUtils::vec_size<VEC>(); + constexpr size_t N = CxxUtils::vec_size<VEC>(); for (size_t i = 0; i < N; i++) { v[i] = x; } +#else + // using - to avoid sign conversions. + // using + adds extra instructions due to float arithmetic. + v = x - VEC{ 0 }; +#endif } /* @@ -408,13 +412,15 @@ vstore(vec_type_t<VEC>* mem_addr, VEC& src) /* * @brief select/blend function. - * Similar _mm_blend X86-64 intrinsics + * Similar to _mm_blend X86-64 intrinsics */ template<typename VEC> inline void vselect(VEC& dst, const VEC& a, const VEC& b, const mask_type_t<VEC>& mask) { -#if (defined(__clang__) && (__clang_major__ < 10)) || \ +// clang supports the ternary operator for vectorized types +// only for llvm version 10 and above. +#if (defined(__clang__) && ((__clang_major__ < 10) || defined(__APPLE__))) || \ !HAVE_VECTOR_SIZE_ATTRIBUTE || WANT_VECTOR_FALLBACK constexpr size_t N = vec_size<VEC>(); for (size_t i = 0; i < N; i++) { @@ -427,13 +433,13 @@ vselect(VEC& dst, const VEC& a, const VEC& b, const mask_type_t<VEC>& mask) /* * @brief vectorized min. - * Similar to _mm_min intrinsics + * Similar to _mm_min X86-64 intrinsics */ template<typename VEC> inline void vmin(VEC& dst, const VEC& a, const VEC& b) { -#if (defined(__clang__) && (__clang_major__ < 10)) || \ +#if (defined(__clang__) && ((__clang_major__ < 10) || defined(__APPLE__))) || \ !HAVE_VECTOR_SIZE_ATTRIBUTE || WANT_VECTOR_FALLBACK constexpr size_t N = vec_size<VEC>(); for (size_t i = 0; i < N; i++) { @@ -444,6 +450,25 @@ vmin(VEC& dst, const VEC& a, const VEC& b) #endif } +/* + * @brief vectorized max. + * Similar to _mm_max X86-64 intrinsics + */ +template<typename VEC> +inline void +vmax(VEC& dst, const VEC& a, const VEC& b) +{ +#if (defined(__clang__) && ((__clang_major__ < 10) || defined(__APPLE__))) || \ + !HAVE_VECTOR_SIZE_ATTRIBUTE || WANT_VECTOR_FALLBACK + constexpr size_t N = vec_size<VEC>(); + for (size_t i = 0; i < N; i++) { + dst[i] = a[i] > b[i] ? a[i] : b[i]; + } +#else + dst = a > b ? a : b; +#endif +} + } // namespace CxxUtils diff --git a/Event/xAOD/xAODCore/Root/FloatCompressor.cxx b/Control/CxxUtils/Root/FloatCompressor.cxx similarity index 97% rename from Event/xAOD/xAODCore/Root/FloatCompressor.cxx rename to Control/CxxUtils/Root/FloatCompressor.cxx index 18e11b7066ec847e5f0a88590988388bbf695d07..f15a1b64cb049484d32f174ce037d24a6d3ae604 100644 --- a/Event/xAOD/xAODCore/Root/FloatCompressor.cxx +++ b/Control/CxxUtils/Root/FloatCompressor.cxx @@ -8,9 +8,9 @@ #include <cmath> // Local include(s): -#include "xAODCore/tools/FloatCompressor.h" +#include "CxxUtils/FloatCompressor.h" -namespace xAOD { +namespace CxxUtils { /// Total number of total mantissa bits static const unsigned int NMANTISSA = 23; @@ -122,4 +122,4 @@ namespace xAOD { return fi.fvalue; } -} // namespace xAOD +} // namespace CxxUtils diff --git a/Event/xAOD/xAODCore/test/ut_xaodcore_floatcompression_test.cxx b/Control/CxxUtils/test/ut_cxxutils_floatcompression_test.cxx similarity index 78% rename from Event/xAOD/xAODCore/test/ut_xaodcore_floatcompression_test.cxx rename to Control/CxxUtils/test/ut_cxxutils_floatcompression_test.cxx index 8eaa2b2f4f9ebfd3980e107dc5f9f6e933272b29..883ba8f2b9a288b7e4870f03c3a5097c9b5f6b6e 100644 --- a/Event/xAOD/xAODCore/test/ut_xaodcore_floatcompression_test.cxx +++ b/Control/CxxUtils/test/ut_cxxutils_floatcompression_test.cxx @@ -4,7 +4,7 @@ // $Id: ut_xaodcore_floatcompression_test.cxx 789425 2016-12-13 10:50:12Z krasznaa $ // -// Unit test for the xAOD::FloatCompressor class. +// Unit test for the CxxUtils::FloatCompressor class. // // System include(s): @@ -12,13 +12,13 @@ #include <iomanip> // Local include(s): -#include "xAODCore/tools/FloatCompressor.h" +#include "CxxUtils/FloatCompressor.h" /// Helper function printing the results of some compressions -void testCompression( const xAOD::FloatCompressor& fc, float value ) { +void testCompression( const CxxUtils::FloatCompressor& fc, float value ) { std::cout << "Original value: " << std::dec << value << std::endl; - xAOD::FloatCompressor::floatint_t compressed; + CxxUtils::FloatCompressor::floatint_t compressed; compressed.fvalue = fc.reduceFloatPrecision( value ); std::cout << "Compressed value: " << compressed.fvalue << " (hex: " << std::hex << std::setw( 8 ) << std::setfill( '0' ) @@ -29,14 +29,14 @@ void testCompression( const xAOD::FloatCompressor& fc, float value ) { int main() { // Create a compressor leaving only 7 mantissa bits: - const xAOD::FloatCompressor fc1( 7 ); + const CxxUtils::FloatCompressor fc1( 7 ); // Try to compress some numbers, and see what we get: testCompression( fc1, 1.2345 ); testCompression( fc1, 3.1415 ); // Now test a compressor leaving 16 mantissa bits: - const xAOD::FloatCompressor fc2( 16 ); + const CxxUtils::FloatCompressor fc2( 16 ); // Try some numbers with this as well: testCompression( fc2, 2.7182 ); @@ -44,7 +44,7 @@ int main() { // Finally, test that when we use the maximal number of mantissa bits for // a float, the number doesn't get changed. - const xAOD::FloatCompressor fc3( 23 ); + const CxxUtils::FloatCompressor fc3( 23 ); // Look at some numbers with this as well: testCompression( fc3, 2.3456 ); diff --git a/Control/CxxUtils/test/vec_test.cxx b/Control/CxxUtils/test/vec_test.cxx index 1fde7ecb02d3c5011dd2bca7240038c6f4e0dcda..91e189fa226792df0ba920811f33cad1d8daed1d 100644 --- a/Control/CxxUtils/test/vec_test.cxx +++ b/Control/CxxUtils/test/vec_test.cxx @@ -330,6 +330,22 @@ test_min(const VEC& v1) } } +template<class VEC> +void +test_max(const VEC& v1) +{ + + const VEC v2 = v1 + 1; + + VEC max; + CxxUtils::vmax(max, v1, v2); + size_t N = CxxUtils::vec_size<VEC>(); + for (size_t i = 0; i < N; i++) { + assert(max[i] == v2[i]); + } +} + + template <template <class T, size_t N> class VEC> void test1a() { @@ -345,10 +361,11 @@ void test1a() do { \ test_arith (VEC<T, N> INITN(N, 1.5, 2.5, 3.5, 4.5, 5.5, 6.5, 7.5, 8.5)); \ test_relops (VEC<T, N> INITN(N, 1.5, 2.5, 3.5, 4.5, 5.5, 6.5, 7.5, 8.5)); \ - test_broadcast (VEC<T, N> INITN(N, 1.5, 1.5, 1.5, 1.5, 1.5, 1.5, 1.5, 1.5)); \ + test_broadcast (VEC<T, N> INITN(N, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0)); \ test_storeload (VEC<T, N> INITN(N, 1.5, 2.5, 3.5, 4.5, 5.5, 6.5, 7.5, 8.5)); \ test_select (VEC<T, N> INITN(N, 1.5, 2.5, 3.5, 4.5, 5.5, 6.5, 7.5, 8.5)); \ test_min (VEC<T, N> INITN(N, 1.5, 2.5, 3.5, 4.5, 5.5, 6.5, 7.5, 8.5)); \ + test_max (VEC<T, N> INITN(N, 1.5, 2.5, 3.5, 4.5, 5.5, 6.5, 7.5, 8.5)); \ } while(0) TEST_FLOAT(float, 1); @@ -365,10 +382,11 @@ void test1a() do { \ test_arith (VEC<T, N> INITN(N, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16)); \ test_relops (VEC<T, N> INITN(N, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16)); \ - test_broadcast (VEC<T, N> INITN(N, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3)); \ + test_broadcast (VEC<T, N> INITN(N, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)); \ test_storeload (VEC<T, N> INITN(N, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16)); \ test_select (VEC<T, N> INITN(N, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16)); \ test_min (VEC<T, N> INITN(N, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16)); \ + test_max (VEC<T, N> INITN(N, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16)); \ test_int (VEC<T, N> INITN(N, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16)); \ test_logops (VEC<T, N> INITN(N, 0, 1, 1, 1, 0, 1, 0, 1, 0, 1, 1, 0, 0, 0, 1, 1)); \ } while(0) diff --git a/Control/PerformanceMonitoring/PerfMonComps/src/PerfMonMTSvc.cxx b/Control/PerformanceMonitoring/PerfMonComps/src/PerfMonMTSvc.cxx index 82c788c2cb3bcb2caca82995e0e0a05326b0d4b3..0d7de4fa4a0d99a10d2d77bc7723f441fb45d8b1 100644 --- a/Control/PerformanceMonitoring/PerfMonComps/src/PerfMonMTSvc.cxx +++ b/Control/PerformanceMonitoring/PerfMonComps/src/PerfMonMTSvc.cxx @@ -544,9 +544,25 @@ void PerfMonMTSvc::report2JsonFile() { report2JsonFile_EventLevel(j); // Event-level } - // Write + // Write and close the JSON file std::ofstream o(m_jsonFileName); o << std::setw(4) << j << std::endl; + o.close(); + + // Compress the JSON file into tar.gz + auto cmd = "tar -czf " + m_jsonFileName + ".tar.gz " + m_jsonFileName + ";"; + int rc = std::system(cmd.c_str()); + if(rc!=0) { + ATH_MSG_WARNING("Couldn't compress the JSON file..."); + return; + } + + // Remove the uncompressed JSON file to save disk-space + rc = std::remove(m_jsonFileName.toString().c_str()); + if(rc!=0) { + ATH_MSG_WARNING("Couldn't remove the uncompressed JSON file..."); + return; + } } /* diff --git a/Database/AthenaPOOL/AthenaPoolExample/AthenaPoolExampleAlgorithms/share/AthenaPoolExample_Concat.ref b/Database/AthenaPOOL/AthenaPoolExample/AthenaPoolExampleAlgorithms/share/AthenaPoolExample_Concat.ref index 1d9b634e6412cb1f7127eea040e84dcea2f1b03a..5dd8b78c7465387a025128620bd1236ba789e724 100644 --- a/Database/AthenaPOOL/AthenaPoolExample/AthenaPoolExampleAlgorithms/share/AthenaPoolExample_Concat.ref +++ b/Database/AthenaPOOL/AthenaPoolExample/AthenaPoolExampleAlgorithms/share/AthenaPoolExample_Concat.ref @@ -1,35 +1,26 @@ -Thu Feb 27 13:46:58 CET 20?0 +Mon Aug 3 17:11:40 CEST 20?0 Preloading tcmalloc_minimal.so Athena INFO including file "AthenaCommon/Preparation.py" Athena INFO including file "AthenaCommon/Atlas.UnixStandardJob.py" Athena INFO executing ROOT6Setup Athena INFO including file "AthenaCommon/Execution.py" Athena INFO including file "AthenaPoolExampleAlgorithms/AthenaPoolExample_ConcatJobOptions.py" -Py:ConfigurableDb INFO Read module info for 5609 configurables from 8 genConfDb files -Py:ConfigurableDb WARNING Found 1 duplicates among the 8 genConfDb files : -Py:ConfigurableDb WARNING -------------------------------------------------- -Py:ConfigurableDb WARNING -<component name>: <module> - [ <duplicates> ] -Py:ConfigurableDb WARNING -------------------------------------------------- -Py:ConfigurableDb WARNING -L1TriggerResultMaker: TrigT1ResultByteStream.TrigT1ResultByteStreamConf - ['L1Decoder.L1DecoderConf'] -Py:ConfigurableDb WARNING Fix your cmt/requirements file !! +Py:ConfigurableDb INFO Read module info for 5545 configurables from 8 genConfDb files +Py:ConfigurableDb INFO No duplicates have been found: that's good ! Athena INFO including file "AthenaCommon/runbatch.py" -ApplicationMgr INFO Updating Gaudi::PluginService::SetDebug(level) to level= 'PluginDebugLevel':0 -ApplicationMgr INFO Updating Gaudi::PluginService::SetDebug(level) to level= 'PluginDebugLevel':0 ApplicationMgr SUCCESS ==================================================================================================================================== - Welcome to ApplicationMgr (GaudiCoreSvc v33r0) - running on aibuild20-040.cern.ch on Thu Feb 27 13:47:07 20?0 + Welcome to ApplicationMgr (GaudiCoreSvc v33r2) + running on lxplus706.cern.ch on Mon Aug 3 17:11:48 20?0 ==================================================================================================================================== ApplicationMgr INFO Application Manager Configured successfully -ApplicationMgr INFO Updating Gaudi::PluginService::SetDebug(level) to level= 'PluginDebugLevel':0 -StatusCodeSvc INFO initialize AthDictLoaderSvc INFO in initialize... AthDictLoaderSvc INFO acquired Dso-registry -ClassIDSvc INFO getRegistryEntries: read 3459 CLIDRegistry entries for module ALL +ClassIDSvc INFO getRegistryEntries: read 3312 CLIDRegistry entries for module ALL AthenaEventLoopMgr INFO Initializing AthenaEventLoopMgr - package version AthenaServices-00-00-00 ClassIDSvc INFO getRegistryEntries: read 705 CLIDRegistry entries for module ALL ClassIDSvc INFO getRegistryEntries: read 581 CLIDRegistry entries for module ALL -ClassIDSvc INFO getRegistryEntries: read 343 CLIDRegistry entries for module ALL +ClassIDSvc INFO getRegistryEntries: read 344 CLIDRegistry entries for module ALL xAODMaker::Even... INFO Initializing - Package version: xAODEventInfoCnv-00-00-00 xAODMaker::Even... INFO Initializing - Package version: xAODEventInfoCnv-00-00-00 MetaDataSvc INFO Initializing MetaDataSvc - package version AthenaServices-00-00-00 @@ -41,8 +32,8 @@ PoolSvc INFO io_register[PoolSvc](xmlcatalog_file:Catalog1.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/20?0-02-25T2133/Athena/22.0.10/InstallArea/x86_64-centos7-gcc8-opt/share/dbreplica.config -DBReplicaSvc INFO Total of 10 servers found for host aibuild20-040.cern.ch [ATLF ATLAS_COOLPROD atlas_dd ATLAS_CONFIG INT8R INTR ATONR_COOL ATONR_CONF DEVDB11 ATLF ] +DBReplicaSvc INFO Read replica configuration from /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/20?0-08-02T2137/Athena/22.0.16/InstallArea/x86_64-centos7-gcc8-opt/share/dbreplica.config +DBReplicaSvc INFO Total of 10 servers found for host lxplus706.cern.ch [ATLF ATLAS_COOLPROD atlas_dd ATLAS_CONFIG INT8R INTR ATONR_COOL ATONR_CONF DEVDB11 ATLF ] PoolSvc INFO Successfully setup replica sorting algorithm PoolSvc DEBUG OutputLevel is 2 PoolSvc INFO Setting up APR FileCatalog and Streams @@ -50,9 +41,10 @@ PoolSvc INFO POOL WriteCatalog is xmlcatalog_file:Catalog1.xml DbSession INFO Open DbSession Domain[ROOT_All] INFO > Access DbDomain READ [ROOT_All] MetaDataSvc INFO Found MetaDataTools = PublicToolHandleArray([]) +OutputStreamSeq... INFO Initializing OutputStreamSequencerSvc - package version AthenaServices-00-00-00 xAODMaker::Even...WARNING Beam conditions service not available xAODMaker::Even...WARNING Will not fill beam spot information into xAOD::EventInfo -ClassIDSvc INFO getRegistryEntries: read 1563 CLIDRegistry entries for module ALL +ClassIDSvc INFO getRegistryEntries: read 1147 CLIDRegistry entries for module ALL WriteData DEBUG Property update for OutputLevel : new value = 2 WriteData INFO in initialize() WriteData DEBUG input handles: 0 @@ -69,6 +61,9 @@ ReWriteData DEBUG Data Deps for ReWriteData + OUTPUT ( 'ExampleTrackContainer' , 'StoreGateSvc+MyTracks' ) Stream1 DEBUG Property update for OutputLevel : new value = 2 Stream1.Stream1... DEBUG Property update for OutputLevel : new value = 2 +Stream1.Stream1... DEBUG Property update for OutputLevel : new value = 2 +Stream1.Stream1... DEBUG Property update for OutputLevel : new value = 2 +Stream1.Stream1... DEBUG Property update for OutputLevel : new value = 2 Stream1 DEBUG In initialize Stream1 DEBUG Found IDecisionSvc. DecisionSvc INFO Inserting stream: Stream1 with no Algs @@ -76,7 +71,6 @@ Stream1 DEBUG End initialize Stream1 DEBUG In initialize Stream1 DEBUG Found StoreGateSvc store. Stream1 DEBUG Found MetaDataStore store. -OutputStreamSeq... INFO Initializing OutputStreamSequencerSvc - package version AthenaServices-00-00-00 Stream1.Stream1... DEBUG Property update for OutputLevel : new value = 2 Stream1.Stream1... INFO Initializing Stream1.Stream1Tool - package version AthenaServices-00-00-00 Stream1.Stream1... DEBUG Property update for OutputLevel : new value = 2 @@ -88,17 +82,21 @@ Stream1 INFO I/O reinitialization... Stream1.Stream1... DEBUG Property update for OutputLevel : new value = 2 Stream1 DEBUG End initialize Stream1 DEBUG input handles: 0 -Stream1 DEBUG output handles: 0 +Stream1 DEBUG output handles: 1 Stream1 DEBUG Registering all Tools in ToolHandleArray HelperTools Stream1 DEBUG Adding private ToolHandle tool Stream1.Stream1_MakeEventStreamInfo (MakeEventStreamInfo) Stream1 DEBUG Adding private ToolHandle tool Stream1.ThinningCacheTool_Stream1 (Athena::ThinningCacheTool) Stream1 DEBUG Adding private ToolHandle tool Stream1.Stream1Tool (AthenaOutputStreamTool) Stream1 DEBUG Data Deps for Stream1 + INPUT ( 'AthenaAttributeList' , 'StoreGateSvc+SimpleTag' ) + + OUTPUT ( 'SG::SelectionVetoes' , 'StoreGateSvc+SelectionVetoes_Stream1' ) MakeInputDataHe... INFO Initializing MakeInputDataHeader - package version OutputStreamAthenaPool-00-00-00 MakeInputDataHe... INFO Name of Stream to be made Input: Stream1 Stream2 DEBUG Property update for OutputLevel : new value = 2 Stream2.Stream2... DEBUG Property update for OutputLevel : new value = 2 +Stream2.Stream2... DEBUG Property update for OutputLevel : new value = 2 +Stream2.Stream2... DEBUG Property update for OutputLevel : new value = 2 +Stream2.Stream2... DEBUG Property update for OutputLevel : new value = 2 Stream2 DEBUG In initialize Stream2 DEBUG Found IDecisionSvc. DecisionSvc INFO Inserting stream: Stream2 with no Algs @@ -117,13 +115,14 @@ Stream2 INFO I/O reinitialization... Stream2.Stream2... DEBUG Property update for OutputLevel : new value = 2 Stream2 DEBUG End initialize Stream2 DEBUG input handles: 0 -Stream2 DEBUG output handles: 0 +Stream2 DEBUG output handles: 1 Stream2 DEBUG Registering all Tools in ToolHandleArray HelperTools Stream2 DEBUG Adding private ToolHandle tool Stream2.Stream2_MakeEventStreamInfo (MakeEventStreamInfo) Stream2 DEBUG Adding private ToolHandle tool Stream2.ThinningCacheTool_Stream2 (Athena::ThinningCacheTool) Stream2 DEBUG Adding private ToolHandle tool Stream2.Stream2Tool (AthenaOutputStreamTool) Stream2 DEBUG Data Deps for Stream2 + INPUT IGNORED ( 'AthenaAttributeList' , '' ) + + OUTPUT ( 'SG::SelectionVetoes' , 'StoreGateSvc+SelectionVetoes_Stream2' ) EventSelector INFO Enter McEventSelector Initialization AthenaEventLoopMgr INFO Setup EventSelector service EventSelector ApplicationMgr INFO Application Manager Initialized successfully @@ -369,7 +368,7 @@ SimplePoolFile1... DEBUG ---->Class:float SimplePoolFile1... DEBUG ---->[0]:float Typ:float [10] Size:0 Offset:0 #Elements:1 AthenaPoolCnvSvc DEBUG setAttribute BRANCH_BASKET_SIZE to 256000 for db: SimplePoolFile1.root and cont: POOLContainer(DataHeader) AthenaPoolCnvSvc DEBUG setAttribute BRANCH_BASKET_SIZE to 1024000 for db: SimplePoolFile1.root and cont: POOLContainerForm(DataHeaderForm) -ClassIDSvc INFO getRegistryEntries: read 88 CLIDRegistry entries for module ALL +ClassIDSvc INFO getRegistryEntries: read 82 CLIDRegistry entries for module ALL Stream2 DEBUG addItemObjects(2101,"*") called Stream2 DEBUG Key:* Stream2 DEBUG Comp Attr High: 0 with 7 mantissa bits. @@ -1600,6 +1599,7 @@ AthenaEventLoopMgr INFO ===>>> done processing event #19, run #1 20 events Stream1 DEBUG AthenaOutputStream Stream1 ::stop() Stream2 DEBUG AthenaOutputStream Stream2 ::stop() Stream1 DEBUG slot 0 handle() incident type: MetaDataStop +Stream1 DEBUG metadataItemList: [EventStreamInfo#Stream1, IOVMetaDataContainer#*] Stream1 DEBUG addItemObjects(167728019,"Stream1") called Stream1 DEBUG Key:Stream1 Stream1 DEBUG Comp Attr High: 0 with 7 mantissa bits. @@ -1640,6 +1640,7 @@ ClassIDSvc INFO getRegistryEntries: read 7 CLIDRegistry entries for m Stream1 INFO Metadata records written: 21 Stream1 DEBUG Leaving incident handler for MetaDataStop Stream2 DEBUG slot 0 handle() incident type: MetaDataStop +Stream2 DEBUG metadataItemList: [EventStreamInfo#Stream2, IOVMetaDataContainer#*] Stream2 DEBUG addItemObjects(167728019,"Stream2") called Stream2 DEBUG Key:Stream2 Stream2 DEBUG Comp Attr High: 0 with 7 mantissa bits. @@ -1700,11 +1701,11 @@ ToolSvc INFO Removing all tools created by ToolSvc *****Chrono***** INFO **************************************************************************************************** *****Chrono***** INFO The Final CPU consumption ( Chrono ) Table (ordered) *****Chrono***** INFO **************************************************************************************************** -commitOutput INFO Time User : Tot= 0 [us] Ave/Min/Max= 0(+- 0)/ 0/ 0 [us] #= 42 -cRep_ALL INFO Time User : Tot= 20 [ms] Ave/Min/Max=0.161(+- 1.79)/ 0/ 20 [ms] #=124 -cRepR_ALL INFO Time User : Tot= 50 [ms] Ave/Min/Max=0.128(+- 1.12)/ 0/ 10 [ms] #=390 -fRep_ALL INFO Time User : Tot= 60 [ms] Ave/Min/Max=0.484(+- 2.15)/ 0/ 10 [ms] #=124 -ChronoStatSvc INFO Time User : Tot= 440 [ms] #= 1 +cRepR_ALL INFO Time User : Tot= 20 [ms] Ave/Min/Max= 0.0513(+- 0.714)/ 0/ 10 [ms] #=390 +commitOutput INFO Time User : Tot= 10 [ms] Ave/Min/Max= 0.238(+- 1.52)/ 0/ 10 [ms] #= 42 +cRep_ALL INFO Time User : Tot= 30 [ms] Ave/Min/Max= 0.242(+- 1.54)/ 0/ 10 [ms] #=124 +fRep_ALL INFO Time User : Tot= 30 [ms] Ave/Min/Max= 0.242(+- 1.54)/ 0/ 10 [ms] #=124 +ChronoStatSvc INFO Time User : Tot= 300 [ms] #= 1 *****Chrono***** INFO **************************************************************************************************** ChronoStatSvc.f... INFO Service finalized successfully ApplicationMgr INFO Application Manager Finalized successfully diff --git a/Database/AthenaPOOL/AthenaPoolExample/AthenaPoolExampleAlgorithms/share/AthenaPoolExample_Copy.ref b/Database/AthenaPOOL/AthenaPoolExample/AthenaPoolExampleAlgorithms/share/AthenaPoolExample_Copy.ref index e8b8791da6a99bb389c5a9bd0771f1ca44ac0a8b..77923852e2d1d51110981af5389db1aef7ac3a29 100644 --- a/Database/AthenaPOOL/AthenaPoolExample/AthenaPoolExampleAlgorithms/share/AthenaPoolExample_Copy.ref +++ b/Database/AthenaPOOL/AthenaPoolExample/AthenaPoolExampleAlgorithms/share/AthenaPoolExample_Copy.ref @@ -1,30 +1,24 @@ -Warning in <TInterpreter::ReadRootmapFile>: class CP::IMuonCalibrationAndSmearingTool found in libMuonMomentumCorrectionsDict.so is already in libMuonAnalysisInterfacesDict.so -Warning in <TInterpreter::ReadRootmapFile>: class CP::IMuonSelectionTool found in libMuonSelectorToolsDict.so is already in libMuonAnalysisInterfacesDict.so -Fri Jan 24 17:17:59 CET 20?0 +Mon Aug 3 17:56:12 CEST 20?0 Preloading tcmalloc_minimal.so Athena INFO including file "AthenaCommon/Preparation.py" Athena INFO including file "AthenaCommon/Atlas.UnixStandardJob.py" Athena INFO executing ROOT6Setup Athena INFO including file "AthenaCommon/Execution.py" Athena INFO including file "AthenaPoolExampleAlgorithms/AthenaPoolExample_CopyJobOptions.py" -Py:ConfigurableDb INFO Read module info for 5625 configurables from 37 genConfDb files +Py:ConfigurableDb INFO Read module info for 5545 configurables from 8 genConfDb files Py:ConfigurableDb INFO No duplicates have been found: that's good ! Athena INFO including file "AthenaCommon/runbatch.py" -ApplicationMgr INFO Updating Gaudi::PluginService::SetDebug(level) to level= 'PluginDebugLevel':0 -ApplicationMgr INFO Updating Gaudi::PluginService::SetDebug(level) to level= 'PluginDebugLevel':0 ApplicationMgr SUCCESS ==================================================================================================================================== - Welcome to ApplicationMgr (GaudiCoreSvc v33r0) - running on lxplus730.cern.ch on Fri Jan 24 17:18:07 20?0 + Welcome to ApplicationMgr (GaudiCoreSvc v33r2) + running on lxplus706.cern.ch on Mon Aug 3 17:56:21 20?0 ==================================================================================================================================== ApplicationMgr INFO Application Manager Configured successfully -ApplicationMgr INFO Updating Gaudi::PluginService::SetDebug(level) to level= 'PluginDebugLevel':0 -StatusCodeSvc INFO initialize AthDictLoaderSvc INFO in initialize... AthDictLoaderSvc INFO acquired Dso-registry -ClassIDSvc INFO getRegistryEntries: read 3459 CLIDRegistry entries for module ALL +ClassIDSvc INFO getRegistryEntries: read 3312 CLIDRegistry entries for module ALL AthenaEventLoopMgr INFO Initializing AthenaEventLoopMgr - package version AthenaServices-00-00-00 -ClassIDSvc INFO getRegistryEntries: read 608 CLIDRegistry entries for module ALL +ClassIDSvc INFO getRegistryEntries: read 609 CLIDRegistry entries for module ALL MetaDataSvc INFO Initializing MetaDataSvc - package version AthenaServices-00-00-00 AthenaPoolCnvSvc DEBUG Property update for OutputLevel : new value = 2 AthenaPoolCnvSvc INFO Initializing AthenaPoolCnvSvc - package version AthenaPoolCnvSvc-00-00-00 @@ -34,8 +28,8 @@ PoolSvc INFO io_register[PoolSvc](xmlcatalog_file:Catalog1.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--py3/20?0-01-23T2132/Athena/22.0.9/InstallArea/x86_64-centos7-gcc8-opt/share/dbreplica.config -DBReplicaSvc INFO Total of 10 servers found for host lxplus730.cern.ch [ATLF ATLAS_COOLPROD atlas_dd ATLAS_CONFIG INT8R INTR ATONR_COOL ATONR_CONF DEVDB11 ATLF ] +DBReplicaSvc INFO Read replica configuration from /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/20?0-08-02T2137/Athena/22.0.16/InstallArea/x86_64-centos7-gcc8-opt/share/dbreplica.config +DBReplicaSvc INFO Total of 10 servers found for host lxplus706.cern.ch [ATLF ATLAS_COOLPROD atlas_dd ATLAS_CONFIG INT8R INTR ATONR_COOL ATONR_CONF DEVDB11 ATLF ] PoolSvc INFO Successfully setup replica sorting algorithm PoolSvc DEBUG OutputLevel is 2 PoolSvc INFO Setting up APR FileCatalog and Streams @@ -113,7 +107,7 @@ MetaDataHdr(Dat... DEBUG Opening MetaDataHdr(Dat... DEBUG attributes# = 1 MetaDataHdr(Dat... DEBUG Branch container 'DataHeader' MetaDataHdr(Dat... DEBUG Opened container MetaDataHdr(DataHeader) of type ROOT_Tree -ClassIDSvc INFO getRegistryEntries: read 2064 CLIDRegistry entries for module ALL +ClassIDSvc INFO getRegistryEntries: read 1652 CLIDRegistry entries for module ALL EventPersistenc... INFO Added successfully Conversion service:AthenaPoolCnvSvc SimplePoolFile1... DEBUG --> Access DbContainer READ [ROOT_Tree] MetaDataHdrForm(DataHeaderForm) MetaDataHdrForm... DEBUG Opening @@ -121,6 +115,7 @@ MetaDataHdrForm... DEBUG attributes# = 1 MetaDataHdrForm... DEBUG Branch container 'DataHeaderForm' MetaDataHdrForm... DEBUG Opened container MetaDataHdrForm(DataHeaderForm) of type ROOT_Tree ClassIDSvc INFO getRegistryEntries: read 2 CLIDRegistry entries for module ALL +OutputStreamSeq... INFO Initializing OutputStreamSequencerSvc - package version AthenaServices-00-00-00 AthenaPoolAddre... DEBUG Property update for OutputLevel : new value = 2 AthenaPoolAddre... DEBUG Service base class initialized successfully Stream1 DEBUG Property update for OutputLevel : new value = 2 @@ -135,7 +130,6 @@ Stream1 DEBUG End initialize Stream1 DEBUG In initialize Stream1 DEBUG Found StoreGateSvc store. Stream1 DEBUG Found MetaDataStore store. -OutputStreamSeq... INFO Initializing OutputStreamSequencerSvc - package version AthenaServices-00-00-00 Stream1.Stream1... DEBUG Property update for OutputLevel : new value = 2 Stream1.Stream1... INFO Initializing Stream1.Stream1Tool - package version AthenaServices-00-00-00 AthenaPoolAddre... DEBUG Cannot retrieve DataHeader from DetectorStore. @@ -148,13 +142,14 @@ Stream1 INFO I/O reinitialization... Stream1.Stream1... DEBUG Property update for OutputLevel : new value = 2 Stream1 DEBUG End initialize Stream1 DEBUG input handles: 0 -Stream1 DEBUG output handles: 0 +Stream1 DEBUG output handles: 1 Stream1 DEBUG Registering all Tools in ToolHandleArray HelperTools Stream1 DEBUG Adding private ToolHandle tool Stream1.Stream1_MakeEventStreamInfo (MakeEventStreamInfo) Stream1 DEBUG Adding private ToolHandle tool Stream1.ThinningCacheTool_Stream1 (Athena::ThinningCacheTool) Stream1 DEBUG Adding private ToolHandle tool Stream1.Stream1Tool (AthenaOutputStreamTool) Stream1 DEBUG Data Deps for Stream1 + INPUT ( 'AthenaAttributeList' , 'StoreGateSvc+SimpleTag' ) + + OUTPUT ( 'SG::SelectionVetoes' , 'StoreGateSvc+SelectionVetoes_Stream1' ) AthenaEventLoopMgr INFO Setup EventSelector service EventSelector ApplicationMgr INFO Application Manager Initialized successfully EventSelector DEBUG Try item: "SimplePoolFile1.root" from the collection list. @@ -192,7 +187,7 @@ AthenaPoolConve... INFO massageEventInfo: unable to get OverrideRunNumberFromI AthenaEventLoopMgr INFO ===>>> start of run 1 <<<=== AthenaEventLoopMgr INFO ===>>> start processing event #0, run #1 0 events processed so far <<<=== EventInfoTagBui...WARNING Did not find xAOD::EventInfo -ClassIDSvc INFO getRegistryEntries: read 21 CLIDRegistry entries for module ALL +ClassIDSvc INFO getRegistryEntries: read 32 CLIDRegistry entries for module ALL Stream1 DEBUG addItemObjects(2101,"*") called Stream1 DEBUG Key:* Stream1 DEBUG Comp Attr High: 0 with 7 mantissa bits. @@ -208,7 +203,7 @@ CollectionTree(... DEBUG attributes# = 1 CollectionTree(... DEBUG Branch container 'ExampleHitContainer_p1_MyHits' CollectionTree(... DEBUG Opened container CollectionTree(ExampleHitContainer_p1/MyHits) of type ROOT_Tree Stream1 DEBUG Added object 9102,"MyHits" -ClassIDSvc INFO getRegistryEntries: read 12 CLIDRegistry entries for module ALL +ClassIDSvc INFO getRegistryEntries: read 6 CLIDRegistry entries for module ALL Stream1 DEBUG Collected objects: Stream1 DEBUG Object/count: EventInfo_McEventInfo, 1 Stream1 DEBUG Object/count: ExampleHitContainer_MyHits, 1 @@ -785,6 +780,7 @@ Domain[ROOT_All] INFO > Deaccess DbDomain READ [ROOT_All] AthenaEventLoopMgr INFO No more events in event selection Stream1 DEBUG AthenaOutputStream Stream1 ::stop() Stream1 DEBUG slot 0 handle() incident type: MetaDataStop +Stream1 DEBUG metadataItemList: [EventStreamInfo#Stream1, IOVMetaDataContainer#*] Stream1 DEBUG addItemObjects(167728019,"Stream1") called Stream1 DEBUG Key:Stream1 Stream1 DEBUG Comp Attr High: 0 with 7 mantissa bits. @@ -837,13 +833,13 @@ ToolSvc INFO Removing all tools created by ToolSvc *****Chrono***** INFO **************************************************************************************************** *****Chrono***** INFO The Final CPU consumption ( Chrono ) Table (ordered) *****Chrono***** INFO **************************************************************************************************** -commitOutput INFO Time User : Tot= 0 [us] Ave/Min/Max= 0(+- 0)/ 0/ 0 [us] #= 21 -cRep_ALL INFO Time User : Tot= 0 [us] Ave/Min/Max= 0(+- 0)/ 0/ 0 [us] #= 62 -cObjR_ALL INFO Time User : Tot= 0 [us] Ave/Min/Max= 0(+- 0)/ 0/ 0 [us] #= 65 -fRep_ALL INFO Time User : Tot= 10 [ms] Ave/Min/Max=0.161(+- 1.26)/ 0/ 10 [ms] #= 62 -cObj_ALL INFO Time User : Tot= 10 [ms] Ave/Min/Max=0.161(+- 1.26)/ 0/ 10 [ms] #= 62 -cRepR_ALL INFO Time User : Tot= 10 [ms] Ave/Min/Max=0.156(+- 1.24)/ 0/ 10 [ms] #= 64 -ChronoStatSvc INFO Time User : Tot= 420 [ms] #= 1 +commitOutput INFO Time User : Tot= 0 [us] Ave/Min/Max= 0(+- 0)/ 0/ 0 [us] #= 21 +cRep_ALL INFO Time User : Tot= 0 [us] Ave/Min/Max= 0(+- 0)/ 0/ 0 [us] #= 62 +fRep_ALL INFO Time User : Tot= 10 [ms] Ave/Min/Max= 0.161(+- 1.26)/ 0/ 10 [ms] #= 62 +cRepR_ALL INFO Time User : Tot= 10 [ms] Ave/Min/Max= 0.156(+- 1.24)/ 0/ 10 [ms] #= 64 +cObjR_ALL INFO Time User : Tot= 10 [ms] Ave/Min/Max= 0.154(+- 1.23)/ 0/ 10 [ms] #= 65 +cObj_ALL INFO Time User : Tot= 20 [ms] Ave/Min/Max= 0.323(+- 1.77)/ 0/ 10 [ms] #= 62 +ChronoStatSvc INFO Time User : Tot= 350 [ms] #= 1 *****Chrono***** INFO **************************************************************************************************** ChronoStatSvc.f... INFO Service finalized successfully ApplicationMgr INFO Application Manager Finalized successfully diff --git a/Database/AthenaPOOL/AthenaPoolExample/AthenaPoolExampleAlgorithms/share/AthenaPoolExample_ReWrite.ref b/Database/AthenaPOOL/AthenaPoolExample/AthenaPoolExampleAlgorithms/share/AthenaPoolExample_ReWrite.ref index 1fd48fdd5a07c0805484a39a9030667db53332e4..d4f218ec832b3d1bd0f3fb7a13073533260c675f 100644 --- a/Database/AthenaPOOL/AthenaPoolExample/AthenaPoolExampleAlgorithms/share/AthenaPoolExample_ReWrite.ref +++ b/Database/AthenaPOOL/AthenaPoolExample/AthenaPoolExampleAlgorithms/share/AthenaPoolExample_ReWrite.ref @@ -1,31 +1,25 @@ -Warning in <TInterpreter::ReadRootmapFile>: class CP::IMuonCalibrationAndSmearingTool found in libMuonMomentumCorrectionsDict.so is already in libMuonAnalysisInterfacesDict.so -Warning in <TInterpreter::ReadRootmapFile>: class CP::IMuonSelectionTool found in libMuonSelectorToolsDict.so is already in libMuonAnalysisInterfacesDict.so -Fri Jan 24 17:14:14 CET 20?0 +Mon Aug 3 17:18:44 CEST 20?0 Preloading tcmalloc_minimal.so Athena INFO including file "AthenaCommon/Preparation.py" Athena INFO including file "AthenaCommon/Atlas.UnixStandardJob.py" Athena INFO executing ROOT6Setup Athena INFO including file "AthenaCommon/Execution.py" Athena INFO including file "AthenaPoolExampleAlgorithms/AthenaPoolExample_RWJobOptions.py" -Py:ConfigurableDb INFO Read module info for 5625 configurables from 37 genConfDb files +Py:ConfigurableDb INFO Read module info for 5545 configurables from 8 genConfDb files Py:ConfigurableDb INFO No duplicates have been found: that's good ! Athena INFO including file "AthenaCommon/runbatch.py" -ApplicationMgr INFO Updating Gaudi::PluginService::SetDebug(level) to level= 'PluginDebugLevel':0 -ApplicationMgr INFO Updating Gaudi::PluginService::SetDebug(level) to level= 'PluginDebugLevel':0 ApplicationMgr SUCCESS ==================================================================================================================================== - Welcome to ApplicationMgr (GaudiCoreSvc v33r0) - running on lxplus730.cern.ch on Fri Jan 24 17:14:22 20?0 + Welcome to ApplicationMgr (GaudiCoreSvc v33r2) + running on lxplus706.cern.ch on Mon Aug 3 17:18:52 20?0 ==================================================================================================================================== ApplicationMgr INFO Application Manager Configured successfully -ApplicationMgr INFO Updating Gaudi::PluginService::SetDebug(level) to level= 'PluginDebugLevel':0 -StatusCodeSvc INFO initialize AthDictLoaderSvc INFO in initialize... AthDictLoaderSvc INFO acquired Dso-registry -ClassIDSvc INFO getRegistryEntries: read 3459 CLIDRegistry entries for module ALL +ClassIDSvc INFO getRegistryEntries: read 3312 CLIDRegistry entries for module ALL AthenaEventLoopMgr INFO Initializing AthenaEventLoopMgr - package version AthenaServices-00-00-00 ClassIDSvc INFO getRegistryEntries: read 846 CLIDRegistry entries for module ALL -ClassIDSvc INFO getRegistryEntries: read 343 CLIDRegistry entries for module ALL +ClassIDSvc INFO getRegistryEntries: read 344 CLIDRegistry entries for module ALL ReadData DEBUG Property update for OutputLevel : new value = 2 ReadData INFO in initialize() MetaDataSvc DEBUG Property update for OutputLevel : new value = 2 @@ -38,8 +32,8 @@ PoolSvc DEBUG Service base class initialized successfully 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--py3/20?0-01-23T2132/Athena/22.0.9/InstallArea/x86_64-centos7-gcc8-opt/share/dbreplica.config -DBReplicaSvc INFO Total of 10 servers found for host lxplus730.cern.ch [ATLF ATLAS_COOLPROD atlas_dd ATLAS_CONFIG INT8R INTR ATONR_COOL ATONR_CONF DEVDB11 ATLF ] +DBReplicaSvc INFO Read replica configuration from /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/20?0-08-02T2137/Athena/22.0.16/InstallArea/x86_64-centos7-gcc8-opt/share/dbreplica.config +DBReplicaSvc INFO Total of 10 servers found for host lxplus706.cern.ch [ATLF ATLAS_COOLPROD atlas_dd ATLAS_CONFIG INT8R INTR ATONR_COOL ATONR_CONF DEVDB11 ATLF ] PoolSvc INFO Successfully setup replica sorting algorithm PoolSvc DEBUG OutputLevel is 2 PoolSvc INFO Setting up APR FileCatalog and Streams @@ -120,7 +114,7 @@ MetaDataHdr(Dat... DEBUG Opening MetaDataHdr(Dat... DEBUG attributes# = 1 MetaDataHdr(Dat... DEBUG Branch container 'DataHeader' MetaDataHdr(Dat... DEBUG Opened container MetaDataHdr(DataHeader) of type ROOT_Tree -ClassIDSvc INFO getRegistryEntries: read 2064 CLIDRegistry entries for module ALL +ClassIDSvc INFO getRegistryEntries: read 1652 CLIDRegistry entries for module ALL EventPersistenc... INFO Added successfully Conversion service:AthenaPoolCnvSvc SimplePoolFile1... DEBUG --> Access DbContainer READ [ROOT_Tree] MetaDataHdrForm(DataHeaderForm) MetaDataHdrForm... DEBUG Opening @@ -129,6 +123,7 @@ MetaDataHdrForm... DEBUG Branch container 'DataHeaderForm' MetaDataHdrForm... DEBUG Opened container MetaDataHdrForm(DataHeaderForm) of type ROOT_Tree MetaDataSvc DEBUG Loaded input meta data store proxies ClassIDSvc INFO getRegistryEntries: read 2 CLIDRegistry entries for module ALL +OutputStreamSeq... INFO Initializing OutputStreamSequencerSvc - package version AthenaServices-00-00-00 AthenaPoolAddre... DEBUG Property update for OutputLevel : new value = 2 AthenaPoolAddre... DEBUG Service base class initialized successfully ReadData DEBUG input handles: 2 @@ -157,7 +152,6 @@ Stream1 DEBUG End initialize Stream1 DEBUG In initialize Stream1 DEBUG Found StoreGateSvc store. Stream1 DEBUG Found MetaDataStore store. -OutputStreamSeq... INFO Initializing OutputStreamSequencerSvc - package version AthenaServices-00-00-00 Stream1.Stream1... DEBUG Property update for OutputLevel : new value = 2 Stream1.Stream1... INFO Initializing Stream1.Stream1Tool - package version AthenaServices-00-00-00 AthenaPoolAddre... DEBUG Cannot retrieve DataHeader from DetectorStore. @@ -170,13 +164,14 @@ Stream1 INFO I/O reinitialization... Stream1.Stream1... DEBUG Property update for OutputLevel : new value = 2 Stream1 DEBUG End initialize Stream1 DEBUG input handles: 0 -Stream1 DEBUG output handles: 0 +Stream1 DEBUG output handles: 1 Stream1 DEBUG Registering all Tools in ToolHandleArray HelperTools Stream1 DEBUG Adding private ToolHandle tool Stream1.Stream1_MakeEventStreamInfo (MakeEventStreamInfo) Stream1 DEBUG Adding private ToolHandle tool Stream1.ThinningCacheTool_Stream1 (Athena::ThinningCacheTool) Stream1 DEBUG Adding private ToolHandle tool Stream1.Stream1Tool (AthenaOutputStreamTool) Stream1 DEBUG Data Deps for Stream1 + INPUT ( 'AthenaAttributeList' , 'StoreGateSvc+MagicTag' ) + + OUTPUT ( 'SG::SelectionVetoes' , 'StoreGateSvc+SelectionVetoes_Stream1' ) AthenaEventLoopMgr INFO Setup EventSelector service EventSelector ApplicationMgr INFO Application Manager Initialized successfully EventSelector DEBUG Try item: "SimplePoolFile1.root" from the collection list. @@ -279,7 +274,7 @@ WriteTag INFO registered all data MagicWriteTag INFO EventInfo event: 0 run: 1 MagicWriteTag INFO registered all data EventInfoTagBui...WARNING Did not find xAOD::EventInfo -ClassIDSvc INFO getRegistryEntries: read 27 CLIDRegistry entries for module ALL +ClassIDSvc INFO getRegistryEntries: read 21 CLIDRegistry entries for module ALL Stream1 DEBUG addItemObjects(2101,"*") called Stream1 DEBUG Key:* Stream1 DEBUG Comp Attr High: 0 with 7 mantissa bits. @@ -1854,6 +1849,7 @@ Stream1 DEBUG AthenaOutputStream Stream1 ::stop() MetaDataSvc DEBUG MetaDataSvc::stop() Stream1 DEBUG slot 0 handle() incident type: MetaDataStop MetaDataSvc DEBUG calling metaDataStop for ToolSvc.IOVDbMetaDataTool +Stream1 DEBUG metadataItemList: [EventStreamInfo#Stream1, IOVMetaDataContainer#*] Stream1 DEBUG addItemObjects(167728019,"Stream1") called Stream1 DEBUG Key:Stream1 Stream1 DEBUG Comp Attr High: 0 with 7 mantissa bits. @@ -1910,13 +1906,13 @@ ToolSvc INFO Removing all tools created by ToolSvc *****Chrono***** INFO **************************************************************************************************** *****Chrono***** INFO The Final CPU consumption ( Chrono ) Table (ordered) *****Chrono***** INFO **************************************************************************************************** -commitOutput INFO Time User : Tot= 0 [us] Ave/Min/Max= 0(+- 0)/ 0/ 0 [us] #= 21 -cRep_ALL INFO Time User : Tot= 0 [us] Ave/Min/Max= 0(+- 0)/ 0/ 0 [us] #= 62 -cObjR_ALL INFO Time User : Tot= 0 [us] Ave/Min/Max= 0(+- 0)/ 0/ 0 [us] #= 66 -cRepR_ALL INFO Time User : Tot= 10 [ms] Ave/Min/Max=0.0694(+- 0.83)/ 0/ 10 [ms] #=144 -fRep_ALL INFO Time User : Tot= 10 [ms] Ave/Min/Max=0.161(+- 1.26)/ 0/ 10 [ms] #= 62 -cObj_ALL INFO Time User : Tot= 10 [ms] Ave/Min/Max=0.159(+- 1.25)/ 0/ 10 [ms] #= 63 -ChronoStatSvc INFO Time User : Tot= 450 [ms] #= 1 +commitOutput INFO Time User : Tot= 0 [us] Ave/Min/Max= 0(+- 0)/ 0/ 0 [us] #= 21 +cRep_ALL INFO Time User : Tot= 0 [us] Ave/Min/Max= 0(+- 0)/ 0/ 0 [us] #= 62 +cObj_ALL INFO Time User : Tot= 20 [ms] Ave/Min/Max= 0.317(+- 1.75)/ 0/ 10 [ms] #= 63 +cObjR_ALL INFO Time User : Tot= 20 [ms] Ave/Min/Max= 0.303(+- 1.71)/ 0/ 10 [ms] #= 66 +cRepR_ALL INFO Time User : Tot= 20 [ms] Ave/Min/Max= 0.139(+- 1.17)/ 0/ 10 [ms] #=144 +fRep_ALL INFO Time User : Tot= 30 [ms] Ave/Min/Max= 0.484(+- 2.15)/ 0/ 10 [ms] #= 62 +ChronoStatSvc INFO Time User : Tot= 310 [ms] #= 1 *****Chrono***** INFO **************************************************************************************************** ChronoStatSvc.f... INFO Service finalized successfully ApplicationMgr INFO Application Manager Finalized successfully diff --git a/Database/AthenaPOOL/AthenaPoolExample/AthenaPoolExampleAlgorithms/share/AthenaPoolExample_ReWriteAgain.ref b/Database/AthenaPOOL/AthenaPoolExample/AthenaPoolExampleAlgorithms/share/AthenaPoolExample_ReWriteAgain.ref index 59a28458c346407ea752448a68761a80faf0cc93..19f77965187744cd963e125c6144429618b282f6 100644 --- a/Database/AthenaPOOL/AthenaPoolExample/AthenaPoolExampleAlgorithms/share/AthenaPoolExample_ReWriteAgain.ref +++ b/Database/AthenaPOOL/AthenaPoolExample/AthenaPoolExampleAlgorithms/share/AthenaPoolExample_ReWriteAgain.ref @@ -1,31 +1,25 @@ -Warning in <TInterpreter::ReadRootmapFile>: class CP::IMuonCalibrationAndSmearingTool found in libMuonMomentumCorrectionsDict.so is already in libMuonAnalysisInterfacesDict.so -Warning in <TInterpreter::ReadRootmapFile>: class CP::IMuonSelectionTool found in libMuonSelectorToolsDict.so is already in libMuonAnalysisInterfacesDict.so -Fri Jan 24 17:24:06 CET 20?0 +Mon Aug 3 17:53:13 CEST 20?0 Preloading tcmalloc_minimal.so Athena INFO including file "AthenaCommon/Preparation.py" Athena INFO including file "AthenaCommon/Atlas.UnixStandardJob.py" Athena INFO executing ROOT6Setup Athena INFO including file "AthenaCommon/Execution.py" Athena INFO including file "AthenaPoolExampleAlgorithms/AthenaPoolExample_ReWriteAgainJobOptions.py" -Py:ConfigurableDb INFO Read module info for 5625 configurables from 37 genConfDb files +Py:ConfigurableDb INFO Read module info for 5545 configurables from 8 genConfDb files Py:ConfigurableDb INFO No duplicates have been found: that's good ! Athena INFO including file "AthenaCommon/runbatch.py" -ApplicationMgr INFO Updating Gaudi::PluginService::SetDebug(level) to level= 'PluginDebugLevel':0 -ApplicationMgr INFO Updating Gaudi::PluginService::SetDebug(level) to level= 'PluginDebugLevel':0 ApplicationMgr SUCCESS ==================================================================================================================================== - Welcome to ApplicationMgr (GaudiCoreSvc v33r0) - running on lxplus730.cern.ch on Fri Jan 24 17:24:15 20?0 + Welcome to ApplicationMgr (GaudiCoreSvc v33r2) + running on lxplus706.cern.ch on Mon Aug 3 17:53:22 20?0 ==================================================================================================================================== ApplicationMgr INFO Application Manager Configured successfully -ApplicationMgr INFO Updating Gaudi::PluginService::SetDebug(level) to level= 'PluginDebugLevel':0 -StatusCodeSvc INFO initialize AthDictLoaderSvc INFO in initialize... AthDictLoaderSvc INFO acquired Dso-registry -ClassIDSvc INFO getRegistryEntries: read 3459 CLIDRegistry entries for module ALL +ClassIDSvc INFO getRegistryEntries: read 3312 CLIDRegistry entries for module ALL AthenaEventLoopMgr INFO Initializing AthenaEventLoopMgr - package version AthenaServices-00-00-00 ClassIDSvc INFO getRegistryEntries: read 846 CLIDRegistry entries for module ALL -ClassIDSvc INFO getRegistryEntries: read 343 CLIDRegistry entries for module ALL +ClassIDSvc INFO getRegistryEntries: read 344 CLIDRegistry entries for module ALL ReadData DEBUG Property update for OutputLevel : new value = 2 ReadData INFO in initialize() MetaDataSvc DEBUG Property update for OutputLevel : new value = 2 @@ -38,8 +32,8 @@ PoolSvc DEBUG Service base class initialized successfully 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--py3/20?0-01-23T2132/Athena/22.0.9/InstallArea/x86_64-centos7-gcc8-opt/share/dbreplica.config -DBReplicaSvc INFO Total of 10 servers found for host lxplus730.cern.ch [ATLF ATLAS_COOLPROD atlas_dd ATLAS_CONFIG INT8R INTR ATONR_COOL ATONR_CONF DEVDB11 ATLF ] +DBReplicaSvc INFO Read replica configuration from /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/20?0-08-02T2137/Athena/22.0.16/InstallArea/x86_64-centos7-gcc8-opt/share/dbreplica.config +DBReplicaSvc INFO Total of 10 servers found for host lxplus706.cern.ch [ATLF ATLAS_COOLPROD atlas_dd ATLAS_CONFIG INT8R INTR ATONR_COOL ATONR_CONF DEVDB11 ATLF ] PoolSvc INFO Successfully setup replica sorting algorithm PoolSvc DEBUG OutputLevel is 2 PoolSvc INFO Setting up APR FileCatalog and Streams @@ -114,7 +108,7 @@ MetaDataHdr(Dat... DEBUG Opening MetaDataHdr(Dat... DEBUG attributes# = 1 MetaDataHdr(Dat... DEBUG Branch container 'DataHeader' MetaDataHdr(Dat... DEBUG Opened container MetaDataHdr(DataHeader) of type ROOT_Tree -ClassIDSvc INFO getRegistryEntries: read 2061 CLIDRegistry entries for module ALL +ClassIDSvc INFO getRegistryEntries: read 1649 CLIDRegistry entries for module ALL EventPersistenc... INFO Added successfully Conversion service:AthenaPoolCnvSvc SimplePoolRepli... DEBUG --> Access DbContainer READ [ROOT_Tree] MetaDataHdrForm(DataHeaderForm) MetaDataHdrForm... DEBUG Opening @@ -123,6 +117,7 @@ MetaDataHdrForm... DEBUG Branch container 'DataHeaderForm' MetaDataHdrForm... DEBUG Opened container MetaDataHdrForm(DataHeaderForm) of type ROOT_Tree MetaDataSvc DEBUG Loaded input meta data store proxies ClassIDSvc INFO getRegistryEntries: read 2 CLIDRegistry entries for module ALL +OutputStreamSeq... INFO Initializing OutputStreamSequencerSvc - package version AthenaServices-00-00-00 AthenaPoolAddre... DEBUG Property update for OutputLevel : new value = 2 AthenaPoolAddre... DEBUG Service base class initialized successfully ReadData DEBUG input handles: 2 @@ -151,7 +146,6 @@ Stream1 DEBUG End initialize Stream1 DEBUG In initialize Stream1 DEBUG Found StoreGateSvc store. Stream1 DEBUG Found MetaDataStore store. -OutputStreamSeq... INFO Initializing OutputStreamSequencerSvc - package version AthenaServices-00-00-00 Stream1.Stream1... DEBUG Property update for OutputLevel : new value = 2 Stream1.Stream1... INFO Initializing Stream1.Stream1Tool - package version AthenaServices-00-00-00 AthenaPoolAddre... DEBUG Cannot retrieve DataHeader from DetectorStore. @@ -164,13 +158,14 @@ Stream1 INFO I/O reinitialization... Stream1.Stream1... DEBUG Property update for OutputLevel : new value = 2 Stream1 DEBUG End initialize Stream1 DEBUG input handles: 0 -Stream1 DEBUG output handles: 0 +Stream1 DEBUG output handles: 1 Stream1 DEBUG Registering all Tools in ToolHandleArray HelperTools Stream1 DEBUG Adding private ToolHandle tool Stream1.Stream1_MakeEventStreamInfo (MakeEventStreamInfo) Stream1 DEBUG Adding private ToolHandle tool Stream1.ThinningCacheTool_Stream1 (Athena::ThinningCacheTool) Stream1 DEBUG Adding private ToolHandle tool Stream1.Stream1Tool (AthenaOutputStreamTool) Stream1 DEBUG Data Deps for Stream1 + INPUT ( 'AthenaAttributeList' , 'StoreGateSvc+MagicTag' ) + + OUTPUT ( 'SG::SelectionVetoes' , 'StoreGateSvc+SelectionVetoes_Stream1' ) AthenaEventLoopMgr INFO Setup EventSelector service EventSelector ApplicationMgr INFO Application Manager Initialized successfully Domain[ROOT_All] INFO -> Deaccess DbDatabase READ [ROOT_All] ???? @@ -330,7 +325,7 @@ WriteTag INFO registered all data MagicWriteTag INFO EventInfo event: 0 run: 1 MagicWriteTag INFO registered all data EventInfoTagBui...WARNING Did not find xAOD::EventInfo -ClassIDSvc INFO getRegistryEntries: read 27 CLIDRegistry entries for module ALL +ClassIDSvc INFO getRegistryEntries: read 21 CLIDRegistry entries for module ALL Stream1 DEBUG addItemObjects(2101,"*") called Stream1 DEBUG Key:* Stream1 DEBUG Comp Attr High: 0 with 7 mantissa bits. @@ -1909,6 +1904,7 @@ Stream1 DEBUG AthenaOutputStream Stream1 ::stop() MetaDataSvc DEBUG MetaDataSvc::stop() Stream1 DEBUG slot 0 handle() incident type: MetaDataStop MetaDataSvc DEBUG calling metaDataStop for ToolSvc.IOVDbMetaDataTool +Stream1 DEBUG metadataItemList: [EventStreamInfo#Stream1, IOVMetaDataContainer#*] Stream1 DEBUG addItemObjects(167728019,"Stream1") called Stream1 DEBUG Key:Stream1 Stream1 DEBUG Comp Attr High: 0 with 7 mantissa bits. @@ -1965,13 +1961,13 @@ ToolSvc INFO Removing all tools created by ToolSvc *****Chrono***** INFO **************************************************************************************************** *****Chrono***** INFO The Final CPU consumption ( Chrono ) Table (ordered) *****Chrono***** INFO **************************************************************************************************** -commitOutput INFO Time User : Tot= 0 [us] Ave/Min/Max= 0(+- 0)/ 0/ 0 [us] #= 21 -cRep_ALL INFO Time User : Tot= 0 [us] Ave/Min/Max= 0(+- 0)/ 0/ 0 [us] #= 62 -cObj_ALL INFO Time User : Tot= 0 [us] Ave/Min/Max= 0(+- 0)/ 0/ 0 [us] #= 63 -cObjR_ALL INFO Time User : Tot= 0 [us] Ave/Min/Max= 0(+- 0)/ 0/ 0 [us] #= 65 -cRepR_ALL INFO Time User : Tot= 10 [ms] Ave/Min/Max=0.0694(+- 0.83)/ 0/ 10 [ms] #=144 -fRep_ALL INFO Time User : Tot= 20 [ms] Ave/Min/Max=0.323(+- 1.77)/ 0/ 10 [ms] #= 62 -ChronoStatSvc INFO Time User : Tot= 440 [ms] #= 1 +commitOutput INFO Time User : Tot= 0 [us] Ave/Min/Max= 0(+- 0)/ 0/ 0 [us] #= 21 +cRep_ALL INFO Time User : Tot= 0 [us] Ave/Min/Max= 0(+- 0)/ 0/ 0 [us] #= 62 +cObjR_ALL INFO Time User : Tot= 0 [us] Ave/Min/Max= 0(+- 0)/ 0/ 0 [us] #= 65 +cObj_ALL INFO Time User : Tot= 10 [ms] Ave/Min/Max= 0.159(+- 1.25)/ 0/ 10 [ms] #= 63 +cRepR_ALL INFO Time User : Tot= 10 [ms] Ave/Min/Max= 0.0694(+- 0.83)/ 0/ 10 [ms] #=144 +fRep_ALL INFO Time User : Tot= 20 [ms] Ave/Min/Max= 0.323(+- 1.77)/ 0/ 10 [ms] #= 62 +ChronoStatSvc INFO Time User : Tot= 310 [ms] #= 1 *****Chrono***** INFO **************************************************************************************************** ChronoStatSvc.f... INFO Service finalized successfully ApplicationMgr INFO Application Manager Finalized successfully diff --git a/Database/AthenaPOOL/AthenaPoolExample/AthenaPoolExampleAlgorithms/share/AthenaPoolExample_ReWriteNext.ref b/Database/AthenaPOOL/AthenaPoolExample/AthenaPoolExampleAlgorithms/share/AthenaPoolExample_ReWriteNext.ref index 4dd9744a18932ade06092566880324259538fc26..526e9f83ade4a27d72589b2b9777b2efb78ea134 100644 --- a/Database/AthenaPOOL/AthenaPoolExample/AthenaPoolExampleAlgorithms/share/AthenaPoolExample_ReWriteNext.ref +++ b/Database/AthenaPOOL/AthenaPoolExample/AthenaPoolExampleAlgorithms/share/AthenaPoolExample_ReWriteNext.ref @@ -1,31 +1,25 @@ -Warning in <TInterpreter::ReadRootmapFile>: class CP::IMuonCalibrationAndSmearingTool found in libMuonMomentumCorrectionsDict.so is already in libMuonAnalysisInterfacesDict.so -Warning in <TInterpreter::ReadRootmapFile>: class CP::IMuonSelectionTool found in libMuonSelectorToolsDict.so is already in libMuonAnalysisInterfacesDict.so -Fri Jan 24 17:18:21 CET 20?0 +Mon Aug 3 17:50:27 CEST 20?0 Preloading tcmalloc_minimal.so Athena INFO including file "AthenaCommon/Preparation.py" Athena INFO including file "AthenaCommon/Atlas.UnixStandardJob.py" Athena INFO executing ROOT6Setup Athena INFO including file "AthenaCommon/Execution.py" Athena INFO including file "AthenaPoolExampleAlgorithms/AthenaPoolExample_ReWriteNextJobOptions.py" -Py:ConfigurableDb INFO Read module info for 5625 configurables from 37 genConfDb files +Py:ConfigurableDb INFO Read module info for 5545 configurables from 8 genConfDb files Py:ConfigurableDb INFO No duplicates have been found: that's good ! Athena INFO including file "AthenaCommon/runbatch.py" -ApplicationMgr INFO Updating Gaudi::PluginService::SetDebug(level) to level= 'PluginDebugLevel':0 -ApplicationMgr INFO Updating Gaudi::PluginService::SetDebug(level) to level= 'PluginDebugLevel':0 ApplicationMgr SUCCESS ==================================================================================================================================== - Welcome to ApplicationMgr (GaudiCoreSvc v33r0) - running on lxplus730.cern.ch on Fri Jan 24 17:18:29 20?0 + Welcome to ApplicationMgr (GaudiCoreSvc v33r2) + running on lxplus706.cern.ch on Mon Aug 3 17:50:36 20?0 ==================================================================================================================================== ApplicationMgr INFO Application Manager Configured successfully -ApplicationMgr INFO Updating Gaudi::PluginService::SetDebug(level) to level= 'PluginDebugLevel':0 -StatusCodeSvc INFO initialize AthDictLoaderSvc INFO in initialize... AthDictLoaderSvc INFO acquired Dso-registry -ClassIDSvc INFO getRegistryEntries: read 3459 CLIDRegistry entries for module ALL +ClassIDSvc INFO getRegistryEntries: read 3312 CLIDRegistry entries for module ALL AthenaEventLoopMgr INFO Initializing AthenaEventLoopMgr - package version AthenaServices-00-00-00 ClassIDSvc INFO getRegistryEntries: read 846 CLIDRegistry entries for module ALL -ClassIDSvc INFO getRegistryEntries: read 343 CLIDRegistry entries for module ALL +ClassIDSvc INFO getRegistryEntries: read 344 CLIDRegistry entries for module ALL ReadData DEBUG Property update for OutputLevel : new value = 2 ReadData INFO in initialize() MetaDataSvc DEBUG Property update for OutputLevel : new value = 2 @@ -38,8 +32,8 @@ PoolSvc DEBUG Service base class initialized successfully 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--py3/20?0-01-23T2132/Athena/22.0.9/InstallArea/x86_64-centos7-gcc8-opt/share/dbreplica.config -DBReplicaSvc INFO Total of 10 servers found for host lxplus730.cern.ch [ATLF ATLAS_COOLPROD atlas_dd ATLAS_CONFIG INT8R INTR ATONR_COOL ATONR_CONF DEVDB11 ATLF ] +DBReplicaSvc INFO Read replica configuration from /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/20?0-08-02T2137/Athena/22.0.16/InstallArea/x86_64-centos7-gcc8-opt/share/dbreplica.config +DBReplicaSvc INFO Total of 10 servers found for host lxplus706.cern.ch [ATLF ATLAS_COOLPROD atlas_dd ATLAS_CONFIG INT8R INTR ATONR_COOL ATONR_CONF DEVDB11 ATLF ] PoolSvc INFO Successfully setup replica sorting algorithm PoolSvc DEBUG OutputLevel is 2 PoolSvc INFO Setting up APR FileCatalog and Streams @@ -120,7 +114,7 @@ MetaDataHdr(Dat... DEBUG Opening MetaDataHdr(Dat... DEBUG attributes# = 1 MetaDataHdr(Dat... DEBUG Branch container 'DataHeader' MetaDataHdr(Dat... DEBUG Opened container MetaDataHdr(DataHeader) of type ROOT_Tree -ClassIDSvc INFO getRegistryEntries: read 2064 CLIDRegistry entries for module ALL +ClassIDSvc INFO getRegistryEntries: read 1652 CLIDRegistry entries for module ALL EventPersistenc... INFO Added successfully Conversion service:AthenaPoolCnvSvc SimplePoolFile3... DEBUG --> Access DbContainer READ [ROOT_Tree] MetaDataHdrForm(DataHeaderForm) MetaDataHdrForm... DEBUG Opening @@ -129,6 +123,7 @@ MetaDataHdrForm... DEBUG Branch container 'DataHeaderForm' MetaDataHdrForm... DEBUG Opened container MetaDataHdrForm(DataHeaderForm) of type ROOT_Tree MetaDataSvc DEBUG Loaded input meta data store proxies ClassIDSvc INFO getRegistryEntries: read 2 CLIDRegistry entries for module ALL +OutputStreamSeq... INFO Initializing OutputStreamSequencerSvc - package version AthenaServices-00-00-00 AthenaPoolAddre... DEBUG Property update for OutputLevel : new value = 2 AthenaPoolAddre... DEBUG Service base class initialized successfully ReadData DEBUG input handles: 2 @@ -157,7 +152,6 @@ Stream1 DEBUG End initialize Stream1 DEBUG In initialize Stream1 DEBUG Found StoreGateSvc store. Stream1 DEBUG Found MetaDataStore store. -OutputStreamSeq... INFO Initializing OutputStreamSequencerSvc - package version AthenaServices-00-00-00 Stream1.Stream1... DEBUG Property update for OutputLevel : new value = 2 Stream1.Stream1... INFO Initializing Stream1.Stream1Tool - package version AthenaServices-00-00-00 AthenaPoolAddre... DEBUG Cannot retrieve DataHeader from DetectorStore. @@ -170,13 +164,14 @@ Stream1 INFO I/O reinitialization... Stream1.Stream1... DEBUG Property update for OutputLevel : new value = 2 Stream1 DEBUG End initialize Stream1 DEBUG input handles: 0 -Stream1 DEBUG output handles: 0 +Stream1 DEBUG output handles: 1 Stream1 DEBUG Registering all Tools in ToolHandleArray HelperTools Stream1 DEBUG Adding private ToolHandle tool Stream1.Stream1_MakeEventStreamInfo (MakeEventStreamInfo) Stream1 DEBUG Adding private ToolHandle tool Stream1.ThinningCacheTool_Stream1 (Athena::ThinningCacheTool) Stream1 DEBUG Adding private ToolHandle tool Stream1.Stream1Tool (AthenaOutputStreamTool) Stream1 DEBUG Data Deps for Stream1 + INPUT ( 'AthenaAttributeList' , 'StoreGateSvc+MagicTag' ) + + OUTPUT ( 'SG::SelectionVetoes' , 'StoreGateSvc+SelectionVetoes_Stream1' ) AthenaEventLoopMgr INFO Setup EventSelector service EventSelector ApplicationMgr INFO Application Manager Initialized successfully EventSelector DEBUG Try item: "SimplePoolFile3.root" from the collection list. @@ -247,7 +242,7 @@ WriteTag INFO registered all data MagicWriteTag INFO EventInfo event: 0 run: 1 MagicWriteTag INFO registered all data EventInfoTagBui...WARNING Did not find xAOD::EventInfo -ClassIDSvc INFO getRegistryEntries: read 27 CLIDRegistry entries for module ALL +ClassIDSvc INFO getRegistryEntries: read 21 CLIDRegistry entries for module ALL Stream1 DEBUG addItemObjects(2101,"*") called Stream1 DEBUG Key:* Stream1 DEBUG Comp Attr High: 0 with 7 mantissa bits. @@ -1212,6 +1207,7 @@ Stream1 DEBUG AthenaOutputStream Stream1 ::stop() MetaDataSvc DEBUG MetaDataSvc::stop() Stream1 DEBUG slot 0 handle() incident type: MetaDataStop MetaDataSvc DEBUG calling metaDataStop for ToolSvc.IOVDbMetaDataTool +Stream1 DEBUG metadataItemList: [EventStreamInfo#Stream1, IOVMetaDataContainer#*] Stream1 DEBUG addItemObjects(167728019,"Stream1") called Stream1 DEBUG Key:Stream1 Stream1 DEBUG Comp Attr High: 0 with 7 mantissa bits. @@ -1268,13 +1264,13 @@ ToolSvc INFO Removing all tools created by ToolSvc *****Chrono***** INFO **************************************************************************************************** *****Chrono***** INFO The Final CPU consumption ( Chrono ) Table (ordered) *****Chrono***** INFO **************************************************************************************************** -commitOutput INFO Time User : Tot= 0 [us] Ave/Min/Max= 0(+- 0)/ 0/ 0 [us] #= 21 -cRep_ALL INFO Time User : Tot= 0 [us] Ave/Min/Max= 0(+- 0)/ 0/ 0 [us] #= 62 -fRep_ALL INFO Time User : Tot= 0 [us] Ave/Min/Max= 0(+- 0)/ 0/ 0 [us] #= 62 -cObjR_ALL INFO Time User : Tot= 0 [us] Ave/Min/Max= 0(+- 0)/ 0/ 0 [us] #= 65 -cRepR_ALL INFO Time User : Tot= 0 [us] Ave/Min/Max= 0(+- 0)/ 0/ 0 [us] #=144 -cObj_ALL INFO Time User : Tot= 10 [ms] Ave/Min/Max=0.159(+- 1.25)/ 0/ 10 [ms] #= 63 -ChronoStatSvc INFO Time User : Tot= 440 [ms] #= 1 +commitOutput INFO Time User : Tot= 0 [us] Ave/Min/Max= 0(+- 0)/ 0/ 0 [us] #= 21 +cRep_ALL INFO Time User : Tot= 0 [us] Ave/Min/Max= 0(+- 0)/ 0/ 0 [us] #= 62 +fRep_ALL INFO Time User : Tot= 10 [ms] Ave/Min/Max= 0.161(+- 1.26)/ 0/ 10 [ms] #= 62 +cObjR_ALL INFO Time User : Tot= 10 [ms] Ave/Min/Max= 0.154(+- 1.23)/ 0/ 10 [ms] #= 65 +cRepR_ALL INFO Time User : Tot= 10 [ms] Ave/Min/Max= 0.0694(+- 0.83)/ 0/ 10 [ms] #=144 +cObj_ALL INFO Time User : Tot= 20 [ms] Ave/Min/Max= 0.317(+- 1.75)/ 0/ 10 [ms] #= 63 +ChronoStatSvc INFO Time User : Tot= 310 [ms] #= 1 *****Chrono***** INFO **************************************************************************************************** ChronoStatSvc.f... INFO Service finalized successfully ApplicationMgr INFO Application Manager Finalized successfully diff --git a/Database/AthenaPOOL/AthenaPoolExample/AthenaPoolExampleAlgorithms/share/AthenaPoolExample_WMeta.ref b/Database/AthenaPOOL/AthenaPoolExample/AthenaPoolExampleAlgorithms/share/AthenaPoolExample_WMeta.ref index c8d4caec16563d87deda75e27cd1a3a07bce097f..898cba10a90c0412b7058e0345da860525675d79 100644 --- a/Database/AthenaPOOL/AthenaPoolExample/AthenaPoolExampleAlgorithms/share/AthenaPoolExample_WMeta.ref +++ b/Database/AthenaPOOL/AthenaPoolExample/AthenaPoolExampleAlgorithms/share/AthenaPoolExample_WMeta.ref @@ -1,31 +1,25 @@ -Warning in <TInterpreter::ReadRootmapFile>: class CP::IMuonCalibrationAndSmearingTool found in libMuonMomentumCorrectionsDict.so is already in libMuonAnalysisInterfacesDict.so -Warning in <TInterpreter::ReadRootmapFile>: class CP::IMuonSelectionTool found in libMuonSelectorToolsDict.so is already in libMuonAnalysisInterfacesDict.so -Fri Jan 24 17:12:06 CET 20?0 +Mon Aug 3 16:49:55 CEST 20?0 Preloading tcmalloc_minimal.so Athena INFO including file "AthenaCommon/Preparation.py" Athena INFO including file "AthenaCommon/Atlas.UnixStandardJob.py" Athena INFO executing ROOT6Setup Athena INFO including file "AthenaCommon/Execution.py" Athena INFO including file "AthenaPoolExampleAlgorithms/AthenaPoolExample_WMetaJobOptions.py" -Py:ConfigurableDb INFO Read module info for 5625 configurables from 37 genConfDb files +Py:ConfigurableDb INFO Read module info for 5545 configurables from 8 genConfDb files Py:ConfigurableDb INFO No duplicates have been found: that's good ! Athena INFO including file "AthenaCommon/runbatch.py" -ApplicationMgr INFO Updating Gaudi::PluginService::SetDebug(level) to level= 'PluginDebugLevel':0 -ApplicationMgr INFO Updating Gaudi::PluginService::SetDebug(level) to level= 'PluginDebugLevel':0 ApplicationMgr SUCCESS ==================================================================================================================================== - Welcome to ApplicationMgr (GaudiCoreSvc v33r0) - running on lxplus730.cern.ch on Fri Jan 24 17:12:15 20?0 + Welcome to ApplicationMgr (GaudiCoreSvc v33r2) + running on lxplus706.cern.ch on Mon Aug 3 16:50:04 20?0 ==================================================================================================================================== ApplicationMgr INFO Application Manager Configured successfully -ApplicationMgr INFO Updating Gaudi::PluginService::SetDebug(level) to level= 'PluginDebugLevel':0 -StatusCodeSvc INFO initialize AthDictLoaderSvc INFO in initialize... AthDictLoaderSvc INFO acquired Dso-registry -ClassIDSvc INFO getRegistryEntries: read 3459 CLIDRegistry entries for module ALL +ClassIDSvc INFO getRegistryEntries: read 3312 CLIDRegistry entries for module ALL AthenaEventLoopMgr INFO Initializing AthenaEventLoopMgr - package version AthenaServices-00-00-00 ClassIDSvc INFO getRegistryEntries: read 705 CLIDRegistry entries for module ALL -ClassIDSvc INFO getRegistryEntries: read 343 CLIDRegistry entries for module ALL +ClassIDSvc INFO getRegistryEntries: read 344 CLIDRegistry entries for module ALL ClassIDSvc INFO getRegistryEntries: read 581 CLIDRegistry entries for module ALL xAODMaker::Even... INFO Initializing - Package version: xAODEventInfoCnv-00-00-00 xAODMaker::Even... INFO Initializing - Package version: xAODEventInfoCnv-00-00-00 @@ -38,8 +32,8 @@ PoolSvc INFO io_register[PoolSvc](xmlcatalog_file:Catalog2.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--py3/20?0-01-23T2132/Athena/22.0.9/InstallArea/x86_64-centos7-gcc8-opt/share/dbreplica.config -DBReplicaSvc INFO Total of 10 servers found for host lxplus730.cern.ch [ATLF ATLAS_COOLPROD atlas_dd ATLAS_CONFIG INT8R INTR ATONR_COOL ATONR_CONF DEVDB11 ATLF ] +DBReplicaSvc INFO Read replica configuration from /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/20?0-08-02T2137/Athena/22.0.16/InstallArea/x86_64-centos7-gcc8-opt/share/dbreplica.config +DBReplicaSvc INFO Total of 10 servers found for host lxplus706.cern.ch [ATLF ATLAS_COOLPROD atlas_dd ATLAS_CONFIG INT8R INTR ATONR_COOL ATONR_CONF DEVDB11 ATLF ] PoolSvc INFO Successfully setup replica sorting algorithm PoolSvc DEBUG OutputLevel is 2 PoolSvc INFO Setting up APR FileCatalog and Streams @@ -47,9 +41,10 @@ PoolSvc INFO POOL WriteCatalog is xmlcatalog_file:Catalog2.xml DbSession INFO Open DbSession Domain[ROOT_All] INFO > Access DbDomain READ [ROOT_All] MetaDataSvc INFO Found MetaDataTools = PublicToolHandleArray([]) +OutputStreamSeq... INFO Initializing OutputStreamSequencerSvc - package version AthenaServices-00-00-00 xAODMaker::Even...WARNING Beam conditions service not available xAODMaker::Even...WARNING Will not fill beam spot information into xAOD::EventInfo -ClassIDSvc INFO getRegistryEntries: read 1563 CLIDRegistry entries for module ALL +ClassIDSvc INFO getRegistryEntries: read 1147 CLIDRegistry entries for module ALL WriteData DEBUG Property update for OutputLevel : new value = 2 WriteData INFO in initialize() WriteData DEBUG input handles: 0 @@ -70,7 +65,6 @@ Stream1 DEBUG End initialize Stream1 DEBUG In initialize Stream1 DEBUG Found StoreGateSvc store. Stream1 DEBUG Found MetaDataStore store. -OutputStreamSeq... INFO Initializing OutputStreamSequencerSvc - package version AthenaServices-00-00-00 Stream1.Stream1... DEBUG Property update for OutputLevel : new value = 2 Stream1.Stream1... INFO Initializing Stream1.Stream1Tool - package version AthenaServices-00-00-00 Stream1.Stream1... DEBUG Property update for OutputLevel : new value = 2 @@ -82,13 +76,14 @@ Stream1 INFO I/O reinitialization... Stream1.Stream1... DEBUG Property update for OutputLevel : new value = 2 Stream1 DEBUG End initialize Stream1 DEBUG input handles: 0 -Stream1 DEBUG output handles: 0 +Stream1 DEBUG output handles: 1 Stream1 DEBUG Registering all Tools in ToolHandleArray HelperTools Stream1 DEBUG Adding private ToolHandle tool Stream1.Stream1_MakeEventStreamInfo (MakeEventStreamInfo) Stream1 DEBUG Adding private ToolHandle tool Stream1.ThinningCacheTool_Stream1 (Athena::ThinningCacheTool) Stream1 DEBUG Adding private ToolHandle tool Stream1.Stream1Tool (AthenaOutputStreamTool) Stream1 DEBUG Data Deps for Stream1 + INPUT ( 'AthenaAttributeList' , 'StoreGateSvc+SimpleTag' ) + + OUTPUT ( 'SG::SelectionVetoes' , 'StoreGateSvc+SelectionVetoes_Stream1' ) EventSelector INFO Enter McEventSelector Initialization AthenaEventLoopMgr INFO Setup EventSelector service EventSelector ApplicationMgr INFO Application Manager Initialized successfully @@ -320,7 +315,7 @@ SimplePoolFile5... DEBUG ---->Class:float SimplePoolFile5... DEBUG ---->[0]:float Typ:float [10] Size:0 Offset:0 #Elements:1 AthenaPoolCnvSvc DEBUG setAttribute BRANCH_BASKET_SIZE to 256000 for db: SimplePoolFile5.root and cont: POOLContainer(DataHeader) AthenaPoolCnvSvc DEBUG setAttribute BRANCH_BASKET_SIZE to 1024000 for db: SimplePoolFile5.root and cont: POOLContainerForm(DataHeaderForm) -ClassIDSvc INFO getRegistryEntries: read 88 CLIDRegistry entries for module ALL +ClassIDSvc INFO getRegistryEntries: read 82 CLIDRegistry entries for module ALL AthenaEventLoopMgr INFO ===>>> done processing event #0, run #0 1 events processed so far <<<=== AthenaEventLoopMgr INFO ===>>> start processing event #1, run #0 1 events processed so far <<<=== EventInfoTagBui... INFO No input attribute list @@ -916,6 +911,7 @@ WriteCond INFO in finalize() WriteCond INFO Pedestal x = 193136 y = -5580.01 z = -175208 string = <..........o..........o..........o..........o..........o..........o..........o..........o..........o..........o..........o..........o..........o..........o..........o..........o..........o..........o..........o..........o> Stream1 DEBUG AthenaOutputStream Stream1 ::stop() Stream1 DEBUG slot 0 handle() incident type: MetaDataStop +Stream1 DEBUG metadataItemList: [EventStreamInfo#Stream1, IOVMetaDataContainer#*, ExampleHitContainer#PedestalWriteData] Stream1 DEBUG addItemObjects(9102,"PedestalWriteData") called Stream1 DEBUG Key:PedestalWriteData Stream1 DEBUG Comp Attr High: 0 with 7 mantissa bits. @@ -986,11 +982,11 @@ ToolSvc INFO Removing all tools created by ToolSvc *****Chrono***** INFO **************************************************************************************************** *****Chrono***** INFO The Final CPU consumption ( Chrono ) Table (ordered) *****Chrono***** INFO **************************************************************************************************** -commitOutput INFO Time User : Tot= 0 [us] Ave/Min/Max= 0(+- 0)/ 0/ 0 [us] #= 21 -cRepR_ALL INFO Time User : Tot= 20 [ms] Ave/Min/Max=0.0613(+-0.781)/ 0/ 10 [ms] #=326 -cRep_ALL INFO Time User : Tot= 30 [ms] Ave/Min/Max=0.476(+- 2.13)/ 0/ 10 [ms] #= 63 -fRep_ALL INFO Time User : Tot= 30 [ms] Ave/Min/Max=0.476(+- 2.13)/ 0/ 10 [ms] #= 63 -ChronoStatSvc INFO Time User : Tot= 430 [ms] #= 1 +commitOutput INFO Time User : Tot= 0 [us] Ave/Min/Max= 0(+- 0)/ 0/ 0 [us] #= 21 +cRep_ALL INFO Time User : Tot= 20 [ms] Ave/Min/Max= 0.317(+- 1.75)/ 0/ 10 [ms] #= 63 +cRepR_ALL INFO Time User : Tot= 20 [ms] Ave/Min/Max= 0.0613(+- 0.781)/ 0/ 10 [ms] #=326 +fRep_ALL INFO Time User : Tot= 30 [ms] Ave/Min/Max= 0.476(+- 2.13)/ 0/ 10 [ms] #= 63 +ChronoStatSvc INFO Time User : Tot= 280 [ms] #= 1 *****Chrono***** INFO **************************************************************************************************** ChronoStatSvc.f... INFO Service finalized successfully ApplicationMgr INFO Application Manager Finalized successfully diff --git a/Database/AthenaPOOL/AthenaPoolExample/AthenaPoolExampleAlgorithms/share/AthenaPoolExample_Write.ref b/Database/AthenaPOOL/AthenaPoolExample/AthenaPoolExampleAlgorithms/share/AthenaPoolExample_Write.ref index 965308e67d21df5df428f258e3f79d995a567559..4d667a510dbd0327241fc2d4301885aa681472ec 100644 --- a/Database/AthenaPOOL/AthenaPoolExample/AthenaPoolExampleAlgorithms/share/AthenaPoolExample_Write.ref +++ b/Database/AthenaPOOL/AthenaPoolExample/AthenaPoolExampleAlgorithms/share/AthenaPoolExample_Write.ref @@ -1,35 +1,26 @@ -Thu Feb 27 13:45:23 CET 20?0 +Mon Aug 3 19:21:45 CEST 20?0 Preloading tcmalloc_minimal.so Athena INFO including file "AthenaCommon/Preparation.py" Athena INFO including file "AthenaCommon/Atlas.UnixStandardJob.py" Athena INFO executing ROOT6Setup Athena INFO including file "AthenaCommon/Execution.py" Athena INFO including file "AthenaPoolExampleAlgorithms/AthenaPoolExample_WriteJobOptions.py" -Py:ConfigurableDb INFO Read module info for 5609 configurables from 8 genConfDb files -Py:ConfigurableDb WARNING Found 1 duplicates among the 8 genConfDb files : -Py:ConfigurableDb WARNING -------------------------------------------------- -Py:ConfigurableDb WARNING -<component name>: <module> - [ <duplicates> ] -Py:ConfigurableDb WARNING -------------------------------------------------- -Py:ConfigurableDb WARNING -L1TriggerResultMaker: TrigT1ResultByteStream.TrigT1ResultByteStreamConf - ['L1Decoder.L1DecoderConf'] -Py:ConfigurableDb WARNING Fix your cmt/requirements file !! +Py:ConfigurableDb INFO Read module info for 5545 configurables from 8 genConfDb files +Py:ConfigurableDb INFO No duplicates have been found: that's good ! Athena INFO including file "AthenaCommon/runbatch.py" -ApplicationMgr INFO Updating Gaudi::PluginService::SetDebug(level) to level= 'PluginDebugLevel':0 -ApplicationMgr INFO Updating Gaudi::PluginService::SetDebug(level) to level= 'PluginDebugLevel':0 ApplicationMgr SUCCESS ==================================================================================================================================== - Welcome to ApplicationMgr (GaudiCoreSvc v33r0) - running on aibuild20-040.cern.ch on Thu Feb 27 13:45:35 20?0 + Welcome to ApplicationMgr (GaudiCoreSvc v33r2) + running on lxplus706.cern.ch on Mon Aug 3 19:22:04 20?0 ==================================================================================================================================== ApplicationMgr INFO Application Manager Configured successfully -ApplicationMgr INFO Updating Gaudi::PluginService::SetDebug(level) to level= 'PluginDebugLevel':0 -StatusCodeSvc INFO initialize AthDictLoaderSvc INFO in initialize... AthDictLoaderSvc INFO acquired Dso-registry -ClassIDSvc INFO getRegistryEntries: read 3459 CLIDRegistry entries for module ALL +ClassIDSvc INFO getRegistryEntries: read 3312 CLIDRegistry entries for module ALL AthenaEventLoopMgr INFO Initializing AthenaEventLoopMgr - package version AthenaServices-00-00-00 ClassIDSvc INFO getRegistryEntries: read 705 CLIDRegistry entries for module ALL ClassIDSvc INFO getRegistryEntries: read 581 CLIDRegistry entries for module ALL -ClassIDSvc INFO getRegistryEntries: read 343 CLIDRegistry entries for module ALL +ClassIDSvc INFO getRegistryEntries: read 344 CLIDRegistry entries for module ALL xAODMaker::Even... INFO Initializing - Package version: xAODEventInfoCnv-00-00-00 xAODMaker::Even... INFO Initializing - Package version: xAODEventInfoCnv-00-00-00 MetaDataSvc INFO Initializing MetaDataSvc - package version AthenaServices-00-00-00 @@ -41,8 +32,8 @@ PoolSvc INFO io_register[PoolSvc](xmlcatalog_file:Catalog1.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/20?0-02-25T2133/Athena/22.0.10/InstallArea/x86_64-centos7-gcc8-opt/share/dbreplica.config -DBReplicaSvc INFO Total of 10 servers found for host aibuild20-040.cern.ch [ATLF ATLAS_COOLPROD atlas_dd ATLAS_CONFIG INT8R INTR ATONR_COOL ATONR_CONF DEVDB11 ATLF ] +DBReplicaSvc INFO Read replica configuration from /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/20?0-08-02T2137/Athena/22.0.16/InstallArea/x86_64-centos7-gcc8-opt/share/dbreplica.config +DBReplicaSvc INFO Total of 10 servers found for host lxplus706.cern.ch [ATLF ATLAS_COOLPROD atlas_dd ATLAS_CONFIG INT8R INTR ATONR_COOL ATONR_CONF DEVDB11 ATLF ] PoolSvc INFO Successfully setup replica sorting algorithm PoolSvc DEBUG OutputLevel is 2 PoolSvc INFO Setting up APR FileCatalog and Streams @@ -50,9 +41,10 @@ PoolSvc INFO POOL WriteCatalog is xmlcatalog_file:Catalog1.xml DbSession INFO Open DbSession Domain[ROOT_All] INFO > Access DbDomain READ [ROOT_All] MetaDataSvc INFO Found MetaDataTools = PublicToolHandleArray([]) +OutputStreamSeq... INFO Initializing OutputStreamSequencerSvc - package version AthenaServices-00-00-00 xAODMaker::Even...WARNING Beam conditions service not available xAODMaker::Even...WARNING Will not fill beam spot information into xAOD::EventInfo -ClassIDSvc INFO getRegistryEntries: read 1563 CLIDRegistry entries for module ALL +ClassIDSvc INFO getRegistryEntries: read 1147 CLIDRegistry entries for module ALL WriteData DEBUG Property update for OutputLevel : new value = 2 WriteData INFO in initialize() WriteData DEBUG input handles: 0 @@ -64,6 +56,9 @@ WriteTag INFO in initialize() MagicWriteTag INFO in initialize() Stream1 DEBUG Property update for OutputLevel : new value = 2 Stream1.Stream1... DEBUG Property update for OutputLevel : new value = 2 +Stream1.Stream1... DEBUG Property update for OutputLevel : new value = 2 +Stream1.Stream1... DEBUG Property update for OutputLevel : new value = 2 +Stream1.Stream1... DEBUG Property update for OutputLevel : new value = 2 Stream1 DEBUG In initialize Stream1 DEBUG Found IDecisionSvc. DecisionSvc INFO Inserting stream: Stream1 with no Algs @@ -71,7 +66,6 @@ Stream1 DEBUG End initialize Stream1 DEBUG In initialize Stream1 DEBUG Found StoreGateSvc store. Stream1 DEBUG Found MetaDataStore store. -OutputStreamSeq... INFO Initializing OutputStreamSequencerSvc - package version AthenaServices-00-00-00 Stream1.Stream1... DEBUG Property update for OutputLevel : new value = 2 Stream1.Stream1... INFO Initializing Stream1.Stream1Tool - package version AthenaServices-00-00-00 Stream1.Stream1... DEBUG Property update for OutputLevel : new value = 2 @@ -83,15 +77,19 @@ Stream1 INFO I/O reinitialization... Stream1.Stream1... DEBUG Property update for OutputLevel : new value = 2 Stream1 DEBUG End initialize Stream1 DEBUG input handles: 0 -Stream1 DEBUG output handles: 0 +Stream1 DEBUG output handles: 1 Stream1 DEBUG Registering all Tools in ToolHandleArray HelperTools Stream1 DEBUG Adding private ToolHandle tool Stream1.Stream1_MakeEventStreamInfo (MakeEventStreamInfo) Stream1 DEBUG Adding private ToolHandle tool Stream1.ThinningCacheTool_Stream1 (Athena::ThinningCacheTool) Stream1 DEBUG Adding private ToolHandle tool Stream1.Stream1Tool (AthenaOutputStreamTool) Stream1 DEBUG Data Deps for Stream1 + INPUT ( 'AthenaAttributeList' , 'StoreGateSvc+MagicTag' ) + + OUTPUT ( 'SG::SelectionVetoes' , 'StoreGateSvc+SelectionVetoes_Stream1' ) Stream2 DEBUG Property update for OutputLevel : new value = 2 Stream2.Stream2... DEBUG Property update for OutputLevel : new value = 2 +Stream2.Stream2... DEBUG Property update for OutputLevel : new value = 2 +Stream2.Stream2... DEBUG Property update for OutputLevel : new value = 2 +Stream2.Stream2... DEBUG Property update for OutputLevel : new value = 2 Stream2 DEBUG In initialize Stream2 DEBUG Found IDecisionSvc. DecisionSvc INFO Inserting stream: Stream2 with no Algs @@ -110,13 +108,14 @@ Stream2 INFO I/O reinitialization... Stream2.Stream2... DEBUG Property update for OutputLevel : new value = 2 Stream2 DEBUG End initialize Stream2 DEBUG input handles: 0 -Stream2 DEBUG output handles: 0 +Stream2 DEBUG output handles: 1 Stream2 DEBUG Registering all Tools in ToolHandleArray HelperTools Stream2 DEBUG Adding private ToolHandle tool Stream2.Stream2_MakeEventStreamInfo (MakeEventStreamInfo) Stream2 DEBUG Adding private ToolHandle tool Stream2.ThinningCacheTool_Stream2 (Athena::ThinningCacheTool) Stream2 DEBUG Adding private ToolHandle tool Stream2.Stream2Tool (AthenaOutputStreamTool) Stream2 DEBUG Data Deps for Stream2 + INPUT ( 'AthenaAttributeList' , 'StoreGateSvc+RunEventTag' ) + + OUTPUT ( 'SG::SelectionVetoes' , 'StoreGateSvc+SelectionVetoes_Stream2' ) DecisionSvc INFO Inserting stream: Stream3 with no Algs Stream3.Stream3... INFO Initializing Stream3.Stream3Tool - package version AthenaServices-00-00-00 Stream3.Stream3... INFO Initializing Stream3.Stream3_MakeEventStreamInfo - package version OutputStreamAthenaPool-00-00-00 @@ -138,7 +137,7 @@ WriteTag INFO registered all data MagicWriteTag INFO EventInfo event: 0 run: 1 MagicWriteTag INFO registered all data EventInfoTagBui... INFO No input attribute list -ClassIDSvc INFO getRegistryEntries: read 666 CLIDRegistry entries for module ALL +ClassIDSvc INFO getRegistryEntries: read 931 CLIDRegistry entries for module ALL Stream1 DEBUG addItemObjects(2101,"*") called Stream1 DEBUG Key:* Stream1 DEBUG Comp Attr High: 0 with 7 mantissa bits. @@ -274,7 +273,7 @@ SimplePoolFile1... DEBUG --->Adding Assoc :????/POOLCollectionTree(MagicNumber) SimplePoolFile1... DEBUG ---->ClassID:???? AthenaPoolCnvSvc DEBUG setAttribute BRANCH_BASKET_SIZE to 256000 for db: SimplePoolFile1.root and cont: POOLContainer(DataHeader) AthenaPoolCnvSvc DEBUG setAttribute BRANCH_BASKET_SIZE to 1024000 for db: SimplePoolFile1.root and cont: POOLContainerForm(DataHeaderForm) -ClassIDSvc INFO getRegistryEntries: read 88 CLIDRegistry entries for module ALL +ClassIDSvc INFO getRegistryEntries: read 82 CLIDRegistry entries for module ALL Stream2 DEBUG addItemObjects(2101,"*") called Stream2 DEBUG Key:* Stream2 DEBUG Comp Attr High: 0 with 7 mantissa bits. @@ -1159,6 +1158,7 @@ AthenaEventLoopMgr INFO ===>>> done processing event #19, run #1 20 events Stream1 DEBUG AthenaOutputStream Stream1 ::stop() Stream2 DEBUG AthenaOutputStream Stream2 ::stop() Stream1 DEBUG slot 0 handle() incident type: MetaDataStop +Stream1 DEBUG metadataItemList: [EventStreamInfo#Stream1, IOVMetaDataContainer#*] Stream1 DEBUG addItemObjects(167728019,"Stream1") called Stream1 DEBUG Key:Stream1 Stream1 DEBUG Comp Attr High: 0 with 7 mantissa bits. @@ -1199,6 +1199,7 @@ ClassIDSvc INFO getRegistryEntries: read 7 CLIDRegistry entries for m Stream1 INFO Metadata records written: 21 Stream1 DEBUG Leaving incident handler for MetaDataStop Stream2 DEBUG slot 0 handle() incident type: MetaDataStop +Stream2 DEBUG metadataItemList: [EventStreamInfo#Stream2, IOVMetaDataContainer#*] Stream2 DEBUG addItemObjects(167728019,"Stream2") called Stream2 DEBUG Key:Stream2 Stream2 DEBUG Comp Attr High: 0 with 7 mantissa bits. @@ -1326,11 +1327,11 @@ ToolSvc INFO Removing all tools created by ToolSvc *****Chrono***** INFO **************************************************************************************************** *****Chrono***** INFO The Final CPU consumption ( Chrono ) Table (ordered) *****Chrono***** INFO **************************************************************************************************** -commitOutput INFO Time User : Tot= 0 [us] Ave/Min/Max= 0(+- 0)/ 0/ 0 [us] #= 43 -cRepR_ALL INFO Time User : Tot= 20 [ms] Ave/Min/Max=0.0735(+-0.854)/ 0/ 10 [ms] #=272 -fRep_ALL INFO Time User : Tot= 30 [ms] Ave/Min/Max=0.283(+- 1.66)/ 0/ 10 [ms] #=106 -cRep_ALL INFO Time User : Tot= 30 [ms] Ave/Min/Max=0.283(+- 1.66)/ 0/ 10 [ms] #=106 -ChronoStatSvc INFO Time User : Tot= 0.53 [s] #= 1 +commitOutput INFO Time User : Tot= 10 [ms] Ave/Min/Max= 0.233(+- 1.51)/ 0/ 10 [ms] #= 43 +cRepR_ALL INFO Time User : Tot= 10 [ms] Ave/Min/Max= 0.0368(+- 0.605)/ 0/ 10 [ms] #=272 +cRep_ALL INFO Time User : Tot= 20 [ms] Ave/Min/Max= 0.189(+- 1.36)/ 0/ 10 [ms] #=106 +fRep_ALL INFO Time User : Tot= 60 [ms] Ave/Min/Max= 0.566(+- 2.31)/ 0/ 10 [ms] #=106 +ChronoStatSvc INFO Time User : Tot= 360 [ms] #= 1 *****Chrono***** INFO **************************************************************************************************** ChronoStatSvc.f... INFO Service finalized successfully ApplicationMgr INFO Application Manager Finalized successfully diff --git a/Database/AthenaPOOL/EventSelectorAthenaPool/src/EventSelectorAthenaPool.cxx b/Database/AthenaPOOL/EventSelectorAthenaPool/src/EventSelectorAthenaPool.cxx index 7561ce0027e987822832c370be50ad4edf242f94..dc60636905353c304fc7fdf4e0ae3673b5ac84be 100644 --- a/Database/AthenaPOOL/EventSelectorAthenaPool/src/EventSelectorAthenaPool.cxx +++ b/Database/AthenaPOOL/EventSelectorAthenaPool/src/EventSelectorAthenaPool.cxx @@ -573,20 +573,13 @@ StatusCode EventSelectorAthenaPool::nextHandleFileTransition(IEvtSelector::Conte if (m_headerIterator == nullptr || m_headerIterator->next() == 0) { m_headerIterator = nullptr; // Close previous collection. - if (!m_keepInputFilesOpen.value() && m_poolCollectionConverter != nullptr) { - m_poolCollectionConverter->disconnectDb().ignore(); - } delete m_poolCollectionConverter; m_poolCollectionConverter = nullptr; - // Assume that the end of collection file indicates the end of payload file. - if (m_processMetadata.value()) { - // Fire EndInputFile incident - FileIncident endInputFileIncident(name(), "EndInputFile", "FID:" + m_guid.toString(), m_guid.toString()); - m_incidentSvc->fireIncident(endInputFileIncident); - } + // zero the current DB ID (m_guid) before disconnect() to indicate it is no longer in use - auto old_guid = m_guid; + const SG::SourceID old_guid = m_guid.toString(); m_guid = Guid::null(); - disconnectIfFinished( old_guid.toString() ); + disconnectIfFinished( old_guid ); + // Open next file from inputCollections list. m_inputCollectionsIterator++; // Create PoolCollectionConverter for input file @@ -616,16 +609,12 @@ StatusCode EventSelectorAthenaPool::nextHandleFileTransition(IEvtSelector::Conte tech = token.technology(); } if (guid != m_guid) { + // we are starting reading from a new DB. Check if the old one needs to be retired if (m_guid != Guid::null()) { - if (m_processMetadata.value()) { - // Fire EndInputFile incident - FileIncident endInputFileIncident(name(), "EndInputFile", "FID:" + m_guid.toString(), m_guid.toString()); - m_incidentSvc->fireIncident(endInputFileIncident); - } - // zero the current DB ID (m_guid) before disconnect() to indicate it is no longer in use - auto old_guid = m_guid; + // zero the current DB ID (m_guid) before trying disconnect() to indicate it is no longer in use + const SG::SourceID old_guid = m_guid.toString(); m_guid = Guid::null(); - disconnectIfFinished(old_guid.toString()); + disconnectIfFinished( old_guid ); } m_guid = guid; // Fire BeginInputFile incident if current InputCollection is a payload file; @@ -1116,11 +1105,16 @@ void EventSelectorAthenaPool::handle(const Incident& inc) m_guid is not pointing to it and there are no events from it being processed (if the EventLoopMgr was not firing Begin/End incidents, this will just close the DB) */ -bool EventSelectorAthenaPool::disconnectIfFinished( SG::SourceID fid ) const +bool EventSelectorAthenaPool::disconnectIfFinished( const SG::SourceID &fid ) const { if( m_activeEventsPerSource[fid] <= 0 && m_guid != fid ) { // Explicitly disconnect file corresponding to old FID to release memory if( !m_keepInputFilesOpen.value() ) { + // Assume that the end of collection file indicates the end of payload file. + if (m_processMetadata.value()) { + FileIncident endInputFileIncident(name(), "EndInputFile", "FID:" + fid, fid); + m_incidentSvc->fireIncident(endInputFileIncident); + } ATH_MSG_INFO("Disconnecting input sourceID: " << fid ); m_athenaPoolCnvSvc->getPoolSvc()->disconnectDb("FID:" + fid, IPoolSvc::kInputStream).ignore(); m_activeEventsPerSource.erase( fid ); diff --git a/Database/AthenaPOOL/EventSelectorAthenaPool/src/EventSelectorAthenaPool.h b/Database/AthenaPOOL/EventSelectorAthenaPool/src/EventSelectorAthenaPool.h index ce19c03b5ad0c2be534c36978abe8ca36d298c16..df76dd5920e1f38960f0ade1c0c7ce5652f7a597 100644 --- a/Database/AthenaPOOL/EventSelectorAthenaPool/src/EventSelectorAthenaPool.h +++ b/Database/AthenaPOOL/EventSelectorAthenaPool/src/EventSelectorAthenaPool.h @@ -151,7 +151,7 @@ protected: /// Fill AttributeList with specific items from the selector and a suffix virtual StatusCode fillAttributeList(coral::AttributeList *attrList, const std::string &suffix, bool copySource) const override; // Disconnect DB if all events from the source FID were processed and the Selector moved to another file - virtual bool disconnectIfFinished(SG::SourceID fid) const override; + virtual bool disconnectIfFinished(const SG::SourceID &fid) const override; private: // internal member functions /// Return pointer to active event SG diff --git a/DetectorDescription/AGDD/AGDD2GeoSvc/src/DefaultAGDDTool.cxx b/DetectorDescription/AGDD/AGDD2GeoSvc/src/DefaultAGDDTool.cxx index 29b7a50f30d98a6786ab52e870026bf845a4f19c..bbf3e19e6ad52f5c73cc0265d4aef86a5a8a7a1a 100644 --- a/DetectorDescription/AGDD/AGDD2GeoSvc/src/DefaultAGDDTool.cxx +++ b/DetectorDescription/AGDD/AGDD2GeoSvc/src/DefaultAGDDTool.cxx @@ -15,7 +15,7 @@ DefaultAGDDTool::DefaultAGDDTool(const std::string& type, const std::string& nam StatusCode DefaultAGDDTool::initialize() { ATH_MSG_INFO("this is DefaultAGDDTool::initialize()!!!!"); - ATH_MSG_INFO("Default detector "<<m_defaultDetector); + ATH_MSG_INFO("Default detector "<<m_defaultDetector.value()); return AGDDToolBase::initialize(); } @@ -35,8 +35,8 @@ StatusCode DefaultAGDDTool::construct() if (!m_defaultDetector.empty()) { - ATH_MSG_INFO(" setting default detector to "<<m_defaultDetector); - m_controller->UseGeoModelDetector(m_defaultDetector); + ATH_MSG_INFO(" setting default detector to "<<m_defaultDetector.value()); + m_controller->UseGeoModelDetector(m_defaultDetector.value()); } m_controller->BuildAll(); diff --git a/DetectorDescription/AGDD/AGDDControl/AGDDControl/AGDDToolBase.h b/DetectorDescription/AGDD/AGDDControl/AGDDControl/AGDDToolBase.h index 357b78efffe85c22ec1330d6ee390c391efc2b9e..148485b13ab60f3232c504bca07c2ad937defd29 100644 --- a/DetectorDescription/AGDD/AGDDControl/AGDDControl/AGDDToolBase.h +++ b/DetectorDescription/AGDD/AGDDControl/AGDDControl/AGDDToolBase.h @@ -1,41 +1,39 @@ /* - 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 AGDDToolBase_H -#define AGDDToolBase_H +#ifndef AGDDCONTROL_AGDDToolBase_H +#define AGDDCONTROL_AGDDToolBase_H #include "AGDDControl/IAGDDToolBase.h" #include "AthenaBaseComps/AthAlgTool.h" #include "GaudiKernel/StatusCode.h" -class IInterface; class AGDDController; -class AGDDToolBase: public AthAlgTool, virtual public IAGDDToolBase +class AGDDToolBase: public extends<AthAlgTool, IAGDDToolBase> { public: - AGDDToolBase(const std::string& type, const std::string& name, - const IInterface* parent); - virtual StatusCode initialize(); - virtual StatusCode construct() {return StatusCode::SUCCESS;} + AGDDToolBase(const std::string& type, const std::string& name, + const IInterface* parent); + virtual StatusCode initialize(); + virtual StatusCode construct() {return StatusCode::SUCCESS;} protected: - std::vector<std::string> m_xmlFiles; - std::vector<std::string> m_sectionsToBuild; - std::vector<std::string> m_volumesToBuild; - int m_parserVerbosity; - int m_builderVerbosity; - bool m_printSections; - bool m_disableSections; - bool m_locked; - bool m_writeDBfile; - std::string m_outFileName; - std::string m_defaultDetector; - std::string m_navigateDetector; - - void InitializeAGDD(); - - AGDDController* m_controller; + void InitializeAGDD(); + + Gaudi::Property<std::vector<std::string> > m_xmlFiles{this, "XMLFiles", {} }; + Gaudi::Property<std::vector<std::string> > m_sectionsToBuild{this, "Sections", {} }; + Gaudi::Property<std::vector<std::string> > m_volumesToBuild{this, "Volumes", {} }; + Gaudi::Property<int> m_parserVerbosity{this, "ParserVerbosity", 0}; + Gaudi::Property<int> m_builderVerbosity{this, "BuilderVerbosity", 0}; + Gaudi::Property<bool> m_printSections{this, "PrintSections", false}; + Gaudi::Property<bool> m_disableSections{this, "DisableSections", true}; + Gaudi::Property<bool> m_locked{this, "Locked", false}; + Gaudi::Property<bool> m_writeDBfile{this, "WriteAGDDFile", false}; + Gaudi::Property<std::string> m_outFileName{this, "OutAGDDXMLName", "mytest.xml"}; + Gaudi::Property<std::string> m_defaultDetector{this, "DefaultDetector", "NoDetector"}; + Gaudi::Property<std::string> m_navigateDetector{this, "NavigateDetector", ""}; + AGDDController* m_controller {}; }; #endif diff --git a/DetectorDescription/AGDD/AGDDControl/AGDDControl/IAGDDToolBase.h b/DetectorDescription/AGDD/AGDDControl/AGDDControl/IAGDDToolBase.h index 45d1a024f4445204a01e20368e201df923157805..49ca8aa412bfc68de023c73a4e3e3a742f8c3bea 100644 --- a/DetectorDescription/AGDD/AGDDControl/AGDDControl/IAGDDToolBase.h +++ b/DetectorDescription/AGDD/AGDDControl/AGDDControl/IAGDDToolBase.h @@ -1,24 +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 IAGDDToolBase_H -#define IAGDDToolBase_H +#ifndef AGDDCONTROL_IAGDDToolBase_H +#define AGDDCONTROL_IAGDDToolBase_H #include "GaudiKernel/IAlgTool.h" -static const InterfaceID IID_IAGDDToolBase("IAGDDToolBase",1,0); - // Interface to define an AGDD-constructing tool to be used from AGDD2GeoSvc class IAGDDToolBase: virtual public IAlgTool { public: - static const InterfaceID& interfaceID() {return IID_IAGDDToolBase;} - - virtual ~IAGDDToolBase() {} - - virtual StatusCode construct() =0; + virtual ~IAGDDToolBase() {} + DeclareInterfaceID(IAGDDToolBase,1,0); + + virtual StatusCode construct() = 0; }; #endif diff --git a/DetectorDescription/AGDD/AGDDControl/src/AGDDToolBase.cxx b/DetectorDescription/AGDD/AGDDControl/src/AGDDToolBase.cxx index 3555489ebda4984879e33799723b93bf4d29501d..05c0aec7df6b652535a684984d6ab96e5e004908 100644 --- a/DetectorDescription/AGDD/AGDDControl/src/AGDDToolBase.cxx +++ b/DetectorDescription/AGDD/AGDDControl/src/AGDDToolBase.cxx @@ -1,39 +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 */ #include "AGDDControl/AGDDToolBase.h" #include "AGDDControl/AGDDController.h" -AGDDToolBase::AGDDToolBase(const std::string& type, const std::string& name, - const IInterface* parent):AthAlgTool(type,name,parent), - m_parserVerbosity(0),m_builderVerbosity(0), - m_printSections(false),m_locked(false), - m_defaultDetector("NoDetector"),m_navigateDetector("") +AGDDToolBase::AGDDToolBase(const std::string& type, const std::string& name, + const IInterface* parent) + : base_class(type,name,parent) { - declareInterface<IAGDDToolBase> (this); - - declareProperty( "XMLFiles", m_xmlFiles); - declareProperty( "Sections", m_sectionsToBuild); - declareProperty( "Volumes" , m_volumesToBuild); - declareProperty( "ParserVerbosity", m_parserVerbosity); - declareProperty( "BuilderVerbosity", m_builderVerbosity); - declareProperty( "PrintSections", m_printSections); - declareProperty( "Locked", m_locked); - declareProperty("DefaultDetector", m_defaultDetector); - declareProperty("NavigateDetector", m_navigateDetector); - declareProperty("DisableSections", m_disableSections); - declareProperty("WriteAGDDFile", m_writeDBfile = false); - declareProperty("OutAGDDXMLName", m_outFileName = "mytest.xml"); - - ATH_MSG_DEBUG(" trying to get the controller"); - m_controller =AGDDController::GetController(); + ATH_MSG_DEBUG(" trying to get the controller"); + m_controller = AGDDController::GetController(); } StatusCode AGDDToolBase::initialize() { - InitializeAGDD(); - return AlgTool::initialize(); + InitializeAGDD(); + return StatusCode::SUCCESS; } void AGDDToolBase::InitializeAGDD() diff --git a/DetectorDescription/AGDD/AGDDHandlers/src/chamberPositionerHandler.cxx b/DetectorDescription/AGDD/AGDDHandlers/src/chamberPositionerHandler.cxx index 6e97fea80fe17db1f2e6366a2cd2c2901b134d27..235a65b70dcc6e7ba099d0dd188e64e55aded80b 100644 --- a/DetectorDescription/AGDD/AGDDHandlers/src/chamberPositionerHandler.cxx +++ b/DetectorDescription/AGDD/AGDDHandlers/src/chamberPositionerHandler.cxx @@ -7,14 +7,12 @@ #include "AGDDKernel/AGDDDetectorPositioner.h" #include "AGDDKernel/AGDDDetector.h" #include "GeoModelKernel/Units.h" +#include "GaudiKernel/MsgStream.h" +#include "AthenaKernel/getMessageSvc.h" +#include "GeoPrimitives/CLHEPtoEigenConverter.h" #include <iostream> -#include "CLHEP/Vector/Rotation.h" -#include "CLHEP/Vector/ThreeVector.h" -#include "CLHEP/Geometry/Transform3D.h" - - chamberPositionerHandler::chamberPositionerHandler(std::string s):XMLHandler(s) { } @@ -22,14 +20,13 @@ chamberPositionerHandler::chamberPositionerHandler(std::string s):XMLHandler(s) void chamberPositionerHandler::ElementHandle() { std::string volume=getAttributeAsString("volume"); - - //AGDDVolume* theVol=AGDDVolumeStore::GetVolumeStore()->GetVolume(volume); - + AGDDDetector* mCham=(AGDDDetectorStore::GetDetectorStore())->GetDetector(volume); std::string subType; if (!mCham) { - std::cout<<"chamberPositionerHandler: something wrong! returning..."<<std::endl; + MsgStream log(Athena::getMessageSvc(),"chamberPositionerHandler"); + log<<MSG::WARNING<<"ElementHandle() - Could not retrieve volume "<<volume<<" from DetectorStore!"<<endmsg; return; } else @@ -49,35 +46,27 @@ void chamberPositionerHandler::ElementHandle() int etaIndex=getAttributeAsInt("etaIndex",0); double dPhi=360./iWedge; - if (iSectors.size()!= (unsigned int) iWedge) throw; - - // std::cout<<" =============>> this is chamberPositionerHandler::ElementHandle() "<<volume<<" "<<subType<<std::endl; - + for (int i=0;i<iWedge;i++) { if (iSectors[i]=='0') continue; if (zLayout!="Z_NEGATIVE") { double Wedge=dPhi*i+phi0; - CLHEP::Hep3Vector cvec; - CLHEP::HepRotation crot; + GeoTrf::Transform3D crot = GeoTrf::Transform3D::Identity(); if (type=="ENDCAP") { // fix to ensure right order of planes - crot.rotateZ(180.*GeoModelKernelUnits::degree); - // - crot.rotateY(90*GeoModelKernelUnits::degree); - crot.rotateZ(Wedge*GeoModelKernelUnits::degree); + crot = crot*GeoTrf::RotateZ3D(Wedge*GeoModelKernelUnits::degree)*GeoTrf::RotateY3D(90*GeoModelKernelUnits::degree)*GeoTrf::RotateZ3D(180.*GeoModelKernelUnits::degree); } - else - crot.rotateZ(Wedge*GeoModelKernelUnits::degree); - double x=radius*cos(Wedge*GeoModelKernelUnits::degree); - double y=radius*sin(Wedge*GeoModelKernelUnits::degree); + else crot = crot*GeoTrf::RotateZ3D(Wedge*GeoModelKernelUnits::degree); + double x=radius*std::cos(Wedge*GeoModelKernelUnits::degree); + double y=radius*std::sin(Wedge*GeoModelKernelUnits::degree); double zpos=zPos; - cvec=CLHEP::Hep3Vector(x,y,zpos); + GeoTrf::Vector3D cvec=GeoTrf::Vector3D(x,y,zpos); AGDDDetectorPositioner *p __attribute__((__unused__)); - p=new AGDDDetectorPositioner(volume,crot,cvec); + p=new AGDDDetectorPositioner(volume,Amg::EigenTransformToCLHEP(GeoTrf::Translation3D(cvec)*crot)); p->SensitiveDetector(true); p->ID.phiIndex=i; p->ID.sideIndex=1; @@ -95,25 +84,19 @@ void chamberPositionerHandler::ElementHandle() if (zLayout!="Z_POSITIVE") { double Wedge=dPhi*i+phi0; - CLHEP::Hep3Vector cvec; - CLHEP::HepRotation crot; + GeoTrf::Transform3D crot = GeoTrf::Transform3D::Identity(); if (type=="ENDCAP") { // fix to ensure right order of planes - crot.rotateZ(180.*GeoModelKernelUnits::degree); - // - crot.rotateY(90*GeoModelKernelUnits::degree); - crot.rotateZ(-Wedge*GeoModelKernelUnits::degree); - crot.rotateX(180.*GeoModelKernelUnits::degree); + crot = crot*GeoTrf::RotateX3D(180.*GeoModelKernelUnits::degree)*GeoTrf::RotateZ3D(-Wedge*GeoModelKernelUnits::degree)*GeoTrf::RotateY3D(90*GeoModelKernelUnits::degree)*GeoTrf::RotateZ3D(180.*GeoModelKernelUnits::degree); } - else - crot.rotateZ(Wedge*GeoModelKernelUnits::degree); - double x=radius*cos(Wedge*GeoModelKernelUnits::degree); - double y=radius*sin(Wedge*GeoModelKernelUnits::degree); + else crot = crot*GeoTrf::RotateZ3D(Wedge*GeoModelKernelUnits::degree); + double x=radius*std::cos(Wedge*GeoModelKernelUnits::degree); + double y=radius*std::sin(Wedge*GeoModelKernelUnits::degree); double zpos=zPos; - cvec=CLHEP::Hep3Vector(x,y,-zpos); + GeoTrf::Vector3D cvec=GeoTrf::Vector3D(x,y,-zpos); AGDDDetectorPositioner *p __attribute__((__unused__)); - p=new AGDDDetectorPositioner(volume,crot,cvec); + p=new AGDDDetectorPositioner(volume,Amg::EigenTransformToCLHEP(GeoTrf::Translation3D(cvec)*crot)); p->SensitiveDetector(true); p->ID.phiIndex=i; p->ID.sideIndex=-1; diff --git a/DetectorDescription/AGDD/AGDDHandlers/src/mposPhiHandler.cxx b/DetectorDescription/AGDD/AGDDHandlers/src/mposPhiHandler.cxx index e9f4caf82d941a3ba2d9a7c9439673c8dc5930df..bd7d0c3f0d13f6ba0f6a081c1a23a62fd0df7f13 100644 --- a/DetectorDescription/AGDD/AGDDHandlers/src/mposPhiHandler.cxx +++ b/DetectorDescription/AGDD/AGDDHandlers/src/mposPhiHandler.cxx @@ -5,14 +5,12 @@ #include "AGDDHandlers/mposPhiHandler.h" #include "AGDDKernel/AGDDPositioner.h" #include "GeoModelKernel/Units.h" +#include "GaudiKernel/MsgStream.h" +#include "AthenaKernel/getMessageSvc.h" +#include "GeoPrimitives/CLHEPtoEigenConverter.h" #include <iostream> -#include "CLHEP/Vector/Rotation.h" -#include "CLHEP/Vector/ThreeVector.h" -#include "CLHEP/Vector/TwoVector.h" -#include "CLHEP/Geometry/Transform3D.h" - mposPhiHandler::mposPhiHandler(std::string s):XMLHandler(s),p(0) { } @@ -33,7 +31,8 @@ void mposPhiHandler::ElementHandle() dphi=360./icopy; else { - std::cout<<"mposPhiHandler: both icopy and dphi are null!! volume "<<volume<<" cannot continue!"<<std::endl; + MsgStream log(Athena::getMessageSvc(),"mposPhiHandler"); + log<<MSG::WARNING<<"ElementHandle() - both icopy and dphi are nullptr!! volume "<<volume<<" cannot continue!"<<endmsg; return; } } @@ -52,31 +51,27 @@ void mposPhiHandler::ElementHandle() zpos=vvv[1]; } - CLHEP::Hep3Vector cvec; - CLHEP::HepRotation crot; + GeoTrf::Transform3D crot = GeoTrf::Transform3D::Identity(); vvv=getAttributeAsVector("rot",res); if (res) { - crot.rotateX(vvv[0]*GeoModelKernelUnits::degree); - crot.rotateY(vvv[1]*GeoModelKernelUnits::degree); - crot.rotateZ(vvv[2]*GeoModelKernelUnits::degree); + crot = crot*GeoTrf::RotateZ3D(vvv[2]*GeoModelKernelUnits::degree)*GeoTrf::RotateY3D(vvv[1]*GeoModelKernelUnits::degree)*GeoTrf::RotateX3D(vvv[0]*GeoModelKernelUnits::degree); } for (int i=0;i<icopy;i++) { - CLHEP::Hep2Vector position(rad,lateral_displacement); - CLHEP::Hep3Vector cvec; + GeoTrf::Vector2D position(rad,lateral_displacement); double phi=phi0+dphi*i; - position.rotate(phi*GeoModelKernelUnits::degree); + position = Eigen::Rotation2Dd(phi*GeoModelKernelUnits::degree)*position; double x=position.x(); double y=position.y(); - cvec=CLHEP::Hep3Vector(x,y,zpos); - if (s!="false"&&i>0) crot.rotateZ(dphi*GeoModelKernelUnits::degree); - if (s!="false"&&i==0) crot.rotateZ(phi0*GeoModelKernelUnits::degree); + GeoTrf::Vector3D cvec=GeoTrf::Vector3D(x,y,zpos); + if (s!="false"&&i>0) crot = GeoTrf::RotateZ3D(dphi*GeoModelKernelUnits::degree)*crot; + else if (s!="false"&&i==0) crot = GeoTrf::RotateZ3D(phi0*GeoModelKernelUnits::degree)*crot; - p=new AGDDPositioner(volume,crot,cvec); + p=new AGDDPositioner(volume,Amg::EigenTransformToCLHEP(GeoTrf::Translation3D(cvec)*crot)); } } diff --git a/DetectorDescription/AGDD/AGDDHandlers/src/mposWedgeHandler.cxx b/DetectorDescription/AGDD/AGDDHandlers/src/mposWedgeHandler.cxx index c28ff18092f35800ce3a1c8cda20a4cc9d77ad58..4808379f990a9f6f22980bc3e85736316170f10e 100644 --- a/DetectorDescription/AGDD/AGDDHandlers/src/mposWedgeHandler.cxx +++ b/DetectorDescription/AGDD/AGDDHandlers/src/mposWedgeHandler.cxx @@ -5,12 +5,10 @@ #include "AGDDHandlers/mposWedgeHandler.h" #include "AGDDKernel/AGDDPositioner.h" #include "GeoModelKernel/Units.h" +#include "GeoPrimitives/CLHEPtoEigenConverter.h" #include <iostream> - -#include "CLHEP/Vector/Rotation.h" -#include "CLHEP/Vector/ThreeVector.h" -#include "CLHEP/Geometry/Transform3D.h" +#include <vector> mposWedgeHandler::mposWedgeHandler(std::string s):XMLHandler(s),p(0) { @@ -22,25 +20,20 @@ void mposWedgeHandler::ElementHandle() std::string volume=getAttributeAsString("volume",res); int iWedge=getAttributeAsInt("wedge_number",8); std::vector<double> iSectors=getAttributeAsVector("sectors",res); - + double dWedge=360./iWedge; - CLHEP::Hep3Vector cvec; - CLHEP::HepRotation crot; - double radius=0; for (int i=0;i<iWedge;i++) { double Wedge=dWedge*i; if ((int)iSectors[i]==0) continue; - CLHEP::Hep3Vector cvec; - CLHEP::HepRotation crot; - crot.rotateZ(Wedge*GeoModelKernelUnits::degree); - double x=radius*cos(Wedge*GeoModelKernelUnits::degree); - double y=radius*sin(Wedge*GeoModelKernelUnits::degree); + GeoTrf::Transform3D crot = GeoTrf::RotateZ3D(Wedge*GeoModelKernelUnits::degree); + double x=radius*std::cos(Wedge*GeoModelKernelUnits::degree); + double y=radius*std::sin(Wedge*GeoModelKernelUnits::degree); double zpos=0; - cvec=CLHEP::Hep3Vector(x,y,zpos); + GeoTrf::Vector3D cvec=GeoTrf::Vector3D(x,y,zpos); - p=new AGDDPositioner(volume,crot,cvec); + p=new AGDDPositioner(volume,Amg::EigenTransformToCLHEP(GeoTrf::Translation3D(cvec)*crot)); } } diff --git a/DetectorDescription/AGDD/AGDDHandlers/src/posRPhiZHandler.cxx b/DetectorDescription/AGDD/AGDDHandlers/src/posRPhiZHandler.cxx index 03769f0c1f5f5fa54609d138ac288ece3a56e203..10986c214e1c3defae180d38123110d5e1042827 100644 --- a/DetectorDescription/AGDD/AGDDHandlers/src/posRPhiZHandler.cxx +++ b/DetectorDescription/AGDD/AGDDHandlers/src/posRPhiZHandler.cxx @@ -5,12 +5,10 @@ #include "AGDDHandlers/posRPhiZHandler.h" #include "AGDDKernel/AGDDPositioner.h" #include "GeoModelKernel/Units.h" +#include "GeoPrimitives/CLHEPtoEigenConverter.h" #include <iostream> - -#include "CLHEP/Vector/Rotation.h" -#include "CLHEP/Vector/ThreeVector.h" -#include "CLHEP/Geometry/Transform3D.h" +#include <vector> posRPhiZHandler::posRPhiZHandler(std::string s):XMLHandler(s),p(0) { @@ -18,32 +16,24 @@ posRPhiZHandler::posRPhiZHandler(std::string s):XMLHandler(s),p(0) void posRPhiZHandler::ElementHandle() { - bool res; + bool res=false; std::string volume=getAttributeAsString("volume",res); std::vector<double> vvv=getAttributeAsVector("R_Phi_Z",res); - - double radius,phi,zpos; - - radius=vvv[0]; - phi=vvv[1]; - zpos=vvv[2]; - - CLHEP::Hep3Vector cvec; - CLHEP::HepRotation crot; + double radius=vvv[0]; + double phi=vvv[1]; + double zpos=vvv[2]; + GeoTrf::Transform3D crot = GeoTrf::Transform3D::Identity(); vvv=getAttributeAsVector("rot",res); if (res) { - crot=CLHEP::HepRotation(); - crot.rotateX(vvv[0]*GeoModelKernelUnits::degree); - crot.rotateY(vvv[1]*GeoModelKernelUnits::degree); - crot.rotateZ(vvv[2]*GeoModelKernelUnits::degree); + crot = crot*GeoTrf::RotateZ3D(vvv[2]*GeoModelKernelUnits::degree)*GeoTrf::RotateY3D(vvv[1]*GeoModelKernelUnits::degree)*GeoTrf::RotateX3D(vvv[0]*GeoModelKernelUnits::degree); } - crot.rotateZ(phi*GeoModelKernelUnits::degree); - double x=radius*cos(phi*GeoModelKernelUnits::degree); - double y=radius*sin(phi*GeoModelKernelUnits::degree); - cvec=CLHEP::Hep3Vector(x,y,zpos); + crot = GeoTrf::RotateZ3D(phi*GeoModelKernelUnits::degree)*crot; + double x=radius*std::cos(phi*GeoModelKernelUnits::degree); + double y=radius*std::sin(phi*GeoModelKernelUnits::degree); + GeoTrf::Vector3D cvec=GeoTrf::Vector3D(x,y,zpos); - p=new AGDDPositioner(volume,crot,cvec); + p=new AGDDPositioner(volume,Amg::EigenTransformToCLHEP(GeoTrf::Translation3D(cvec)*crot)); } diff --git a/DetectorDescription/AGDD/AGDDHandlers/src/posXYZHandler.cxx b/DetectorDescription/AGDD/AGDDHandlers/src/posXYZHandler.cxx index 86be3de8a991b329d9f15cbc10d24ccd9135b964..58c2172ddea2beede3211dc9635037bf8d306078 100644 --- a/DetectorDescription/AGDD/AGDDHandlers/src/posXYZHandler.cxx +++ b/DetectorDescription/AGDD/AGDDHandlers/src/posXYZHandler.cxx @@ -45,6 +45,6 @@ void posXYZHandler::ElementHandle() if (rotRet) std::cout<<" rot= ("<<rot[0]<<";"<<rot[1]<<";"<<rot[2]<<")"; std::cout<<std::endl; } - AGDDPositioner *p=new AGDDPositioner(volume,crot,cvec); + AGDDPositioner *p=new AGDDPositioner(volume,HepGeom::Transform3D(crot,cvec)); globals::currentPositioner=p; } diff --git a/DetectorDescription/AGDD/AGDDKernel/AGDDKernel/AGDDDetectorPositioner.h b/DetectorDescription/AGDD/AGDDKernel/AGDDKernel/AGDDDetectorPositioner.h index 0090c8203ca31730834e0e678abdeb4c53873752..f5b5739717ddbd9db40a13e25e65e671881a2b03 100644 --- a/DetectorDescription/AGDD/AGDDKernel/AGDDKernel/AGDDDetectorPositioner.h +++ b/DetectorDescription/AGDD/AGDDKernel/AGDDKernel/AGDDDetectorPositioner.h @@ -42,7 +42,6 @@ struct DetectorPositionParameters { class AGDDDetectorPositioner:public AGDDPositioner { public: AGDDDetectorPositioner(std::string n,HepGeom::Transform3D t); - AGDDDetectorPositioner(std::string n,CLHEP::HepRotation r,CLHEP::Hep3Vector v); Identifiers ID; diff --git a/DetectorDescription/AGDD/AGDDKernel/AGDDKernel/AGDDPositioner.h b/DetectorDescription/AGDD/AGDDKernel/AGDDKernel/AGDDPositioner.h index 7368160af8fbb4f10e3d07935c69629c22c5d1d5..ed08246b9395bfeeb5d4f6ae3a96482fae6eedb4 100644 --- a/DetectorDescription/AGDD/AGDDKernel/AGDDKernel/AGDDPositioner.h +++ b/DetectorDescription/AGDD/AGDDKernel/AGDDKernel/AGDDPositioner.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 AGDDPositioner_H @@ -8,6 +8,8 @@ #include "CLHEP/Geometry/Transform3D.h" #include "CLHEP/Vector/ThreeVector.h" #include "CLHEP/Vector/Rotation.h" +#include "GeoModelKernel/GeoDefinitions.h" + #include <string> class AGDDVolume; @@ -15,7 +17,6 @@ class AGDDVolume; class AGDDPositioner { public: AGDDPositioner(std::string n,HepGeom::Transform3D t); - AGDDPositioner(std::string n,CLHEP::HepRotation r,CLHEP::Hep3Vector v); virtual ~AGDDPositioner() {;} std::string Volume(); AGDDVolume *GetVolume(); diff --git a/DetectorDescription/AGDD/AGDDKernel/src/AGDDDetectorPositioner.cxx b/DetectorDescription/AGDD/AGDDKernel/src/AGDDDetectorPositioner.cxx index 4b81f3da7b416a3da78a1fb7129f0df3dcec298e..f929ef033b6d954d966eb20771aecdf8c17e6e78 100644 --- a/DetectorDescription/AGDD/AGDDKernel/src/AGDDDetectorPositioner.cxx +++ b/DetectorDescription/AGDD/AGDDKernel/src/AGDDDetectorPositioner.cxx @@ -13,8 +13,4 @@ AGDDDetectorPositioner::AGDDDetectorPositioner(std::string n,HepGeom::Transform3D t):AGDDPositioner(n,t),theDetector(0),theVolume(0) { -} -AGDDDetectorPositioner::AGDDDetectorPositioner(std::string n,CLHEP::HepRotation r,CLHEP::Hep3Vector v):AGDDPositioner(n,r,v),theDetector(0),theVolume(0) -{ -} - +} \ No newline at end of file diff --git a/DetectorDescription/AGDD/AGDDKernel/src/AGDDPositioner.cxx b/DetectorDescription/AGDD/AGDDKernel/src/AGDDPositioner.cxx index b83d221e253bb576aca9438afd48d26c20ec7786..6257e84ec34abf49981466dcf803bd71832e8843 100644 --- a/DetectorDescription/AGDD/AGDDKernel/src/AGDDPositioner.cxx +++ b/DetectorDescription/AGDD/AGDDKernel/src/AGDDPositioner.cxx @@ -16,12 +16,6 @@ AGDDPositioner::AGDDPositioner(std::string n,HepGeom::Transform3D t):m_isSensiti AGDDPositionerStore::GetPositionerStore()->RegisterPositioner(this); m_theVolume=AGDDVolumeStore::GetVolumeStore()->GetVolume(Volume()); } -AGDDPositioner::AGDDPositioner(std::string n,CLHEP::HepRotation r,CLHEP::Hep3Vector v):m_isSensitiveDetector(false),m_volume(n) -{ - AGDDPositionerStore::GetPositionerStore()->RegisterPositioner(this); - m_transform=HepGeom::Transform3D(r,v); - m_theVolume=AGDDVolumeStore::GetVolumeStore()->GetVolume(Volume()); -} std::string AGDDPositioner::Volume() { return m_volume; diff --git a/DetectorDescription/GeoModel/GeoAdaptors/CMakeLists.txt b/DetectorDescription/GeoModel/GeoAdaptors/CMakeLists.txt index b225db4116b1a1a7187c0a0f996abe92be18bf40..546f29964e10227d7bb2dee56284946e56607701 100644 --- a/DetectorDescription/GeoModel/GeoAdaptors/CMakeLists.txt +++ b/DetectorDescription/GeoModel/GeoAdaptors/CMakeLists.txt @@ -1,30 +1,8 @@ -################################################################################ -# Package: GeoAdaptors -################################################################################ +# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration # Declare the package name: atlas_subdir( GeoAdaptors ) -# Declare the package's dependencies: -atlas_depends_on_subdirs( PUBLIC - Calorimeter/CaloDetDescr - Calorimeter/CaloIdentifier - Calorimeter/CaloSimEvent - Control/StoreGate - DetectorDescription/Identifier - DetectorDescription/GeoPrimitives - InnerDetector/InDetDetDescr/InDetIdentifier - InnerDetector/InDetDetDescr/InDetReadoutGeometry - InnerDetector/InDetDetDescr/PixelReadoutGeometry - InnerDetector/InDetDetDescr/SCT_ReadoutGeometry - InnerDetector/InDetDetDescr/TRT_ReadoutGeometry - InnerDetector/InDetSimEvent - LArCalorimeter/LArSimEvent - MuonSpectrometer/MuonDetDescr/MuonReadoutGeometry - MuonSpectrometer/MuonIdHelpers - MuonSpectrometer/MuonReconstruction/MuonRecEvent/MuonPrepRawData - MuonSpectrometer/MuonSimEvent ) - # External dependencies: find_package( CLHEP ) @@ -34,5 +12,4 @@ atlas_add_library( GeoAdaptors PUBLIC_HEADERS GeoAdaptors INCLUDE_DIRS ${CLHEP_INCLUDE_DIRS} DEFINITIONS ${CLHEP_DEFINITIONS} - LINK_LIBRARIES ${CLHEP_LIBRARIES} CaloIdentifier CaloSimEvent Identifier InDetIdentifier InDetReadoutGeometry PixelReadoutGeometry SCT_ReadoutGeometry TRT_ReadoutGeometry InDetSimEvent LArSimEvent MuonReadoutGeometry MuonPrepRawData MuonSimEvent CaloDetDescrLib StoreGateLib SGtests MuonIdHelpersLib ) - + LINK_LIBRARIES ${CLHEP_LIBRARIES} CaloIdentifier CaloSimEvent GeoPrimitives Identifier InDetIdentifier InDetReadoutGeometry PixelReadoutGeometry SCT_ReadoutGeometry TRT_ReadoutGeometry InDetSimEvent LArSimEvent MuonReadoutGeometry MuonPrepRawData MuonSimEvent CaloDetDescrLib StoreGateLib MuonIdHelpersLib ) diff --git a/DetectorDescription/GeoModel/GeoModelStandalone/GeoExporter/CMakeLists.txt b/DetectorDescription/GeoModel/GeoModelStandalone/GeoExporter/CMakeLists.txt index f877b8407d79d0cc2bed3198e6b88885c5f64fb6..b8aadde4e722590e1995d2f5dd48bf43d04890af 100644 --- a/DetectorDescription/GeoModel/GeoModelStandalone/GeoExporter/CMakeLists.txt +++ b/DetectorDescription/GeoModel/GeoModelStandalone/GeoExporter/CMakeLists.txt @@ -1,47 +1,20 @@ -################################################################################ -# Package: GeoExporter -################################################################################ +# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration # Declare the package name: atlas_subdir( GeoExporter ) -# Declare the package's dependencies: -atlas_depends_on_subdirs( PUBLIC - Control/AthenaBaseComps - GaudiKernel - PRIVATE - Event/EventInfo - Tools/PathResolver - DetectorDescription/GeoModel/GeoModelStandalone/GeoExporter - DetectorDescription/GeoModel/GeoModelKernel - DetectorDescription/GeoModel/GeoModelUtilities - graphics/VP1/VP1Utils - ) - #DetectorDescription/GeoModel/GeoModelStandalone/GeoWrite - #DetectorDescription/GeoModel/GeoModelStandalone/GeoModelDBManager - # External dependencies: find_package( Qt5 COMPONENTS Sql Gui PrintSupport ) -find_package( Eigen ) # is it really needed here? -FIND_PACKAGE( Boost ) # is it really needed here? -find_package( CLHEP ) -#find_package( GeoModelCore REQUIRED ) +find_package( Boost ) find_package( GeoModelIO REQUIRED ) -#message( "GEOMODELIO_LIBRARIES: ${GEOMODELIO_LIBRARIES}") # Component(s) in the package: atlas_add_library( GeoExporter src/*.cxx GeoExporter/*.h PUBLIC_HEADERS GeoExporter - INCLUDE_DIRS ${EIGEN_INCLUDE_DIRS} ${Boost_INCLUDE_DIRS} - ${CLHEP_INCLUDE_DIRS} - LINK_LIBRARIES Qt5::Sql - ${GEOMODELIO_LIBRARIES} - GeoModelUtilities - VP1Utils - ${CLHEP_LIBRARIES} - ${EIGEN_LIBRARIES} + INCLUDE_DIRS ${Boost_INCLUDE_DIRS} + LINK_LIBRARIES Qt5::Sql ${GEOMODELIO_LIBRARIES} GeoModelUtilities VP1Base VP1Utils ) #NEW SYNTAX TO BE USED SOON: GeoModelIO::GeoModelDBManager GeoModelIO::GeoModelWrite diff --git a/DetectorDescription/GeoModel/GeoModelUtilities/CMakeLists.txt b/DetectorDescription/GeoModel/GeoModelUtilities/CMakeLists.txt index 53d5172ffbaaf85eb8a04f4e18700cd696564880..2ed421cc58b17b85a6a2a74b62eb3928c77eab2c 100644 --- a/DetectorDescription/GeoModel/GeoModelUtilities/CMakeLists.txt +++ b/DetectorDescription/GeoModel/GeoModelUtilities/CMakeLists.txt @@ -1,6 +1,4 @@ -################################################################################ -# Package: GeoModelUtilities -################################################################################ +# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration # Declare the package name: atlas_subdir( GeoModelUtilities ) @@ -15,8 +13,7 @@ atlas_add_library( GeoModelUtilities src/*.cxx PUBLIC_HEADERS GeoModelUtilities INCLUDE_DIRS ${EIGEN_INCLUDE_DIRS} ${GEOMODELCORE_INCLUDE_DIRS} - LINK_LIBRARIES ${EIGEN_LIBRARIES} ${GEOMODELCORE_LIBRARIES} AthenaBaseComps SGTools GeoModelInterfaces - PRIVATE_LINK_LIBRARIES GaudiKernel ) + LINK_LIBRARIES ${EIGEN_LIBRARIES} ${GEOMODELCORE_LIBRARIES} AthenaBaseComps AthenaKernel GaudiKernel GeoModelInterfaces RDBAccessSvcLib ) atlas_add_test( GeoGetIds_test SOURCES test/GeoGetIds_test.cxx @@ -28,12 +25,8 @@ atlas_add_test( GeoVisitVolumes_test endif() if(BUILDVP1LIGHT) -# Declare the package's dependencies: -#atlas_depends_on_subdirs( PUBLIC -# DetectorDescription/GeoModel/GeoModelKernel ) # External dependencies: -find_package( CLHEP ) find_package( GeoModelCore ) find_package( Eigen ) @@ -53,7 +46,7 @@ atlas_add_library( GeoModelUtilities ${SOURCES} PUBLIC_HEADERS GeoModelUtilities INCLUDE_DIRS ${EIGEN_INCLUDE_DIRS} ${GEOMODELCORE_INCLUDE_DIRS} - LINK_LIBRARIES ${CLHEP_LIBRARIES} ${EIGEN_LIBRARIES} ${GEOMODELCORE_LIBRARIES} ) + LINK_LIBRARIES ${EIGEN_LIBRARIES} ${GEOMODELCORE_LIBRARIES} ) endif() # Code in this file makes heavy use of eigen and runs orders of magnitude diff --git a/DetectorDescription/GeoModelXml/CMakeLists.txt b/DetectorDescription/GeoModelXml/CMakeLists.txt index 0bc2cd00b7295feb31b9995930b861349bd10f60..cab5c4759ac92a7166e8855142950bcf8f941308 100644 --- a/DetectorDescription/GeoModelXml/CMakeLists.txt +++ b/DetectorDescription/GeoModelXml/CMakeLists.txt @@ -1,18 +1,8 @@ -################################################################################ -# Package: GeoModelXml -################################################################################ +# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration # Declare the package name: atlas_subdir( GeoModelXml ) -# Declare the package's dependencies: -atlas_depends_on_subdirs( PUBLIC - AtlasPolicy - PRIVATE - DetectorDescription/GeoModelInterfaces - Control/StoreGate - GaudiKernel ) - # External dependencies: find_package( XercesC ) find_package( Eigen ) @@ -25,7 +15,7 @@ atlas_add_library( GeoModelXml src/*.cxx PUBLIC_HEADERS GeoModelXml INCLUDE_DIRS ${XERCESC_INCLUDE_DIRS} ${EIGEN_INCLUDE_DIRS} ${ZLIB_INCLUDE_DIRS} ${GEOMODELCORE_INCLUDE_DIRS} ${GEOMODELTOOLS_INCLUDE_DIRS} - LINK_LIBRARIES ${XERCESC_LIBRARIES} ${EIGEN_LIBRARIES} ${ZLIB_LIBRARIES} ${GEOMODELCORE_LIBRARIES} ${GEOMODELTOOLS_LIBRARIES} StoreGateLib - PRIVATE_LINK_LIBRARIES GaudiKernel ) + LINK_LIBRARIES ${XERCESC_LIBRARIES} ${ZLIB_LIBRARIES} ${GEOMODELCORE_LIBRARIES} ${GEOMODELTOOLS_LIBRARIES} + PRIVATE_LINK_LIBRARIES ${EIGEN_LIBRARIES} GaudiKernel GeoModelInterfaces StoreGateLib ) atlas_install_runtime( data/*.dtd ) diff --git a/DetectorDescription/GeoPrimitives/CMakeLists.txt b/DetectorDescription/GeoPrimitives/CMakeLists.txt index b9f1342212eb372089df274be478c69c5cd13fbe..847b560b380a63c2c64bfb21eb3080944e74eb13 100644 --- a/DetectorDescription/GeoPrimitives/CMakeLists.txt +++ b/DetectorDescription/GeoPrimitives/CMakeLists.txt @@ -1,17 +1,10 @@ +# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration + # $Id: CMakeLists.txt 744450 2016-05-03 12:38:18Z krasznaa $ -################################################################################ -# Package: GeoPrimitives -################################################################################ # Declare the package name: atlas_subdir( GeoPrimitives ) -# Declare the package's dependencies: -atlas_depends_on_subdirs( - PUBLIC - Control/CxxUtils - Event/EventPrimitives ) - # External dependencies: find_package( CLHEP QUIET ) find_package( Eigen ) diff --git a/DetectorDescription/GeometryDBSvc/CMakeLists.txt b/DetectorDescription/GeometryDBSvc/CMakeLists.txt index 03aed93c583120a5c4de5f36c501f50103f59f75..61dcc2d2a1b01c9a50f2f1793fb638dda806d4b4 100644 --- a/DetectorDescription/GeometryDBSvc/CMakeLists.txt +++ b/DetectorDescription/GeometryDBSvc/CMakeLists.txt @@ -1,30 +1,15 @@ -################################################################################ -# Package: GeometryDBSvc -################################################################################ +# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration # Declare the package name: atlas_subdir( GeometryDBSvc ) -# Declare the package's dependencies: -atlas_depends_on_subdirs( PUBLIC - Database/RDBAccessSvc - GaudiKernel - PRIVATE - Control/AthenaBaseComps ) - -# External dependencies: -find_package( Boost COMPONENTS filesystem thread system ) -find_package( CORAL COMPONENTS CoralBase CoralKernel RelationalAccess ) - +# Component(s) in the package: atlas_add_library( GeometryDBSvcLib INTERFACE PUBLIC_HEADERS GeometryDBSvc LINK_LIBRARIES RDBAccessSvcLib GaudiKernel ) -# Component(s) in the package: atlas_add_component( GeometryDBSvc src/*.cxx src/components/*.cxx - INCLUDE_DIRS ${Boost_INCLUDE_DIRS} ${CORAL_INCLUDE_DIRS} - LINK_LIBRARIES ${Boost_LIBRARIES} ${CORAL_LIBRARIES} GaudiKernel AthenaBaseComps GeometryDBSvcLib ) - + LINK_LIBRARIES AthenaBaseComps CxxUtils GeometryDBSvcLib ) diff --git a/Event/ByteStreamCnvSvc/src/EventSelectorByteStream.cxx b/Event/ByteStreamCnvSvc/src/EventSelectorByteStream.cxx index 4c944dc7eaa0038287b99d831b41127542092520..0d7be0857d5f8c333c8c4ccc96ce18f8a9cff89e 100644 --- a/Event/ByteStreamCnvSvc/src/EventSelectorByteStream.cxx +++ b/Event/ByteStreamCnvSvc/src/EventSelectorByteStream.cxx @@ -1014,7 +1014,7 @@ void EventSelectorByteStream::syncEventCount(int count) const } //__________________________________________________________________________ -bool EventSelectorByteStream::disconnectIfFinished(SG::SourceID /* fid */) const +bool EventSelectorByteStream::disconnectIfFinished(const SG::SourceID &/* fid */) const { return true; } diff --git a/Event/ByteStreamCnvSvc/src/EventSelectorByteStream.h b/Event/ByteStreamCnvSvc/src/EventSelectorByteStream.h index 412414862e192bd2f91a7fc0778e3ba6b0ade890..53c8158a59646c7579f85847dfa2a9af33785a2c 100644 --- a/Event/ByteStreamCnvSvc/src/EventSelectorByteStream.h +++ b/Event/ByteStreamCnvSvc/src/EventSelectorByteStream.h @@ -135,7 +135,7 @@ protected: /// Fill AttributeList with specific items from the selector and a suffix virtual StatusCode fillAttributeList(coral::AttributeList *attrList, const std::string &suffix, bool copySource) const override; // Disconnect DB if all events from the source FID were processed and the Selector moved to another file - virtual bool disconnectIfFinished(SG::SourceID fid) const override; + virtual bool disconnectIfFinished(const SG::SourceID &fid) const override; private: // internal member functions /// Reinitialize the service when a @c fork() occured/was-issued diff --git a/Event/EventOverlay/EventOverlayJobTransforms/share/skeleton.BSOverlayFilter_tf.py b/Event/EventOverlay/EventOverlayJobTransforms/share/skeleton.BSOverlayFilter_tf.py index d3bca8642c640e081dd0c7f69077767de98c9a4b..a62ab37b0621cdc53398decb89cc253af89155a2 100644 --- a/Event/EventOverlay/EventOverlayJobTransforms/share/skeleton.BSOverlayFilter_tf.py +++ b/Event/EventOverlay/EventOverlayJobTransforms/share/skeleton.BSOverlayFilter_tf.py @@ -74,7 +74,7 @@ svcMgr.ByteStreamAddressProviderSvc.TypeNames += ["HLT::HLTResult/HLTResult_EF", "CTP_RDO/CTP_RDO", "CTP_RIO/CTP_RIO"] # main alg -from OverlayByteStreamAlgs.OverlayByteStreamAlgsConf import BSFilter +from OverlayByteStreamUtils.OverlayByteStreamUtilsConf import BSFilter filAlg = BSFilter("BSFilter") topSequence += filAlg if hasattr( runArgs, "triggerBit"): @@ -101,7 +101,7 @@ else: BSFilterLog.info( '**** ByteStreamCopyTool configuration' ) if hasattr( runArgs, 'InputLbnMapFile'): - from OverlayByteStreamAlgs.OverlayByteStreamAlgsConf import ByteStreamMultipleOutputStreamCopyTool + from OverlayByteStreamUtils.OverlayByteStreamUtilsConf import ByteStreamMultipleOutputStreamCopyTool bsCopyTool = ByteStreamMultipleOutputStreamCopyTool("MultipleOutputStreamBSCopyTool") bsCopyTool.lbn_map_file = runArgs.InputLbnMapFile if hasattr( runArgs, "inputFilterFile"): bsCopyTool.trigfile = runArgs.inputFilterFile diff --git a/Event/xAOD/xAODCore/CMakeLists.txt b/Event/xAOD/xAODCore/CMakeLists.txt index dc2c153a0e782a64adde2f8b950e5ce7be88fbec..72e0b5084ecf07ad325dd40bb320180570ed398d 100644 --- a/Event/xAOD/xAODCore/CMakeLists.txt +++ b/Event/xAOD/xAODCore/CMakeLists.txt @@ -55,10 +55,6 @@ atlas_add_test( ut_xaodcore_clearDecorations_test SOURCES test/ut_xaodcore_clearDecorations_test.cxx LINK_LIBRARIES AthContainers xAODCore ) -atlas_add_test( ut_xaodcore_floatcompression_test - SOURCES test/ut_xaodcore_floatcompression_test.cxx - LINK_LIBRARIES xAODCore ) - atlas_add_test( ut_xaodcore_printhelpers_test SOURCES test/ut_xaodcore_printhelpers_test.cxx LINK_LIBRARIES AthContainers xAODCore ) diff --git a/Event/xAOD/xAODCore/Root/AuxContainerBase.cxx b/Event/xAOD/xAODCore/Root/AuxContainerBase.cxx index a99cbed3f892dcabd8273219a5e27495017d4d2c..40cd0a7a4e5125ecd2779ca7a1b1fb411dabc36a 100644 --- a/Event/xAOD/xAODCore/Root/AuxContainerBase.cxx +++ b/Event/xAOD/xAODCore/Root/AuxContainerBase.cxx @@ -16,9 +16,9 @@ #include "xAODCore/AuxContainerBase.h" #include "xAODCore/tools/IOStats.h" #include "xAODCore/tools/ReadStats.h" -#include "xAODCore/tools/FloatCompressor.h" #include "CxxUtils/checker_macros.h" +#include "CxxUtils/FloatCompressor.h" using namespace std; @@ -682,13 +682,13 @@ namespace xAOD { // Two main modes are supported: High and Low Compression const unsigned int idx = highComp ? AuxCompression::High : AuxCompression::Low; - // This part could be nicer if we were to rewrite xAOD::FloatCompressor + // This part could be nicer if we were to rewrite CxxUtils::FloatCompressor // to accept the number of bits in the call to reduceFloatPrecision instead // of the constructor static const unsigned int high_bits = m_compression.getCompressionBits(true); static const unsigned int low_bits = m_compression.getCompressionBits(false); - static const std::vector< xAOD::FloatCompressor > - myFloatCompressors { xAOD::FloatCompressor(high_bits), xAOD::FloatCompressor(low_bits) }; + static const std::vector< CxxUtils::FloatCompressor > + myFloatCompressors { CxxUtils::FloatCompressor(high_bits), CxxUtils::FloatCompressor(low_bits) }; return myFloatCompressors[ idx ].reduceFloatPrecision( value ); } diff --git a/Event/xAOD/xAODTrackingCnv/CMakeLists.txt b/Event/xAOD/xAODTrackingCnv/CMakeLists.txt index 2515ff711506926404be8e836f3aa7adc7472d6a..df9daef57bca7a4d9fc79189be3360217dcffd59 100644 --- a/Event/xAOD/xAODTrackingCnv/CMakeLists.txt +++ b/Event/xAOD/xAODTrackingCnv/CMakeLists.txt @@ -40,4 +40,5 @@ atlas_add_component( xAODTrackingCnv LINK_LIBRARIES xAODTracking TrkTrack AthenaBaseComps AthenaKernel EventPrimitives GaudiKernel GeneratorObjects MCTruthClassifierLib Particle ParticleTruth TrkLinks TrkParticleBase TrkTruthData VxVertex - TrkToolInterfaces xAODCore xAODTrackingCnvLib ) + TrkToolInterfaces xAODCore xAODTrackingCnvLib + PRIVATE_LINK_LIBRARIES CxxUtils ) diff --git a/Event/xAOD/xAODTrackingCnv/src/TrackParticleCompressorTool.cxx b/Event/xAOD/xAODTrackingCnv/src/TrackParticleCompressorTool.cxx index 0831e6655ce4100547f8a2676ea57331e9e34900..88c40aabd0e396265e4f8ff532388851631c082a 100644 --- a/Event/xAOD/xAODTrackingCnv/src/TrackParticleCompressorTool.cxx +++ b/Event/xAOD/xAODTrackingCnv/src/TrackParticleCompressorTool.cxx @@ -41,7 +41,7 @@ namespace xAODMaker { // Create the helper objects: m_diagCovMatrixCompressor.reset( - new xAOD::FloatCompressor( m_diagCovMatrixBits ) ); + new CxxUtils::FloatCompressor( m_diagCovMatrixBits ) ); // Return gracefully: return StatusCode::SUCCESS; @@ -69,7 +69,7 @@ namespace xAODMaker { tp.setDefiningParametersCovMatrixDiagVec( diagVecCompr ); auto compressOffDiag = []( const std::vector< float >& offDiagVec, int bits ) -> std::vector< float > { - xAOD::FloatCompressor fc( bits ); + CxxUtils::FloatCompressor fc( bits ); std::vector< float > offDiagVecCompr; offDiagVecCompr.reserve( offDiagVec.size() ); for( float element : offDiagVec ) { diff --git a/Event/xAOD/xAODTrackingCnv/src/TrackParticleCompressorTool.h b/Event/xAOD/xAODTrackingCnv/src/TrackParticleCompressorTool.h index 7a03ef9b7f6b3f9c01b4e88d35cc723fdc6d8463..7bf758733e8499ea139c2cfec7e4da43d41160de 100644 --- a/Event/xAOD/xAODTrackingCnv/src/TrackParticleCompressorTool.h +++ b/Event/xAOD/xAODTrackingCnv/src/TrackParticleCompressorTool.h @@ -14,8 +14,8 @@ // Gaudi/Athena include(s): #include "AthenaBaseComps/AthAlgTool.h" -// xAOD include(s): -#include "xAODCore/tools/FloatCompressor.h" +// CxxUtils include(s): +#include "CxxUtils/FloatCompressor.h" // Local include(s): #include "xAODTrackingCnv/ITrackParticleCompressorTool.h" @@ -60,7 +60,7 @@ namespace xAODMaker { /// Helper object for compressing the on-diagonal covariance matrix /// elements - std::unique_ptr< xAOD::FloatCompressor > m_diagCovMatrixCompressor; + std::unique_ptr< CxxUtils::FloatCompressor > m_diagCovMatrixCompressor; }; // class TrackParticleCompressorTool diff --git a/Event/xAOD/xAODTrigRingerCnv/CMakeLists.txt b/Event/xAOD/xAODTrigRingerCnv/CMakeLists.txt deleted file mode 100644 index a07b99790358ebe58e74603f366206176e317896..0000000000000000000000000000000000000000 --- a/Event/xAOD/xAODTrigRingerCnv/CMakeLists.txt +++ /dev/null @@ -1,25 +0,0 @@ -################################################################################ -# Package: xAODTrigRingerCnv -################################################################################ - -# Declare the package name: -atlas_subdir( xAODTrigRingerCnv ) - -# Declare the package's dependencies: -atlas_depends_on_subdirs( PUBLIC - Event/xAOD/xAODTrigRinger - GaudiKernel - PRIVATE - Control/AthenaBaseComps - Control/AthenaKernel - Trigger/TrigEvent/TrigCaloEvent ) - -# Component(s) in the package: -atlas_add_component( xAODTrigRingerCnv - src/*.cxx - LINK_LIBRARIES xAODTrigRinger GaudiKernel AthenaBaseComps AthenaKernel TrigCaloEvent ) - -# Install files from the package: -atlas_install_headers( xAODTrigRingerCnv ) -atlas_install_joboptions( share/*.py ) - diff --git a/Event/xAOD/xAODTrigRingerCnv/share/xAODTrigRingerCnv_jobOptions.py b/Event/xAOD/xAODTrigRingerCnv/share/xAODTrigRingerCnv_jobOptions.py deleted file mode 100644 index 1c0af12c070ca4078f975849b5770e4a03f73dce..0000000000000000000000000000000000000000 --- a/Event/xAOD/xAODTrigRingerCnv/share/xAODTrigRingerCnv_jobOptions.py +++ /dev/null @@ -1,58 +0,0 @@ - -# Enable xAOD making: -from RecExConfig.RecFlags import rec -rec.doWritexAOD = True - -# Set up the reading of a file: -FNAME = "AOD.pool.root" -include( "AthenaPython/iread_file.py" ) - -# Access the algorithm sequence: -from AthenaCommon.AlgSequence import AlgSequence -theJob = AlgSequence() - -# Create a logger object: -from AthenaCommon.Logging import logging -logger = logging.getLogger( "xAODTrigCaloCnv_jobOptions" ) - -# Create a POOL output file with the StoreGate contents: -from OutputStreamAthenaPool.MultipleStreamManager import MSMgr -xaodStream = MSMgr.NewPoolStream( "StreamAOD", "xAOD.pool.root" ) - -# Create the xAOD trigger calorimeter cluster: -from xAODTrigRingerCnv.xAODTrigRingerCreator import xAODTrigRingerCreator -xAODTrigRingerCreator() -alg = getattr( theJob, "xAODMaker::TrigRingerCnvAlg" ) -alg.OutputLevel = DEBUG - -# Create the xAOD trigger EM cluster: -from xAODTrigCaloCnv.xAODTrigRNNOutputCreator import xAODTrigRNNOutputCreator -xAODTrigRNNOutputCreator() -alg = getattr( theJob, "xAODMaker::TrigRNNOutputCnvAlg" ) -alg.OutputLevel = DEBUG - -# Additional type(s) created automatically by RecExCommon: -xaodStream.AddItem( "xAOD::TrigRingerContainer_v1#*" ) -xaodStream.AddItem( "xAOD::TrigRingerAuxContainer_v1#*" ) -xaodStream.AddItem( "xAOD::TrigRNNOutputContainer_v1#*" ) -xaodStream.AddItem( "xAOD::TrigRNNOutputAuxContainer_v1#*" ) - -# Make sure that the event format object is added to the output: -theApp.CreateSvc += [ "xAODMaker::EventFormatSvc" ] -xaodStream.AddMetaDataItem( "xAOD::EventFormat_v1#EventFormat" ) - -# Check what happened to the stream: -xaodStream.Print() - -# Split all branches: -ServiceMgr.AthenaPoolCnvSvc.PoolAttributes += [ - "DEFAULT_SPLITLEVEL='1'" ] - -# Force POOL to just simply use the StoreGate keys as branch names: -ServiceMgr.AthenaPoolCnvSvc.SubLevelBranchName = "<key>" - -# Do some additional tweaking: -from AthenaCommon.AppMgr import theApp -theApp.EvtMax = 100 -ServiceMgr.MessageSvc.OutputLevel = INFO -ServiceMgr.MessageSvc.defaultLimit = 1000 diff --git a/Event/xAOD/xAODTrigRingerCnv/src/TrigRNNOutputCnvAlg.cxx b/Event/xAOD/xAODTrigRingerCnv/src/TrigRNNOutputCnvAlg.cxx deleted file mode 100644 index a148d330aca827818c33b1326a70bda949fc20d9..0000000000000000000000000000000000000000 --- a/Event/xAOD/xAODTrigRingerCnv/src/TrigRNNOutputCnvAlg.cxx +++ /dev/null @@ -1,66 +0,0 @@ -/* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration -*/ - -// $Id: RingerRNNOutputCnvAlg.cxx $ - -// Gaudi/Athena include(s): -#include "AthenaKernel/errorcheck.h" - -// EDM include(s): -#include "TrigCaloEvent/TrigRNNOutputContainer.h" -#include "xAODTrigRinger/TrigRNNOutputContainer.h" -#include "xAODTrigRinger/TrigRNNOutputAuxContainer.h" - -// Local include(s): -#include "TrigRNNOutputCnvAlg.h" - -namespace xAODMaker { - - TrigRNNOutputCnvAlg::TrigRNNOutputCnvAlg( const std::string& name, - ISvcLocator* svcLoc ) - : AthAlgorithm( name, svcLoc ), - m_cnvTool( "xAODMaker::TrigRNNOutputCnvTool/TrigRNNOutputCnvTool", this ) { - - declareProperty( "AODKey", m_aodKey = "TrigRingerNeuralFex" ); - declareProperty( "xAODKey", m_xaodKey = "TrigRingerNeuralFex" ); - declareProperty( "CnvTool", m_cnvTool ); - } - - StatusCode TrigRNNOutputCnvAlg::initialize() { - - // Greet the user: - ATH_MSG_INFO( "Initializing - Package version: " << PACKAGE_VERSION ); - ATH_MSG_DEBUG( " AOD Key: " << m_aodKey ); - ATH_MSG_DEBUG( "xAOD Key: " << m_xaodKey ); - - // Retrieve the converter tool: - CHECK( m_cnvTool.retrieve() ); - - // Return gracefully: - return StatusCode::SUCCESS; - } - - StatusCode TrigRNNOutputCnvAlg::execute() { - - // Retrieve the AOD container: - const TrigRNNOutputContainer* aod = 0; - CHECK( evtStore()->retrieve( aod, m_aodKey ) ); - - // Create the xAOD container and its auxiliary store: - xAOD::TrigRNNOutputAuxContainer* aux = new xAOD::TrigRNNOutputAuxContainer(); - xAOD::TrigRNNOutputContainer* xaod = new xAOD::TrigRNNOutputContainer(); - xaod->setStore( aux ); - - // Fill the xAOD container: - CHECK( m_cnvTool->convert( aod, xaod ) ); - - // Record the xAOD containers: - CHECK( evtStore()->record( aux, m_xaodKey + "Aux." ) ); - CHECK( evtStore()->record( xaod, m_xaodKey ) ); - - // Return gracefully: - return StatusCode::SUCCESS; - } - -} // namespace xAODMaker diff --git a/Event/xAOD/xAODTrigRingerCnv/src/TrigRNNOutputCnvAlg.h b/Event/xAOD/xAODTrigRingerCnv/src/TrigRNNOutputCnvAlg.h deleted file mode 100644 index 449c43572eeeecb9c7ab031e15b939fb429ddf79..0000000000000000000000000000000000000000 --- a/Event/xAOD/xAODTrigRingerCnv/src/TrigRNNOutputCnvAlg.h +++ /dev/null @@ -1,58 +0,0 @@ -// Dear emacs, this is -*- c++ -*- - -/* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration -*/ - -// $Id: RingerRNNOutputCnvAlg.h $ -#ifndef XAODTRIGRINGERCNV_TRIGRNNOUTPUTCNVALG_H -#define XAODTRIGRINGERCNV_TRIGRNNOUTPUTCNVALG_H - -// System include(s): -#include <string> - -// Gaudi/Athena include(s): -#include "AthenaBaseComps/AthAlgorithm.h" -#include "GaudiKernel/ToolHandle.h" - -// Local include(s): -#include "xAODTrigRingerCnv/ITrigRNNOutputCnvTool.h" - -namespace xAODMaker { - - /** - * @short Algorithm for creating xAOD::RingerRNNOutput from an AOD - * - * This algorithm can be used to create an xAOD RingerRNNOutput - * out of the object found in an AOD file. - * - * @author joao victor da fonseca pinto <joao.victor.da.fonseca.pinto@cern.ch> - * - * $Revision: $ - * $Date: $ - */ - class TrigRNNOutputCnvAlg : public AthAlgorithm { - - public: - /// Regular Algorithm constructor - TrigRNNOutputCnvAlg( const std::string& name, ISvcLocator* svcLoc ); - - /// Function initialising the algorithm - virtual StatusCode initialize(); - /// Function executing the algorithm - virtual StatusCode execute(); - - private: - /// StoreGate key of the input container - std::string m_aodKey; - /// StoreGate key for the output container - std::string m_xaodKey; - - /// Handle to the converter tool - ToolHandle< ITrigRNNOutputCnvTool > m_cnvTool; - - }; // class RingerRNNOutputCnvAlg - -} // namespace xAODMaker - -#endif // XAOD diff --git a/Event/xAOD/xAODTrigRingerCnv/src/TrigRNNOutputCnvTool.cxx b/Event/xAOD/xAODTrigRingerCnv/src/TrigRNNOutputCnvTool.cxx deleted file mode 100644 index b505fd5673cd822772686dba58a80e0b09bbaf6d..0000000000000000000000000000000000000000 --- a/Event/xAOD/xAODTrigRingerCnv/src/TrigRNNOutputCnvTool.cxx +++ /dev/null @@ -1,74 +0,0 @@ -/* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration -*/ - -// $Id: RingerRNNOutputCnvTool.cxx 592334 2014-04-10 11:01:56Z krasznaa $ - -// EDM include(s): -#include "TrigCaloEvent/TrigRNNOutput.h" -#include "TrigCaloEvent/TrigRNNOutputContainer.h" -#include "xAODTrigRinger/TrigRNNOutput.h" -#include "xAODTrigRinger/TrigRNNOutputContainer.h" - -// Local include(s): -#include "TrigRNNOutputCnvTool.h" - -namespace xAODMaker { - - TrigRNNOutputCnvTool::TrigRNNOutputCnvTool( const std::string& type, - const std::string& name, - const IInterface* parent ) - : AthAlgTool( type, name, parent ) { - - // Declare the interface(s) provided by the tool: - declareInterface< ITrigRNNOutputCnvTool >( this ); - } - - StatusCode TrigRNNOutputCnvTool::initialize() { - - // Greet the user: - ATH_MSG_INFO( "Initializing - Package version: " << PACKAGE_VERSION ); - - // Return gracefully: - return StatusCode::SUCCESS; - } - - /** - * This is the important function of the tool. It takes the RingerRNNOutput object - * from a RingerRNNOutput container, and fills an xAOD::RingerRNNOutput with it. - * - * @param aod The AOD object to take the RingerRNNOutput from - * @param xaod The xAOD object to fill with information - * @returns <code>StatusCode::SUCCESS</code> if all went fine, - * something else if not - */ - StatusCode - TrigRNNOutputCnvTool::convert( const TrigRNNOutputContainer* aod, - xAOD::TrigRNNOutputContainer* xaod ) { - - ATH_MSG_DEBUG( "Size of the xAOD container before loop: " - << xaod->size() ); - - // Loop over the AOD objects: - TrigRNNOutputContainer::const_iterator aod_itr = aod->begin(); - TrigRNNOutputContainer::const_iterator aod_end = aod->end(); - - for( ; aod_itr != aod_end; ++aod_itr ) { - - // Create the xAOD object: - xAOD::TrigRNNOutput* rnn = new xAOD::TrigRNNOutput(); - xaod->push_back( rnn ); - - rnn->setRnnDecision( ((*aod_itr)->output())[0] ); - //rnn->setEt( ((*aod_itr)->cluster())->et() ); - rnn->auxdata<float>("et") = ((*aod_itr)->cluster())->et(); - } - - ATH_MSG_DEBUG( "Size of the xAOD container after loop: " - << xaod->size() ); - - // Return gracefully: - return StatusCode::SUCCESS; - } - -} // namespace xAODMaker diff --git a/Event/xAOD/xAODTrigRingerCnv/src/TrigRNNOutputCnvTool.h b/Event/xAOD/xAODTrigRingerCnv/src/TrigRNNOutputCnvTool.h deleted file mode 100644 index 3fbc3c499aeb9e001408962ab7664d7e0e23859b..0000000000000000000000000000000000000000 --- a/Event/xAOD/xAODTrigRingerCnv/src/TrigRNNOutputCnvTool.h +++ /dev/null @@ -1,49 +0,0 @@ -// Dear emacs, this is -*- c++ -*- - -/* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration -*/ - -// $Id: RingerRNNOutputCnvTool.h 592334 2014-04-10 11:01:56Z krasznaa $ -#ifndef XAODTRIGRINGERCNV_TRIGRNNOUTPUTCNVTOOL_H -#define XAODTRIGRINGERCNV_TRIGRNNOUTPUTCNVTOOL_H - -// Gaudi/Athena include(s): -#include "AthenaBaseComps/AthAlgTool.h" - -// Local include(s): -#include "xAODTrigRingerCnv/ITrigRNNOutputCnvTool.h" - -namespace xAODMaker { - - /** - * @short Implementation for the ITrigRNNOutputCnvTool interface - * - * This is a simple tool that implements the converter function - * defined in IRingerRNNOutputCnvTool. - * - * @author joao victor da fonseca pinto <joao.victor.da.fonseca.pinto@cern.ch> - * - * $Revision: $ - * $Date: $ - */ - class TrigRNNOutputCnvTool : public AthAlgTool, - public virtual ITrigRNNOutputCnvTool { - - public: - /// Regular AlgTool constructor - TrigRNNOutputCnvTool( const std::string& type, const std::string& name, - const IInterface* parent ); - - /// Function initialising the tool - virtual StatusCode initialize(); - - /// Function that fills an existing xAOD::RingerRNNOutput - virtual StatusCode convert( const TrigRNNOutputContainer* aod, - xAOD::TrigRNNOutputContainer* xaod ); - - }; // class TrigRNNOutputCnvTool - -} // namespace xAODMaker - -#endif // XAODMaker diff --git a/Event/xAOD/xAODTrigRingerCnv/src/TrigRingerRingsCnvAlg.cxx b/Event/xAOD/xAODTrigRingerCnv/src/TrigRingerRingsCnvAlg.cxx deleted file mode 100644 index a77bc4f50f301092ad2d17459a082f83bf7e9bd1..0000000000000000000000000000000000000000 --- a/Event/xAOD/xAODTrigRingerCnv/src/TrigRingerRingsCnvAlg.cxx +++ /dev/null @@ -1,66 +0,0 @@ -/* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration -*/ - -// $Id: RingerRingsCnvAlg.cxx 592334 2014-04-10 11:01:56Z krasznaa $ - -// Gaudi/Athena include(s): -#include "AthenaKernel/errorcheck.h" - -// EDM include(s): -#include "TrigCaloEvent/RingerRingsContainer.h" -#include "xAODTrigRinger/TrigRingerRingsContainer.h" -#include "xAODTrigRinger/TrigRingerRingsAuxContainer.h" - -// Local include(s): -#include "TrigRingerRingsCnvAlg.h" - -namespace xAODMaker { - - TrigRingerRingsCnvAlg::TrigRingerRingsCnvAlg( const std::string& name, - ISvcLocator* svcLoc ) - : AthAlgorithm( name, svcLoc ), - m_cnvTool( "xAODMaker::TrigRingerRingsCnvTool/TrigRingerRingsCnvTool", this ) { - - declareProperty( "AODKey", m_aodKey = "TrigT2CaloEgamma" ); - declareProperty( "xAODKey", m_xaodKey = "TrigT2CaloEgamma" ); - declareProperty( "CnvTool", m_cnvTool ); - } - - StatusCode TrigRingerRingsCnvAlg::initialize() { - - // Greet the user: - ATH_MSG_INFO( "Initializing - Package version: " << PACKAGE_VERSION ); - ATH_MSG_DEBUG( " AOD Key: " << m_aodKey ); - ATH_MSG_DEBUG( "xAOD Key: " << m_xaodKey ); - - // Retrieve the converter tool: - CHECK( m_cnvTool.retrieve() ); - - // Return gracefully: - return StatusCode::SUCCESS; - } - - StatusCode TrigRingerRingsCnvAlg::execute() { - - // Retrieve the AOD container: - const RingerRingsContainer* aod = 0; - CHECK( evtStore()->retrieve( aod, m_aodKey ) ); - - // Create the xAOD container and its auxiliary store: - xAOD::TrigRingerRingsAuxContainer* aux = new xAOD::TrigRingerRingsAuxContainer(); - xAOD::TrigRingerRingsContainer* xaod = new xAOD::TrigRingerRingsContainer(); - xaod->setStore( aux ); - - // Fill the xAOD container: - CHECK( m_cnvTool->convert( aod, xaod ) ); - - // Record the xAOD containers: - CHECK( evtStore()->record( aux, m_xaodKey + "Aux." ) ); - CHECK( evtStore()->record( xaod, m_xaodKey ) ); - - // Return gracefully: - return StatusCode::SUCCESS; - } - -} // namespace xAODMaker diff --git a/Event/xAOD/xAODTrigRingerCnv/src/TrigRingerRingsCnvAlg.h b/Event/xAOD/xAODTrigRingerCnv/src/TrigRingerRingsCnvAlg.h deleted file mode 100644 index 557597634dc4e79d6f375be23d106cd9c54a3538..0000000000000000000000000000000000000000 --- a/Event/xAOD/xAODTrigRingerCnv/src/TrigRingerRingsCnvAlg.h +++ /dev/null @@ -1,58 +0,0 @@ -// Dear emacs, this is -*- c++ -*- - -/* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration -*/ - -// $Id: RingerRingsCnvAlg.h $ -#ifndef XAODTRIGRINGERCNV_TRIGRINGERRINGSCNVALG_H -#define XAODTRIGRINGERCNV_TRIGRINGERRINGSCNVALG_H - -// System include(s): -#include <string> - -// Gaudi/Athena include(s): -#include "AthenaBaseComps/AthAlgorithm.h" -#include "GaudiKernel/ToolHandle.h" - -// Local include(s): -#include "xAODTrigRingerCnv/ITrigRingerRingsCnvTool.h" - -namespace xAODMaker { - - /** - * @short Algorithm for creating xAOD::RingerRings from an AOD - * - * This algorithm can be used to create an xAOD RingerRings - * out of the object found in an AOD file. - * - * @author joao victor da fonseca pinto <joao.victor.da.fonseca.pinto@cern.ch> - * - * $Revision: $ - * $Date: $ - */ - class TrigRingerRingsCnvAlg : public AthAlgorithm { - - public: - /// Regular Algorithm constructor - TrigRingerRingsCnvAlg( const std::string& name, ISvcLocator* svcLoc ); - - /// Function initialising the algorithm - virtual StatusCode initialize(); - /// Function executing the algorithm - virtual StatusCode execute(); - - private: - /// StoreGate key of the input container - std::string m_aodKey; - /// StoreGate key for the output container - std::string m_xaodKey; - - /// Handle to the converter tool - ToolHandle< ITrigRingerRingsCnvTool > m_cnvTool; - - }; // class RingerRingsCnvAlg - -} // namespace xAODMaker - -#endif // diff --git a/Event/xAOD/xAODTrigRingerCnv/src/TrigRingerRingsCnvTool.cxx b/Event/xAOD/xAODTrigRingerCnv/src/TrigRingerRingsCnvTool.cxx deleted file mode 100644 index b07e8476652226518f0a20b3d9775d2cc79edfb7..0000000000000000000000000000000000000000 --- a/Event/xAOD/xAODTrigRingerCnv/src/TrigRingerRingsCnvTool.cxx +++ /dev/null @@ -1,72 +0,0 @@ -/* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration -*/ - -// $Id: RingerRingsCnvTool.cxx 592334 2014-04-10 11:01:56Z krasznaa $ - -// EDM include(s): -#include "TrigCaloEvent/RingerRings.h" -#include "TrigCaloEvent/RingerRingsContainer.h" -#include "xAODTrigRinger/TrigRingerRings.h" -#include "xAODTrigRinger/TrigRingerRingsContainer.h" - -// Local include(s): -#include "TrigRingerRingsCnvTool.h" - -namespace xAODMaker { - - TrigRingerRingsCnvTool::TrigRingerRingsCnvTool( const std::string& type, - const std::string& name, - const IInterface* parent ) - : AthAlgTool( type, name, parent ) { - - // Declare the interface(s) provided by the tool: - declareInterface< ITrigRingerRingsCnvTool >( this ); - } - - StatusCode TrigRingerRingsCnvTool::initialize() { - - // Greet the user: - ATH_MSG_INFO( "Initializing - Package version: " << PACKAGE_VERSION ); - - // Return gracefully: - return StatusCode::SUCCESS; - } - - /** - * This is the important function of the tool. It takes the RingerRings object - * from a RingerRings container, and fills an xAOD::RingerRings with it. - * - * @param aod The AOD object to take the RingerRings from - * @param xaod The xAOD object to fill with information - * @returns <code>StatusCode::SUCCESS</code> if all went fine, - * something else if not - */ - StatusCode - TrigRingerRingsCnvTool::convert( const RingerRingsContainer* aod, - xAOD::TrigRingerRingsContainer* xaod ) { - - ATH_MSG_DEBUG( "Size of the xAOD container before loop: " - << xaod->size() ); - - // Loop over the AOD objects: - RingerRingsContainer::const_iterator aod_itr = aod->begin(); - RingerRingsContainer::const_iterator aod_end = aod->end(); - - for( ; aod_itr != aod_end; ++aod_itr ) { - - // Create the xAOD object: - xAOD::TrigRingerRings* rings = new xAOD::TrigRingerRings(); - xaod->push_back( rings ); - - rings->setRings(( *aod_itr )->rings() ); - } - - ATH_MSG_DEBUG( "Size of the xAOD container after loop: " - << xaod->size() ); - - // Return gracefully: - return StatusCode::SUCCESS; - } - -} // namespace xAODMaker diff --git a/Event/xAOD/xAODTrigRingerCnv/src/TrigRingerRingsCnvTool.h b/Event/xAOD/xAODTrigRingerCnv/src/TrigRingerRingsCnvTool.h deleted file mode 100644 index aaa4de0c4a13f10f827e80245298a980cb87dcca..0000000000000000000000000000000000000000 --- a/Event/xAOD/xAODTrigRingerCnv/src/TrigRingerRingsCnvTool.h +++ /dev/null @@ -1,49 +0,0 @@ -// Dear emacs, this is -*- c++ -*- - -/* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration -*/ - -// $Id: RingerRingsCnvTool.h $ -#ifndef XAODTRIGRINGERCNV_TRIGRINGERRINGSCNVTOOL_H -#define XAODTRIGRINGERCNV_TRIGRINGERRINGSCNVTOOL_H - -// Gaudi/Athena include(s): -#include "AthenaBaseComps/AthAlgTool.h" - -// Local include(s): -#include "xAODTrigRingerCnv/ITrigRingerRingsCnvTool.h" - -namespace xAODMaker { - - /** - * @short Implementation for the IRingerRingsCnvTool interface - * - * This is a simple tool that implements the converter function - * defined in IRingerRingsCnvTool. - * - * @author joao victor da fonseca pinto <joao.victor.da.fonseca.pinto@cern.ch> - * - * $Revision: $ - * $Date: $ - */ - class TrigRingerRingsCnvTool : public AthAlgTool, - public virtual ITrigRingerRingsCnvTool { - - public: - /// Regular AlgTool constructor - TrigRingerRingsCnvTool( const std::string& type, const std::string& name, - const IInterface* parent ); - - /// Function initialising the tool - virtual StatusCode initialize(); - - /// Function that fills an existing xAOD::RingerRings - virtual StatusCode convert( const RingerRingsContainer* aod, - xAOD::TrigRingerRingsContainer* xaod ); - - }; // class RingerRingsCnvTool - -} // namespace xAODMaker - -#endif // XAODTRIGCALOCNV_RINGERRINGSCNVTOOL_H diff --git a/Event/xAOD/xAODTrigRingerCnv/xAODTrigRingerCnv/ATLAS_CHECK_THREAD_SAFETY b/Event/xAOD/xAODTrigRingerCnv/xAODTrigRingerCnv/ATLAS_CHECK_THREAD_SAFETY deleted file mode 100644 index bb007d103d227e060b6cfb156ad90a69e80209ea..0000000000000000000000000000000000000000 --- a/Event/xAOD/xAODTrigRingerCnv/xAODTrigRingerCnv/ATLAS_CHECK_THREAD_SAFETY +++ /dev/null @@ -1 +0,0 @@ -Event/xAOD/xAODTrigRingerCnv diff --git a/Event/xAOD/xAODTrigRingerCnv/xAODTrigRingerCnv/ITrigRNNOutputCnvTool.h b/Event/xAOD/xAODTrigRingerCnv/xAODTrigRingerCnv/ITrigRNNOutputCnvTool.h deleted file mode 100644 index 465e9b9802c4976cea69963b7888404d53750494..0000000000000000000000000000000000000000 --- a/Event/xAOD/xAODTrigRingerCnv/xAODTrigRingerCnv/ITrigRNNOutputCnvTool.h +++ /dev/null @@ -1,54 +0,0 @@ -// Dear emacs, this is -*- c++ -*- - -/* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration -*/ - -// $Id: IRingerRNNOutputCnvTool.h $ -#ifndef XAODTRIGRINGERCNV_ITRIGRNNOUTPUTCNVTOOL_H -#define XAODTRIGRINGERCNV_ITRIGRNNOUTPUTCNVTOOL_H - -// Gaudi/Athena include(s): -#include "GaudiKernel/IAlgTool.h" - -// EDM include(s): -#include "xAODTrigRinger/TrigRNNOutputContainer.h" - -// Forward declaration(s): -class TrigRNNOutputContainer; - -namespace xAODMaker { - - /// The interface provided by IRingerRNNOutputCnvTool - static const InterfaceID - IID_ITrigRNNOutputCnvTool( "xAODMaker::ITrigRNNOutputCnvTool", 1, 0 ); - - /** - * @short Interface for the tool creating TrigRNNOutput from an AOD - * - * This interface is implemented by the tool that converts the - * RingerRNNOutput object from an existing AOD RingerRNNOutput container into - * an xAOD::RingerRNNOutput. - * - * @author joao victor da fonseca pinto <joao.victor.da.fonseca.pinto@cern.ch> - * - * $Revision: $ - * $Date: $ - */ - class ITrigRNNOutputCnvTool : public virtual IAlgTool { - - public: - /// Function that fills an existing xAOD::RingerRNNOutputContainer - virtual StatusCode convert( const TrigRNNOutputContainer* aod, - xAOD::TrigRNNOutputContainer* xaod ) = 0; - - /// Gaudi interface definition - static const InterfaceID& interfaceID() { - return IID_ITrigRNNOutputCnvTool; - } - - }; // class ITrigRNNOutputCnvTool - -} // namespace xAODMaker - -#endif // XAODTRIGRINGERCNV_ITRIGRNNOUTPUTCNVTOOL_H diff --git a/Event/xAOD/xAODTrigRingerCnv/xAODTrigRingerCnv/ITrigRingerRingsCnvTool.h b/Event/xAOD/xAODTrigRingerCnv/xAODTrigRingerCnv/ITrigRingerRingsCnvTool.h deleted file mode 100644 index bb7931ddc3be04f0fc4c4bd0f915bef03d2bee6d..0000000000000000000000000000000000000000 --- a/Event/xAOD/xAODTrigRingerCnv/xAODTrigRingerCnv/ITrigRingerRingsCnvTool.h +++ /dev/null @@ -1,54 +0,0 @@ -// Dear emacs, this is -*- c++ -*- - -/* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration -*/ - -// $Id: IRingerRingsCnvTool.h $ -#ifndef XAODTRIGRINGERCNV_ITRIGRINGERRINGSCNVTOOL_H -#define XAODTRIGRINGERCNV_ITRIGRINGERRINGSCNVTOOL_H - -// Gaudi/Athena include(s): -#include "GaudiKernel/IAlgTool.h" - -// EDM include(s): -#include "xAODTrigRinger/TrigRingerRingsContainer.h" - -// Forward declaration(s): -class RingerRingsContainer; - -namespace xAODMaker { - - /// The interface provided by IRingerRingsCnvTool - static const InterfaceID - IID_ITrigRingerRingsCnvTool( "xAODMaker::ITrigRingerRingsCnvTool", 1, 0 ); - - /** - * @short Interface for the tool creating RingerRings from an AOD - * - * This interface is implemented by the tool that converts the - * RingerRings object from an existing AOD RingerRings container into - * an xAOD::RingerRings. - * - * @author joao victor da fonseca pinto <joao.victor.da.fonseca.pinto@cern.ch> - * - * $Revision: $ - * $Date: $ - */ - class ITrigRingerRingsCnvTool : public virtual IAlgTool { - - public: - /// Function that fills an existing xAOD::RingerRingsContainer - virtual StatusCode convert( const RingerRingsContainer* aod, - xAOD::TrigRingerRingsContainer* xaod ) = 0; - - /// Gaudi interface definition - static const InterfaceID& interfaceID() { - return IID_ITrigRingerRingsCnvTool; - } - - }; // class ITrigRingerRingsCnvTool - -} // namespace xAODMaker - -#endif // XAODRINGERRINGSCNV_IRINGERRINGSCNVTOOL_H diff --git a/Event/xAOD/xAODTrigger/Root/dict/ContainerProxies.cxx b/Event/xAOD/xAODTrigger/Root/dict/ContainerProxies.cxx index a63ad6ba574d1f6006c44d1e287b7f7ed9c93ad9..04a66ad2406c17d4d09022e7363570372ebdf8cf 100644 --- a/Event/xAOD/xAODTrigger/Root/dict/ContainerProxies.cxx +++ b/Event/xAOD/xAODTrigger/Root/dict/ContainerProxies.cxx @@ -16,6 +16,7 @@ #include "xAODTrigger/versions/JetRoIContainer_v1.h" #include "xAODTrigger/versions/JetRoIContainer_v2.h" #include "xAODTrigger/versions/MuonRoIContainer_v1.h" +#include "xAODTrigger/versions/eFexEMRoIContainer_v1.h" #include "xAODTrigger/versions/TrigCompositeContainer_v1.h" #include "xAODTrigger/versions/BunchConfContainer_v1.h" @@ -30,6 +31,7 @@ ADD_NS_DV_PROXY( xAOD, EmTauRoIContainer_v2 ); ADD_NS_DV_PROXY( xAOD, JetRoIContainer_v1 ); ADD_NS_DV_PROXY( xAOD, JetRoIContainer_v2 ); ADD_NS_DV_PROXY( xAOD, MuonRoIContainer_v1 ); +ADD_NS_DV_PROXY( xAOD, eFexEMRoIContainer_v1 ); ADD_NS_DV_PROXY( xAOD, TrigCompositeContainer_v1 ); ADD_NS_DV_PROXY( xAOD, BunchConfContainer_v1 ); diff --git a/Event/xAOD/xAODTrigger/Root/eFexEMRoIAuxContainer_v1.cxx b/Event/xAOD/xAODTrigger/Root/eFexEMRoIAuxContainer_v1.cxx new file mode 100644 index 0000000000000000000000000000000000000000..635f2d77b683b1621161d33d2dc369784f7d9710 --- /dev/null +++ b/Event/xAOD/xAODTrigger/Root/eFexEMRoIAuxContainer_v1.cxx @@ -0,0 +1,31 @@ +/* + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration +*/ + +// $Id: eFexEMRoIAuxContainer_v1.cxx 2019-07-01 13:04:25Z watsona $ + +// Local include(s): +#include "xAODTrigger/versions/eFexEMRoIAuxContainer_v1.h" + +namespace xAOD { + + eFexEMRoIAuxContainer_v1::eFexEMRoIAuxContainer_v1() + : AuxContainerBase() { + + AUX_VARIABLE( word0); + AUX_VARIABLE( word1); + AUX_VARIABLE( eFexNumber); + AUX_VARIABLE( retaEnv); + AUX_VARIABLE( retaCore); + AUX_VARIABLE( rhadHad); + AUX_VARIABLE( rhadEM); + AUX_VARIABLE( wstotNumerator); + AUX_VARIABLE( wstotDenominator); + AUX_VARIABLE( et); + AUX_VARIABLE( eta); + AUX_VARIABLE( phi); + AUX_VARIABLE( isTOB); + AUX_VARIABLE( thrPattern); + } + +} // namespace xAOD diff --git a/Event/xAOD/xAODTrigger/Root/eFexEMRoI_v1.cxx b/Event/xAOD/xAODTrigger/Root/eFexEMRoI_v1.cxx new file mode 100755 index 0000000000000000000000000000000000000000..267e49b9e5dcd420f62ea392bf5fd8bf17bb1db1 --- /dev/null +++ b/Event/xAOD/xAODTrigger/Root/eFexEMRoI_v1.cxx @@ -0,0 +1,249 @@ +/* + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration +*/ + + +// System include(s): +#include <stdexcept> + +// xAOD include(s): +#include "xAODCore/AuxStoreAccessorMacros.h" + +// Local include(s): +#include "xAODTrigger/versions/eFexEMRoI_v1.h" + +namespace xAOD { + + /// Constants used in converting to ATLAS units + const float eFexEMRoI_v1::s_tobEtScale = 100.; + const float eFexEMRoI_v1::s_xTobEtScale = 25.; + const float eFexEMRoI_v1::s_towerEtaWidth = 0.1; + const float eFexEMRoI_v1::s_minEta = -2.5; + + eFexEMRoI_v1::eFexEMRoI_v1() + : SG::AuxElement() { + + } + + void eFexEMRoI_v1::initialize( uint8_t eFexNumber, uint32_t word0, uint32_t word1 ) { + + setWord0( word0 ); + setWord1( word1 ); + seteFexNumber( eFexNumber ); + setTobEt( etTOB() ); + setEta( etaIndex() ); + setPhi( phiIndex() ); + + /** If the object is a TOB then the isTOB should be true. + For xTOB default is false, but should be set if a matching TOB is found */ + if (type() == TOB) setIsTOB(1); + else setIsTOB(0); + + return; + } + + + /// Raw data words + AUXSTORE_PRIMITIVE_SETTER_AND_GETTER( eFexEMRoI_v1, uint32_t, Word0, + setWord0 ) + AUXSTORE_PRIMITIVE_SETTER_AND_GETTER( eFexEMRoI_v1, uint32_t, Word1, + setWord1 ) + AUXSTORE_PRIMITIVE_SETTER_AND_GETTER( eFexEMRoI_v1, uint8_t, eFexNumber, + seteFexNumber ) + + /// Only calculable externally + AUXSTORE_PRIMITIVE_SETTER_AND_GETTER( eFexEMRoI_v1, uint16_t, RetaCore, + setRetaCore ) + AUXSTORE_PRIMITIVE_SETTER_AND_GETTER( eFexEMRoI_v1, uint16_t, RetaEnv, + setRetaEnv ) + AUXSTORE_PRIMITIVE_SETTER_AND_GETTER( eFexEMRoI_v1, uint16_t, RhadEM, + setRhadEM ) + AUXSTORE_PRIMITIVE_SETTER_AND_GETTER( eFexEMRoI_v1, uint16_t, RhadHad, + setRhadHad ) + AUXSTORE_PRIMITIVE_SETTER_AND_GETTER( eFexEMRoI_v1, uint16_t, WstotNumerator, + setWstotNumerator ) + AUXSTORE_PRIMITIVE_SETTER_AND_GETTER( eFexEMRoI_v1, uint16_t, WstotDenominator, + setWstotDenominator ) + AUXSTORE_PRIMITIVE_SETTER_AND_GETTER( eFexEMRoI_v1, uint32_t, thrPattern, + setThrPattern ) + + + /// Should be set for xTOB if there is a matching TOB + AUXSTORE_PRIMITIVE_SETTER_AND_GETTER( eFexEMRoI_v1, char, isTOB, + setIsTOB ) + + /// Extracted from data words, stored for convenience + AUXSTORE_PRIMITIVE_SETTER_AND_GETTER( eFexEMRoI_v1, uint16_t, tobEt, + setTobEt ) + AUXSTORE_PRIMITIVE_SETTER_AND_GETTER( eFexEMRoI_v1, uint8_t, iEta, + setEta ) + AUXSTORE_PRIMITIVE_SETTER_AND_GETTER( eFexEMRoI_v1, uint8_t, iPhi, + setPhi ) + + + /// Methods to decode data from the TOB/RoI and return to the user + + /// TOB or xTOB? + eFexEMRoI_v1::ObjectType eFexEMRoI_v1::type() const { + if (Word1() == 0) return TOB; + else return xTOB; + } + + /// Hardware coordinate elements + unsigned int eFexEMRoI_v1::fpga() const { + return (Word0() >> s_fpgaBit) & s_fpgaMask; + } + + unsigned int eFexEMRoI_v1::fpgaEta() const { + return (Word0() >> s_etaBit) & s_etaMask; + } + + unsigned int eFexEMRoI_v1::fpgaPhi() const { + return (Word0() >> s_phiBit) & s_phiMask; + } + + unsigned int eFexEMRoI_v1::UpNotDown() const { + return (Word0() >> s_updownBit) & s_updownMask; + } + + unsigned int eFexEMRoI_v1::seed() const { + return (Word0() >> s_seedBit) & s_seedMask; + } + + unsigned int eFexEMRoI_v1::seedMax() const { + return (Word0() >> s_maxBit) & s_maxMask; + } + + /// Raw ET on TOB scale (100 MeV/count) + unsigned int eFexEMRoI_v1::etTOB() const { + // Data content = TOB + if (Word1() == 0) { + return (Word0() >> s_etBit) & s_etMask; + } + // Data Content = xTOB. Need to remove lower bits and cap range + else { + unsigned int etWord = (etXTOB() >> s_etBitXTOB); + if (etWord > s_etMask) etWord = s_etMask; + return etWord; + } + } + + /// Full precision ET (25 MeV/count, only available if object is an xTOB + unsigned int eFexEMRoI_v1::etXTOB() const { + /// If the object is not an xTOB return 0 as high-precision ET unavailable + if (Word1() == 0) { + //return etTOB()*s_tobEtScale/s_xTobEtScale; + return 0; + } + else { + return (Word1() >> s_etBit) & s_etFullMask; + } + } + + /// Results of the 3 jet discriminant algorithms + unsigned int eFexEMRoI_v1::RetaThresholds() const { + return (Word0() >> s_veto1Bit) & s_veto1Mask; + } + + unsigned int eFexEMRoI_v1::RhadThresholds() const { + return (Word0() >> s_veto2Bit) & s_veto2Mask; + } + + unsigned int eFexEMRoI_v1::WstotThresholds() const { + return (Word0() >> s_veto3Bit) & s_veto3Mask; + } + + unsigned int eFexEMRoI_v1::bcn4() const { + return (Word1() >> s_bcn4Bit) & s_bcn4Mask; + } + + /// Return single 32-bit TOB word from an xTOB + uint32_t eFexEMRoI_v1::tobWord() const { + // Do something sensible if called for a TOB + if (Word1() == 0) return Word0(); + // When called for xTOB + else { + uint32_t word = Word0() + etTOB(); + return word; + } + } + + /// Methods that require combining results or applying scales + /// ET on TOB scale + float eFexEMRoI_v1::et() const { + return tobEt()*s_tobEtScale; + } + + /// Floating point coordinates + float eFexEMRoI_v1::eta() const { + return (s_minEta + iEta()*s_towerEtaWidth + (seed()+0.5)*s_towerEtaWidth/4); + } + + float eFexEMRoI_v1::phi() const { + float value = iPhi() * M_PI/32. + M_PI/64.; + if (value > M_PI) value = value - 2.*M_PI; + return value; + } + + /// Jet discriminant values. + /// Note that these are for convenience & intelligibility, but these should + /// not be used for bitwise-accurate menu studies + float eFexEMRoI_v1::Reta() const { + float sum = RetaCore() + RetaEnv(); + if (sum > 0) return (1. - RetaCore()/sum); + else return -1.; + } + + float eFexEMRoI_v1::Rhad() const { + float sum = RhadEM() + RhadHad(); + if (sum > 0) return (RhadHad()/sum); + else return -1.; + } + + float eFexEMRoI_v1::Wstot() const { + if (WstotDenominator() > 0) return (WstotNumerator()/WstotDenominator()); + else return -1.; + } + + /// Methods that decode the eFEX number + + /// Return phi index in the range 0-63 + int eFexEMRoI_v1::phiIndex() const { + + /// Get the eFEX index in phi (1-8, unfortunately) + unsigned int eFEX = (eFexNumber() >> s_eFexPhiBit) & s_eFexPhiMask; + + /// Find global phi index (0-63) for this window in this eFEX (the -1 is to correct for the eFEX phi index) + unsigned int index = s_eFexPhiWidth*eFEX + s_eFexPhiOffset + fpgaPhi() -1; + if (index >= s_numPhi) index -= s_numPhi; + return index; + } + + /// Return an eta index in the range 0-49 + /// Note that this may not be the final format! + /// And you need to combine with the seed() value to get full eta precision + int eFexEMRoI_v1::etaIndex() const { + + /// Get the eFEX number + uint8_t eFEX = (eFexNumber() >> s_eFexEtaBit) & s_eFexEtaMask; + + /// FPGA min eta + uint8_t index = 99; /// Define a default value in case of invalid eFEX number + + switch (eFEX) { + case eFexC: index = s_EtaCOffset + fpga()*s_fpgaEtaWidth + (fpga() > 0 ? 1 : 0); + break; + case eFexB: index = s_EtaBOffset + fpga()*s_fpgaEtaWidth; + break; + case eFexA: index = s_EtaAOffset + fpga()*s_fpgaEtaWidth; + break; + } + + /// Add eta location within the FPGA & return value + return index + fpgaEta(); + + } + + + +} // namespace xAOD diff --git a/Event/xAOD/xAODTrigger/Root/xAODTriggerCLIDs.cxx b/Event/xAOD/xAODTrigger/Root/xAODTriggerCLIDs.cxx index be4bf891b6c2b14cdd4b01887915abaa9dda0ebf..3f117e029d7ea05eba44a1520d5c3d956a67239f 100644 --- a/Event/xAOD/xAODTrigger/Root/xAODTriggerCLIDs.cxx +++ b/Event/xAOD/xAODTrigger/Root/xAODTriggerCLIDs.cxx @@ -30,4 +30,5 @@ #include "xAODTrigger/TrigPassBitsAuxContainer.h" #include "xAODTrigger/RoiDescriptorStore.h" #include "xAODTrigger/RoiDescriptorStoreAuxInfo.h" - +#include "xAODTrigger/eFexEMRoIContainer.h" +#include "xAODTrigger/eFexEMRoIAuxContainer.h" diff --git a/Event/xAOD/xAODTrigger/xAODTrigger/eFexEMRoI.h b/Event/xAOD/xAODTrigger/xAODTrigger/eFexEMRoI.h new file mode 100644 index 0000000000000000000000000000000000000000..f9fcde58656a38eee88cf0b45143427ad58d4276 --- /dev/null +++ b/Event/xAOD/xAODTrigger/xAODTrigger/eFexEMRoI.h @@ -0,0 +1,22 @@ +// Dear emacs, this is -*- c++ -*- + +/* + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration +*/ + +// $Id: eFexEMRoI.h Alan Watson $ +#ifndef XAODEFEXEMROI_H +#define XAODEFEXEMROI_H + +// Local include(s): +#include "xAODTrigger/versions/eFexEMRoI_v1.h" + +// Namespace holding all the xAOD EDM classes +namespace xAOD{ + /// Define the latest version of the eFexEMRoI class + typedef eFexEMRoI_v1 eFexEMRoI; +} + +#include "xAODCore/CLASS_DEF.h" +CLASS_DEF( xAOD::eFexEMRoI , 58699861 , 1 ) +#endif diff --git a/Event/xAOD/xAODTrigger/xAODTrigger/eFexEMRoIAuxContainer.h b/Event/xAOD/xAODTrigger/xAODTrigger/eFexEMRoIAuxContainer.h new file mode 100644 index 0000000000000000000000000000000000000000..22eac298f5ebb8d6b9f3ece981bfdeca1b1f6856 --- /dev/null +++ b/Event/xAOD/xAODTrigger/xAODTrigger/eFexEMRoIAuxContainer.h @@ -0,0 +1,22 @@ +// Dear emacs, this is -*- c++ -*- + +/* + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration +*/ + +// $Id: eFexEMRoIAuxContainer.h 2019-07-01 13:04:25Z watsona $ +#ifndef XAODTRIGGER_EFEXEMROIAUXCONTAINER_H +#define XAODTRIGGER_EFEXEMROIAUXCONTAINER_H + +// Local include(s): +#include "xAODTrigger/versions/eFexEMRoIAuxContainer_v1.h" + +namespace xAOD{ + typedef eFexEMRoIAuxContainer_v1 eFexEMRoIAuxContainer; +} + +// Set up a CLID for the class: +#include "xAODCore/CLASS_DEF.h" +CLASS_DEF( xAOD::eFexEMRoIAuxContainer , 1081052998 , 1 ) + +#endif // XAODTRIGGER_EFEXEMROIAUXCONTAINER_H diff --git a/Event/xAOD/xAODTrigger/xAODTrigger/eFexEMRoIContainer.h b/Event/xAOD/xAODTrigger/xAODTrigger/eFexEMRoIContainer.h new file mode 100644 index 0000000000000000000000000000000000000000..84122339729c84b037d8c2357d630091583a4073 --- /dev/null +++ b/Event/xAOD/xAODTrigger/xAODTrigger/eFexEMRoIContainer.h @@ -0,0 +1,23 @@ +// Dear emacs, this is -*- c++ -*- + +/* + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration +*/ + +// $Id: eFexEMRoIContainer.h 2019-07-01 13:04:25Z watsona $ +#ifndef XAODTRIGGER_EFEXEMROICONTAINER_H +#define XAODTRIGGER_EFEXEMROICONTAINER_H + +// Local include(s): +#include "xAODTrigger/eFexEMRoI.h" +#include "xAODTrigger/versions/eFexEMRoIContainer_v1.h" + +namespace xAOD{ + typedef eFexEMRoIContainer_v1 eFexEMRoIContainer; +} + +// Set up a CLID for the container: +#include "xAODCore/CLASS_DEF.h" +CLASS_DEF( xAOD::eFexEMRoIContainer , 1176191655 , 1 ) + +#endif // XAODTRIGGER_EMTAUROICONTAINER_H diff --git a/Event/xAOD/xAODTrigger/xAODTrigger/selection.xml b/Event/xAOD/xAODTrigger/xAODTrigger/selection.xml index 7eaee8ee54b8c2c393abbb211d823106caadb819..f6cf1bdca61d07afc21d662f56479ab367fc972f 100644 --- a/Event/xAOD/xAODTrigger/xAODTrigger/selection.xml +++ b/Event/xAOD/xAODTrigger/xAODTrigger/selection.xml @@ -114,6 +114,19 @@ targetClass="DataLink<xAOD::EnergySumRoI_v2>" source="" target="" /> + <!-- Phase I L1Calo RoI dictionaries: --> + <!-- RoI interface types --> + <class name="xAOD::eFexEMRoI_v1" /> + <class name="xAOD::eFexEMRoIContainer_v1" + id="89FFBED7-9DDF-4FC4-B099-2B4F827BD098" /> + <typedef name="xAOD::eFexEMRoI" /> + <typedef name="xAOD::eFexEMRoIContainer" /> + + <!-- RoI auxilliary types --> + <class name="xAOD::eFexEMRoIAuxContainer_v1" + id="6A1D7149-7476-4F23-8896-D88CB3BF6846" /> + <typedef name="xAOD::eFexEMRoIAuxContainer" /> + <!-- xAOD::TriggerMenu interface type(s). --> <class name="xAOD::TriggerMenu_v1" /> <class name="xAOD::TriggerMenuContainer_v1" diff --git a/Event/xAOD/xAODTrigger/xAODTrigger/versions/eFexEMRoIAuxContainer_v1.h b/Event/xAOD/xAODTrigger/xAODTrigger/versions/eFexEMRoIAuxContainer_v1.h new file mode 100644 index 0000000000000000000000000000000000000000..bf6af04d71b5111a7adb1c13568c84462f4c5c3f --- /dev/null +++ b/Event/xAOD/xAODTrigger/xAODTrigger/versions/eFexEMRoIAuxContainer_v1.h @@ -0,0 +1,63 @@ +// Dear emacs, this is -*- c++ -*- + +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +// $Id: eFexEMRoIAuxContainer_v1.h 631149 2014-11-26 12:26:18Z krasznaa $ +#ifndef XAODTRIGGER_VERSIONS_EFEXEMROIAUXCONTAINER_V1_H +#define XAODTRIGGER_VERSIONS_EFEXEMROIAUXCONTAINER_V1_H + +// System include(s): +extern "C" { +# include <stdint.h> +} +#include <vector> +#include <string> + +// EDM include(s): +#include "xAODCore/AuxContainerBase.h" + +namespace xAOD { + + /// Auxiliary store for the LVL1 eFEX EM TOB/RoI container + /// + /// This auxiliary container can describe the properties of a container + /// of LVL1 EM RoIs. + /// + /// @author Alan Watson <Alan.Watson@cern.ch> + /// + /// $Revision: 1 $ + /// $Date: 2019-07-01 13:04:25 +0100 (Mon, 01 Jul 2019) $ + /// + class eFexEMRoIAuxContainer_v1 : public AuxContainerBase { + + public: + /// Default constuctor + eFexEMRoIAuxContainer_v1(); + + private: + std::vector< uint32_t > word0; + std::vector< uint32_t > word1; + std::vector< uint8_t > eFexNumber; + std::vector< uint16_t > retaEnv; + std::vector< uint16_t > retaCore; + std::vector< uint16_t > rhadHad; + std::vector< uint16_t > rhadEM; + std::vector< uint16_t > wstotNumerator; + std::vector< uint16_t > wstotDenominator; + std::vector< uint16_t > et; + std::vector< uint8_t > eta; + std::vector< uint8_t > phi; + std::vector< char > isTOB; + std::vector< uint32_t > thrPattern; + + }; // class eFexEMRoIAuxContainer_v1 + +} // namespace xAOD + +// Declare the inheritance of the container: +#include "xAODCore/BaseInfo.h" +SG_BASE( xAOD::eFexEMRoIAuxContainer_v1, xAOD::AuxContainerBase ); + +#endif // XAODTRIGGER_VERSIONS_eFexEMRoIAuxContainer_V1_H diff --git a/Event/xAOD/xAODTrigger/xAODTrigger/versions/eFexEMRoIContainer_v1.h b/Event/xAOD/xAODTrigger/xAODTrigger/versions/eFexEMRoIContainer_v1.h new file mode 100644 index 0000000000000000000000000000000000000000..612e3bcedd3d5c154a5312a063f51ed0a6f179ac --- /dev/null +++ b/Event/xAOD/xAODTrigger/xAODTrigger/versions/eFexEMRoIContainer_v1.h @@ -0,0 +1,22 @@ +// Dear emacs, this is -*- c++ -*- + +/* + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration +*/ + +// $Id: eFexEMRoIContainer_v1.cxx 2019-07-01 13:04:25Z watsona $ +#ifndef XAODTRIGGER_VERSIONS_EFEXEMROICONTAINER_V1_H +#define XAODTRIGGER_VERSIONS_EFEXEMROICONTAINER_V1_H + +// Core include(s): +#include "AthContainers/DataVector.h" + +// Local include(s): +#include "xAODTrigger/versions/eFexEMRoI_v1.h" + +namespace xAOD { + /// Declare the em/tau RoI container type + typedef DataVector< xAOD::eFexEMRoI_v1 > eFexEMRoIContainer_v1; +} + +#endif // XAODTRIGGER_VERSIONS_EFEXEMROICONTAINER_V1_H diff --git a/Event/xAOD/xAODTrigger/xAODTrigger/versions/eFexEMRoI_v1.h b/Event/xAOD/xAODTrigger/xAODTrigger/versions/eFexEMRoI_v1.h new file mode 100755 index 0000000000000000000000000000000000000000..d947a73bee248f86795b99b81d2076b6186650ab --- /dev/null +++ b/Event/xAOD/xAODTrigger/xAODTrigger/versions/eFexEMRoI_v1.h @@ -0,0 +1,219 @@ +// Dear emacs, this is -*- c++ -*- + +/* + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration +*/ + +// $Id: eFexEMRoI_v1.h 1 2019-06-30 12:15:18 watsona $ +#ifndef XAODTRIGGER_VERSIONS_EFEXEMROI_V1_H +#define XAODTRIGGER_VERSIONS_EFEXEMROI_V1_H + +// System include(s): +extern "C" { +# include <stdint.h> +} +#include <vector> +#include <string> + +// xAOD include(s): +#include "AthContainers/AuxElement.h" + +namespace xAOD { + + /// Class describing a LVL1 eFEX EM region of interest + /// + /// This class describes the properties of an EM Trigger Object (TOB) + /// or Region of Interest (RoI) in the xAOD format. + /// + /// @author Alan Watson <Alan.Watson@cern.ch> + /// + /// $Revision: 1 $ + /// $Date: 2019-06-30 12:15:18 +0100 (Sun, 30 Jun 2019) $ + /// + class eFexEMRoI_v1 : public SG::AuxElement { + + public: + /// Default constructor + eFexEMRoI_v1(); + + /// Initialise the object with its most important properties + void initialize( uint8_t eFexNumber, uint32_t Word0, uint32_t Word1 = 0 ); + + /// Object types + enum ObjectType { + xTOB = 0, ///< This object is an xTOB (2*32 bit words) + TOB = 1 ///< This object is a TOB (1*32 bit word) + }; + + /// The "raw" 32-bit words describing the e/gamma candidate + uint32_t Word0() const; + uint32_t Word1() const; + /// Set the "raw" 32-bit words describing the e/gamma candidate + void setWord0( uint32_t value ); + void setWord1( uint32_t value ); + + /// The eFEX number + uint8_t eFexNumber() const; + /// Set the eFEX number + void seteFexNumber( uint8_t value ); + + /// TOB ET (decoded from TOB, stored for convenience) + uint16_t tobEt() const; /// getter for integer ET on TOB scale (100 MeV/count) + void setTobEt( uint16_t value); /// setter for the above + float et() const; /// floating point value (MeV, TOB scale) + + + /// Eta Coordinates (decoded from TOB, stored for convenience) + uint8_t iEta() const; /// getter for integer eta index (0-49) + void setEta( uint8_t value); /// setter for the above + unsigned int seed() const; /// Seed supercell index within central tower (0 -> 3) + float eta() const; /// Floating point, full precision (0.025) + + /// Phi coordinates + uint8_t iPhi() const; /// Getter for integer phi index (0-63) + void setPhi( uint8_t value); /// Setter for the above + float phi() const; /// Floating point, ATLAS phi convention (-pi -> pi) + + + /// Jet Discriminants + /// Derived floating point values (not used in actual algorithm) + float Reta() const; + float Rhad() const; + float Wstot() const; + + /// Actual values used in algorithm (setters and getters) + uint16_t RetaCore() const; + uint16_t RetaEnv() const; + uint16_t RhadEM() const; + uint16_t RhadHad() const; + uint16_t WstotNumerator() const; + uint16_t WstotDenominator() const; + void setRetaCore( uint16_t value); + void setRetaEnv( uint16_t value); + void setRhadEM( uint16_t value); + void setRhadHad( uint16_t value); + void setWstotNumerator( uint16_t value); + void setWstotDenominator( uint16_t value); + + /// Is this one a TOB (or xTOB partner of a TOB)? + char isTOB() const; + void setIsTOB( char value); + + /// Pattern of thresholds passed + uint32_t thrPattern() const; + void setThrPattern( uint32_t value); + + /// Return TOB word corresponding to this TOB or xTOB + uint32_t tobWord() const; + + + /// Data decoded from the TOB/RoI word and eFEX number + + /// Object type (TOB or xTOB) + ObjectType type() const; + + + /// FPGA number + unsigned int fpga() const; + + /// eta index within FPGA + unsigned int fpgaEta() const; + + /// phi index within FPGA + unsigned int fpgaPhi() const; + + /// Cluster up/down flag (1 = up, 0 = down) + unsigned int UpNotDown() const; + + /// Cluster ET (TOB ET scale, 100 MeV/count) + unsigned int etTOB() const; + + /// Cluster ET (xTOB ET scale, 25 MeV/count) + unsigned int etXTOB() const; + + /// Jet Discriminant 1 (R_eta) results + unsigned int RetaThresholds() const; + + /// Jet Discriminant 2 (R_had) results + unsigned int RhadThresholds() const; + + /// Jet Discriminant 3 (W_stot) results + unsigned int WstotThresholds() const; + + /// Seed = max flag. Is this really useful? + unsigned int seedMax() const; + + //? Bunch crossing number (last 4 bits, xTOB only) + unsigned int bcn4() const; + + private: + + /// Constants used in converting to ATLAS units + static const float s_tobEtScale; + static const float s_xTobEtScale; + static const float s_towerEtaWidth; + static const float s_minEta; + + + /** Constants used in decoding TOB words + For TOB word format changes these can be replaced + by arrays in the _v2 object so that different + versions can be decoded by one class */ + + // Data locations within word + static const int s_fpgaBit = 30; + static const int s_etaBit = 27; + static const int s_phiBit = 24; + static const int s_veto3Bit = 22; + static const int s_veto2Bit = 20; + static const int s_veto1Bit = 18; + static const int s_seedBit = 16; + static const int s_updownBit = 15; + static const int s_maxBit = 14; + static const int s_etBit = 0; + static const int s_etBitXTOB = 3; + static const int s_bcn4Bit = 28; + + // Data masks + static const int s_fpgaMask = 0x3; + static const int s_etaMask = 0x7; + static const int s_phiMask = 0x7; + static const int s_veto1Mask = 0x3; + static const int s_veto2Mask = 0x3; + static const int s_veto3Mask = 0x3; + static const int s_seedMask = 0x3; + static const int s_updownMask = 0x1; + static const int s_maxMask = 0x1; + static const int s_etMask = 0xfff; + static const int s_etFullMask = 0xffff; + static const int s_bcn4Mask = 0xf; + // For decoding coordinates + // + static const int s_numPhi = 64; + static const int s_eFexPhiMask = 0xf; + static const int s_eFexPhiBit = 0; + static const int s_eFexPhiWidth = 8; + static const int s_eFexPhiOffset = 2; + static const int s_eFexEtaMask = 0xf; + static const int s_eFexEtaBit = 4; + static const int s_fpgaEtaWidth = 4; + static const int s_EtaCOffset = 0; + static const int s_EtaBOffset = 17; + static const int s_EtaAOffset = 33; + + /// eFEX numbering (eta, 3 locations) + enum eFEXTypes {eFexC = 0xc, eFexB = 0xb, eFexA = 0xa}; + + /// Compute eta & phi indices from TOB word + int etaIndex() const; + int phiIndex() const; + + }; // class eFexEMRoI_v1 + +} // namespace xAOD + +// Declare the inheritance of the type: +#include "xAODCore/BaseInfo.h" +SG_BASE( xAOD::eFexEMRoI_v1, SG::AuxElement ); + +#endif // XAODTRIGGER_VERSIONS_EFEXEMROI_V1_H diff --git a/Event/xAOD/xAODTrigger/xAODTrigger/xAODTriggerDict.h b/Event/xAOD/xAODTrigger/xAODTrigger/xAODTriggerDict.h index 7beb29624bfeb18c89e1c019a35edf74c67b2747..05c57c3beedc2724f3acba9ee09bf2575aef294e 100644 --- a/Event/xAOD/xAODTrigger/xAODTrigger/xAODTriggerDict.h +++ b/Event/xAOD/xAODTrigger/xAODTrigger/xAODTriggerDict.h @@ -61,6 +61,13 @@ #include "xAODTrigger/versions/EnergySumRoI_v2.h" #include "xAODTrigger/versions/EnergySumRoIAuxInfo_v2.h" +#include "xAODTrigger/eFexEMRoI.h" +#include "xAODTrigger/eFexEMRoIContainer.h" +#include "xAODTrigger/eFexEMRoIAuxContainer.h" +#include "xAODTrigger/versions/eFexEMRoI_v1.h" +#include "xAODTrigger/versions/eFexEMRoIContainer_v1.h" +#include "xAODTrigger/versions/eFexEMRoIAuxContainer_v1.h" + #include "xAODTrigger/TrigDecision.h" #include "xAODTrigger/TrigDecisionAuxInfo.h" #include "xAODTrigger/versions/TrigDecision_v1.h" @@ -121,6 +128,8 @@ namespace { XAOD_INSTANTIATE_NS_CONTAINER_TYPES( xAOD, EmTauRoIContainer_v1 ); XAOD_INSTANTIATE_NS_CONTAINER_TYPES( xAOD, EmTauRoIContainer_v2 ); + XAOD_INSTANTIATE_NS_CONTAINER_TYPES( xAOD, eFexEMRoIContainer_v1 ); + XAOD_INSTANTIATE_NS_CONTAINER_TYPES( xAOD, TrigCompositeContainer_v1 ); XAOD_INSTANTIATE_NS_CONTAINER_TYPES( xAOD, TrigPassBitsContainer_v1 ); diff --git a/Generators/AtlasHepMC/AtlasHepMC/Flow.h b/Generators/AtlasHepMC/AtlasHepMC/Flow.h index 72c3b7df628b669bc4047fdcfd47c9d3a24d3805..1aee5c176b48c6264f8f21e8a7f756c4c4262624 100644 --- a/Generators/AtlasHepMC/AtlasHepMC/Flow.h +++ b/Generators/AtlasHepMC/AtlasHepMC/Flow.h @@ -16,10 +16,26 @@ std::shared_ptr<HepMC3::IntAttribute> f=p->attribute<HepMC3::IntAttribute>("flow std::shared_ptr<HepMC3::VectorIntAttribute> vf=p->attribute<HepMC3::VectorIntAttribute>("flow"); if (vf) if (0<i&&i<(int)(vf->value().size())) return vf->value().at(i); return 0; } +inline int flow(HepMC3::ConstGenParticlePtr p, int i){ +std::shared_ptr<HepMC3::IntAttribute> f=p->attribute<HepMC3::IntAttribute>("flow"+std::to_string(i)); if (f) return f->value(); +std::shared_ptr<HepMC3::VectorIntAttribute> vf=p->attribute<HepMC3::VectorIntAttribute>("flow"); if (vf) if (0<i&&i<(int)(vf->value().size())) return vf->value().at(i); +return 0; +} inline Flow flow(HepMC3::GenParticlePtr p){ std::shared_ptr<HepMC3::VectorIntAttribute> vf=p->attribute<HepMC3::VectorIntAttribute>("flow"); if (vf) return vf; +std::vector<int> fl; +for (int i=1;i<=10;i++) +{ +std::shared_ptr<HepMC3::IntAttribute> f=p->attribute<HepMC3::IntAttribute>("flow"+std::to_string(i)); if (f) fl.push_back(i); else break; +} +return std::make_shared<HepMC3::VectorIntAttribute>(fl); +} +inline Flow flow(HepMC3::ConstGenParticlePtr p){ +std::shared_ptr<HepMC3::VectorIntAttribute> vf=p->attribute<HepMC3::VectorIntAttribute>("flow"); +if (vf) return vf; + std::vector<int> fl; for (int i=1;i<=10;i++) { diff --git a/Generators/GenAnalysisTools/EventBoost/src/EventBoost.cxx b/Generators/GenAnalysisTools/EventBoost/src/EventBoost.cxx index 9fcb86b8ccf864dd71130024378b82e1e9b593da..2cf0d6625417ca68f4ae1b3d3a48b9074d637030 100755 --- a/Generators/GenAnalysisTools/EventBoost/src/EventBoost.cxx +++ b/Generators/GenAnalysisTools/EventBoost/src/EventBoost.cxx @@ -174,7 +174,7 @@ StatusCode EventBoost::AnalyseGenEvent(const HepMC::GenEvent* genEvt) { std::vector<HepMC::GenParticlePtr> particles_needing_modification; - for(auto p: *genEvt) particles_needing_modification.push_back(p); + for(auto p: *((HepMC::GenEvent*)genEvt)) particles_needing_modification.push_back(p); m_pxsum=0.; for (auto it: particles_needing_modification) { @@ -191,11 +191,15 @@ StatusCode EventBoost::AnalyseGenEvent(const HepMC::GenEvent* genEvt) { std::vector<HepMC::GenVertexPtr> vertices_needing_modification; +#ifdef HEPMC3 + for(auto v: ((HepMC::GenEvent*)genEvt)->vertices()) vertices_needing_modification.push_back(v); +#else HepMC::GenEvent::vertex_const_iterator v = genEvt->vertices_begin(); HepMC::GenEvent::vertex_const_iterator vEnd = genEvt->vertices_end(); for(; v != vEnd; ++v ) { vertices_needing_modification.push_back(*v); } +#endif Rndm::Numbers GaussVertexModifier_x(randSvc(), Rndm::Gauss(m_gaussian_mean[0],m_gaussian_width[0])); diff --git a/Generators/HforTool/src/HforTool.cxx b/Generators/HforTool/src/HforTool.cxx index a72dc7b1af1973af8f0a1c4f0c227a9d02e5b0c6..edf429a9a14cd38dd4b82e39996c39cd47ed59df 100644 --- a/Generators/HforTool/src/HforTool.cxx +++ b/Generators/HforTool/src/HforTool.cxx @@ -300,10 +300,15 @@ void HforTool::findHFQuarks() { ATH_MSG_DEBUG(" prod vtx: " << prodvtx); // check that there is no b/c-hadron as a parent // also find mpi and top parents - for (auto pin = prodvtx->particles_begin(HepMC::parents); pin != prodvtx->particles_end(HepMC::parents) && !hasbchadronparent; pin++) - { - ATH_MSG_DEBUG(" incoming: " << *(*pin)); - int pdgin(abs((*pin)->pdg_id())) ; +#ifdef HEPMC3 + for (auto pin: prodvtx->particles_in()){ +#else + for (auto pin_it = prodvtx->particles_begin(HepMC::parents); pin_it != prodvtx->particles_end(HepMC::parents); pin_it++) { + auto pin=pin_it; +#endif + if(hasbchadronparent) break; + ATH_MSG_DEBUG(" incoming: " << *pin); + int pdgin(std::abs((*pin)->pdg_id())) ; if ( (pdgin%10000)/1000 == apdg || (pdgin%1000)/100 == apdg ) hasbchadronparent = true ; @@ -336,10 +341,11 @@ void HforTool::findHFQuarks() { ATH_MSG_DEBUG(" decay vtx: " << decayvtx); // check whether there are only non-b/c-quark daughters - for (auto pout = decayvtx->particles_begin(HepMC::children) ; pout != decayvtx->particles_end(HepMC::children) && !hasbcquarkdaughter; pout++) + for (auto pout: *decayvtx) { - ATH_MSG_DEBUG(" outgoing: " << (*pout)); - int pdgout(std::abs((*pout)->pdg_id())) ; + if (hasbcquarkdaughter) break; + ATH_MSG_DEBUG(" outgoing: " << pout); + int pdgout(std::abs(pout->pdg_id())) ; if ( pdgout == apdg ) hasbcquarkdaughter = true ; } @@ -379,8 +385,13 @@ void HforTool::findHFQuarks() { ATH_MSG_DEBUG("print out vertex -5") ; auto vtx5=HepMC::barcode_to_vertex(evt,-5) ; if (vtx5) { +#ifdef HEPMC3 + for ( auto pin = vtx5->particles_in().begin() ; pin != vtx5->particles_in().end(); pin++) ATH_MSG_DEBUG(" incoming: " << (*pin)); + for ( auto pout = vtx5->particles_out().begin() ; pout != vtx5->particles_out().end(); pout++) ATH_MSG_DEBUG(" outgoing: " << (*pout)); +#else for ( auto pin = vtx5->particles_begin(HepMC::parents) ; pin != vtx5->particles_end(HepMC::parents); pin++) ATH_MSG_DEBUG(" incoming: " << (*pin)); for ( auto pout = vtx5->particles_begin(HepMC::children) ; pout != vtx5->particles_end(HepMC::children); pout++) ATH_MSG_DEBUG(" outgoing: " << (*pout)); +#endif } } // print out vtx -5 if there are HF quarks and in DEBUG mode } // Pythia shower @@ -429,21 +440,27 @@ void HforTool::findHFQuarksHerwig isPDF = true ; } if ( !isPDF && prodvtx ) { +#ifdef HEPMC3 + for (auto pin: HepMC::ancestor_particles(prodvtx)) { +#else HepMC::GenVertex::particle_iterator prodvtx_particles_begin = prodvtx->particles_begin(HepMC::ancestors) ; HepMC::GenVertex::particle_iterator prodvtx_particles_end = prodvtx->particles_end(HepMC::ancestors) ; - for (auto pin=prodvtx_particles_begin; pin!= prodvtx_particles_end && !iscquarkfromb && !isPDF ; pin++ ) { - int apdgin = std::abs((*pin)->pdg_id()) ; + for (auto pin_it=prodvtx_particles_begin; pin_it!= prodvtx_particles_end ; pin_it++ ) { + auto pin=*pin_it; +#endif + if (iscquarkfromb || isPDF) break; + int apdgin = std::abs(pin->pdg_id()) ; if (apdgin != apdg ) { - ATH_MSG_DEBUG(" non b/c parent " << (*pin)); + ATH_MSG_DEBUG(" non b/c parent " << pin); // if MPI as a non-b parent, label it - if ( apdgin == 0 && (*pin)->status() == 120 ) { + if ( apdgin == 0 && pin->status() == 120 ) { ATH_MSG_DEBUG(" MPI !!"); isMPI = true ; } // gluon splitting or ME origin: in evgen files, // proton (id 2212) seems to be saved in all events; not so in // AOD files... Thus look for non-HF origin with status 121 or 122 - if ( (*pin)->status() == 121 || (*pin)->status() == 122 ) { + if ( pin->status() == 121 || pin->status() == 122 ) { ATH_MSG_DEBUG(" GS !!"); isGS = true ; } @@ -471,14 +488,14 @@ void HforTool::findHFQuarksHerwig isWDecay = true ; } } else { - ATH_MSG_DEBUG(" b/c parent " << (*pin)); + ATH_MSG_DEBUG(" b/c parent " << pin); // if the status of a b-quark is 123 or 124, then it is a ME b-quark - if ( (*pin)->status() == 123 || (*pin)->status() == 124 ) { + if ( pin->status() == 123 || pin->status() == 124 ) { ATH_MSG_DEBUG(" ME !!"); isME = true ; } // if status 141 or 142 then it came from the PDF, ignore those!! - if ( (*pin)->status() == 141 || (*pin)->status() == 142 ) { + if ( pin->status() == 141 || pin->status() == 142 ) { ATH_MSG_DEBUG(" PDF !!"); isPDF = true ; } @@ -559,7 +576,11 @@ void HforTool::findHFQuarksPythia // then there is PDF parton too (eg, qc->q'Wc) auto prodvtx=bcpart->production_vertex() ; if ( prodvtx ) { +#ifdef HEPMC3 + for (auto pin=prodvtx->particles_in().begin(); pin != prodvtx->particles_in().end(); pin++) +#else for (auto pin=prodvtx->particles_begin(HepMC::parents); pin != prodvtx->particles_end(HepMC::parents); pin++) +#endif { ATH_MSG_DEBUG(" incoming: " << (*pin)); int pdgin((*pin)->pdg_id()) ; @@ -598,11 +619,16 @@ void HforTool::findHFQuarksPythia if ( prodvtx ) { // check whether there is a proton ancestor, // and how many ancestors there are - for ( auto pin = prodvtx->particles_begin(HepMC::ancestors); pin != prodvtx->particles_end(HepMC::ancestors) && !iscquarkfromb ; pin++ ) - { - int apdgin = std::abs((*pin)->pdg_id()) ; +#ifdef HEPMC3 + for ( auto pin: prodvtx->particles_in()) { +#else + for ( auto pin_it = prodvtx->particles_begin(HepMC::ancestors); pin_it != prodvtx->particles_end(HepMC::ancestors) ; pin_it++ ) { + auto pin=*pin_it; +#endif + if (iscquarkfromb ) break; + int apdgin = std::abs(pin->pdg_id()) ; if ( apdgin != apdg ) { - ATH_MSG_DEBUG(" non b/c ancestor " << (*pin)); + ATH_MSG_DEBUG(" non b/c ancestor " << pin); // proton parent if ( apdgin == 2212 ) { hasPAncestor = true ; @@ -632,7 +658,7 @@ void HforTool::findHFQuarksPythia isWDecay = true ; } } else { - ATH_MSG_DEBUG(" b/c or ME/PDF parent " << (*pin)); + ATH_MSG_DEBUG(" b/c or ME/PDF parent " << pin); } // b/c or non-b/c quark as parent } // loop over all ancestors @@ -675,13 +701,18 @@ void HforTool::findHFQuarksPythia auto pvtx34=prodvtx ; bool bc34=(HepMC::barcode(pvtx34)==-3 || HepMC::barcode(pvtx34)==-4) ; if ( !bc34 ) { - for (auto pin=prodvtx->particles_begin(HepMC::ancestors);pin!=prodvtx->particles_end(HepMC::ancestors)&&!bc34 ; pin++ ) - { +#ifdef HEPMC3 + for (auto pin: HepMC::ancestor_particles(prodvtx) ) { +#else + for (auto pin_it=prodvtx->particles_begin(HepMC::ancestors);pin_it!=prodvtx->particles_end(HepMC::ancestors); pin_it++ ) { + auto pin=*pin_it; +#endif + if (bc34) break; int bcpv(-1) ; - if ( (*pin)->production_vertex() ) - bcpv = HepMC::barcode((*pin)->production_vertex()) ; - if ( (*pin)->pdg_id() == pdg && (bcpv==-3 || bcpv==-4) ) { - pvtx34 = (*pin)->production_vertex() ; + if ( pin->production_vertex() ) + bcpv = HepMC::barcode(pin->production_vertex()) ; + if ( pin->pdg_id() == pdg && (bcpv==-3 || bcpv==-4) ) { + pvtx34 = pin->production_vertex() ; bc34 = true ; } } // loop over ancestors @@ -704,7 +735,11 @@ void HforTool::findHFQuarksPythia auto mepvtx=ime->production_vertex() ; // check the prod.vertices of the parents if ( mepvtx ) { +#ifdef HEPMC3 + for (auto pin = mepvtx->particles_in().begin() ; pin != mepvtx->particles_in().end(); pin++) +#else for (auto pin = mepvtx->particles_begin(HepMC::parents) ; pin != mepvtx->particles_end(HepMC::parents); pin++) +#endif { if ( (*pin)->production_vertex() == pvtx34 && ime->pdg_id() == pdg ) { ATH_MSG_DEBUG(" -> ME parton") ; @@ -797,11 +832,16 @@ void HforTool::findHFQuarksUnknown bool isWDecay(false) ; // subset of top-decays, for hadronic top-decays bool iscquarkfromb(false) ; if ( prodvtx ) { - for ( auto pin = prodvtx->particles_begin(HepMC::ancestors); pin != prodvtx->particles_end(HepMC::ancestors) && !iscquarkfromb ; pin++ ) - { - int apdgin = std::abs((*pin)->pdg_id()) ; +#ifdef HEPMC3 + for ( auto pin: prodvtx->particles_in()) { +#else + for ( auto pin_it = prodvtx->particles_begin(HepMC::ancestors); pin_it != prodvtx->particles_end(HepMC::ancestors) ; pin_it++ ) { + auto pin=*pin_it; +#endif + if (!!iscquarkfromb ) break; + int apdgin = std::abs(pin->pdg_id()) ; if (apdgin != apdg ) { - ATH_MSG_DEBUG(" non b/c parent " << (*pin)); + ATH_MSG_DEBUG(" non b/c parent " << pin); // c quark from a b quark (in b-hadron decays) if ( apdg == 4 && ( apdgin == 5 || (apdgin%10000)/1000 == 5 ||(apdgin%1000)/100 == 5 ) ) { ATH_MSG_DEBUG(" c quark from b quark or b hadron"); diff --git a/HLT/Event/TrigByteStreamCnvSvc/python/TrigByteStreamCnvSvcConfig.py b/HLT/Event/TrigByteStreamCnvSvc/python/TrigByteStreamCnvSvcConfig.py index 45b6667c8c9f97ee33444419a0959f1a3a8e2e0f..2c0213946f82c2a545802b6a77a74a0d2101c00f 100644 --- a/HLT/Event/TrigByteStreamCnvSvc/python/TrigByteStreamCnvSvcConfig.py +++ b/HLT/Event/TrigByteStreamCnvSvc/python/TrigByteStreamCnvSvcConfig.py @@ -3,6 +3,7 @@ # from TrigByteStreamCnvSvc.TrigByteStreamCnvSvcConf import TrigByteStreamInputSvc as _TrigByteStreamInputSvc +from TrigByteStreamCnvSvc.TrigByteStreamCnvSvcConf import TrigByteStreamCnvSvc as _TrigByteStreamCnvSvc from AthenaMonitoringKernel.GenericMonitoringTool import GenericMonitoringTool class TrigByteStreamInputSvc(_TrigByteStreamInputSvc): @@ -10,20 +11,76 @@ class TrigByteStreamInputSvc(_TrigByteStreamInputSvc): super(TrigByteStreamInputSvc, self).__init__(name) self.MonTool = GenericMonitoringTool('MonTool', HistPath='HLTFramework/'+name) self.MonTool.defineHistogram('L1Result_NumROBs', path='EXPERT', type='TH1F', - title='Number of ROBs received in L1 result;Number of ROBs;N events', + title='Number of ROBs received in L1 result;Number of ROBs;Events', xbins=100, xmin=0, xmax=100) self.MonTool.defineHistogram('L1Result_FullEvFragSize', path='EXPERT', type='TH1F', - title='Size of L1 result FullEventFragment;Size [kB];N events', + title='Size of L1 result FullEventFragment;Size [kB];Events', xbins=100, xmin=0, xmax=100) self.MonTool.defineHistogram('L1Result_SubDets', path='EXPERT', type='TH1F', title='Source of ROBs in L1 result passed to HLT;;Total number of ROBs', xbins=1, xmin=0, xmax=1) self.MonTool.defineHistogram('TIME_getNext', path='EXPERT', type='TH1F', - title='Time of DataCollector::getNext() calls;Time [ms];N calls', + title='Time of DataCollector::getNext() calls;Time [ms];Calls', xbins=400, xmin=0, xmax=200) self.MonTool.defineHistogram('TIME_getNext;TIME_getNext_extRange', path='EXPERT', type='TH1F', - title='Time of DataCollector::getNext() calls;Time [ms];N calls', + title='Time of DataCollector::getNext() calls;Time [ms];Calls', xbins=400, xmin=0, xmax=2000) self.MonTool.defineHistogram('getNext_LBN,getNext_noEvent;NoEventFraction', path='EXPERT', type='TProfile', title='Fraction of getNext calls returning NO_EVENT;Lumi Block;Event fraction', xbins=100, xmin=0, xmax=100, opt='kCanRebin') + +class TrigByteStreamCnvSvc(_TrigByteStreamCnvSvc): + def __init__(self, name='TrigByteStreamCnvSvc'): + super(TrigByteStreamCnvSvc, self).__init__(name) + self.MonTool = GenericMonitoringTool('MonTool', HistPath='HLTFramework/'+name) + self.MonTool.defineHistogram('TIME_eventDone', path='EXPERT', type='TH1F', + title='Time of DataCollector::eventDone() calls;Time [ms];Calls', + xbins=400, xmin=0, xmax=2) + self.MonTool.defineHistogram('TIME_eventDone;TIME_eventDone_extRange', path='EXPERT', type='TH1F', + title='Time of DataCollector::eventDone() calls;Time [ms];Calls', + xbins=400, xmin=0, xmax=200) + self.MonTool.defineHistogram('StreamTags', path='EXPERT', type='TH1F', + title='Stream Tags produced by HLT;;Events', + xbins=1, xmin=0, xmax=1) + self.MonTool.defineHistogram('StreamTagCorrA,StreamTagCorrB;StreamTagsCorr', path='EXPERT', type='TH2F', + title='Stream Tags (produced by HLT) correlation', + xbins=1, xmin=0, xmax=1, ybins=1, ymin=0, ymax=1) + self.MonTool.defineHistogram('StreamTagsNum', path='EXPERT', type='TH1F', + title='Number of Stream Tags produced by HLT;Number of Stream Tags;Events', + xbins=20, xmin=0, xmax=20) + self.MonTool.defineHistogram('StreamTagsType', path='EXPERT', type='TH1F', + title='Type of Stream Tags produced by HLT;;Events', + xbins=7, xmin=0, xmax=7, + xlabels=["physics", "calibration", "express", "monitoring", "debug", "reserved", "unknown"]) + self.MonTool.defineHistogram('StreamTagsPebRobsNum', path='EXPERT', type='TH1F', + title='Number of ROBs in PEB stream tags;Number of ROBs;Entries', + xbins=200, xmin=0, xmax=200, + cutmask="StreamTagIsPeb") + self.MonTool.defineHistogram('StreamTagsPebSubDetsNum', path='EXPERT', type='TH1F', + title='Number of SubDetectors in PEB stream tags;Number of SubDetectors;Entries', + xbins=100, xmin=0, xmax=100, + cutmask="StreamTagIsPeb") + self.MonTool.defineHistogram('StreamTagsPebSubDetsFromRobList', path='EXPERT', type='TH1F', + title='SubDetectors in PEB stream tags ROB list;;Entries', + xbins=1, xmin=0, xmax=1) + self.MonTool.defineHistogram('StreamTagsPebSubDetsFromSubDetList', path='EXPERT', type='TH1F', + title='SubDetectors in PEB stream tags SubDetector list;;Entries', + xbins=1, xmin=0, xmax=1) + self.MonTool.defineHistogram('ResultSizeTotal', path='EXPERT', type='TH1F', + title='HLT result total size (sum of all modules);Size [kB];Events', + xbins=200, xmin=0, xmax=2000) + self.MonTool.defineHistogram('ResultSizeFullEvFrag', path='EXPERT', type='TH1F', + title='HLT output FullEventFragment size;Size [kB];Events', + xbins=200, xmin=0, xmax=2000) + self.MonTool.defineHistogram('ResultModuleID,ResultModuleSize;ResultSizeByModule', path='EXPERT', type='TH2F', + title='HLT result size by module;Module ID;Size [kB]', + xbins=10, xmin=0, xmax=10, ybins=200, ymin=0, ymax=2000) + self.MonTool.defineHistogram('StreamTags,ResultSizeStream;ResultSizeByStream', path='EXPERT', type='TH2F', + title='HLT result size by stream;;Size [kB]', + xbins=1, xmin=0, xmax=1, ybins=200, ymin=0, ymax=2000) + self.MonTool.defineHistogram('OnlineErrorCode', path='EXPERT', type='TH1F', + title='Online error codes;;Events', + xbins=1, xmin=0, xmax=1) + self.MonTool.defineHistogram('TIME_monitorRawEvent', path='EXPERT', type='TH1F', + title='Time of monitorRawEvent() calls;Time [us];Calls', + xbins=1000, xmin=0, xmax=1000) diff --git a/HLT/Event/TrigByteStreamCnvSvc/src/TrigByteStreamCnvSvc.cxx b/HLT/Event/TrigByteStreamCnvSvc/src/TrigByteStreamCnvSvc.cxx index facf9426ab10bb390de689c4b922ace6b5b64222..ffeda04b3f7de388f9eaf845a4c91492b9bc529f 100644 --- a/HLT/Event/TrigByteStreamCnvSvc/src/TrigByteStreamCnvSvc.cxx +++ b/HLT/Event/TrigByteStreamCnvSvc/src/TrigByteStreamCnvSvc.cxx @@ -8,7 +8,6 @@ // Athena includes #include "AthenaKernel/EventContextClid.h" -#include "AthenaMonitoringKernel/OHLockedHist.h" #include "ByteStreamCnvSvcBase/IROBDataProviderSvc.h" #include "StoreGate/StoreGateSvc.h" @@ -29,6 +28,13 @@ // Local helper functions namespace { constexpr float wordsToKiloBytes = 0.001*sizeof(uint32_t); + template<typename T> inline bool contains(const std::vector<T>& vec, const T& val) { + return std::find(vec.cbegin(), vec.cend(), val)!=vec.cend(); + } + template<typename T> inline int index(const std::vector<T>& vec, const T& val) { + typename std::vector<T>::const_iterator it = std::find(vec.cbegin(), vec.cend(), val); + return it==vec.cend() ? -1 : std::distance(vec.cbegin(), it); + } template<typename T> struct printWordHex { printWordHex(const T w) : word(w) {} T word; @@ -56,16 +62,29 @@ namespace { } return str; } + // StreamTag monitoring accessors + inline const std::string mon_streamTypeName(const eformat::helper::StreamTag& st){ + return st.type+"_"+st.name; + } + inline const std::string& mon_streamType(const eformat::helper::StreamTag& st){ + return st.type; + } + inline bool mon_streamIsPeb(const eformat::helper::StreamTag& st){ + return st.robs.size()>0 || st.dets.size()>0; + } + inline size_t mon_streamPebRobsNum(const eformat::helper::StreamTag& st){ + return st.robs.size(); + } + inline size_t mon_streamPebSubDetsNum(const eformat::helper::StreamTag& st){ + return st.dets.size(); + } } // ============================================================================= // Standard constructor // ============================================================================= TrigByteStreamCnvSvc::TrigByteStreamCnvSvc(const std::string& name, ISvcLocator* svcLoc) -: ByteStreamCnvSvc(name, svcLoc), - m_evtStore("StoreGateSvc", name), - m_robDataProviderSvc("ROBDataProviderSvc", name), - m_THistSvc("THistSvc", name) {} +: ByteStreamCnvSvc(name, svcLoc) {} // ============================================================================= // Standard destructor @@ -80,19 +99,11 @@ StatusCode TrigByteStreamCnvSvc::initialize() { ATH_CHECK(ByteStreamCnvSvc::initialize()); ATH_CHECK(m_evtStore.retrieve()); ATH_CHECK(m_robDataProviderSvc.retrieve()); - ATH_CHECK(m_THistSvc.retrieve()); + if (!m_monTool.empty()) ATH_CHECK(m_monTool.retrieve()); ATH_MSG_VERBOSE("end of " << __FUNCTION__); return StatusCode::SUCCESS; } -// ============================================================================= -// Reimplementation of Service::start -// ============================================================================= -StatusCode TrigByteStreamCnvSvc::start() { - bookHistograms(); - return StatusCode::SUCCESS; -} - // ============================================================================= // Implementation of Service::finalize // ============================================================================= @@ -102,8 +113,6 @@ StatusCode TrigByteStreamCnvSvc::finalize() { ATH_MSG_WARNING("Failed to release service " << m_robDataProviderSvc.typeAndName()); if (m_evtStore.release().isFailure()) ATH_MSG_WARNING("Failed to release service " << m_evtStore.typeAndName()); - if (m_THistSvc.release().isFailure()) - ATH_MSG_WARNING("Failed to release service " << m_THistSvc.typeAndName()); ATH_MSG_VERBOSE("end of " << __FUNCTION__); ATH_CHECK(ByteStreamCnvSvc::finalize()); return StatusCode::SUCCESS; @@ -180,19 +189,20 @@ StatusCode TrigByteStreamCnvSvc::commitOutput(const std::string& /*outputFile*/, return StatusCode::FAILURE; } - monitorRawEvent(rawEventPtr); + { + auto t_mon = Monitored::Timer("TIME_monitorRawEvent"); + monitorRawEvent(rawEventPtr); + Monitored::Group(m_monTool, t_mon); + } // Send output to the DataCollector StatusCode result = StatusCode::SUCCESS; try { - auto startTime = std::chrono::high_resolution_clock::now(); + auto t_eventDone = Monitored::Timer<std::chrono::duration<float, std::milli>>("TIME_eventDone"); hltinterface::DataCollector::instance()->eventDone(std::move(rawEventPtr)); - auto endTime = std::chrono::high_resolution_clock::now(); - auto duration = std::chrono::duration<float, std::milli>(endTime - startTime); - m_histEventDoneTime->Fill(static_cast<float>(duration.count())); - m_histEventDoneTimeER->Fill(static_cast<float>(duration.count())); + Monitored::Group(m_monTool, t_eventDone); ATH_MSG_DEBUG("Serialised FullEventFragment with HLT result was returned to DataCollector successfully, " - << "the eventDone call took " << duration.count() << " microseconds"); + << "the eventDone call took " << (double)t_eventDone << " milliseconds"); } catch (const std::exception& e) { ATH_MSG_ERROR("Sending output to DataCollector failed, caught an unexpected std::exception " << e.what()); @@ -220,9 +230,8 @@ void TrigByteStreamCnvSvc::monitorRawEvent(const std::unique_ptr<uint32_t[]>& ra HLT::OnlineErrorCode errorCode = static_cast<HLT::OnlineErrorCode>(rawEvent.status()[1]); std::ostringstream ss; ss << errorCode; - oh_scoped_lock_histogram lock; - m_histOnlineErrorCode->Fill(ss.str().data(), 1.0); - m_histOnlineErrorCode->LabelsDeflate("X"); + auto monOnlineErrorCode = Monitored::Scalar<std::string>("OnlineErrorCode", ss.str()); + Monitored::Group(m_monTool, monOnlineErrorCode); } // Decode stream tags @@ -242,17 +251,24 @@ void TrigByteStreamCnvSvc::monitorRawEvent(const std::unique_ptr<uint32_t[]>& ra // Get HLT result sizes std::vector<eformat::read::ROBFragment> robs; rawEvent.robs(robs); - std::unordered_map<uint16_t, uint32_t> resultSizes; // {module ID, size in words} + std::vector<uint16_t> resultSizeMap_moduleID; + std::vector<uint32_t> resultSizeMap_size; uint32_t totalSizeWords = 0; try { for (const eformat::read::ROBFragment& rob : robs) { eformat::helper::SourceIdentifier sid(rob.rob_source_id()); if (sid.subdetector_id() != eformat::SubDetector::TDAQ_HLT) continue; - uint32_t size = rob.fragment_size_word(); - uint16_t module_id = sid.module_id(); - resultSizes[module_id] = size; + const uint16_t module_id = sid.module_id(); + const uint32_t size = rob.fragment_size_word(); totalSizeWords += size; + if (!contains(resultSizeMap_moduleID, module_id)) { + resultSizeMap_moduleID.push_back(module_id); + resultSizeMap_size.push_back(size); + } + else { + ATH_MSG_ERROR("HLT result ROB monitoring found multiple HLT ROBs with the same module ID " << module_id); + } } } catch (const std::exception& ex) { @@ -264,80 +280,68 @@ void TrigByteStreamCnvSvc::monitorRawEvent(const std::unique_ptr<uint32_t[]>& ra return; } - // Associate result sizes to streams and fill histograms - m_histStreamTagsNum->Fill(streamTags.size()); - std::unordered_map<std::string, uint32_t> resultSizesByStream; + // Fill helper containers for monitoring + std::vector<std::string> sdFromRobList; + std::vector<std::string> sdFromSubDetList; + std::vector<std::string> streamTagCorrA; + std::vector<std::string> streamTagCorrB; + std::vector<float> streamResultSize; // Correlated with streamTags vector + streamTagCorrA.reserve(streamTags.size() * streamTags.size()); + streamTagCorrB.reserve(streamTags.size() * streamTags.size()); + streamResultSize.reserve(streamTags.size()); for (const eformat::helper::StreamTag& st : streamTags) { - std::string typeName = st.type + "_" + st.name; - { - oh_scoped_lock_histogram lock; - m_histStreamTags->Fill(typeName.data(), 1.0); - m_histStreamTags->LabelsDeflate("X"); - } - m_histStreamTagsType->Fill(st.type.data(), 1.0); - if (st.robs.size() > 0 || st.dets.size() >0) { // PEB stream tag - m_histPebRobsNum->Fill(st.robs.size()); - m_histPebSubDetsNum->Fill(st.dets.size()); - } - bool hasHLTSubDet = st.dets.find(eformat::SubDetector::TDAQ_HLT) != st.dets.end(); bool includeAll = st.robs.empty() && (st.dets.empty() || hasHLTSubDet); - if (includeAll) { - resultSizesByStream[typeName] = totalSizeWords; - continue; - } - uint32_t size = 0; - std::set<std::string> sdFromRobList; - std::set<std::string> sdFromSubDetList; + // includeAll means a stream with full event building or all HLT results included + uint32_t sizeWords = includeAll ? totalSizeWords : 0; for (const eformat::SubDetector sd : st.dets) { - sdFromSubDetList.insert(eformat::helper::SubDetectorDictionary.string(sd)); + const std::string& detName = eformat::helper::SubDetectorDictionary.string(sd); + if (!contains(sdFromSubDetList, detName)) sdFromSubDetList.push_back(detName); } - for (uint32_t robid : st.robs) { + for (const uint32_t robid : st.robs) { eformat::helper::SourceIdentifier sid(robid); - sdFromRobList.insert(sid.human_detector()); - if (sid.subdetector_id() != eformat::SubDetector::TDAQ_HLT) - continue; - if (resultSizes.find(sid.module_id()) == resultSizes.end()) { - ATH_MSG_WARNING("Stream tag " << typeName << " declares " << sid.human() - << " in ROB list, but the ROBFragment is missing"); - continue; + const std::string& detName = sid.human_detector(); + if (!contains(sdFromRobList, detName)) sdFromRobList.push_back(detName); + if (!includeAll && sid.subdetector_id() == eformat::SubDetector::TDAQ_HLT) { + if (const int ix = index(resultSizeMap_moduleID, sid.module_id()); ix >= 0) { + sizeWords += resultSizeMap_size[ix]; + } + else { + ATH_MSG_WARNING("Stream tag " << st.type << "_" << st.name << " declares " << sid.human() + << " in ROB list, but the ROBFragment is missing"); + } } - size += resultSizes[sid.module_id()]; - } - resultSizesByStream[typeName] = size; - for (const std::string& sdName : sdFromRobList) { - oh_scoped_lock_histogram lock; - m_histPebSubDetsFromRobList->Fill(sdName.data(), 1.0); - m_histPebSubDetsFromRobList->LabelsDeflate("X"); } - for (const std::string& sdName : sdFromSubDetList) { - oh_scoped_lock_histogram lock; - m_histPebSubDetsFromSubDetList->Fill(sdName.data(), 1.0); - m_histPebSubDetsFromSubDetList->LabelsDeflate("X"); + streamResultSize.push_back(sizeWords*wordsToKiloBytes); + for (const eformat::helper::StreamTag& st2 : streamTags) { + streamTagCorrA.push_back(mon_streamTypeName(st)); + streamTagCorrB.push_back(mon_streamTypeName(st2)); } } - // Fill result size and stream tag correlation histograms - for (const auto& [typeName, size] : resultSizesByStream) { - { - oh_scoped_lock_histogram lock; - m_histResultSizeByStream->Fill(typeName.data(), size*wordsToKiloBytes, 1.0); - m_histResultSizeByStream->LabelsDeflate("X"); - } - for (const auto& [typeName2, size2] : resultSizesByStream) { - oh_scoped_lock_histogram lock; - m_histStreamTagsCorr->Fill(typeName.data(), typeName2.data(), 1.0); - m_histStreamTagsCorr->LabelsDeflate("X"); - m_histStreamTagsCorr->LabelsDeflate("Y"); - } - } - for (const auto& [moduleId, size] : resultSizes) { - m_histResultSizeByModule->Fill(static_cast<float>(moduleId), size*wordsToKiloBytes, 1.0); - } - m_histResultSizeTotal->Fill(totalSizeWords*wordsToKiloBytes); - m_histResultSizeFullEvFrag->Fill(rawEvent.fragment_size_word()*wordsToKiloBytes); - ATH_MSG_DEBUG("Total size of HLT ROBs is " << totalSizeWords*wordsToKiloBytes - << " kB and FullEventFragment size is " << rawEvent.fragment_size_word()*wordsToKiloBytes << " kB"); + // General stream tag monitoring + auto monStreamTagsNum = Monitored::Scalar<size_t>("StreamTagsNum", streamTags.size()); + auto monStreamTags = Monitored::Collection("StreamTags", streamTags, mon_streamTypeName); + auto monStreamTagsType = Monitored::Collection("StreamTagsType", streamTags, mon_streamType); + auto monStreamTagCorrA = Monitored::Collection("StreamTagCorrA", streamTagCorrA); + auto monStreamTagCorrB = Monitored::Collection("StreamTagCorrB", streamTagCorrB); + // PEB stream tag monitoring + auto monStreamIsPeb = Monitored::Collection("StreamTagIsPeb", streamTags, mon_streamIsPeb); + auto monPebRobsNum = Monitored::Collection("StreamTagsPebRobsNum", streamTags, mon_streamPebRobsNum); + auto monPebSubDetsNum = Monitored::Collection("StreamTagsPebSubDetsNum", streamTags, mon_streamPebSubDetsNum); + auto monSubDetsFromRobList = Monitored::Collection("StreamTagsPebSubDetsFromRobList", sdFromRobList); + auto monSubDetsFromSubDetList = Monitored::Collection("StreamTagsPebSubDetsFromSubDetList", sdFromSubDetList); + // Result size monitoring + auto monResultSizeTotal = Monitored::Scalar<float>("ResultSizeTotal", totalSizeWords*wordsToKiloBytes); + auto monResultSizeFullEvFrag = Monitored::Scalar<float>("ResultSizeFullEvFrag", rawEvent.fragment_size_word()*wordsToKiloBytes); + auto monResultCollModuleID = Monitored::Collection("ResultModuleID", resultSizeMap_moduleID); + auto monResultCollModuleSize = Monitored::Collection("ResultModuleSize", resultSizeMap_size, [](uint32_t sw){return sw*wordsToKiloBytes;}); + auto monResultSizeByStream = Monitored::Collection("ResultSizeStream", streamResultSize); + // Collect all variables + Monitored::Group(m_monTool, monStreamTagsNum, monStreamTags, monStreamTagsType, monStreamTagCorrA, + monStreamTagCorrB, monStreamIsPeb, monPebRobsNum, monPebSubDetsNum, monSubDetsFromRobList, + monSubDetsFromSubDetList, monResultSizeTotal, monResultSizeFullEvFrag, monResultCollModuleID, + monResultCollModuleSize, monResultSizeByStream); } // ============================================================================= @@ -403,87 +407,3 @@ void TrigByteStreamCnvSvc::printRawEvent() { ATH_MSG_DEBUG(ss.str()); } - -// ============================================================================= -void TrigByteStreamCnvSvc::bookHistograms() { - const std::string path = "/EXPERT/HLTFramework/" + name() + "/"; - - // Function to register histogram in THistSvc (moves the ownership to THistSvc) - auto regHist = [&path, this](TH1* hist){ - if (m_THistSvc->regHist(path + hist->GetName(), hist).isFailure()) - ATH_MSG_WARNING("Cannot register monitoring histogram " << hist->GetName()); - }; - - m_histOnlineErrorCode = new TH1I( - "OnlineErrorCode", "Online error codes;;Events", 1, 0, 1); - m_histOnlineErrorCode->SetCanExtend(TH1::kXaxis); - regHist(m_histOnlineErrorCode); - - m_histStreamTags = new TH1F( - "StreamTags", "Stream Tags produced by HLT;;Events", 1, 0, 1); - m_histStreamTags->SetCanExtend(TH1::kXaxis); - regHist(m_histStreamTags); - - m_histStreamTagsCorr = new TH2F( - "StreamTagsCorr", "Stream Tags (produced by HLT) correlation", 1, 0, 1, 1, 0, 1); - m_histStreamTagsCorr->SetCanExtend(TH1::kAllAxes); - regHist(m_histStreamTagsCorr); - - m_histStreamTagsNum = new TH1F( - "StreamTagsNum", "Number of Stream Tags produced by HLT;Number of Stream Tags;Events", 20, 0, 20); - regHist(m_histStreamTagsNum); - - m_histStreamTagsType = new TH1F( - "StreamTagsType", "Type of Stream Tags produced by HLT;;Events", 7, 0, 7); - m_histStreamTagsType->GetXaxis()->SetBinLabel(1, "physics"); - m_histStreamTagsType->GetXaxis()->SetBinLabel(2, "calibration"); - m_histStreamTagsType->GetXaxis()->SetBinLabel(3, "express"); - m_histStreamTagsType->GetXaxis()->SetBinLabel(4, "monitoring"); - m_histStreamTagsType->GetXaxis()->SetBinLabel(5, "debug"); - m_histStreamTagsType->GetXaxis()->SetBinLabel(6, "reserved"); - m_histStreamTagsType->GetXaxis()->SetBinLabel(7, "unknown"); - regHist(m_histStreamTagsType); - - m_histPebRobsNum = new TH1F( - "StreamTagsPebRobsNum", "Number of ROBs in PEB stream tags;Number of ROBs;Entries", 200, 0, 200); - regHist(m_histPebRobsNum); - - m_histPebSubDetsNum = new TH1F( - "StreamTagsPebSubDetsNum", "Number of SubDetectors in PEB stream tags;Number of SubDetectors;Entries", 100, 0, 100); - regHist(m_histPebSubDetsNum); - - m_histPebSubDetsFromRobList = new TH1F( - "StreamTagsPebSubDetsFromRobList", "SubDetectors in PEB stream tags ROB list;;Entries", 1, 0, 1); - m_histPebSubDetsFromRobList->SetCanExtend(TH1::kXaxis); - regHist(m_histPebSubDetsFromRobList); - - m_histPebSubDetsFromSubDetList = new TH1F( - "StreamTagsPebSubDetsFromSubDetList", "SubDetectors in PEB stream tags SubDetector list;;Entries", 1, 0, 1); - m_histPebSubDetsFromSubDetList->SetCanExtend(TH1::kXaxis); - regHist(m_histPebSubDetsFromSubDetList); - - m_histResultSizeByModule = new TH2F( - "ResultSizeByModule", "HLT result size by module;Module ID;Size [kB]", 10, 0, 10, 200, 0, 2000); - regHist(m_histResultSizeByModule); - - m_histResultSizeByStream = new TH2F( - "ResultSizeByStream", "HLT result size by stream;;Size [kB]", 1, 0, 1, 200, 0, 2000); - m_histResultSizeByStream->SetCanExtend(TH1::kXaxis); - regHist(m_histResultSizeByStream); - - m_histResultSizeTotal = new TH1F( - "ResultSizeTotal", "HLT result total size (sum of all modules);Size [kB];Events", 200, 0, 2000); - regHist(m_histResultSizeTotal); - - m_histResultSizeFullEvFrag = new TH1F( - "ResultSizeFullEvFrag", "HLT output FullEventFragment size;Size [kB];Events", 200, 0, 2000); - regHist(m_histResultSizeFullEvFrag); - - m_histEventDoneTime = new TH1F( - "TIME_EventDoneCall", "Time of DataCollector::eventDone calls;Time [ms];Events", 400, 0, 2); - regHist(m_histEventDoneTime); - - m_histEventDoneTimeER = new TH1F( - "TIME_EventDoneCall_extRange", "Time of DataCollector::eventDone calls;Time [ms];Events", 400, 0, 200); - regHist(m_histEventDoneTimeER); -} diff --git a/HLT/Event/TrigByteStreamCnvSvc/src/TrigByteStreamCnvSvc.h b/HLT/Event/TrigByteStreamCnvSvc/src/TrigByteStreamCnvSvc.h index cedcb95ff6ddfe1c00982eab8d3e3ab7a640e57f..55e6e0d026e72b8f855d191427a97fddff0c2717 100644 --- a/HLT/Event/TrigByteStreamCnvSvc/src/TrigByteStreamCnvSvc.h +++ b/HLT/Event/TrigByteStreamCnvSvc/src/TrigByteStreamCnvSvc.h @@ -6,14 +6,11 @@ #define TRIGBYTESTREAMCNVSVC_H #include "ByteStreamCnvSvc/ByteStreamCnvSvc.h" -#include <TH1I.h> -#include <TH1F.h> -#include <TH2F.h> +#include "AthenaMonitoringKernel/Monitored.h" // Forward declarations class StoreGateSvc; class IROBDataProviderSvc; -class ITHistSvc; /** @class TrigByteStreamCnvSvc * @brief A ByteStreamCnvSvc implementation for online use @@ -33,7 +30,6 @@ public: // ------------------------- IService methods -------------------------------- virtual StatusCode initialize() override; - virtual StatusCode start() override; virtual StatusCode finalize() override; // ------------------------- IConversionSvc methods -------------------------- @@ -46,35 +42,16 @@ public: virtual StatusCode commitOutput(const std::string& outputFile, bool do_commit) override; private: - // ------------------------- Helper methods --------------------------- + // ------------------------- Helper methods ---------------------------------- /// Print contents of m_rawEventWrite void printRawEvent(); /// Fill histograms from contents of a FullEventFragment void monitorRawEvent(const std::unique_ptr<uint32_t[]>& rawEventPtr) const; - /// Register monitoring histograms with THistSvc - void bookHistograms(); - // ------------------------- Service handles --------------------------- - ServiceHandle<StoreGateSvc> m_evtStore; //< Event store - ServiceHandle<IROBDataProviderSvc> m_robDataProviderSvc; //< ROB Data Provider - ServiceHandle<ITHistSvc> m_THistSvc; //< Histogramming service - - // ------------------------- Monitoring histograms --------------------------- - TH1I* m_histOnlineErrorCode{nullptr}; //< Histogram of online error codes - TH1F* m_histStreamTags{nullptr}; //< Histogram of stream tags - TH2F* m_histStreamTagsCorr{nullptr}; //< Histogram of stream tags correlation - TH1F* m_histStreamTagsNum{nullptr}; //< Histogram of number of stream tags - TH1F* m_histStreamTagsType{nullptr}; //< Histogram of stream tags type - TH1F* m_histPebRobsNum{nullptr}; //< Histogram of the number of ROBs in PEB stream tag - TH1F* m_histPebSubDetsNum{nullptr}; //< Histogram of the number of SubDetectors in PEB stream tag - TH1F* m_histPebSubDetsFromRobList{nullptr}; //< Histogram of SubDetectors from ROB list in PEB stream tag - TH1F* m_histPebSubDetsFromSubDetList{nullptr}; //< Histogram of SubDetectors from SubDetector list in PEB stream tag - TH2F* m_histResultSizeByModule{nullptr}; //< Histogram of HLT result size per module ID - TH2F* m_histResultSizeByStream{nullptr}; //< Histogram of HLT result size per stream - TH1F* m_histResultSizeTotal{nullptr}; //< Histogram of total HLT result size (all modules) - TH1F* m_histResultSizeFullEvFrag{nullptr}; //< Histogram of the size of FullEventFragment sent from HLT to DataCollector - TH1F* m_histEventDoneTime{nullptr}; //< Histogram of the time taken by the eventDone call - TH1F* m_histEventDoneTimeER{nullptr}; //< Histogram of the time taken by the eventDone call (extended range) + // ------------------------- Service / Tool handles -------------------------- + ServiceHandle<StoreGateSvc> m_evtStore {this, "EventStore", "StoreGateSvc"}; + ServiceHandle<IROBDataProviderSvc> m_robDataProviderSvc {this, "ROBDataProvider", "ROBDataProviderSvc"}; + ToolHandle<GenericMonitoringTool> m_monTool {this, "MonTool", "" , "Monitoring tool"}; }; #endif // TRIGBYTESTREAMCNVSVC_H diff --git a/HLT/Trigger/TrigControl/TrigServices/python/TriggerUnixStandardSetup.py b/HLT/Trigger/TrigControl/TrigServices/python/TriggerUnixStandardSetup.py index 4ea12222f7e83875bb08ef41e72cb2a2ae9851cd..ee0c6cad6bd22a610d1ed46f88433110afd645f5 100644 --- a/HLT/Trigger/TrigControl/TrigServices/python/TriggerUnixStandardSetup.py +++ b/HLT/Trigger/TrigControl/TrigServices/python/TriggerUnixStandardSetup.py @@ -106,8 +106,8 @@ def setupCommonServices(): svcMgr.EventPersistencySvc.CnvServices += [ "DetDescrCnvSvc" ] # Online services for ByteStream input/output - from TrigByteStreamCnvSvc.TrigByteStreamCnvSvcConf import TrigByteStreamCnvSvc, TrigEventSelectorByteStream - from TrigByteStreamCnvSvc.TrigByteStreamCnvSvcConfig import TrigByteStreamInputSvc + from TrigByteStreamCnvSvc.TrigByteStreamCnvSvcConf import TrigEventSelectorByteStream + from TrigByteStreamCnvSvc.TrigByteStreamCnvSvcConfig import TrigByteStreamInputSvc, TrigByteStreamCnvSvc svcMgr += TrigByteStreamCnvSvc("ByteStreamCnvSvc") # this name is hard-coded in some converters svcMgr.EventPersistencySvc.CnvServices += [ "ByteStreamCnvSvc" ] svcMgr += TrigByteStreamInputSvc("ByteStreamInputSvc") diff --git a/InnerDetector/InDetConditions/PixelConditionsAlgorithms/python/PixelConditionsConfig.py b/InnerDetector/InDetConditions/PixelConditionsAlgorithms/python/PixelConditionsConfig.py index d37d8a0a7350ea84fafd25fcb070086e57ba0003..efe9975e1714003e8898e45a0fd16750dee7c0be 100644 --- a/InnerDetector/InDetConditions/PixelConditionsAlgorithms/python/PixelConditionsConfig.py +++ b/InnerDetector/InDetConditions/PixelConditionsAlgorithms/python/PixelConditionsConfig.py @@ -198,7 +198,7 @@ def PixelConfigCondAlgCfg(flags, name="PixelConfigCondAlg", **kwargs): # Cabling parameters useCablingConditions = False IdMappingDat="PixelCabling/Pixels_Atlas_IdMapping_2016.dat" - if flags.Input.isMC: + if flags.Input.isMC or flags.Overlay.DataOverlay: # ITk: if flags.GeoModel.Run == "RUN4": IdMappingDat = "ITk_Atlas_IdMapping.dat" @@ -296,7 +296,7 @@ def PixelAlignCondAlgCfg(flags, name="PixelAlignCondAlg", **kwargs): def PixelCablingCondAlgCfg(flags, name="PixelCablingCondAlg", **kwargs): """Return a ComponentAccumulator with configured PixelCablingCondAlg""" acc = ComponentAccumulator() - if not flags.Input.isMC: + if not flags.Input.isMC and not flags.Overlay.DataOverlay: acc.merge(addFoldersSplitOnline(flags, "PIXEL", "/PIXEL/Onl/CablingMap","/PIXEL/CablingMap", className="AthenaAttributeList")) kwargs.setdefault("ReadKey", "/PIXEL/CablingMap") else: @@ -305,7 +305,7 @@ def PixelCablingCondAlgCfg(flags, name="PixelCablingCondAlg", **kwargs): # Cabling parameters IdMappingDat="PixelCabling/Pixels_Atlas_IdMapping_2016.dat" rodIDForSingleLink40=0 - if flags.Input.isMC: + if flags.Input.isMC or flags.Overlay.DataOverlay: # ITk: if flags.GeoModel.Run == "RUN4": IdMappingDat = "ITk_Atlas_IdMapping.dat" @@ -396,7 +396,7 @@ def PixelDCSCondHVAlgCfg(flags, name="PixelDCSCondHVAlg", **kwargs): def PixelDCSCondStateAlgCfg(flags, name="PixelDCSCondStateAlg", **kwargs): """Return a ComponentAccumulator with configured PixelDCSCondStateAlg""" acc = ComponentAccumulator() - if not flags.Input.isMC: + if not flags.Input.isMC and not flags.Overlay.DataOverlay: acc.merge(addFolders(flags, "/PIXEL/DCS/FSMSTATE", "DCS_OFL", className="CondAttrListCollection")) kwargs.setdefault("ReadKeyState", "/PIXEL/DCS/FSMSTATE") else: @@ -409,7 +409,7 @@ def PixelDCSCondStateAlgCfg(flags, name="PixelDCSCondStateAlg", **kwargs): def PixelDCSCondStatusAlgCfg(flags, name="PixelDCSCondStatusAlg", **kwargs): """Return a ComponentAccumulator with configured PixelDCSCondStatusAlg""" acc = ComponentAccumulator() - if not flags.Input.isMC: + if not flags.Input.isMC and not flags.Overlay.DataOverlay: acc.merge(addFolders(flags, "/PIXEL/DCS/FSMSTATUS", "DCS_OFL", className="CondAttrListCollection")) kwargs.setdefault("ReadKeyStatus", "/PIXEL/DCS/FSMSTATUS") else: diff --git a/InnerDetector/InDetDigitization/PixelDigitization/python/PixelDigitizationConfig.py b/InnerDetector/InDetDigitization/PixelDigitization/python/PixelDigitizationConfig.py index b28499e81e0170caf03d55d35454b3eb37a05201..9fda804bfb2b953a9a69d259cec5f8a134f0c7ed 100644 --- a/InnerDetector/InDetDigitization/PixelDigitization/python/PixelDigitizationConfig.py +++ b/InnerDetector/InDetDigitization/PixelDigitization/python/PixelDigitizationConfig.py @@ -4,8 +4,6 @@ from __future__ import print_function from AthenaCommon import CfgMgr from Digitization.DigitizationFlags import digitizationFlags -from AtlasGeoModel.InDetGMJobProperties import InDetGeometryFlags -from AthenaCommon.DetFlags import DetFlags # The earliest bunch crossing time for which interactions will be sent # to the Pixel Digitization code. @@ -69,7 +67,8 @@ def SensorSimTool(name="SensorSimTool", **kwargs): return CfgMgr.SensorSimTool(name, **kwargs) def FrontEndSimTool(name="FrontEndSimTool", **kwargs): - from AthenaCommon.AppMgr import ToolSvc + from PixelConditionsTools.PixelConditionsToolsConf import PixelConditionsSummaryTool + pixelConditionsSummaryToolSetup = PixelConditionsSummaryTool("PixelConditionsSummaryTool", UseByteStream=False) kwargs.setdefault("PixelConditionsSummaryTool", pixelConditionsSummaryToolSetup) return CfgMgr.FrontEndSimTool(name, **kwargs) @@ -102,7 +101,6 @@ def EndcapFEI3SimTool(name="EndcapFEI3SimTool", **kwargs): return CfgMgr.FEI3SimTool(name, **kwargs) def BasicPixelDigitizationTool(name="PixelDigitizationTool", **kwargs): - from AthenaCommon import CfgGetter from AthenaCommon.AppMgr import ServiceMgr from AthenaCommon.AppMgr import ToolSvc from IOVDbSvc.CondDB import conddb @@ -313,12 +311,12 @@ def BasicPixelDigitizationTool(name="PixelDigitizationTool", **kwargs): IdMappingDat = "ITk_Atlas_IdMapping_ExtBrl4.dat" elif "BrlExt3.2_ref" == commonGeoFlags.GeoType(): IdMappingDat = "ITk_Atlas_IdMapping_ExtBrl32.dat" - elif (geoFlags.isIBL() == False): + elif not geoFlags.isIBL(): IdMappingDat="PixelCabling/Pixels_Atlas_IdMapping.dat" else: # Planar IBL if (geoFlags.IBLLayout() == "planar"): - if (geoFlags.isDBM() == True): + if geoFlags.isDBM(): IdMappingDat="PixelCabling/Pixels_Atlas_IdMapping_inclIBL_DBM.dat" else: IdMappingDat="PixelCabling/Pixels_Atlas_IdMapping_inclIBL.dat" @@ -383,10 +381,10 @@ def BasicPixelDigitizationTool(name="PixelDigitizationTool", **kwargs): ##################### # Cabling map Setup # ##################### - if geoFlags.isIBL()==True and not conddb.folderRequested("/PIXEL/HitDiscCnfg"): + if geoFlags.isIBL() and not conddb.folderRequested("/PIXEL/HitDiscCnfg"): conddb.addFolderSplitMC("PIXEL","/PIXEL/HitDiscCnfg","/PIXEL/HitDiscCnfg", className="AthenaAttributeList") - if geoFlags.isIBL()==True and not hasattr(condSeq, 'PixelHitDiscCnfgAlg'): + if geoFlags.isIBL() and not hasattr(condSeq, 'PixelHitDiscCnfgAlg'): from PixelConditionsAlgorithms.PixelConditionsAlgorithmsConf import PixelHitDiscCnfgAlg condSeq += PixelHitDiscCnfgAlg(name="PixelHitDiscCnfgAlg") @@ -399,7 +397,6 @@ def BasicPixelDigitizationTool(name="PixelDigitizationTool", **kwargs): pixelReadKey = '' if (globalflags.DataSource=='data' and conddb.dbdata == 'CONDBR2'): # for data overlay - pixelReaddKey = '/PIXEL/CablingMap' if not conddb.folderRequested("/PIXEL/CablingMap"): conddb.addFolderSplitOnline("PIXEL", "/PIXEL/Onl/CablingMap","/PIXEL/CablingMap", className="AthenaAttributeList") @@ -408,7 +405,8 @@ def BasicPixelDigitizationTool(name="PixelDigitizationTool", **kwargs): condSeq += PixelCablingCondAlg(name="PixelCablingCondAlg", ReadKey = pixelReadKey, MappingFile=IdMappingDat, - RodIDForSingleLink40=0) + RodIDForSingleLink40=0, + RecordInInitialize=not globalflags.isOverlay()) if not conddb.folderRequested("/PIXEL/PixReco"): conddb.addFolder("PIXEL_OFL", "/PIXEL/PixReco", className="DetCondCFloat") @@ -456,12 +454,6 @@ def BasicPixelDigitizationTool(name="PixelDigitizationTool", **kwargs): # Set up Tool/Service ############################################################################################ - ################# - # Setup deadmap # - ################# - from PixelConditionsTools.PixelConditionsToolsConf import PixelConditionsSummaryTool - pixelConditionsSummaryToolSetup = PixelConditionsSummaryTool("PixelConditionsSummaryTool", UseByteStream=False) - ##################### # Setup Cabling Svc # ##################### diff --git a/InnerDetector/InDetDigitization/SCT_Digitization/python/SCT_DigitizationConfig.py b/InnerDetector/InDetDigitization/SCT_Digitization/python/SCT_DigitizationConfig.py index 327807676eac0ab7acd4f0748bca29026a971a8b..39b21f3a7170d3ccbdcac7b60aaf3387cc2f86a6 100644 --- a/InnerDetector/InDetDigitization/SCT_Digitization/python/SCT_DigitizationConfig.py +++ b/InnerDetector/InDetDigitization/SCT_Digitization/python/SCT_DigitizationConfig.py @@ -1,6 +1,7 @@ # Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration from AthenaCommon import CfgMgr +import AthenaCommon.SystemOfUnits as Units # The earliest bunch crossing time for which interactions will be sent # to the SCT Digitization code. def SCT_FirstXing(): @@ -56,9 +57,9 @@ def getSCT_SurfaceChargesGenerator(name="SCT_SurfaceChargesGenerator", **kwargs) kwargs.setdefault("FixedTime", -999) kwargs.setdefault("SubtractTime", -999) - kwargs.setdefault("SurfaceDriftTime", 10) + kwargs.setdefault("SurfaceDriftTime", 10*Units.ns) kwargs.setdefault("NumberOfCharges", 1) - kwargs.setdefault("SmallStepLength", 5) + kwargs.setdefault("SmallStepLength", 5*Units.micrometer) kwargs.setdefault("DepletionVoltage", 70) kwargs.setdefault("BiasVoltage", 150) kwargs.setdefault("SiPropertiesTool", sct_SiPropertiesToolSetup.getTool()) diff --git a/InnerDetector/InDetDigitization/SCT_Digitization/python/SCT_DigitizationConfigNew.py b/InnerDetector/InDetDigitization/SCT_Digitization/python/SCT_DigitizationConfigNew.py index 42db1199644560516599d2a8b94cad8888b64cc4..c3615af60448b45c3725e05979c35b96bf8521f8 100644 --- a/InnerDetector/InDetDigitization/SCT_Digitization/python/SCT_DigitizationConfigNew.py +++ b/InnerDetector/InDetDigitization/SCT_Digitization/python/SCT_DigitizationConfigNew.py @@ -15,6 +15,7 @@ from SiLorentzAngleTool.SCT_LorentzAngleConfig import SCT_LorentzAngleCfg from Digitization.TruthDigitizationOutputConfig import TruthDigitizationOutputCfg from Digitization.PileUpToolsConfig import PileUpToolsCfg +import AthenaCommon.SystemOfUnits as Units # The earliest and last bunch crossing times for which interactions will be sent # to the SCT Digitization code @@ -133,9 +134,9 @@ def SCT_SurfaceChargesGeneratorCfg(flags, name="SCT_SurfaceChargesGenerator", ** acc = ComponentAccumulator() kwargs.setdefault("FixedTime", -999) kwargs.setdefault("SubtractTime", -999) - kwargs.setdefault("SurfaceDriftTime", 10) + kwargs.setdefault("SurfaceDriftTime", 10*Units.ns) kwargs.setdefault("NumberOfCharges", 1) - kwargs.setdefault("SmallStepLength", 5) + kwargs.setdefault("SmallStepLength", 5*Units.micrometer) kwargs.setdefault("DepletionVoltage", 70) kwargs.setdefault("BiasVoltage", 150) kwargs.setdefault("isOverlay", flags.Detector.Overlay) diff --git a/InnerDetector/InDetDigitization/SCT_Digitization/src/SCT_SurfaceChargesGenerator.cxx b/InnerDetector/InDetDigitization/SCT_Digitization/src/SCT_SurfaceChargesGenerator.cxx index d8a74cebf9eeac1f88090e886eda806ab81c1ad9..afbcb52c9653b4a8f36c67b5e80a348b7b717742 100644 --- a/InnerDetector/InDetDigitization/SCT_Digitization/src/SCT_SurfaceChargesGenerator.cxx +++ b/InnerDetector/InDetDigitization/SCT_Digitization/src/SCT_SurfaceChargesGenerator.cxx @@ -22,7 +22,6 @@ #include "CLHEP/Geometry/Point3D.h" #include "CLHEP/Random/RandomEngine.h" #include "CLHEP/Random/RandGaussZiggurat.h" -#include "CLHEP/Units/SystemOfUnits.h" // C++ Standard Library #include <cmath> @@ -130,9 +129,6 @@ StatusCode SCT_SurfaceChargesGenerator::initialize() { } /////////////////////////////////////////////////// - m_smallStepLength.setValue(m_smallStepLength.value() * CLHEP::micrometer); - m_tSurfaceDrift.setValue(m_tSurfaceDrift.value() * CLHEP::ns); - // Surface drift time calculation Stuff m_tHalfwayDrift = m_tSurfaceDrift * 0.5; m_distHalfInterStrip = m_distInterStrip * 0.5; diff --git a/InnerDetector/InDetDigitization/SCT_Digitization/src/SCT_SurfaceChargesGenerator.h b/InnerDetector/InDetDigitization/SCT_Digitization/src/SCT_SurfaceChargesGenerator.h index e790cef3220c209a3a296abefb1ad07199e88d29..a6a89fabcdc0d2883aa31a48fe56b084ac48b865 100644 --- a/InnerDetector/InDetDigitization/SCT_Digitization/src/SCT_SurfaceChargesGenerator.h +++ b/InnerDetector/InDetDigitization/SCT_Digitization/src/SCT_SurfaceChargesGenerator.h @@ -48,6 +48,9 @@ #include "GaudiKernel/ServiceHandle.h" #include "GaudiKernel/ToolHandle.h" +// CLHEP +#include "CLHEP/Units/SystemOfUnits.h" + #include <iostream> // Charges and hits @@ -104,10 +107,10 @@ class SCT_SurfaceChargesGenerator : public extends<AthAlgTool, ISCT_SurfaceCharg bool chargeIsTrapped(double spess, const InDetDD::SiDetectorElement* element, double& trap_pos, double& drift_time) const; IntegerProperty m_numberOfCharges{this, "NumberOfCharges", 1, "number of charges"}; - FloatProperty m_smallStepLength{this, "SmallStepLength", 5, "max internal step along the larger G4 step"}; + FloatProperty m_smallStepLength{this, "SmallStepLength", 5 * CLHEP::micrometer, "max internal step along the larger G4 step"}; /** related to the surface drift */ - FloatProperty m_tSurfaceDrift{this, "SurfaceDriftTime", 10, "max surface drift time"}; + FloatProperty m_tSurfaceDrift{this, "SurfaceDriftTime", 10 * CLHEP::ns, "max surface drift time"}; FloatProperty m_tfix{this, "FixedTime", -999., "fixed time"}; FloatProperty m_tsubtract{this, "SubtractTime", -999., "subtract drift time from mid gap"}; diff --git a/InnerDetector/InDetEventCnv/InDetEventAthenaPool/CMakeLists.txt b/InnerDetector/InDetEventCnv/InDetEventAthenaPool/CMakeLists.txt index 20f9493414f8aa5153d05ffec31f3b23d8ac7e8e..1ad7e645715af8a941645d7fccc4f2a0fc124aac 100644 --- a/InnerDetector/InDetEventCnv/InDetEventAthenaPool/CMakeLists.txt +++ b/InnerDetector/InDetEventCnv/InDetEventAthenaPool/CMakeLists.txt @@ -42,7 +42,7 @@ atlas_install_joboptions( share/*.py ) find_package( AthenaPoolUtilitiesTest ) if( ATHENAPOOLUTILITIESTEST_FOUND ) set( INDETEVENTATHENAPOOL_REFERENCE_TAG - InDetEventAthenaPoolReference-01-00-00 ) + InDetEventAthenaPoolReference-02-00-00 ) run_tpcnv_legacy_test( InDetEventTPCnv_16.6.2.1 ESD-16.6.2.1 REFERENCE_TAG ${INDETEVENTATHENAPOOL_REFERENCE_TAG} ) else() diff --git a/InnerDetector/InDetEventCnv/TRT_RawDataByteStreamCnv/src/TRT_RodDecoder.cxx b/InnerDetector/InDetEventCnv/TRT_RawDataByteStreamCnv/src/TRT_RodDecoder.cxx index ef075ad8c416a6f51c45fb27db7c8cf50efec533..e4ef27f56482a6e14dd3c1ceb9862239636fa695 100644 --- a/InnerDetector/InDetEventCnv/TRT_RawDataByteStreamCnv/src/TRT_RodDecoder.cxx +++ b/InnerDetector/InDetEventCnv/TRT_RawDataByteStreamCnv/src/TRT_RodDecoder.cxx @@ -54,7 +54,6 @@ TRT_RodDecoder::TRT_RodDecoder m_lookAtMissingErrors ( true ), m_loadCompressTableFile ( false ), m_loadCompressTableDB ( true ), - m_compressTableFolder ( "/TRT/Onl/ROD/Compress" ), m_maxCompressionVersion ( 255 ), m_forceRodVersion ( -1 ), m_trt_id ( nullptr ), @@ -248,8 +247,7 @@ StatusCode TRT_RodDecoder::finalize() { * ---------------------------------------------------------- */ StatusCode -TRT_RodDecoder::fillCollection ATLAS_NOT_THREAD_SAFE // Non-thread-safe function 'StatusCode TRT_RodDecoder::update()' called - ( const ROBFragment* robFrag, +TRT_RodDecoder::fillCollection ( const ROBFragment* robFrag, TRT_RDO_Container* rdoIdc, TRT_BSErrContainer* bsErr, const std::vector<IdentifierHash>* vecHash ) @@ -1700,8 +1698,7 @@ TableFilename * Read Compression Table from DB on IOV change */ StatusCode -TRT_RodDecoder::update ATLAS_NOT_THREAD_SAFE () // Non-thread-safe function 'AthenaAttributeList::AthenaAttributeList(const coral::AttributeList&)' called -{ +TRT_RodDecoder::update() { /* * function to update compression table when condDB data changes: @@ -1723,7 +1720,7 @@ TRT_RodDecoder::update ATLAS_NOT_THREAD_SAFE () // Non-thread-safe function 'Ath { t_CompressTable *Ctable = new t_CompressTable; - const AthenaAttributeList atrlist(catrIt->second); + const coral::AttributeList& atrlist = catrIt->second; Ctable->m_TableVersion = (atrlist)["Version"].data<cool::Int32>(); diff --git a/InnerDetector/InDetEventCnv/TRT_RawDataByteStreamCnv/src/TRT_RodDecoder.h b/InnerDetector/InDetEventCnv/TRT_RawDataByteStreamCnv/src/TRT_RodDecoder.h index 0a0d47657d6584da455bc365c9f182c2606f145c..d0b7b9bfc648f54445421689120ee1d6adf1e519 100644 --- a/InnerDetector/InDetEventCnv/TRT_RawDataByteStreamCnv/src/TRT_RodDecoder.h +++ b/InnerDetector/InDetEventCnv/TRT_RawDataByteStreamCnv/src/TRT_RodDecoder.h @@ -33,28 +33,7 @@ #include "AthenaPoolUtilities/CondAttrListCollection.h" #include "StoreGate/ReadCondHandleKey.h" - -/* /\* */ -/* * Cool Headers */ -/* *\/ */ -/* // COOL API include files (CoolKernel) */ -/* #include "CoolKernel/DatabaseId.h" */ -/* #include "CoolKernel/Exception.h" */ -/* #include "CoolKernel/IDatabaseSvc.h" */ -/* #include "CoolKernel/IDatabase.h" */ -/* #include "CoolKernel/IFolder.h" */ -/* #include "CoolKernel/IObject.h" */ -/* #include "CoolKernel/IObjectIterator.h" */ -/* #include "CoolKernel/Record.h" */ -/* #include "CoolKernel/RecordSpecification.h" */ -/* #include "CoolApplication/DatabaseSvcFactory.h" */ -/* // COOL API include files (CoolApplication) */ -/* #include "CoolApplication/Application.h" */ - -/* /\* */ -/* * Coral Headers */ -/* *\/ */ -/* #include "CoralBase/Attribute.h" */ +#include "CoralBase/Attribute.h" /* * Identifier @@ -124,10 +103,7 @@ public: bool m_loadCompressTableFile; bool m_loadCompressTableDB; std::vector<int> m_LoadCompressTableVersions; - std::string m_compressTableFolder; - // std::string m_compressTableFile; const int m_maxCompressionVersion; - // bool m_compressTableLoaded[16]; bool m_compressTableLoaded[256]; int m_forceRodVersion; diff --git a/InnerDetector/InDetExample/InDetBeamSpotExample/share/VxSplitValTemplate.py b/InnerDetector/InDetExample/InDetBeamSpotExample/share/VxSplitValTemplate.py index 7db9e525c08ffead89ddf5d269c35e61a8418843..6e30e669d6d1392b5e4037bfd7cd1a62e06ebaa4 100644 --- a/InnerDetector/InDetExample/InDetBeamSpotExample/share/VxSplitValTemplate.py +++ b/InnerDetector/InDetExample/InDetBeamSpotExample/share/VxSplitValTemplate.py @@ -228,14 +228,20 @@ InDetPrdAssociationTool = InDet__InDetPRD_AssociationToolGangedPixels(name ToolSvc += InDetPrdAssociationTool if InDetFlags.doPrintConfigurables: printfunc ( InDetPrdAssociationTool) - + +from InDetBoundaryCheckTool.InDetBoundaryCheckToolConf import InDet__InDetBoundaryCheckTool +InDetBoundaryCheckTool = InDet__InDetBoundaryCheckTool( + name="InDetBoundaryCheckTool", + UsePixel=DetFlags.haveRIO.pixel_on(), + UseSCT=DetFlags.haveRIO.SCT_on() +) +ToolSvc += InDetBoundaryCheckTool + from InDetTrackHoleSearch.InDetTrackHoleSearchConf import InDet__InDetTrackHoleSearchTool InDetHoleSearchTool = InDet__InDetTrackHoleSearchTool(name = "InDetHoleSearchTool", Extrapolator = InDetExtrapolator, - usePixel = DetFlags.haveRIO.pixel_on(), - useSCT = DetFlags.haveRIO.SCT_on()) -InDetHoleSearchTool.SctSummaryTool = None - + BoundaryCheckTool=InDetBoundaryCheckTool) + ToolSvc += InDetHoleSearchTool if InDetFlags.doPrintConfigurables: printfunc ( InDetHoleSearchTool) diff --git a/InnerDetector/InDetExample/InDetRecExample/python/TrackingCommon.py b/InnerDetector/InDetExample/InDetRecExample/python/TrackingCommon.py index de8e47974b79935a896ebc1925a654d03e4dd15d..84f5ebc4b79abb4d858049f600c0f3190f606cb7 100644 --- a/InnerDetector/InDetExample/InDetRecExample/python/TrackingCommon.py +++ b/InnerDetector/InDetExample/InDetRecExample/python/TrackingCommon.py @@ -839,6 +839,27 @@ def_InDetSCT_ConditionsSummaryTool=None def getInDetSCT_ConditionsSummaryTool() : return def_InDetSCT_ConditionsSummaryTool +@makePublicTool +def getInDetBoundaryCheckTool(name="InDetBoundarySearchTool", **kwargs): + the_name = makeName(name, kwargs) + from AthenaCommon.DetFlags import DetFlags + from InDetRecExample.InDetJobProperties import InDetFlags + + if 'SctSummaryTool' not in kwargs : + kwargs = setDefaults( kwargs, SctSummaryTool = getInDetSCT_ConditionsSummaryTool() if DetFlags.haveRIO.SCT_on() else None) + + if 'PixelLayerTool' not in kwargs : + kwargs = setDefaults( kwargs, PixelLayerTool = getInDetTestPixelLayerTool()) + + kwargs = setDefaults( + kwargs, + UsePixel=DetFlags.haveRIO.pixel_on(), + UseSCT=DetFlags.haveRIO.SCT_on(), + ) + + from InDetBoundaryCheckTool.InDetBoundaryCheckToolConf import InDet__InDetBoundaryCheckTool + return InDet__InDetBoundaryCheckTool(name=the_name, **kwargs) + @makePublicTool def getInDetHoleSearchTool(name = 'InDetHoleSearchTool', **kwargs) : the_name = makeName( name, kwargs) @@ -848,18 +869,13 @@ def getInDetHoleSearchTool(name = 'InDetHoleSearchTool', **kwargs) : if 'Extrapolator' not in kwargs : kwargs = setDefaults( kwargs, Extrapolator = getInDetExtrapolator()) - if 'SctSummaryTool' not in kwargs : - kwargs = setDefaults( kwargs, SctSummaryTool = getInDetSCT_ConditionsSummaryTool() if DetFlags.haveRIO.SCT_on() else None) - - if 'PixelLayerTool' not in kwargs : - kwargs = setDefaults( kwargs, PixelLayerTool = getInDetTestPixelLayerTool()) + if 'BoundaryCheckTool' not in kwargs : + kwargs = setDefaults( kwargs, BoundaryCheckTool= getInDetBoundaryCheckTool()) if InDetFlags.doCosmics : kwargs = setDefaults( kwargs, Cosmics = True) kwargs = setDefaults( kwargs, - usePixel = DetFlags.haveRIO.pixel_on(), - useSCT = DetFlags.haveRIO.SCT_on(), CountDeadModulesAfterLastHit = True) from InDetTrackHoleSearch.InDetTrackHoleSearchConf import InDet__InDetTrackHoleSearchTool diff --git a/InnerDetector/InDetExample/InDetTrigRecExample/python/InDetTrigConfigRecLoadTools.py b/InnerDetector/InDetExample/InDetTrigRecExample/python/InDetTrigConfigRecLoadTools.py index 11b940938dadcdad1c2283febee86cf2e5304846..cedfd5bd811585e4e3636ba8d9062b440bff8363 100755 --- a/InnerDetector/InDetExample/InDetTrigRecExample/python/InDetTrigConfigRecLoadTools.py +++ b/InnerDetector/InDetExample/InDetTrigRecExample/python/InDetTrigConfigRecLoadTools.py @@ -664,6 +664,16 @@ if InDetTrigFlags.loadSummaryTool(): if (InDetTrigFlags.doPrintConfigurables()): print ( InDetTrigTestPixelLayerTool) + from InDetBoundaryCheckTool.InDetBoundaryCheckToolConf import InDet__InDetBoundaryCheckTool + InDetTrigBoundaryCheckTool = InDet__InDetBoundaryCheckTool( + name="InDetTrigBoundaryCheckTool", + UsePixel=DetFlags.haveRIO.pixel_on(), + UseSCT=DetFlags.haveRIO.SCT_on(), + SctSummaryTool = InDetTrigSCTConditionsSummaryTool, + PixelLayerTool=InDetTrigTestPixelLayerTool + ) + ToolSvc += InDetTrigBoundaryCheckTool + # # Loading Configurable HoleSearchTool @@ -672,10 +682,7 @@ if InDetTrigFlags.loadSummaryTool(): InDetTrigHoleSearchTool = InDet__InDetTrackHoleSearchTool(name = "InDetTrigHoleSearchTool", Extrapolator = InDetTrigExtrapolator, - usePixel = DetFlags.haveRIO.pixel_on(), - useSCT = DetFlags.haveRIO.SCT_on(), - SctSummaryTool = InDetTrigSCTConditionsSummaryTool, - PixelLayerTool=InDetTrigTestPixelLayerTool, + BoundaryCheckTool=InDetTrigBoundaryCheckTool ) #Commissioning = InDetTrigFlags.doCommissioning()) #renamed InDetTrigHoleSearchTool.CountDeadModulesAfterLastHit = True diff --git a/InnerDetector/InDetExample/InDetTrigRecExample/python/TrigInDetConfiguredVtxCuts.py b/InnerDetector/InDetExample/InDetTrigRecExample/python/TrigInDetConfiguredVtxCuts.py new file mode 100644 index 0000000000000000000000000000000000000000..e1d891932927d63777bd129f6df1807e0a1ca457 --- /dev/null +++ b/InnerDetector/InDetExample/InDetTrigRecExample/python/TrigInDetConfiguredVtxCuts.py @@ -0,0 +1,178 @@ +# +# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration +# + +from __future__ import print_function + +import AthenaCommon.SystemOfUnits as Units + + + +class ConfiguredTrigVtxCuts(): +# """docstring for ConfiguredTrigVtxCuts""" + def __init__(self, mode = ""): + self.__mode = mode + + # Cut level for the track selection tool. + self.__TrackCutLevel = "NoCut" + + # this is cutLevel = 1 + self.__minPT = 400. * Units.MeV + self.__IPd0Max = 4. # = 4. for useBeamConstraint()==true, = 10. for useBeamConstraint()==false + self.__IPz0Max = 1000. + self.__z0Max = 1000. + self.__sigIPd0Max = 5. + self.__sigIPz0Max = 10. + self.__d0significanceMax = -1. + self.__z0significanceMax = -1. + self.__etaMax = 9999. + + #cluster and track quality cuts + self.__useTrackSummaryInfo = True + self.__nHitInnermostLayer = 0 + self.__nHitPix = 1 + self.__nHolesPix = 1 + self.__nHitSct = 4 + self.__nHitSi = 6 + self.__nHitTrt = 0 + self.__nHitTrtHighEFractionMax = 1 + self.__nHitTrtHighEFractionWithOutliersMax = 1 + self.__useSharedHitInfo = False + self.__useTrackQualityInfo = False + self.__fitChi2OnNdfMax = 3.5 + self.__TrtMaxEtaAcceptance = 1.9 + + #cuts ONLY relevant to InDetPriVxFinder + Full or Fast or similar + self.__chi2CutMethod = 2 + self.__enableMultipleVertices = True + + self.__doMaxTracksCut = True + self.__MaxTracks = 3000 #Not applied anyway if above false + +# self.__indetflags = InDetFlags #TODO: implement or find InDetJobProperties + + def mode( self ) : + return self.__mode + + def TrackCutLevel( self ) : + return self.__TrackCutLevel + + def minPT( self ) : + return self.__minPT + + def IPd0Max( self ) : + return self.__IPd0Max + + def IPz0Max( self ) : + return self.__IPz0Max + + def z0Max( self ) : + return self.__z0Max + + def sigIPd0Max( self ) : + return self.__sigIPd0Max + + def sigIPz0Max( self ) : + return self.__sigIPz0Max + + def d0significanceMax( self ) : + return self.__d0significanceMax + + def z0significanceMax( self ) : + return self.__z0significanceMax + + def etaMax( self ) : + return self.__etaMax + + def useTrackSummaryInfo( self ) : + return self.__useTrackSummaryInfo + + def nHitInnermostLayer( self ) : + return self.__nHitInnermostLayer + + def nHitPix( self ): + return self.__nHitPix + + def nHitSct( self ): + return self.__nHitSct + + def nHitSi( self ): + return self.__nHitSi + + def nHitTrt( self ): + return self.__nHitTrt + + def nHitTrtHighEFractionMax(self): + return self.__nHitTrtHighEFractionMax + + def nHitTrtHighEFractionWithOutliersMax(self): + return self.__nHitTrtHighEFractionWithOutliersMax + + def useSharedHitInfo(self): + return self.__useSharedHitInfo + + def useTrackQualityInfo(self): + return self.__useTrackQualityInfo + + def fitChi2OnNdfMax(self): + return self.__fitChi2OnNdfMax + + def TrtMaxEtaAcceptance(self): + return self.__TrtMaxEtaAcceptance + + def MaxChi2PerTrack(self): + return self.__maxChi2PerTrack + + def nHolesPix(self): + return self.__nHolesPix + + def chi2CutMethod(self): + return self.__chi2CutMethod + + def enableMultipleVertices(self): + return self.__enableMultipleVertices + + def doMaxTracksCut(self): + return self.__doMaxTracksCut + + def MaxTracks(self): + return self.__MaxTracks + + def printInfo( self ) : + print('****** Inner Detector Primary Vertex Reconstruction Cuts ****************************') + print('*') + print('* mode is : ' + self.__mode) + #print('* cut level for primary vertexing is : ' + self.__indetflags.priVtxCutLevel()) + print('*') + print('* Track Cut Level : ' + self.__TrackCutLevel) + print('*') + print('* min pT : ' + str(self.__minPT) + ' MeV') + print('* Max IP d0 : ' + str(self.__IPd0Max)) + print('* Max IP Z0 : ' + str(self.__IPz0Max)) + print('* Max z0 : ' + str(self.__z0Max)) + print('* Max Sig IP d0 : ' + str(self.__sigIPd0Max)) + print('* Max Sig IP z0 : ' + str(self.__sigIPz0Max)) + print('* Max Sig d0 : ' + str(self.__d0significanceMax)) + print('* Max Sig z0 : ' + str(self.__z0significanceMax)) + print('* Max eta : ' + str(self.__etaMax)) + +#cluster and track quality cuts + print('* Use TrackSummary : ' + str(self.__useTrackSummaryInfo)) + print('* Min N Innermost Layer Hits : ' + str(self.__nHitInnermostLayer)) + print('* Min N Pix Hit : ' + str(self.__nHitPix)) + print('* Max N Pix Holes : ' + str(self.__nHolesPix)) + print('* Min N SCT Hits : ' + str(self.__nHitSct)) + print('* Min N Si Hits : ' + str(self.__nHitSi)) + print('* Min N TRT Hits : ' + str(self.__nHitTrt)) + print('* Min N high threshold hits TRT : ' + str(self.__nHitTrtHighEFractionMax)) + print('* Min N high threshold hits TRT (incl. outliers) : ' + str(self.__nHitTrtHighEFractionWithOutliersMax)) + print('* Use shared hit info : ' + str(self.__useSharedHitInfo)) + print('* Use Track Quality info : ' + str(self.__useTrackQualityInfo)) + print('* Chi2/ndf of the fit : ' + str(self.__fitChi2OnNdfMax)) + print('* TRT Max eta : ' + str(self.__TrtMaxEtaAcceptance)) + print('*') + print('* Chi2 cut method : ' + str(self.__chi2CutMethod )) + print('* Enable Multiple Vertices : ' + str(self.__enableMultipleVertices) ) + print('*') + print('***********************************************************************************') + diff --git a/InnerDetector/InDetMonitoring/SCT_Monitoring/python/TrackSummaryToolWorkaround.py b/InnerDetector/InDetMonitoring/SCT_Monitoring/python/TrackSummaryToolWorkaround.py index ee832c2c61adc3f7004c37500a6c863731631d2e..c589bb357c64fc53953358605719dec1cb327c62 100644 --- a/InnerDetector/InDetMonitoring/SCT_Monitoring/python/TrackSummaryToolWorkaround.py +++ b/InnerDetector/InDetMonitoring/SCT_Monitoring/python/TrackSummaryToolWorkaround.py @@ -75,12 +75,17 @@ def TrackSummaryToolWorkaround(flags): CheckDeadRegions=True, CheckDisabledFEs=True) result.addPublicTool(InDetTestPixelLayerTool) + InDetBoundaryCheckTool = CompFactory.InDet.InDetBoundaryCheckTool( + name="InDetBoundaryCheckTool", + UsePixel=flags.Detector.GeometryPixel, + UseSCT=flags.Detector.GeometrySCT, + PixelLayerTool=InDetTestPixelLayerTool + ) + result.addPublicTool(InDetBoundaryCheckTool) InDetHoleSearchTool = CompFactory.InDet.InDetTrackHoleSearchTool(name = "InDetHoleSearchTool", Extrapolator = InDetExtrapolator, - usePixel = flags.Detector.GeometryPixel, - useSCT = flags.Detector.GeometrySCT, CountDeadModulesAfterLastHit = True, - PixelLayerTool = InDetTestPixelLayerTool) + BoundaryCheckTool=InDetBoundaryCheckTool) result.addPublicTool(InDetHoleSearchTool) InDetPrdAssociationTool = CompFactory.InDet.InDetPRD_AssociationToolGangedPixels(name = "InDetPrdAssociationTool", PixelClusterAmbiguitiesMapName = "PixelClusterAmbiguitiesMap", diff --git a/InnerDetector/InDetMonitoring/SCT_Monitoring/share/SCTMonitor_topOptions.py b/InnerDetector/InDetMonitoring/SCT_Monitoring/share/SCTMonitor_topOptions.py index de531d151c97749409d9288ec80270443784ad68..482b645bea914022095c018c8bec10699edf3ab8 100644 --- a/InnerDetector/InDetMonitoring/SCT_Monitoring/share/SCTMonitor_topOptions.py +++ b/InnerDetector/InDetMonitoring/SCT_Monitoring/share/SCTMonitor_topOptions.py @@ -143,14 +143,22 @@ InDetSCT_FlaggedConditionTool = sct_FlaggedConditionToolSetup.getTool() SCTHitEffMonTool.FlaggedConditionTool = InDetSCT_FlaggedConditionTool SCTHitEffMonTool.ChronoTime = False + +from InDetBoundaryCheckTool.InDetBoundaryCheckToolConf import InDet__InDetBoundaryCheckTool +SCT_MonBoundaryCheckTool = InDet__InDetBoundaryCheckTool( + name="SCT_MonBoundaryCheckTool", + SctSummaryTool=SCT_MonConditionsSummaryTool +) +ToolSvc += SCT_MonBoundaryCheckTool + from InDetTrackHoleSearch.InDetTrackHoleSearchConf import InDet__InDetTrackHoleSearchTool SCT_MonHoleSearch = InDet__InDetTrackHoleSearchTool(name ="SCT_MonHoleSearch", Extrapolator = InDetExtrapolator, ExtendedListOfHoles = True, Cosmics =InDetFlags.doCosmics(), - SctSummaryTool=SCT_MonConditionsSummaryTool) - + BoundaryCheckTool=SCT_MonBoundaryCheckTool) + ToolSvc += SCT_MonHoleSearch if (InDetFlags.doPrintConfigurables()): print SCT_MonHoleSearch diff --git a/InnerDetector/InDetRecAlgs/InDetPrepRawDataFormation/CMakeLists.txt b/InnerDetector/InDetRecAlgs/InDetPrepRawDataFormation/CMakeLists.txt index 2572ba80199fe8fc041b24907b38141c231f183c..e56930e1b11b2133752b6646c0869afd4f177cf8 100644 --- a/InnerDetector/InDetRecAlgs/InDetPrepRawDataFormation/CMakeLists.txt +++ b/InnerDetector/InDetRecAlgs/InDetPrepRawDataFormation/CMakeLists.txt @@ -19,6 +19,7 @@ atlas_depends_on_subdirs( PUBLIC PRIVATE Control/AthViews DetectorDescription/AtlasDetDescr + Trigger/TrigSteer/ViewAlgs InnerDetector/InDetDetDescr/InDetIdentifier InnerDetector/InDetDetDescr/InDetReadoutGeometry InnerDetector/InDetRecTools/TRT_DriftCircleTool @@ -30,7 +31,7 @@ atlas_depends_on_subdirs( PUBLIC atlas_add_component( InDetPrepRawDataFormation src/*.cxx src/components/*.cxx - LINK_LIBRARIES AthenaBaseComps StoreGateLib SGtests IRegionSelector Identifier GaudiKernel InDetRawData InDetPrepRawData SiClusterizationToolLib TrigSteeringEvent AtlasDetDescr InDetIdentifier InDetReadoutGeometry InDetByteStreamErrors AthViews SCT_ConditionsData TRT_DriftCircleToolLib ) + LINK_LIBRARIES AthenaBaseComps StoreGateLib SGtests IRegionSelector Identifier GaudiKernel InDetRawData InDetPrepRawData SiClusterizationToolLib TrigSteeringEvent AtlasDetDescr InDetIdentifier InDetReadoutGeometry InDetByteStreamErrors AthViews SCT_ConditionsData TRT_DriftCircleToolLib ViewAlgsLib ) # Install files from the package: atlas_install_headers( InDetPrepRawDataFormation ) diff --git a/InnerDetector/InDetRecAlgs/InDetPrepRawDataFormation/src/CacheCreator.cxx b/InnerDetector/InDetRecAlgs/InDetPrepRawDataFormation/src/CacheCreator.cxx index 2421142ed68c7dfb41e2241ef85c4df8f2c09478..c1b898082ee941c13083041f097bf7cb1ba490fc 100644 --- a/InnerDetector/InDetRecAlgs/InDetPrepRawDataFormation/src/CacheCreator.cxx +++ b/InnerDetector/InDetRecAlgs/InDetPrepRawDataFormation/src/CacheCreator.cxx @@ -14,50 +14,39 @@ Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration namespace InDet{ CacheCreator::CacheCreator(const std::string &name, ISvcLocator *pSvcLocator) : - AthReentrantAlgorithm(name,pSvcLocator), + IDCCacheCreatorBase(name,pSvcLocator), m_pTRTHelper(nullptr), m_pix_idHelper(nullptr), - m_sct_idHelper(nullptr), - m_disableWarningCheck(false) + m_sct_idHelper(nullptr) { } StatusCode CacheCreator::initialize(){ - ATH_CHECK( m_rioContainerCacheKey.initialize(!m_rioContainerCacheKey.key().empty()) ); - ATH_CHECK( m_SCTclusterContainerCacheKey.initialize(!m_SCTclusterContainerCacheKey.key().empty()) ); - ATH_CHECK( m_PIXclusterContainerCacheKey.initialize(!m_PIXclusterContainerCacheKey.key().empty()) ); - ATH_CHECK( m_PIXSpacePointCacheKey.initialize(!m_PIXSpacePointCacheKey.key().empty()) ); - ATH_CHECK( m_SCTSpacePointCacheKey.initialize(!m_SCTSpacePointCacheKey.key().empty()) ); - ATH_CHECK( m_SCTRDOCacheKey.initialize(!m_SCTRDOCacheKey.key().empty()) ); - ATH_CHECK( m_SCTBSErrCacheKey.initialize(!m_SCTBSErrCacheKey.key().empty()) ); - ATH_CHECK( m_PixRDOCacheKey.initialize(!m_PixRDOCacheKey.key().empty()) ); - ATH_CHECK( m_PixBSErrCacheKey.initialize(!m_PixBSErrCacheKey.key().empty()) ); + ATH_CHECK( m_rioContainerCacheKey.initialize(SG::AllowEmpty) ); + ATH_CHECK( m_SCTclusterContainerCacheKey.initialize(SG::AllowEmpty) ); + ATH_CHECK( m_PIXclusterContainerCacheKey.initialize(SG::AllowEmpty) ); + ATH_CHECK( m_PIXSpacePointCacheKey.initialize(SG::AllowEmpty) ); + ATH_CHECK( m_SCTSpacePointCacheKey.initialize(SG::AllowEmpty) ); + ATH_CHECK( m_SCTRDOCacheKey.initialize(SG::AllowEmpty) ); + ATH_CHECK( m_SCTBSErrCacheKey.initialize(SG::AllowEmpty) ); + ATH_CHECK( m_PixRDOCacheKey.initialize(SG::AllowEmpty) ); + ATH_CHECK( m_PixBSErrCacheKey.initialize(SG::AllowEmpty) ); if (!m_disableTRT.value()) ATH_CHECK(detStore()->retrieve(m_pTRTHelper , "TRT_ID")); ATH_CHECK(detStore()->retrieve(m_sct_idHelper, "SCT_ID")); ATH_CHECK(detStore()->retrieve(m_pix_idHelper, "PixelID")); + if(m_disableWarning) m_disableWarningCheck.store(true, std::memory_order_relaxed); return StatusCode::SUCCESS; } CacheCreator::~CacheCreator() {} - bool CacheCreator::isInsideView(const EventContext& context) const - { - const IProxyDict* proxy = Atlas::getExtendedEventContext(context).proxy(); - const SG::View* view = dynamic_cast<const SG::View*>(proxy); - return view != nullptr; - } + StatusCode CacheCreator::execute (const EventContext& ctx) const { - if (!m_disableWarningCheck and !m_disableWarning.value()){ - if (isInsideView(ctx)){ - ATH_MSG_ERROR("CacheCreator is running inside a view, this is probably a misconfiguration"); - return StatusCode::FAILURE; - } - m_disableWarningCheck = true; //only check once - } + ATH_CHECK(checkInsideViewOnce(ctx)); if (!m_disableTRT.value()) ATH_CHECK(createContainer(m_rioContainerCacheKey, m_pTRTHelper->straw_layer_hash_max(), ctx)); @@ -75,7 +64,7 @@ namespace InDet{ ATH_CHECK(createContainer(m_PixRDOCacheKey, m_pix_idHelper->wafer_hash_max(), ctx)); - ATH_CHECK(createValueContainer(m_PixBSErrCacheKey, m_pix_idHelper->wafer_hash_max(), ctx, std::numeric_limits<uint64_t>::min())); + ATH_CHECK(createValueContainer(m_PixBSErrCacheKey, m_pix_idHelper->wafer_hash_max(), ctx, std::numeric_limits<uint64_t>::min())); return StatusCode::SUCCESS; } diff --git a/InnerDetector/InDetRecAlgs/InDetPrepRawDataFormation/src/CacheCreator.h b/InnerDetector/InDetRecAlgs/InDetPrepRawDataFormation/src/CacheCreator.h index b21bc974c6181d8db63afb0d000bfd6cd007a429..e666b0e246dfc2534dafdfa7f4eb531949c0f932 100644 --- a/InnerDetector/InDetRecAlgs/InDetPrepRawDataFormation/src/CacheCreator.h +++ b/InnerDetector/InDetRecAlgs/InDetPrepRawDataFormation/src/CacheCreator.h @@ -11,7 +11,7 @@ Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration #ifndef INDETPREPRAWDATAFORMATION_CACHECREATOR #define INDETPREPRAWDATAFORMATION_CACHECREATOR -#include "AthenaBaseComps/AthReentrantAlgorithm.h" +#include "ViewAlgs/IDCCacheCreatorBase.h" #include "InDetPrepRawData/PixelClusterContainer.h" #include "InDetPrepRawData/TRT_DriftCircleContainer.h" #include "InDetPrepRawData/SCT_ClusterContainer.h" @@ -20,18 +20,13 @@ Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration #include "InDetRawData/PixelRDO_Container.h" #include "InDetByteStreamErrors/IDCInDetBSErrContainer.h" - -#include "AthenaPoolUtilities/CondAttrListCollection.h" - -#include <atomic> - class TRT_ID; class PixelID; class SCT_ID; namespace InDet{ - class CacheCreator : public AthReentrantAlgorithm + class CacheCreator : public IDCCacheCreatorBase { public: @@ -65,41 +60,8 @@ namespace InDet{ BooleanProperty m_disableTRT{this, "disableTRT", false}; BooleanProperty m_disableWarning{this, "DisableViewWarning", false}; - mutable std::atomic_bool m_disableWarningCheck; - //Temporary workarounds for problem in scheduler - remove later - bool isInsideView(const EventContext&) const; - template<typename T> - StatusCode createContainer(const SG::WriteHandleKey<T>& , long unsigned int , const EventContext& ) const; - template<typename T, typename X> - StatusCode createValueContainer(const SG::WriteHandleKey<T>& , long unsigned int , const EventContext&, const X& defaultValue ) const; - }; - - template<typename T> - StatusCode CacheCreator::createContainer(const SG::WriteHandleKey<T>& containerKey, long unsigned int size, const EventContext& ctx) const{ - static_assert(std::is_base_of<EventContainers::IdentifiableCacheBase, T>::value, "Expects a IdentifiableCache Class" ); - if(containerKey.key().empty()){ - ATH_MSG_DEBUG( "Creation of container "<< containerKey.key() << " is disabled (no name specified)"); - return StatusCode::SUCCESS; - } - SG::WriteHandle<T> ContainerCacheKey(containerKey, ctx); - ATH_CHECK( ContainerCacheKey.recordNonConst ( std::make_unique<T>(IdentifierHash(size), nullptr) )); - ATH_MSG_DEBUG( "Container "<< containerKey.key() << " created to hold " << size ); - return StatusCode::SUCCESS; - } - - template<typename T, typename X> - StatusCode CacheCreator::createValueContainer(const SG::WriteHandleKey<T>& containerKey, long unsigned int size, const EventContext& ctx, const X& defaultValue) const{ - static_assert(std::is_base_of<IdentifiableValueCache<X>, T>::value, "Expects a IdentifiableValueCache Class" ); - if(containerKey.key().empty()){ - ATH_MSG_DEBUG( "Creation of container "<< containerKey.key() << " is disabled (no name specified)"); - return StatusCode::SUCCESS; - } - SG::WriteHandle<T> ContainerCacheKey(containerKey, ctx); - ATH_CHECK( ContainerCacheKey.recordNonConst ( std::make_unique<T>(size, defaultValue) )); - ATH_MSG_DEBUG( "ValueContainer "<< containerKey.key() << " created to hold " << size ); - return StatusCode::SUCCESS; - } + }; } diff --git a/InnerDetector/InDetRecAlgs/InDetPriVxFinder/python/InDetPriVxFinderMonitoring.py b/InnerDetector/InDetRecAlgs/InDetPriVxFinder/python/InDetPriVxFinderMonitoring.py index b77583df96d60d823188415bd36f5cd9ed1b8519..0828c432589ff2756b17b3e05d64aaaa2dc45fb1 100644 --- a/InnerDetector/InDetRecAlgs/InDetPriVxFinder/python/InDetPriVxFinderMonitoring.py +++ b/InnerDetector/InDetRecAlgs/InDetPriVxFinder/python/InDetPriVxFinderMonitoring.py @@ -2,8 +2,12 @@ from AthenaMonitoringKernel.GenericMonitoringTool import GenericMonitoringTool def InDetPriVxFinderMonitoringTool(): newMonTool = GenericMonitoringTool("PriVxMonTool") - newMonTool.defineHistogram('numTracks' , type='TH1F',path='EXPERT',title="Number of Input Tracks", xbins=200, xmin=0., xmax=200) - newMonTool.defineHistogram('numVertices', type='TH1F',path='EXPERT',title="Number of Vertices ", xbins=100, xmin=0., xmax=100) + + newMonTool.defineHistogram('allVertexNTracks' , type='TH1I',path='EXPERT',title="N of Input Tracks of all vertices" , xbins=50, xmin=0., xmax=50) + newMonTool.defineHistogram('primVertexNTracks' , type='TH1I',path='EXPERT',title="N of Input Tracks of primary vertices", xbins=50, xmin=0., xmax=50) + + newMonTool.defineHistogram('NVertices', type='TH1I',path='EXPERT',title="N of Vertices ", xbins=50, xmin=0., xmax=50) + #All vertices X vs Y position newMonTool.defineHistogram('allVertexZ', type='TH1F',path='EXPERT',title="All Vertex Z position", xbins=400, xmin=-50., xmax=50) @@ -17,9 +21,9 @@ def InDetPriVxFinderMonitoringTool(): #Just primary vertex - newMonTool.defineHistogram('primVertexZ', type='TH1F',path='EXPERT',title="All Vertex Z position", xbins=400, xmin=-50., xmax=50) - newMonTool.defineHistogram('primVertexChi2', type='TH1F',path='EXPERT',title="All Vertex Chi2 of the fit", xbins=100, xmin=0., xmax=10) - newMonTool.defineHistogram('primVertexnDoF', type='TH1F',path='EXPERT',title="All Vertex nDoF of the fit", xbins=100, xmin=0., xmax=10) + newMonTool.defineHistogram('primVertexZ', type='TH1F',path='EXPERT',title="Primary Vertex Z position", xbins=400, xmin=-50., xmax=50) + newMonTool.defineHistogram('primVertexChi2', type='TH1F',path='EXPERT',title="Primary Vertex Chi2 of the fit", xbins=100, xmin=0., xmax=10) + newMonTool.defineHistogram('primVertexnDoF', type='TH1F',path='EXPERT',title="Primary Vertex nDoF of the fit", xbins=100, xmin=0., xmax=10) newMonTool.defineHistogram('primVertexX, primVertexY',path='EXPERT', type='TH2F', title="Primary Vertex Y vs X; Vertex X [mm]; Vertex Y [mm]", diff --git a/InnerDetector/InDetRecAlgs/InDetPriVxFinder/src/InDetPriVxFinder.cxx b/InnerDetector/InDetRecAlgs/InDetPriVxFinder/src/InDetPriVxFinder.cxx index 3ce6d6ba6899b8c2c9b11de3eaec97c59cf24622..d508a6f4099afdb025b674bafbd1dedfa94ec4cf 100755 --- a/InnerDetector/InDetRecAlgs/InDetPriVxFinder/src/InDetPriVxFinder.cxx +++ b/InnerDetector/InDetRecAlgs/InDetPriVxFinder/src/InDetPriVxFinder.cxx @@ -109,104 +109,88 @@ namespace InDet { m_numEventsProcessed++; - auto numOfTracks = Monitored::Scalar<int>( "numTracks" , 0 ); - auto numOfVertices = Monitored::Scalar<int>( "numVertices" , 0 ); - SG::WriteHandle<xAOD::VertexContainer> outputVertices (m_vxCandidatesOutputName); - xAOD::VertexContainer* theXAODContainer = 0; - xAOD::VertexAuxContainer* theXAODAuxContainer = 0; - std::pair<xAOD::VertexContainer*,xAOD::VertexAuxContainer*> theXAODContainers - = std::make_pair( theXAODContainer, theXAODAuxContainer ); + xAOD::VertexContainer* vertexContainer = 0; + xAOD::VertexAuxContainer* vertexAuxContainer = 0; + std::pair< xAOD::VertexContainer*, xAOD::VertexAuxContainer* > vertexContainerPair + = std::make_pair( vertexContainer, vertexAuxContainer ); if(m_useTrackParticles){ SG::ReadHandle<xAOD::TrackParticleContainer> trackParticleCollection(m_tracksName); if(trackParticleCollection.isValid()){ - theXAODContainers = m_VertexFinderTool->findVertex ( trackParticleCollection.cptr() ); - numOfTracks = trackParticleCollection->size(); + vertexContainerPair = m_VertexFinderTool->findVertex ( trackParticleCollection.cptr() ); } else{ - ATH_MSG_DEBUG("No TrackParticle Collection with key "<<m_tracksName.key()<<" exists in StoreGate. No Vertexing Possible"); - return StatusCode::SUCCESS; + ATH_MSG_ERROR("No TrackParticle Collection with key "<<m_tracksName.key()<<" exists in StoreGate. No Vertexing Possible"); + return StatusCode::FAILURE; } } else{ SG::ReadHandle<TrackCollection> trackCollection(m_trkTracksName); if(trackCollection.isValid()){ - theXAODContainers = m_VertexFinderTool->findVertex ( trackCollection.cptr() ); - numOfTracks = trackCollection->size(); + vertexContainerPair = m_VertexFinderTool->findVertex ( trackCollection.cptr() ); } else{ - ATH_MSG_DEBUG("No Trk::Track Collection with key "<<m_trkTracksName.key()<<" exists in StoreGate. No Vertexing Possible"); - return StatusCode::SUCCESS; + ATH_MSG_ERROR("No Trk::Track Collection with key "<<m_trkTracksName.key()<<" exists in StoreGate. No Vertexing Possible"); + return StatusCode::FAILURE; } } - - - // now re-merge and resort the vertex container and store to SG xAOD::VertexContainer* myVertexContainer = 0; xAOD::VertexAuxContainer* myVertexAuxContainer = 0; - std::pair<xAOD::VertexContainer*, xAOD::VertexAuxContainer*> myVxContainers + std::pair<xAOD::VertexContainer*, xAOD::VertexAuxContainer* > myVertexContainerPair = std::make_pair( myVertexContainer, myVertexAuxContainer ); - - - if (theXAODContainers.first) { + + if (vertexContainerPair.first) { //sort xAOD::Vertex container - if(m_doVertexMerging && theXAODContainers.first->size() > 1) { - myVxContainers = m_VertexMergingTool->mergeVertexContainer( *theXAODContainers.first ); - delete theXAODContainers.first; //also cleans up the aux store - delete theXAODContainers.second; - theXAODContainers = myVxContainers; + if(m_doVertexMerging && vertexContainerPair.first->size() > 1) { + myVertexContainerPair = m_VertexMergingTool->mergeVertexContainer( *vertexContainerPair.first ); + delete vertexContainerPair.first; //also cleans up the aux store + delete vertexContainerPair.second; + vertexContainerPair = myVertexContainerPair; } - if (m_doVertexSorting && theXAODContainers.first->size() > 1) { - myVxContainers = m_VertexCollectionSortingTool->sortVertexContainer(*theXAODContainers.first); - delete theXAODContainers.first; //also cleans up the aux store - delete theXAODContainers.second; + if (m_doVertexSorting && vertexContainerPair.first->size() > 1) { + myVertexContainerPair = m_VertexCollectionSortingTool->sortVertexContainer(*vertexContainerPair.first); + delete vertexContainerPair.first; //also cleans up the aux store + delete vertexContainerPair.second; } else { - myVxContainers.first = theXAODContainers.first; - myVxContainers.second = theXAODContainers.second; + myVertexContainerPair.first = vertexContainerPair.first; + myVertexContainerPair.second = vertexContainerPair.second; } - if (myVxContainers.first == 0) { - ATH_MSG_WARNING("Vertex container has no associated store."); - return StatusCode::SUCCESS; + if (myVertexContainerPair.first == 0) { + ATH_MSG_ERROR("Vertex container has no associated store."); + return StatusCode::FAILURE; } - if (not myVxContainers.first->hasStore()) { - ATH_MSG_WARNING("Vertex container has no associated store."); - return StatusCode::SUCCESS; + if (not myVertexContainerPair.first->hasStore()) { + ATH_MSG_ERROR("Vertex container has no associated store."); + return StatusCode::FAILURE; } - ATH_MSG_DEBUG("Successfully reconstructed " << myVxContainers.first->size()-1 << " vertices (excluding dummy)"); - m_totalNumVerticesWithoutDummy += (myVxContainers.first->size()-1); - numOfVertices = m_totalNumVerticesWithoutDummy; + ATH_MSG_DEBUG("Successfully reconstructed " << myVertexContainerPair.first->size()-1 << " vertices (excluding dummy)"); + m_totalNumVerticesWithoutDummy += (myVertexContainerPair.first->size()-1); } - - //Loop over vertex container and monitor vertex parameters - for ( xAOD::VertexContainer::iterator vertexIter = myVxContainers.first->begin(); - vertexIter != myVxContainers.first->end(); ++vertexIter ) { - - monitor_vertex( "allVertex", **vertexIter); - - //This expects that vertices are already sorted by SumpT(or different criteria)!!! - if( vertexIter == myVxContainers.first->begin() ) monitor_vertex( "primVertex", **vertexIter); + ATH_CHECK(outputVertices.record(std::unique_ptr<xAOD::VertexContainer>(myVertexContainerPair.first),std::unique_ptr<xAOD::VertexAuxContainer>(myVertexContainerPair.second))); + + auto NVertices = Monitored::Scalar<int>( "NVertices" , 0 ); + for ( xAOD::VertexContainer::iterator vertexIter = myVertexContainerPair.first->begin(); + vertexIter != myVertexContainerPair.first->end(); ++vertexIter ) { + if((*vertexIter)->nTrackParticles() > 0 and (*vertexIter)->vertexType() != 0 ){ + NVertices++; + monitor_vertex( "allVertex", **vertexIter); + //This expects that vertices are already sorted by SumpT(or different criteria)!!! + if( vertexIter == myVertexContainerPair.first->begin() ) monitor_vertex( "primVertex", **vertexIter); + } } + auto mon = Monitored::Group( m_monTool, NVertices); - - - ATH_CHECK(outputVertices.record(std::unique_ptr<xAOD::VertexContainer>(myVxContainers.first),std::unique_ptr<xAOD::VertexAuxContainer>(myVxContainers.second))); - - - ATH_MSG_DEBUG( "Recorded Vertices with key: " << m_vxCandidatesOutputName.key() ); - - auto mon = Monitored::Group( m_monTool, numOfTracks, numOfVertices ); - return StatusCode::SUCCESS; } @@ -222,12 +206,26 @@ namespace InDet } void InDetPriVxFinder::monitor_vertex( const std::string &prefix, xAOD::Vertex vertex ){ - auto x = Monitored::Scalar<double>( prefix + "X", vertex.x() ); - auto y = Monitored::Scalar<double>( prefix + "Y", vertex.y() ); - auto z = Monitored::Scalar<double>( prefix + "Z", vertex.z() ); - auto chi2 = Monitored::Scalar<double>( prefix + "Chi2", vertex.chiSquared() ); - auto nDoF = Monitored::Scalar<double>( prefix + "nDoF", vertex.numberDoF() ); - auto mon = Monitored::Group(m_monTool, x, y, z, chi2, nDoF ); + if (prefix == "allVertex"){ + auto x = Monitored::Scalar<double>( "allVertexX", vertex.x() ); + auto y = Monitored::Scalar<double>( "allVertexY", vertex.y() ); + auto z = Monitored::Scalar<double>( "allVertexZ", vertex.z() ); + auto chi2 = Monitored::Scalar<double>( "allVertexChi2", vertex.chiSquared() ); + auto nDoF = Monitored::Scalar<double>( "allVertexnDoF", vertex.numberDoF() ); + auto NTracks = Monitored::Scalar<int> ( "allVertexNTracks", vertex.nTrackParticles() ); + auto mon = Monitored::Group(m_monTool, x, y, z, chi2, nDoF, NTracks ); + } + else if (prefix == "primVertex"){ + auto x = Monitored::Scalar<double>( "primVertexX", vertex.x() ); + auto y = Monitored::Scalar<double>( "primVertexY", vertex.y() ); + auto z = Monitored::Scalar<double>( "primVertexZ", vertex.z() ); + auto chi2 = Monitored::Scalar<double>( "primVertexChi2", vertex.chiSquared() ); + auto nDoF = Monitored::Scalar<double>( "primVertexnDoF", vertex.numberDoF() ); + auto NTracks = Monitored::Scalar<int> ( "primVertexNTracks", vertex.nTrackParticles() ); + auto mon = Monitored::Group(m_monTool, x, y, z, chi2, nDoF, NTracks ); + } } + + } // end namespace InDet diff --git a/InnerDetector/InDetRecTools/InDetBoundaryCheckTool/InDetBoundaryCheckTool/InDetBoundaryCheckTool.h b/InnerDetector/InDetRecTools/InDetBoundaryCheckTool/InDetBoundaryCheckTool/InDetBoundaryCheckTool.h index d5b041ac01f2c6c09cb8ad6b0cb2e094e64ca456..4ca60caf55505839a7a05a3519b14fe8565f238b 100644 --- a/InnerDetector/InDetRecTools/InDetBoundaryCheckTool/InDetBoundaryCheckTool/InDetBoundaryCheckTool.h +++ b/InnerDetector/InDetRecTools/InDetBoundaryCheckTool/InDetBoundaryCheckTool/InDetBoundaryCheckTool.h @@ -66,15 +66,15 @@ namespace InDet { const AtlasDetectorID *m_atlasId; /** eta and phi tolerances **/ - Gaudi::Property<double> m_etaTol = 3.0; - Gaudi::Property<double> m_phiTol = 3.0; + Gaudi::Property<double> m_etaTol{this, "ToleranceEta", 3.0}; + Gaudi::Property<double> m_phiTol{this, "TolerancePhi", 3.0}; /** Control usage of pixel and SCT info */ - Gaudi::Property<bool> m_usePixel; - Gaudi::Property<bool> m_useSCT; + Gaudi::Property<bool> m_usePixel{this, "UsePixel", true}; + Gaudi::Property<bool> m_useSCT{this, "UseSCT", true}; /** Control check of bad SCT chip (should be false for ITk Strip) */ - Gaudi::Property<bool> m_checkBadSCT; + Gaudi::Property<bool> m_checkBadSCT{this, "CheckBadSCT", true}; }; } diff --git a/InnerDetector/InDetRecTools/InDetTrackHoleSearch/InDetTrackHoleSearch/InDetTrackHoleSearchTool.h b/InnerDetector/InDetRecTools/InDetTrackHoleSearch/InDetTrackHoleSearch/InDetTrackHoleSearchTool.h index 53b5ace5b53aa32781d7d3cb03c1beb12875bcd1..4b4c7a4ea00a17361833a82da287e476636096c8 100644 --- a/InnerDetector/InDetRecTools/InDetTrackHoleSearch/InDetTrackHoleSearch/InDetTrackHoleSearchTool.h +++ b/InnerDetector/InDetRecTools/InDetTrackHoleSearch/InDetTrackHoleSearch/InDetTrackHoleSearchTool.h @@ -13,6 +13,7 @@ #include "GaudiKernel/ToolHandle.h" #include "GaudiKernel/ServiceHandle.h" #include "TrkToolInterfaces/ITrackHoleSearchTool.h" +#include "TrkToolInterfaces/IBoundaryCheckTool.h" #include "TrkEventPrimitives/ParticleHypothesis.h" #include "InDetConditionsSummaryService/IInDetConditionsTool.h" #include "TrkParameters/TrackParameters.h" @@ -111,33 +112,22 @@ namespace InDet /** Pointer to Extrapolator AlgTool*/ ToolHandle< Trk::IExtrapolator > m_extrapolator; - - /** Handles to IConditionsSummaryTools for Pixels and SCT*/ - ToolHandle <IInDetConditionsTool> m_sctCondSummaryTool{this, "SctSummaryTool", "SCT_ConditionsSummaryTool/InDetSCT_ConditionsSummaryTool", "Tool to retrieve SCT Conditions summary"}; - - ToolHandle< IInDetTestPixelLayerTool > m_pixelLayerTool; - - /** Handle for IGeoModelSvc to retrieve geo model information */ - ServiceHandle<IGeoModelSvc> m_geoModelSvc; + ToolHandle<Trk::IBoundaryCheckTool> m_boundaryCheckTool { + this, + "BoundaryCheckTool", + "InDet::InDetBoundaryCheckTool", + "Boundary checking tool for detector sensitivities" + }; /** Configure outwards hole search */ bool m_extendedListOfHoles,m_cosmic; - /** Control usage of pixel, SCT and TRT info */ - bool m_usepix, m_usesct; - - /** Control check of bad SCT chip (should be false for ITk Strip) */ - bool m_checkBadSCTChip; - /** Min number of hits **/ int m_minSiHits; /* searching for dead modules after the last measurement (needed for robustness of SW)*/ bool m_countDeadModulesAfterLastHit; - /** eta and phi tolerances **/ - float m_etatol, m_phitol; - /** number of warnings printed when no track parameters available **/ mutable std::atomic_int m_warning; @@ -169,19 +159,10 @@ namespace InDet */ const Trk::TrackStateOnSurface* createHoleTSOS(const Trk::TrackParameters* trackPar) const; - - /** This method returns true, if the detector element the input parameters correspond to is sensitive detector material, - otherwise it returns false. - */ - bool isSensitive(const Trk::TrackParameters* parameters, bool &isgood) const ; - /** This Method creates a new Track from the TSOS of the input track combined with the TSOS from listOfHoles */ const Trk::Track* addHolesToTrack(const Trk::Track& oldTrack, std::vector<const Trk::TrackStateOnSurface*>* listOfHoles) const; - - /** This method checks the SCT ABCD chip and SCT strip where the track passes through is bad or not */ - bool isBadSCTChipStrip(const Identifier& waferId, const Trk::TrackParameters& parameters, const InDetDD::SiDetectorElement& siElement) const; }; } // end of namespace diff --git a/InnerDetector/InDetRecTools/InDetTrackHoleSearch/src/InDetTrackHoleSearchTool.cxx b/InnerDetector/InDetRecTools/InDetTrackHoleSearch/src/InDetTrackHoleSearchTool.cxx index a4fc7a559f1cdd455b4d62fc7d2e12c188e1999b..53257116bfae807b505a38b6bffd821403a8f84a 100644 --- a/InnerDetector/InDetRecTools/InDetTrackHoleSearch/src/InDetTrackHoleSearchTool.cxx +++ b/InnerDetector/InDetRecTools/InDetTrackHoleSearch/src/InDetTrackHoleSearchTool.cxx @@ -36,27 +36,15 @@ InDet::InDetTrackHoleSearchTool::InDetTrackHoleSearchTool(const std::string& t, AthAlgTool(t,n,p), m_atlasId(nullptr), m_extrapolator("Trk::Extrapolator"), - m_pixelLayerTool("InDet::InDetTestPixelLayerTool"), - m_geoModelSvc("GeoModelSvc", n), m_extendedListOfHoles(false), m_cosmic(false), - m_usepix(true), - m_usesct(true), - m_checkBadSCTChip(true), m_warning(0) { declareInterface<ITrackHoleSearchTool>(this); declareProperty("Extrapolator" , m_extrapolator); - declareProperty("PixelLayerTool" , m_pixelLayerTool); - declareProperty("GeoModelService" , m_geoModelSvc); declareProperty("ExtendedListOfHoles" , m_extendedListOfHoles = false); declareProperty("Cosmics" , m_cosmic); - declareProperty("usePixel" , m_usepix); - declareProperty("useSCT" , m_usesct); - declareProperty("checkBadSCTChip" , m_checkBadSCTChip); declareProperty("minSiHits" , m_minSiHits = 3); declareProperty("CountDeadModulesAfterLastHit", m_countDeadModulesAfterLastHit = true); - declareProperty("phitol" , m_phitol = 3.); - declareProperty("etatol" , m_etatol = 3.); } //================ Destructor ================================================= @@ -75,30 +63,6 @@ StatusCode InDet::InDetTrackHoleSearchTool::initialize() { ATH_CHECK(m_extrapolator.retrieve()); ATH_MSG_INFO("Retrieved tool " << m_extrapolator); - if (m_usepix) { - // Get InDetPixelLayerTool from ToolService - ATH_CHECK(m_pixelLayerTool.retrieve()); - ATH_MSG_INFO("Retrieved tool " << m_pixelLayerTool); - } - - if (m_usesct) { - // Get SctConditionsSummaryTool - ATH_CHECK(m_sctCondSummaryTool.retrieve()); - ATH_MSG_INFO("Retrieved tool " << m_sctCondSummaryTool); - } else { - m_sctCondSummaryTool.disable(); - } - - if (m_checkBadSCTChip) { - // Check if ITk Strip is used because isBadSCTChipStrip method is valid only for SCT. - ATH_CHECK(m_geoModelSvc.retrieve()); - if (m_geoModelSvc->geoConfig()==GeoModel::GEO_RUN4 or - m_geoModelSvc->geoConfig()==GeoModel::GEO_ITk) { - ATH_MSG_WARNING("Since ITk Strip is used, m_checkBadSCTChip is turned off."); - m_checkBadSCTChip = false; - } - } - if (m_extendedListOfHoles) ATH_MSG_INFO("Search for extended list of holes "); ATH_MSG_INFO("initialize() successful in " << name()); @@ -628,24 +592,24 @@ void InDet::InDetTrackHoleSearchTool::performHoleSearchStepWise(std::map<const I std::map<const Identifier, const Trk::TrackStateOnSurface*>::iterator iTSOS = mapOfHits.find(id); if (iTSOS == mapOfHits.end()) { - bool isgood = true; - if (!isSensitive(nextParameters, isgood)) { - if (isgood) ATH_MSG_VERBOSE("Extrapolation not in sensitive area, ignore and continue"); - - if (!isgood) { + switch (m_boundaryCheckTool->boundaryCheck(*nextParameters)) { + case Trk::BoundaryCheckResult::DeadElement: if (m_atlasId->is_pixel(id)) { - + ATH_MSG_VERBOSE("Found element is a dead pixel module, add it to the list and continue"); ++PixelDead; } else if (m_atlasId->is_sct(id)) { - + ATH_MSG_VERBOSE("Found element is a dead SCT module, add it to the list and continue"); ++SctDead; } - } - continue; - } - + case Trk::BoundaryCheckResult::Insensitive: + case Trk::BoundaryCheckResult::Error: + continue; + case Trk::BoundaryCheckResult::Candidate: + break; + } + // increment tmp counters only if this detElement should be considered for a proper holesearch // this info is the boolean in the (mapOfPredictions->second).second if (((it->second).second)) { @@ -741,112 +705,6 @@ void InDet::InDetTrackHoleSearchTool::performHoleSearchStepWise(std::map<const I return; } -// ==================================================================================================================== -bool InDet::InDetTrackHoleSearchTool::isSensitive(const Trk::TrackParameters* parameters, bool &isgood) const { - // do strict boundary check for SCT and Pixels to make sure we are in active area - - if (!parameters || - !parameters->associatedSurface().associatedDetectorElement()) return false; - - const InDetDD::SiDetectorElement* siElement = - dynamic_cast<const InDetDD::SiDetectorElement*> (parameters->associatedSurface().associatedDetectorElement()); - if (siElement == nullptr) { - // ------- in dubio pro reo --> return false (is assumed insensitive) - ATH_MSG_DEBUG("TrackParameters do not belong to a Si Element"); - return false; - } - - double phitol; - double etatol; - - if (parameters->covariance()) { - phitol = m_phitol * sqrt((*parameters->covariance())(Trk::locX,Trk::locX)); - etatol = m_etatol * sqrt((*parameters->covariance())(Trk::locY,Trk::locY)); - } else { - phitol = 2.5; - etatol = 5.0; - } - // not on bond gap within tolerance - if (siElement->nearBondGap(parameters->localPosition(), etatol)) { - ATH_MSG_VERBOSE("---> extrapolation on bond gap within " << etatol << ", return"); - return false; - } - - bool isActiveElement = true; - // inside detector within tolerance - InDetDD::SiIntersect siIn = siElement->inDetector(parameters->localPosition(), phitol, etatol); - if (!siIn.in()) { - ATH_MSG_VERBOSE("---> extrapolation not inside (active?) det" - << "ector within "<<phitol<<" "<<etatol<<", but check for dead module anyway"); - isActiveElement=false; - } - - // errors might be too big (especially for track seeds or short tracks) - // check for dead modules if extrapolation with smaller errors are in active detector (2.5 5.) - if (!isActiveElement) { - if (phitol>2.5 || etatol>5) { - siIn = siElement->inDetector(parameters->localPosition(), 2.5, 5.); - if (!siIn.in()) { - ATH_MSG_VERBOSE("extrapolation too close to inactive detector; abort search for dead module"); - return false; - } - } else { - ATH_MSG_VERBOSE("extrapolation precise enough and too close to inactive detector; abort search for dead module"); - return false; - } - } - - Identifier id = siElement->identify(); - IdentifierHash idHash = siElement->identifyHash(); - // check if it is a dead module using conditions services ! - if (m_atlasId->is_pixel(id)) { - if (m_usepix) { - ATH_MSG_VERBOSE("Found element is a Pixel module without a hit, see if it might be dead"); - isgood=m_pixelLayerTool->expectHit(parameters); - if (isgood) { - // this detElement is only cosidered as hole if the extrapolation of - // the track plus its error hits the active material - if (isActiveElement) { - ATH_MSG_VERBOSE("Pixel module is good, this is a hole canditate !"); - return true; - } - } else { - ATH_MSG_VERBOSE("Track is hitting a bad Pixel module, this is not a hole candidate!"); - return false; - } - } - } else if (m_atlasId->is_sct(id)) { - if (m_usesct) { - ATH_MSG_VERBOSE("Found element is a SCT module without a hit, see if it might be dead"); - isgood=m_sctCondSummaryTool->isGood(idHash); - if (isgood) { - // this detElement is only cosidered as hole if the extrapolation of - // the track plus its error hits the active material - if (isActiveElement) { - - if (m_checkBadSCTChip and isBadSCTChipStrip(id, *parameters, *siElement)) { - ATH_MSG_VERBOSE("Track is hiting a bad SCT chip, this is not a hole candidate!"); - isgood = false; - return false; - } - - ATH_MSG_VERBOSE("SCT module is good, this is a hole candidate !"); - return true; - } - } else { - ATH_MSG_VERBOSE("Track is hiting a bad SCT module, this is not a hole candidate!"); - return false; - } - } - } else { - ATH_MSG_WARNING("unknown identifier type, this should not happen !"); - return false; - } - // the extrapolation of the track plus its error might not - // be inside the active detector for a good module - return false; -} - // ==================================================================================================================== const Trk::TrackStateOnSurface* InDet::InDetTrackHoleSearchTool::createHoleTSOS(const Trk::TrackParameters* trackPar) const { std::bitset<Trk::TrackStateOnSurface::NumberOfTrackStateOnSurfaceTypes> typePattern; @@ -910,32 +768,3 @@ const Trk::Track* InDet::InDetTrackHoleSearchTool::addHolesToTrack(const Trk::T return newTrack; } -// ==================================================================================================================== -bool InDet::InDetTrackHoleSearchTool::isBadSCTChipStrip(const Identifier& waferId, - const Trk::TrackParameters& parameters, - const InDetDD::SiDetectorElement& siElement) const { - // Check if the track passes through a bad SCT ABCD chip or a bad SCT strip. - // A chip and a strip are determined by the extrapolated position. - // Algorithm is based on InnerDetector/InDetMonitoring/SCT_Monitoring/src/SCTHitEffMonTool.cxx - - // Check the input. - if (not m_atlasId->is_sct(waferId)) { - ATH_MSG_WARNING(waferId << " is not an SCT Identifier"); - return true; - } - - // Get strip id from local position. - // Due to the limited position resolution, we may pick up a neighboring strip... - const Amg::Vector2D localPos(parameters.localPosition()); - const Identifier stripIdentifier(siElement.identifierOfPosition(localPos)); - if (not m_atlasId->is_sct(stripIdentifier)) { - ATH_MSG_WARNING(stripIdentifier << " is not an SCT Identifier"); - return true; - } - - // The extrapolated position is on a bad chip. - if (not m_sctCondSummaryTool->isGood(stripIdentifier, InDetConditions::SCT_CHIP)) return true; - // The extrapolated position is on a bad strip. (We may need to check neighboring strips.) - if (not m_sctCondSummaryTool->isGood(stripIdentifier, InDetConditions::SCT_STRIP)) return true; - return false; -} diff --git a/InnerDetector/InDetRecTools/SiSpacePointsSeedTool_xk/src/SiSpacePointsSeedMaker_ATLxk.cxx b/InnerDetector/InDetRecTools/SiSpacePointsSeedTool_xk/src/SiSpacePointsSeedMaker_ATLxk.cxx index b0dd7293bab00a76fb591e89ec1490e26747d3d7..49a59e4c69a6ecd573802e6b7e967a7b0b97cfb7 100644 --- a/InnerDetector/InDetRecTools/SiSpacePointsSeedTool_xk/src/SiSpacePointsSeedMaker_ATLxk.cxx +++ b/InnerDetector/InDetRecTools/SiSpacePointsSeedTool_xk/src/SiSpacePointsSeedMaker_ATLxk.cxx @@ -2140,6 +2140,9 @@ void InDet::SiSpacePointsSeedMaker_ATLxk::newOneSeedWithCurvaturesComparison /// sort common SP by curvature if(data.CmSp.size() > 2) std::sort(data.CmSp.begin(), data.CmSp.end(), comCurvature()); + + float bottomR=SPb->radius(); + float bottomZ=SPb->z(); std::vector<std::pair<float,InDet::SiSpacePointForSeed*>>::iterator it_otherSP; std::vector<std::pair<float,InDet::SiSpacePointForSeed*>>::iterator it_commonTopSP = data.CmSp.begin(), ie = data.CmSp.end(); @@ -2152,6 +2155,25 @@ void InDet::SiSpacePointsSeedMaker_ATLxk::newOneSeedWithCurvaturesComparison float seedQuality = (*it_commonTopSP).second->param(); float originalSeedQuality = (*it_commonTopSP).second->param(); + if(m_maxdImpact > 50){ //This only applies to LRT + + float topR=(*it_commonTopSP).second->radius(); + float topZ=(*it_commonTopSP).second->z(); + + float theta1=std::atan2(topR-bottomR,topZ-bottomZ); + float eta1=-std::log(std::tan(.5*theta1)); + + float Zot=bottomZ - (bottomR-originalSeedQuality) * ((topZ-bottomZ)/(topR-bottomR)); + float theta0=std::atan2((*it_commonTopSP).second->param(),Zot); + float eta0=-std::log(std::tan(.5*theta0)); + + float deltaEta=std::abs(eta1-eta0); //For LLP daughters, the direction of the track is correlated with the direction of the LLP (which is correlated with the direction of the point of closest approach + //calculate weighted average of d0 and deltaEta, normalized by their maximum values + float f=std::min(0.5,originalSeedQuality/200.); //0.5 and 200 are parameters chosen from a grid scan to optimize efficiency + seedQuality*=(1-f)/300.; + seedQuality+=f*deltaEta/2.5; + } + bool topSPisPixel = !(*it_commonTopSP).second->spacepoint->clusterList().second; /// check the surface the hit is on diff --git a/InnerDetector/InDetValidation/InDetPhysValMonitoring/run/AllAndTightSelections.py b/InnerDetector/InDetValidation/InDetPhysValMonitoring/run/AllAndTightSelections.py index 29cf162e9fc6a4f57dfc23011db50c3aa07ea28b..5508f9af45c4a3cc2492767ada1be46d87e70e51 100644 --- a/InnerDetector/InDetValidation/InDetPhysValMonitoring/run/AllAndTightSelections.py +++ b/InnerDetector/InDetValidation/InDetPhysValMonitoring/run/AllAndTightSelections.py @@ -67,8 +67,14 @@ ToolSvc += tool2 monMan.AthenaMonTools += [tool1, tool2] +from InDetBoundaryCheckTool.InDetBoundaryCheckToolConf import InDet__InDetBoundaryCheckTool +InDetBoundaryCheckTool = InDet__InDetBoundaryCheckTool( + name="InDetBoundaryCheckTool" +) +ToolSvc += InDetBoundaryCheckTool + from InDetTrackHoleSearch.InDetTrackHoleSearchConf import InDet__InDetTrackHoleSearchTool -InDetHoleSearchTool = InDet__InDetTrackHoleSearchTool(name = "InDetHoleSearchTool", Extrapolator = InDetExtrapolator, usePixel = True, useSCT= True, CountDeadModulesAfterLastHit = True) +InDetHoleSearchTool = InDet__InDetTrackHoleSearchTool(name = "InDetHoleSearchTool", Extrapolator = InDetExtrapolator, BoundaryCheckTool=InDetBoundaryCheckTool, CountDeadModulesAfterLastHit = True) ToolSvc += InDetHoleSearchTool print InDetHoleSearchTool diff --git a/InnerDetector/InDetValidation/InDetPhysValMonitoring/run/LargeD0_jobOptions.py b/InnerDetector/InDetValidation/InDetPhysValMonitoring/run/LargeD0_jobOptions.py index a2ef80eea165ca6f86fba6e52a35215b97dc5b55..72449f7597e834b797171d96ce78bebc279dc6c9 100644 --- a/InnerDetector/InDetValidation/InDetPhysValMonitoring/run/LargeD0_jobOptions.py +++ b/InnerDetector/InDetValidation/InDetPhysValMonitoring/run/LargeD0_jobOptions.py @@ -100,8 +100,14 @@ ToolSvc += tool2 monMan.AthenaMonTools += [tool2] #monMan.AthenaMonTools += [truthSelection] +from InDetBoundaryCheckTool.InDetBoundaryCheckToolConf import InDet__InDetBoundaryCheckTool +InDetBoundaryCheckTool = InDet__InDetBoundaryCheckTool( + name="InDetBoundaryCheckTool" +) +ToolSvc += InDetBoundaryCheckTool + from InDetTrackHoleSearch.InDetTrackHoleSearchConf import InDet__InDetTrackHoleSearchTool -InDetHoleSearchTool = InDet__InDetTrackHoleSearchTool(name = "InDetHoleSearchTool", Extrapolator = InDetExtrapolator,usePixel = True,useSCT= True,CountDeadModulesAfterLastHit = True) +InDetHoleSearchTool = InDet__InDetTrackHoleSearchTool(name = "InDetHoleSearchTool", Extrapolator = InDetExtrapolator, BoundaryCheckTool=InDetBoundaryCheckTool, CountDeadModulesAfterLastHit = True) ToolSvc += InDetHoleSearchTool print InDetHoleSearchTool diff --git a/InnerDetector/InDetValidation/InDetPhysValMonitoring/run/PhysVal_jobOptions.py b/InnerDetector/InDetValidation/InDetPhysValMonitoring/run/PhysVal_jobOptions.py index e1a1e3c2e9a42d4b9839f6b2d7e4524631148b9a..007395fc9d28058a2b534e1761779b210dec05cb 100644 --- a/InnerDetector/InDetValidation/InDetPhysValMonitoring/run/PhysVal_jobOptions.py +++ b/InnerDetector/InDetValidation/InDetPhysValMonitoring/run/PhysVal_jobOptions.py @@ -104,8 +104,14 @@ print tool1 monMan.AthenaMonTools += [tool1] +from InDetBoundaryCheckTool.InDetBoundaryCheckToolConf import InDet__InDetBoundaryCheckTool +InDetBoundaryCheckTool = InDet__InDetBoundaryCheckTool( + name="InDetBoundaryCheckTool" +) +ToolSvc += InDetBoundaryCheckTool + from InDetTrackHoleSearch.InDetTrackHoleSearchConf import InDet__InDetTrackHoleSearchTool -InDetHoleSearchTool = InDet__InDetTrackHoleSearchTool(name = "InDetHoleSearchTool", Extrapolator = InDetExtrapolator, usePixel = True, useSCT= True, CountDeadModulesAfterLastHit = True) +InDetHoleSearchTool = InDet__InDetTrackHoleSearchTool(name = "InDetHoleSearchTool", Extrapolator = InDetExtrapolator, BoundaryCheckTool=InDetBoundaryCheckTool, CountDeadModulesAfterLastHit = True) ToolSvc += InDetHoleSearchTool print InDetHoleSearchTool diff --git a/InnerDetector/InDetValidation/InDetVertexSplitter/share/VxSplitValTemplate.py b/InnerDetector/InDetValidation/InDetVertexSplitter/share/VxSplitValTemplate.py index d73dd964357209d69f161c7c830a253fb277c2ba..3dd674e195c817c5f21cf6473948c54a66320c1a 100644 --- a/InnerDetector/InDetValidation/InDetVertexSplitter/share/VxSplitValTemplate.py +++ b/InnerDetector/InDetValidation/InDetVertexSplitter/share/VxSplitValTemplate.py @@ -222,13 +222,20 @@ InDetPrdAssociationTool = InDet__InDetPRD_AssociationToolGangedPixels(name PixelClusterAmbiguitiesMapName = InDetKeys.GangedPixelMap()) ToolSvc += InDetPrdAssociationTool if InDetFlags.doPrintConfigurables: print InDetPrdAssociationTool - + +from InDetBoundaryCheckTool.InDetBoundaryCheckToolConf import InDet__InDetBoundaryCheckTool +InDetBoundaryCheckTool = InDet__InDetBoundaryCheckTool( + name="InDetBoundaryCheckTool", + UsePixel=DetFlags.haveRIO.pixel_on(), + UseSCT=DetFlags.haveRIO.SCT_on(), + SctSummaryTool=None +) +ToolSvc += InDetBoundaryCheckTool + from InDetTrackHoleSearch.InDetTrackHoleSearchConf import InDet__InDetTrackHoleSearchTool InDetHoleSearchTool = InDet__InDetTrackHoleSearchTool(name = "InDetHoleSearchTool", Extrapolator = InDetExtrapolator, - usePixel = DetFlags.haveRIO.pixel_on(), - useSCT = DetFlags.haveRIO.SCT_on()) -InDetHoleSearchTool.SctSummaryTool = None + BoundaryCheckTool=InDetBoundaryCheckTool) ToolSvc += InDetHoleSearchTool if InDetFlags.doPrintConfigurables: print InDetHoleSearchTool diff --git a/LArCalorimeter/LArDigitization/python/LArDigitizationConfigNew.py b/LArCalorimeter/LArDigitization/python/LArDigitizationConfigNew.py index c847ac214ddb07c2cf06d7f70a1dd49e15cf839b..5ecee41f17d24b1aea95221ef2f88262cd254e19 100644 --- a/LArCalorimeter/LArDigitization/python/LArDigitizationConfigNew.py +++ b/LArCalorimeter/LArDigitization/python/LArDigitizationConfigNew.py @@ -154,17 +154,18 @@ def LArOutputCfg(flags): acc = ComponentAccumulator() if flags.Output.doWriteRDO: ItemList = [] - if flags.Digitization.PileUpPremixing: - ItemList += ["LArDigitContainer#" + flags.Overlay.BkgPrefix + "LArDigitContainer_MC"] + if flags.Digitization.AddCaloDigi: + ItemList.append("LArDigitContainer#*") + elif flags.Digitization.PileUpPremixing: + ItemList.append("LArDigitContainer#" + flags.Overlay.BkgPrefix + "LArDigitContainer_MC") else: - ItemList += [ - "LArRawChannelContainer#LArRawChannels", - "LArDigitContainer#LArDigitContainer_MC_Thinned" - ] + ItemList.append("LArDigitContainer#LArDigitContainer_MC_Thinned") + if not flags.Digitization.PileUpPremixing: + ItemList.append("LArRawChannelContainer#LArRawChannels") if flags.Detector.SimulateHGTD: - ItemList += ["LArHitContainer#HGTDDigitContainer_MC"] + ItemList.append("LArHitContainer#HGTDDigitContainer_MC") if flags.Digitization.TruthOutput: - ItemList += ["CaloCalibrationHitContainer#*"] + ItemList.append("CaloCalibrationHitContainer#*") acc.merge(TruthDigitizationOutputCfg(flags)) acc.merge(OutputStreamCfg(flags, "RDO", ItemList)) return acc diff --git a/LArCalorimeter/LArGeoModel/LArHV/src/EMBHVManager.cxx b/LArCalorimeter/LArGeoModel/LArHV/src/EMBHVManager.cxx index 06d7ea5752e40f16b8c539c4f0667d70de315a62..d92032af94022997a9b55c995fda86f83420aebb 100644 --- a/LArCalorimeter/LArGeoModel/LArHV/src/EMBHVManager.cxx +++ b/LArCalorimeter/LArGeoModel/LArHV/src/EMBHVManager.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 "LArHV/EMBHVManager.h" @@ -11,10 +11,10 @@ #include "EMBHVPayload.h" #include "StoreGate/StoreGateSvc.h" -#include "StoreGate/StoreGate.h" #include "GaudiKernel/ISvcLocator.h" #include "GaudiKernel/IToolSvc.h" #include "GaudiKernel/Bootstrap.h" +#include "GaudiKernel/ServiceHandle.h" #include "AthenaPoolUtilities/AthenaAttributeList.h" #include "AthenaPoolUtilities/CondAttrListCollection.h" @@ -46,7 +46,7 @@ public: } } - StoreGateSvc *detStore = StoreGate::pointer("DetectorStore"); + ServiceHandle<StoreGateSvc> detStore ("DetectorStore", "HECHVManager"); if (StatusCode::SUCCESS!=detStore->retrieve(elecId, "LArElectrodeID")) { throw std::runtime_error("EMBHVManager failed to retrieve LArElectrodeID"); } @@ -147,7 +147,7 @@ void EMBHVManager::update() const { m_c->payloadArray[i].voltage[1]=-99999.; } - StoreGateSvc *detStore = StoreGate::pointer("DetectorStore"); + ServiceHandle<StoreGateSvc> detStore ("DetectorStore", "HECHVManager"); ISvcLocator* svcLocator = Gaudi::svcLocator(); IToolSvc* toolSvc; diff --git a/LArCalorimeter/LArGeoModel/LArHV/src/EMBPresamplerHVManager.cxx b/LArCalorimeter/LArGeoModel/LArHV/src/EMBPresamplerHVManager.cxx index 1a2354cccca4e1c4f414071b9756ffa94c5e51d5..dd040ea2802d4efc67c1bc58c1c600fbc0f04f02 100644 --- a/LArCalorimeter/LArGeoModel/LArHV/src/EMBPresamplerHVManager.cxx +++ b/LArCalorimeter/LArGeoModel/LArHV/src/EMBPresamplerHVManager.cxx @@ -12,10 +12,10 @@ #include "EMBPresamplerHVPayload.h" #include "StoreGate/StoreGateSvc.h" -#include "StoreGate/StoreGate.h" #include "GaudiKernel/ISvcLocator.h" #include "GaudiKernel/IToolSvc.h" #include "GaudiKernel/Bootstrap.h" +#include "GaudiKernel/ServiceHandle.h" #include "AthenaPoolUtilities/AthenaAttributeList.h" #include "AthenaPoolUtilities/CondAttrListCollection.h" @@ -50,7 +50,7 @@ public: } } - StoreGateSvc *detStore = StoreGate::pointer("DetectorStore"); + ServiceHandle<StoreGateSvc> detStore ("DetectorStore", "HECHVManager"); if (StatusCode::SUCCESS!=detStore->retrieve(elecId, "LArElectrodeID")) { throw std::runtime_error("EMBPresamplerHVManager failed to retrieve LArElectrodeID"); } @@ -140,7 +140,7 @@ void EMBPresamplerHVManager::update() const { m_c->payloadArray[i].voltage[1]=-99999.; } - StoreGateSvc *detStore = StoreGate::pointer("DetectorStore"); + ServiceHandle<StoreGateSvc> detStore ("DetectorStore", "HECHVManager"); ISvcLocator* svcLocator = Gaudi::svcLocator(); IToolSvc* toolSvc; diff --git a/LArCalorimeter/LArGeoModel/LArHV/src/EMECHVManager.cxx b/LArCalorimeter/LArGeoModel/LArHV/src/EMECHVManager.cxx index e315aaef798b05eafe98efdcc4a1e8d95e80b3d0..c059da3103e8f647473e4d3c2f909073071fee00 100644 --- a/LArCalorimeter/LArGeoModel/LArHV/src/EMECHVManager.cxx +++ b/LArCalorimeter/LArGeoModel/LArHV/src/EMECHVManager.cxx @@ -11,10 +11,10 @@ #include "EMECHVPayload.h" #include "StoreGate/StoreGateSvc.h" -#include "StoreGate/StoreGate.h" #include "GaudiKernel/ISvcLocator.h" #include "GaudiKernel/IToolSvc.h" #include "GaudiKernel/Bootstrap.h" +#include "GaudiKernel/ServiceHandle.h" #include "AthenaPoolUtilities/AthenaAttributeList.h" #include "AthenaPoolUtilities/CondAttrListCollection.h" @@ -48,7 +48,7 @@ public: } } - StoreGateSvc *detStore = StoreGate::pointer("DetectorStore"); + ServiceHandle<StoreGateSvc> detStore ("DetectorStore", "HECHVManager"); if (StatusCode::SUCCESS!=detStore->retrieve(elecId, "LArElectrodeID")) { throw std::runtime_error("EMECHVManager failed to retrieve LArElectrodeID"); } @@ -183,7 +183,7 @@ void EMECHVManager::update() const { } } - StoreGateSvc *detStore = StoreGate::pointer("DetectorStore"); + ServiceHandle<StoreGateSvc> detStore ("DetectorStore", "HECHVManager"); ISvcLocator* svcLocator = Gaudi::svcLocator(); IToolSvc* toolSvc; diff --git a/LArCalorimeter/LArGeoModel/LArHV/src/EMECPresamplerHVManager.cxx b/LArCalorimeter/LArGeoModel/LArHV/src/EMECPresamplerHVManager.cxx index ee349c73d203f016d8452d62a5951a01b1474c86..655edf3f95ad6f003d1446d93e100fbaf01ac31f 100644 --- a/LArCalorimeter/LArGeoModel/LArHV/src/EMECPresamplerHVManager.cxx +++ b/LArCalorimeter/LArGeoModel/LArHV/src/EMECPresamplerHVManager.cxx @@ -11,10 +11,10 @@ #include "EMECPresamplerHVPayload.h" #include "StoreGate/StoreGateSvc.h" -#include "StoreGate/StoreGate.h" #include "GaudiKernel/ISvcLocator.h" #include "GaudiKernel/IToolSvc.h" #include "GaudiKernel/Bootstrap.h" +#include "GaudiKernel/ServiceHandle.h" #include "AthenaPoolUtilities/AthenaAttributeList.h" #include "AthenaPoolUtilities/CondAttrListCollection.h" @@ -40,7 +40,7 @@ public: moduleArray[iSide][iPhi] = new EMECPresamplerHVModule(manager, iSide, iPhi); } } - StoreGateSvc *detStore = StoreGate::pointer("DetectorStore"); + ServiceHandle<StoreGateSvc> detStore ("DetectorStore", "HECHVManager"); if (StatusCode::SUCCESS!=detStore->retrieve(elecId, "LArElectrodeID")) { throw std::runtime_error("EMECPresamplerHVManager failed to retrieve LArElectrodeID"); } @@ -117,7 +117,7 @@ void EMECPresamplerHVManager::update() const { } } - StoreGateSvc *detStore = StoreGate::pointer("DetectorStore"); + ServiceHandle<StoreGateSvc> detStore ("DetectorStore", "HECHVManager"); ISvcLocator* svcLocator = Gaudi::svcLocator(); IToolSvc* toolSvc; diff --git a/LArCalorimeter/LArGeoModel/LArHV/src/FCALHVManager.cxx b/LArCalorimeter/LArGeoModel/LArHV/src/FCALHVManager.cxx index e396cc7d8cbf80ad4cb0f23111f326c0ab584cae..632e1295db295f9b02a333f402235ab9bf85f5f5 100644 --- a/LArCalorimeter/LArGeoModel/LArHV/src/FCALHVManager.cxx +++ b/LArCalorimeter/LArGeoModel/LArHV/src/FCALHVManager.cxx @@ -10,8 +10,8 @@ #include "GaudiKernel/ISvcLocator.h" #include "GaudiKernel/IToolSvc.h" #include "GaudiKernel/Bootstrap.h" +#include "GaudiKernel/ServiceHandle.h" #include "StoreGate/StoreGateSvc.h" -#include "StoreGate/StoreGate.h" #include "AthenaPoolUtilities/AthenaAttributeList.h" #include "AthenaPoolUtilities/CondAttrListCollection.h" #include "LArIdentifier/LArElectrodeID.h" @@ -37,7 +37,7 @@ public: } } - StoreGateSvc *detStore = StoreGate::pointer("DetectorStore"); + ServiceHandle<StoreGateSvc> detStore ("DetectorStore", "HECHVManager"); if (StatusCode::SUCCESS!=detStore->retrieve(elecId, "LArElectrodeID")) { throw std::runtime_error("FCALHVManager failed to retrieve LArElectrodeID"); } @@ -121,7 +121,7 @@ void FCALHVManager::update() const { m_c->payloadArray[i].voltage = -99999; } - StoreGateSvc *detStore = StoreGate::pointer("DetectorStore"); + ServiceHandle<StoreGateSvc> detStore ("DetectorStore", "HECHVManager"); ISvcLocator* svcLocator = Gaudi::svcLocator(); IToolSvc* toolSvc; diff --git a/LArCalorimeter/LArGeoModel/LArHV/src/HECHVManager.cxx b/LArCalorimeter/LArGeoModel/LArHV/src/HECHVManager.cxx index b97113d8b4e4cc58d10a0277f3395afc31b73c10..0849948926979b383b112ea58a1e66603419c62f 100644 --- a/LArCalorimeter/LArGeoModel/LArHV/src/HECHVManager.cxx +++ b/LArCalorimeter/LArGeoModel/LArHV/src/HECHVManager.cxx @@ -10,10 +10,10 @@ #include "HECHVPayload.h" #include "StoreGate/StoreGateSvc.h" -#include "StoreGate/StoreGate.h" #include "GaudiKernel/ISvcLocator.h" #include "GaudiKernel/IToolSvc.h" #include "GaudiKernel/Bootstrap.h" +#include "GaudiKernel/ServiceHandle.h" #include "AthenaPoolUtilities/AthenaAttributeList.h" #include "AthenaPoolUtilities/CondAttrListCollection.h" @@ -40,7 +40,7 @@ public: } } - StoreGateSvc *detStore = StoreGate::pointer("DetectorStore"); + ServiceHandle<StoreGateSvc> detStore ("DetectorStore", "HECHVManager"); if (StatusCode::SUCCESS!=detStore->retrieve(elecId, "LArElectrodeID")) { throw std::runtime_error("HECHVManager failed to retrieve LArElectrodeID"); } @@ -129,7 +129,7 @@ void HECHVManager::update() const { m_c->payloadArray[i].voltage = -99999; } - StoreGateSvc *detStore = StoreGate::pointer("DetectorStore"); + ServiceHandle<StoreGateSvc> detStore ("DetectorStore", "HECHVManager"); ISvcLocator* svcLocator = Gaudi::svcLocator(); IToolSvc* toolSvc; diff --git a/LArCalorimeter/LArGeoModel/LArReadoutGeometry/src/EMECDetectorManager.cxx b/LArCalorimeter/LArGeoModel/LArReadoutGeometry/src/EMECDetectorManager.cxx index f244a4b07b6a72babc9fb6451c6828478064dad0..fb7efdf627ce75f40df80e89570deafe2dc33f72 100755 --- a/LArCalorimeter/LArGeoModel/LArReadoutGeometry/src/EMECDetectorManager.cxx +++ b/LArCalorimeter/LArGeoModel/LArReadoutGeometry/src/EMECDetectorManager.cxx @@ -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 */ #include "GaudiKernel/MsgStream.h" #include "GaudiKernel/Bootstrap.h" #include "GaudiKernel/SystemOfUnits.h" +#include "GaudiKernel/ServiceHandle.h" #include "RDBAccessSvc/IRDBRecord.h" #include "RDBAccessSvc/IRDBRecordset.h" @@ -15,7 +16,7 @@ #include "LArReadoutGeometry/EMECDetectorManager.h" #include "LArReadoutGeometry/EMECDetectorRegion.h" #include "LArReadoutGeometry/EMECDetDescr.h" -#include "StoreGate/StoreGate.h" +#include "StoreGate/StoreGateSvc.h" #include "LArHV/LArHVManager.h" // Class EMECDetectorManager @@ -130,7 +131,7 @@ const EMECHVManager& EMECDetectorManager::getHVManager (EMECHVManager::IOType io { if(!m_HVManager[io]) { //Support lazy initialization for testbeams - StoreGateSvc *detStore = StoreGate::pointer("DetectorStore"); + ServiceHandle<StoreGateSvc> detStore ("DetectorStore", "HECHVManager"); const LArHVManager *manager{nullptr}; if (detStore->retrieve(manager)==StatusCode::SUCCESS) { m_HVManager[io]=&(manager->getEMECHVManager(io)); @@ -142,7 +143,7 @@ const EMECHVManager& EMECDetectorManager::getHVManager (EMECHVManager::IOType io const EMECPresamplerHVManager& EMECDetectorManager::getPresamplerHVManager () const { if (!m_presamplerHVManager) { - StoreGateSvc *detStore = StoreGate::pointer("DetectorStore"); + ServiceHandle<StoreGateSvc> detStore ("DetectorStore", "HECHVManager"); const LArHVManager *manager{nullptr}; if (detStore->retrieve(manager)==StatusCode::SUCCESS) { m_presamplerHVManager=&(manager->getEMECPresamplerHVManager()); diff --git a/MagneticField/MagFieldConditions/MagFieldConditions/AtlasFieldCacheCondObj.h b/MagneticField/MagFieldConditions/MagFieldConditions/AtlasFieldCacheCondObj.h index f0a75517d5ff6a306631e65d2059a343da05773a..61e5be32d80b329fb1d83330a6713e884437dc26 100644 --- a/MagneticField/MagFieldConditions/MagFieldConditions/AtlasFieldCacheCondObj.h +++ b/MagneticField/MagFieldConditions/MagFieldConditions/AtlasFieldCacheCondObj.h @@ -37,7 +37,7 @@ public: const MagField::AtlasFieldMap* fieldMap() const { return m_fieldMap; } /** set values for field scale and service to be able to build the cache **/ - bool initialize(double solFieldScale, double torFieldScale, + void initialize(double solFieldScale, double torFieldScale, const MagField::AtlasFieldMap* fieldMap); private: diff --git a/MagneticField/MagFieldConditions/src/AtlasFieldCacheCondObj.cxx b/MagneticField/MagFieldConditions/src/AtlasFieldCacheCondObj.cxx index d78140314c8c22c45900b9879d5adb1a5c12d1fd..6539ae91be73ae181b076319799891dafbada432 100644 --- a/MagneticField/MagFieldConditions/src/AtlasFieldCacheCondObj.cxx +++ b/MagneticField/MagFieldConditions/src/AtlasFieldCacheCondObj.cxx @@ -9,7 +9,7 @@ AtlasFieldCacheCondObj::AtlasFieldCacheCondObj() AtlasFieldCacheCondObj::~AtlasFieldCacheCondObj() {} -bool +void AtlasFieldCacheCondObj::initialize(double solFieldScale, double torFieldScale, const MagField::AtlasFieldMap* fieldMap) @@ -18,6 +18,5 @@ AtlasFieldCacheCondObj::initialize(double solFieldScale, m_solFieldScale = solFieldScale; m_torFieldScale = torFieldScale; m_fieldMap = fieldMap; - return (m_fieldMap) != nullptr; // return false if cast failed } diff --git a/MagneticField/MagFieldServices/src/AtlasFieldCacheCondAlg.cxx b/MagneticField/MagFieldServices/src/AtlasFieldCacheCondAlg.cxx index f246e474820c2990639aaa6bb2bc3a61644f6c21..423716477a267d4db65df94900a0ac2447dccb6c 100644 --- a/MagneticField/MagFieldServices/src/AtlasFieldCacheCondAlg.cxx +++ b/MagneticField/MagFieldServices/src/AtlasFieldCacheCondAlg.cxx @@ -116,13 +116,9 @@ MagField::AtlasFieldCacheCondAlg::execute(const EventContext& ctx) const { auto fieldCondObj = std::make_unique<AtlasFieldCacheCondObj>(); // 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)) { - ATH_MSG_ERROR("execute: Could not initialize conditions field object with solenoid/toroid currents " - << cache.m_solScaleFactor << "," << cache.m_torScaleFactor); - return StatusCode::FAILURE; - } + fieldCondObj->initialize(cache.m_solScaleFactor, + cache.m_torScaleFactor, + fieldMap); // Record in conditions store the conditions object with scale factors and map pointer for cache if(writeHandle.record(cache.m_condObjOutputRange, std::move(fieldCondObj)).isFailure()) { @@ -134,7 +130,12 @@ 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()); + if (fieldMap) { + ATH_MSG_INFO ( "execute: solenoid zone id " << fieldMap->solenoidZoneId()); + } + else { + ATH_MSG_INFO ( "execute: no map read (currents == 0"); + } return StatusCode::SUCCESS; } diff --git a/MagneticField/MagFieldServices/src/AtlasFieldMapCondAlg.cxx b/MagneticField/MagFieldServices/src/AtlasFieldMapCondAlg.cxx index 4d15b83660bb8916d3b974b0f050b84291818fe6..fcefb86070bbbe66d4ce786742ad23467596ad53 100644 --- a/MagneticField/MagFieldServices/src/AtlasFieldMapCondAlg.cxx +++ b/MagneticField/MagFieldServices/src/AtlasFieldMapCondAlg.cxx @@ -97,15 +97,20 @@ MagField::AtlasFieldMapCondAlg::execute(const EventContext& ctx) const { ATH_CHECK( updateFieldMap(ctx, cache) ); - - ATH_MSG_INFO ( "execute: solenoid zone id " << cache.m_fieldMap->solenoidZoneId()); + if (cache.m_fieldMap) { + ATH_MSG_INFO ( "execute: solenoid zone id " << cache.m_fieldMap->solenoidZoneId()); + } + else { + ATH_MSG_INFO ( "execute: no map read (currents == 0"); + } + // Save newly created map in conditions object, and record it in the conditions store, with its // own range auto fieldMapCondObj = std::make_unique<AtlasFieldMapCondObj>(); // move ownership of the field map to the fieldMapCondObj - fieldMapCondObj->setFieldMap(std::move(cache.m_fieldMap)); + if (cache.m_fieldMap) fieldMapCondObj->setFieldMap(std::move(cache.m_fieldMap)); if(mapWriteHandle.record(cache.m_mapCondObjOutputRange, std::move(fieldMapCondObj)).isFailure()) { ATH_MSG_ERROR("execute: Could not record AtlasFieldMapCondObj object with " << mapWriteHandle.key() @@ -202,7 +207,7 @@ MagField::AtlasFieldMapCondAlg::updateFieldMap(const EventContext& ctx, Cache& c 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) { @@ -235,7 +240,7 @@ MagField::AtlasFieldMapCondAlg::updateFieldMap(const EventContext& ctx, Cache& c 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/MagneticField/MagFieldUtils/CMakeLists.txt b/MagneticField/MagFieldUtils/CMakeLists.txt index 433f9eda16812493b5ea234f89b685b2edff005a..54ac61d251329407b134ce01068c3b3be8544730 100644 --- a/MagneticField/MagFieldUtils/CMakeLists.txt +++ b/MagneticField/MagFieldUtils/CMakeLists.txt @@ -14,9 +14,7 @@ atlas_add_component( MagFieldUtils 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} AthenaBaseComps GaudiKernel MagFieldInterfaces ) + LINK_LIBRARIES ${ROOT_LIBRARIES} ${XERCESC_LIBRARIES} ${GEANT4_LIBRARIES} ${CLHEP_LIBRARIES} AthenaBaseComps GaudiKernel MagFieldConditions MagFieldInterfaces ) # Install files from the package: -atlas_install_headers( MagFieldUtils ) atlas_install_joboptions( share/*.py ) - diff --git a/MagneticField/MagFieldUtils/src/MagFieldCondReader.cxx b/MagneticField/MagFieldUtils/src/MagFieldCondReader.cxx new file mode 100644 index 0000000000000000000000000000000000000000..e90b199f13ceaa642efd4f246205d73f240e164a --- /dev/null +++ b/MagneticField/MagFieldUtils/src/MagFieldCondReader.cxx @@ -0,0 +1,33 @@ +/* + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration +*/ + +#include "MagFieldCondReader.h" + +MagField::CondReader::CondReader(const std::string& name, ISvcLocator* pSvcLocator) : + AthReentrantAlgorithm(name, pSvcLocator) +{} + +StatusCode MagField::CondReader::initialize() +{ + ATH_CHECK(m_fieldCacheKey.initialize()); + + return StatusCode::SUCCESS; +} + +StatusCode MagField::CondReader::execute(const EventContext& ctx) const +{ + SG::ReadCondHandle<AtlasFieldCacheCondObj> rh{m_fieldCacheKey, ctx}; + const AtlasFieldCacheCondObj* fieldCondObj{*rh}; + if (fieldCondObj == nullptr) { + ATH_MSG_ERROR("Failed to retrieve AtlasFieldCacheCondObj with key " << m_fieldCacheKey.key()); + return StatusCode::FAILURE; + } + + MagField::AtlasFieldCache fieldCache; + fieldCondObj->getInitializedCache(fieldCache); + + ATH_MSG_INFO("Field status: solenoid=" << fieldCache.solenoidOn() << ", toroids=" << fieldCache.toroidOn()); + + return StatusCode::SUCCESS; +} diff --git a/MagneticField/MagFieldUtils/src/MagFieldCondReader.h b/MagneticField/MagFieldUtils/src/MagFieldCondReader.h new file mode 100644 index 0000000000000000000000000000000000000000..96fbf4046fa379d3336cbaa046dc80b39330bdd6 --- /dev/null +++ b/MagneticField/MagFieldUtils/src/MagFieldCondReader.h @@ -0,0 +1,31 @@ +/* + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration +*/ + +#ifndef MAGFIELDUTILS_MAGFIELDCONDREADER_H +#define MAGFIELDUTILS_MAGFIELDCONDREADER_H + +#include "AthenaBaseComps/AthReentrantAlgorithm.h" +#include "MagFieldConditions/AtlasFieldCacheCondObj.h" +#include "StoreGate/ReadHandleKey.h" + +namespace MagField { + + /** + * Testing algorithm to read magnetic field + */ + class CondReader : public AthReentrantAlgorithm { + + public: + CondReader(const std::string& name, ISvcLocator* pSvcLocator); + StatusCode initialize() override; + StatusCode execute(const EventContext& ctx) const override; + + private: + SG::ReadCondHandleKey<AtlasFieldCacheCondObj> m_fieldCacheKey{ + this, "AtlasFieldCacheCondObj", "fieldCondObj", "Magnetic Field conditions object key"}; + }; + +} // namespace MagField + +#endif diff --git a/MagneticField/MagFieldUtils/src/components/MagFieldUtils_entries.cxx b/MagneticField/MagFieldUtils/src/components/MagFieldUtils_entries.cxx index f0d04aae274864ab3ac846457c3ba3e4ed4833d0..ae4d9b8978c60a48392a1b596d82b22b8b111c7e 100644 --- a/MagneticField/MagFieldUtils/src/components/MagFieldUtils_entries.cxx +++ b/MagneticField/MagFieldUtils/src/components/MagFieldUtils_entries.cxx @@ -1,8 +1,9 @@ #include "MagFieldUtils/MagFieldTestbedAlg.h" #include "MagFieldUtils/SolenoidTest.h" #include "MagFieldUtils/IdentityManipulator.h" +#include "../MagFieldCondReader.h" DECLARE_COMPONENT( MagField::MagFieldTestbedAlg ) DECLARE_COMPONENT( MagField::SolenoidTest ) DECLARE_COMPONENT( MagField::IdentityManipulator ) - +DECLARE_COMPONENT( MagField::CondReader ) diff --git a/MuonSpectrometer/MSVertexReconstruction/MSVertexTools/src/MSVertexRecoTool.cxx b/MuonSpectrometer/MSVertexReconstruction/MSVertexTools/src/MSVertexRecoTool.cxx index ba353c4482b99d2b88215fe57a0545d8a08a2a69..22a8c39952eebb22a67e19d6935004644068e770 100644 --- a/MuonSpectrometer/MSVertexReconstruction/MSVertexTools/src/MSVertexRecoTool.cxx +++ b/MuonSpectrometer/MSVertexReconstruction/MSVertexTools/src/MSVertexRecoTool.cxx @@ -698,7 +698,10 @@ namespace Muon { vxtracks.clear(); trkp[k].clear(); int tmpnTrks(0); - float tmpzLoF(0),tmpzpossigma(0),tmpchi2(0),posWeight(0); + float tmpzLoF(0); + float tmpzpossigma(0); + float tmpchi2(0); + float posWeight(0); float worstdelz(0); unsigned int iworst(0xC0FFEE); //loop on the tracklets, find the chi^2 contribution from each tracklet @@ -892,7 +895,8 @@ namespace Muon { std::vector<Tracklet> tracklets = getTracklets(trks, *prelim_vx_max); // use tracklets to estimate the line of flight of decaying particle - float aveX(0),aveY(0); + float aveX(0); + float aveY(0); for(std::vector<Tracklet>::iterator trkItr=tracklets.begin(); trkItr!=tracklets.end(); ++trkItr) { aveX += ((Tracklet)*trkItr).globalPosition().x(); aveY += ((Tracklet)*trkItr).globalPosition().y(); @@ -901,14 +905,12 @@ namespace Muon { Amg::Vector3D MyVx = VxMinQuad(tracklets); float vxtheta = std::atan2(MyVx.x(),MyVx.z()); float vxphi = vxPhiFinder(std::abs(vxtheta),tracklet_vxphi, ctx); - Amg::Vector3D vxpos(MyVx.x()*std::cos(vxphi),MyVx.x()*std::sin(vxphi),MyVx.z()); std::vector<xAOD::TrackParticle*> vxTrkTracks; for(std::vector<Tracklet>::iterator tracklet = tracklets.begin(); tracklet != tracklets.end(); tracklet++) { AmgSymMatrix(5)* covariance = new AmgSymMatrix(5)(((Tracklet)*tracklet).errorMatrix()); Trk::Perigee* myPerigee = new Trk::Perigee(vxpos,((Tracklet)*tracklet).momentum(),0,vxpos,covariance); - xAOD::TrackParticle* myTrack = new xAOD::TrackParticle(); myTrack->makePrivateStore(); @@ -1137,10 +1139,23 @@ namespace Muon { //vertex phi location -- determined from the RPC/TGC hits - float MSVertexRecoTool::vxPhiFinder(float theta,float phi, const EventContext &ctx) const { + float MSVertexRecoTool::vxPhiFinder(const float theta, const float phi, const EventContext &ctx) const { float nmeas(0); - float sinphi(0),cosphi(0); - float eta = -1*std::log(std::tan(0.5*theta)); + float sinphi(0); + float cosphi(0); + if (theta==0) { + ATH_MSG_WARNING("vxPhiFinder() called with theta="<<theta<<" and phi="<<phi<<", return 0"); + return 0; + } else if (theta>M_PI) { + ATH_MSG_WARNING("vxPhiFinder() called with theta="<<std::setprecision(15)<<theta<<" and phi="<<phi<<", (theta>M_PI), return 0"); + return 0; + } + float tanThetaHalf = std::tan(0.5*theta); + if (tanThetaHalf<=0) { + ATH_MSG_WARNING("vxPhiFinder() called with theta="<<std::setprecision(15)<<theta<<" and phi="<<phi<<", resulting in tan(0.5*theta)<=0, return 0"); + return 0; + } + float eta = -std::log(tanThetaHalf); if(std::abs(eta) < 1.5) { SG::ReadHandle<Muon::RpcPrepDataContainer> rpcTES(m_rpcTESKey, ctx); if(!rpcTES.isValid()) { diff --git a/MuonSpectrometer/MSVertexReconstruction/MSVertexTools/src/MSVertexRecoTool.h b/MuonSpectrometer/MSVertexReconstruction/MSVertexTools/src/MSVertexRecoTool.h index 20428164ca5e15787fea28bcf12f659becd183ea..b09fa89bb4b05643af7645d49357a8dfd625441a 100644 --- a/MuonSpectrometer/MSVertexReconstruction/MSVertexTools/src/MSVertexRecoTool.h +++ b/MuonSpectrometer/MSVertexReconstruction/MSVertexTools/src/MSVertexRecoTool.h @@ -90,7 +90,7 @@ namespace Muon { void MSStraightLineVx(const std::vector<Tracklet> &trks, std::unique_ptr<MSVertex>& vtx, const EventContext &ctx) const; void MSStraightLineVx_oldMethod(const std::vector<Tracklet> &trks, std::unique_ptr<MSVertex>& vtx, const EventContext &ctx )const; void MakeDummyVertex(MSVertex*&) const; - float vxPhiFinder(float theta,float phi, const EventContext &ctx) const;//vertex phi location reco algorithm + float vxPhiFinder(const float theta, const float phi, const EventContext &ctx) const;//vertex phi location reco algorithm void HitCounter(MSVertex* MSRecoVx, const EventContext &ctx) const;//counts MDT, RPC & TGC around a reco'd vertex std::vector<TrkCluster> findTrackClusters(const std::vector<Tracklet>& tracklets) const;//group tracklets into clusters -- vertex reco runs on each cluster of tracklets TrkCluster ClusterizeTracks(std::vector<Tracklet>& tracks) const;//core algorithm for creating the clusters diff --git a/MuonSpectrometer/MuonCalib/CscCalib/CscCalibTools/src/CscCalibTool.cxx b/MuonSpectrometer/MuonCalib/CscCalib/CscCalibTools/src/CscCalibTool.cxx index 95de963a1a9e261809754ae4f94e5409a7a7d31a..a898d8246cdc1b3633ba4ae7773e0a9a36625e95 100644 --- a/MuonSpectrometer/MuonCalib/CscCalib/CscCalibTools/src/CscCalibTool.cxx +++ b/MuonSpectrometer/MuonCalib/CscCalib/CscCalibTools/src/CscCalibTool.cxx @@ -63,15 +63,6 @@ Double_t dualbipfunc(const Double_t *x, const Double_t *par){ return ( bipfunc(x,par) + bipfunc(x,&par[5]) ); } -StatusCode CscCalibTool::finalize() { - delete m_addedfunc; - delete m_bipolarFunc; - m_addedfunc = nullptr; - m_bipolarFunc = nullptr; - return StatusCode::SUCCESS; -} - - StatusCode CscCalibTool::initialize() { ATH_MSG_DEBUG ( "Initializing Initializing CscCalibTool"); @@ -100,8 +91,12 @@ StatusCode CscCalibTool::initialize() { m_messageCnt_t0phase=0; std::lock_guard<std::mutex> lock(m_mutex); - m_addedfunc =new TF1("addedfunc", dualbipfunc, 0,500,10); - m_bipolarFunc =new TF1("bipolarFunc", bipfunc, -500,500,5); + if (m_addedfunc == nullptr) { + m_addedfunc = std::make_unique<TF1>("addedfunc", dualbipfunc, 0, 500, 10, 1, TF1::EAddToList::kNo); + } + if (m_bipolarFunc == nullptr) { + m_bipolarFunc = std::make_unique<TF1>("bipolarFunc", bipfunc, -500, 500, 5, 1, TF1::EAddToList::kNo); + } return StatusCode::SUCCESS; } diff --git a/MuonSpectrometer/MuonCalib/CscCalib/CscCalibTools/src/CscCalibTool.h b/MuonSpectrometer/MuonCalib/CscCalib/CscCalibTools/src/CscCalibTool.h index 8ecba81dad90471656e11e189b3d370f2f02100c..1f92d66e443a845880e7d8f8470cae262fba067f 100644 --- a/MuonSpectrometer/MuonCalib/CscCalib/CscCalibTools/src/CscCalibTool.h +++ b/MuonSpectrometer/MuonCalib/CscCalib/CscCalibTools/src/CscCalibTool.h @@ -27,6 +27,7 @@ #include <atomic> #include <inttypes.h> +#include <memory> #include <mutex> #include <vector> @@ -39,7 +40,6 @@ public: virtual ~CscCalibTool () = default; virtual StatusCode initialize() override final; - virtual StatusCode finalize() override final; /** given a charge on the CSC strip, convert that to ADC counts this is needed in the digitization for example where it is the charges @@ -168,8 +168,8 @@ protected: float m_latencyInDigitization; // new in 12/2010 for New Digitization package... unsigned int m_nSamples; - mutable TF1* m_addedfunc ATLAS_THREAD_SAFE; // Guarded by m_mutex - mutable TF1* m_bipolarFunc ATLAS_THREAD_SAFE; // Guarded by m_mutex + mutable std::unique_ptr<TF1> m_addedfunc ATLAS_THREAD_SAFE = nullptr; // Guarded by m_mutex + mutable std::unique_ptr<TF1> m_bipolarFunc ATLAS_THREAD_SAFE = nullptr; // Guarded by m_mutex mutable std::mutex m_mutex; bool m_onlineHLT; diff --git a/MuonSpectrometer/MuonCalib/MdtCalib/MdtCalibITools/CMakeLists.txt b/MuonSpectrometer/MuonCalib/MdtCalib/MdtCalibITools/CMakeLists.txt deleted file mode 100644 index e6c1c7f8c1f7c5ba46bf0d4a10d9961169fbce5b..0000000000000000000000000000000000000000 --- a/MuonSpectrometer/MuonCalib/MdtCalib/MdtCalibITools/CMakeLists.txt +++ /dev/null @@ -1,14 +0,0 @@ -################################################################################ -# Package: MdtCalibITools -################################################################################ - -# Declare the package name: -atlas_subdir( MdtCalibITools ) - -# Declare the package's dependencies: -atlas_depends_on_subdirs( PUBLIC - GaudiKernel ) - -# Install files from the package: -atlas_install_headers( MdtCalibITools ) - diff --git a/MuonSpectrometer/MuonCalib/MdtCalib/MdtCalibITools/MdtCalibITools/IMdtCalibTool.h b/MuonSpectrometer/MuonCalib/MdtCalib/MdtCalibITools/MdtCalibITools/IMdtCalibTool.h deleted file mode 100755 index 4e0ce443bc46b928d59e6ce112cd019990fc2067..0000000000000000000000000000000000000000 --- a/MuonSpectrometer/MuonCalib/MdtCalib/MdtCalibITools/MdtCalibITools/IMdtCalibTool.h +++ /dev/null @@ -1,56 +0,0 @@ -/* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration -*/ - -/////////////////////////////////////////////////////////////////// -// IMdtCalibTool.h -// Header file for class IMdtCalibTool -/////////////////////////////////////////////////////////////////// -// (c) ATLAS Detector software -/////////////////////////////////////////////////////////////////// -// Niels.Van.Eldik@cern.ch, -/////////////////////////////////////////////////////////////////// - - -#ifndef MUONCALIB_IMDTCALIBTOOL_H -#define MUONCALIB_IMDTCALIBTOOL_H - -// Gaudi -#include "GaudiKernel/IAlgTool.h" - -#include <string> - -namespace MuonCalib { - - class IMdtCalibration; - class IMdtCalibrationOutput; - - - - /** Interface ID for IMdtCalibTool*/ - static const InterfaceID IID_IMdtCalibTool("MuonCalib::IMdtCalibTool", 1, 0); - - /**@class IMdtCalibTool - Interface class IMdtCalibTool. - Concrete implementation creates an instance of an IMdtCalibration implementation. - - @author Niels.Van.Eldik@cern.ch, - */ - class IMdtCalibTool : virtual public IAlgTool { - - public: - /**Virtual destructor*/ - virtual ~IMdtCalibTool(){}; - - /** AlgTool and IAlgTool interface methods */ - static const InterfaceID& interfaceID() { return IID_IMdtCalibTool; }; - - /** Interface method: return the IMdtCalibration pointer */ - virtual IMdtCalibration* getImp(std::string RegionKey) = 0; - - virtual bool writeToDb( const IMdtCalibrationOutput* result, std::string regionKey ) const = 0; - }; - -} - -#endif // diff --git a/MuonSpectrometer/MuonCalib/MdtCalib/MdtCalibITools/MdtCalibITools/IMdtSegmentFitterTool.h b/MuonSpectrometer/MuonCalib/MdtCalib/MdtCalibITools/MdtCalibITools/IMdtSegmentFitterTool.h deleted file mode 100755 index 9b9387398003f3c0fd5e8f56a94984f7bdadcb38..0000000000000000000000000000000000000000 --- a/MuonSpectrometer/MuonCalib/MdtCalib/MdtCalibITools/MdtCalibITools/IMdtSegmentFitterTool.h +++ /dev/null @@ -1,52 +0,0 @@ -/* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration -*/ - -/////////////////////////////////////////////////////////////////// -// IMdtSegmentFitterTool.h -// Header file for class IMdtSegmentFitterTool -/////////////////////////////////////////////////////////////////// -// (c) ATLAS Detector software -/////////////////////////////////////////////////////////////////// -// Niels.Van.Eldik@cern.ch, -/////////////////////////////////////////////////////////////////// - - -#ifndef MUONCALIB_IMDTSEGMENTFITTERTOOL_H -#define MUONCALIB_IMDTSEGMENTFITTERTOOL_H - -// Gaudi -#include "GaudiKernel/IAlgTool.h" - -namespace MuonCalib { - - class IMdtSegmentFitter; - - - /** Interface ID for IMdtSegmentFitterTool */ - static const InterfaceID IID_IMdtSegmentFitterTool("MuonCalib::IMdtSegmentFitterTool", 1, 0); - - /**@class IMdtSegmentFitterTool - Interface class IMdtSegmentFitterTool. - Implementations create an instance of a IMdtSegmentFitter implementation - - @author Niels.Van.Eldik@cern.ch, - */ - class IMdtSegmentFitterTool : virtual public IAlgTool { - - public: - /**Virtual destructor*/ - virtual ~IMdtSegmentFitterTool(){}; - - /** AlgTool and IAlgTool interface methods */ - static const InterfaceID& interfaceID() { return IID_IMdtSegmentFitterTool; }; - - /** Interface method: return the IMdtSegmentFitter pointer */ - - virtual IMdtSegmentFitter* getImp() = 0; - - }; - -} - -#endif // diff --git a/MuonSpectrometer/MuonCalib/MdtCalib/MdtCalibITools/MdtCalibITools/IMdtSegmentSelectorTool.h b/MuonSpectrometer/MuonCalib/MdtCalib/MdtCalibITools/MdtCalibITools/IMdtSegmentSelectorTool.h deleted file mode 100755 index 3b32d241bd76551befbd8c3319c555307e8c0d3c..0000000000000000000000000000000000000000 --- a/MuonSpectrometer/MuonCalib/MdtCalib/MdtCalibITools/MdtCalibITools/IMdtSegmentSelectorTool.h +++ /dev/null @@ -1,43 +0,0 @@ -/* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration -*/ - -#ifndef MUONCALIB_IMDTSEGMENTSELECTORTOOL_H -#define MUONCALIB_IMDTSEGMENTSELECTORTOOL_H - -// Gaudi -#include "GaudiKernel/IAlgTool.h" - - -namespace MuonCalib { - - /** Interface ID for IMdtSegmentSelectorTool*/ - static const InterfaceID IID_IMdtSegmentSelectorTool("MuonCalib::IMdtSegmentSelectorTool", 1, 0); - - /**@class IMdtSegmentSelectorTool - Interface class for MdtSegmentSelectorTool's - Implementations create an instance of a IMdtSegmentSelector implementation. - - @author Niels.Van.Eldik@cern.ch, - */ - - class IMdtSegmentSelector; - - class IMdtSegmentSelectorTool : virtual public IAlgTool { - - public: - /**Virtual destructor*/ - virtual ~IMdtSegmentSelectorTool(){}; - - /** AlgTool and IAlgTool interface methods */ - static const InterfaceID& interfaceID() { return IID_IMdtSegmentSelectorTool; }; - - /** Interface method: return the implementation pointer */ - virtual const IMdtSegmentSelector* getImp() = 0; - - - }; - -} - -#endif // diff --git a/MuonSpectrometer/MuonCalib/MdtCalib/MdtCalibITools/MdtCalibITools/IPatternSelectorTool.h b/MuonSpectrometer/MuonCalib/MdtCalib/MdtCalibITools/MdtCalibITools/IPatternSelectorTool.h deleted file mode 100755 index b95dc4eb53e2b82807eb14d9a5590a2d7dcec9d2..0000000000000000000000000000000000000000 --- a/MuonSpectrometer/MuonCalib/MdtCalib/MdtCalibITools/MdtCalibITools/IPatternSelectorTool.h +++ /dev/null @@ -1,42 +0,0 @@ -/* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration -*/ - -#ifndef IPATTERNSELECTORTOOL_H -#define IPATTERNSELECTORTOOL_H - -// Gaudi -#include "GaudiKernel/IAlgTool.h" - -namespace MuonCalib { - - /** Interface ID for IMdtSegmentSelectorTool*/ - static const InterfaceID IID_IPatternSelectorTool("MuonCalib::IPatternSelectorTool", 1, 0); - - /**@class IPatternSelectorTool - Interface class for PatternSelectorTool's - Implementations create an instance of a IMuonCalibPatternSelector implementation. - - @author Niels.Van.Eldik@cern.ch, - */ - - class ICalibPatternSelector; - - class IPatternSelectorTool : virtual public IAlgTool { - - public: - /**Virtual destructor*/ - virtual ~IPatternSelectorTool(){}; - - /** AlgTool and IAlgTool interface methods */ - static const InterfaceID& interfaceID() { return IID_IPatternSelectorTool; }; - - /** Interface method: return the implementation pointer */ - virtual const ICalibPatternSelector* getImp() = 0; - - - }; - -} - -#endif // diff --git a/MuonSpectrometer/MuonCalib/MdtCalib/MdtCalibITools/doc/Doxyfile b/MuonSpectrometer/MuonCalib/MdtCalib/MdtCalibITools/doc/Doxyfile deleted file mode 100755 index 0dbcbb0e02d6c823033ea477db8e8fcf0ef276c1..0000000000000000000000000000000000000000 --- a/MuonSpectrometer/MuonCalib/MdtCalib/MdtCalibITools/doc/Doxyfile +++ /dev/null @@ -1,160 +0,0 @@ -# Doxyfile 1.2.10 - -#--------------------------------------------------------------------------- -# General configuration options -#--------------------------------------------------------------------------- -PROJECT_NAME = MdtCalibITools -PROJECT_NUMBER = MdtCalibITools-00-00-01 -OUTPUT_DIRECTORY = /afs/cern.ch/user/d/domizia/calibration4/InstallArea/doc/MdtCalibITools -OUTPUT_LANGUAGE = English -EXTRACT_ALL = YES -EXTRACT_PRIVATE = YES -EXTRACT_STATIC = YES -HIDE_UNDOC_MEMBERS = NO -HIDE_UNDOC_CLASSES = NO -BRIEF_MEMBER_DESC = YES -REPEAT_BRIEF = YES -ALWAYS_DETAILED_SEC = NO -FULL_PATH_NAMES = NO -STRIP_FROM_PATH = -INTERNAL_DOCS = NO -CLASS_DIAGRAMS = YES -SOURCE_BROWSER = YES -INLINE_SOURCES = YES -STRIP_CODE_COMMENTS = YES -CASE_SENSE_NAMES = YES -SHORT_NAMES = NO -HIDE_SCOPE_NAMES = NO -VERBATIM_HEADERS = YES -SHOW_INCLUDE_FILES = YES -JAVADOC_AUTOBRIEF = YES -INHERIT_DOCS = YES -INLINE_INHERITED_MEMB = YES -INLINE_INFO = YES -SORT_MEMBER_DOCS = NO -DISTRIBUTE_GROUP_DOC = NO -TAB_SIZE = 8 -GENERATE_TODOLIST = YES -GENERATE_TESTLIST = YES -GENERATE_BUGLIST = YES -ALIASES = -ENABLED_SECTIONS = -MAX_INITIALIZER_LINES = 30 -OPTIMIZE_OUTPUT_FOR_C = NO -SHOW_USED_FILES = YES -#--------------------------------------------------------------------------- -# configuration options related to warning and progress messages -#--------------------------------------------------------------------------- -QUIET = NO -WARNINGS = YES -WARN_IF_UNDOCUMENTED = YES -WARN_FORMAT = -WARN_LOGFILE = -#--------------------------------------------------------------------------- -# configuration options related to the input files -#--------------------------------------------------------------------------- -INPUT = ../MdtCalibITools ../doc -FILE_PATTERNS = *.cxx *.h *.py *.xml *.mk -RECURSIVE = YES -EXCLUDE = -EXCLUDE_PATTERNS = -EXAMPLE_PATH = ../doc ../cmt ../share -EXAMPLE_PATTERNS = *.cxx *.html requirements *.py -IMAGE_PATH = -INPUT_FILTER = -FILTER_SOURCE_FILES = NO -#--------------------------------------------------------------------------- -# configuration options related to the alphabetical class index -#--------------------------------------------------------------------------- -ALPHABETICAL_INDEX = NO -COLS_IN_ALPHA_INDEX = 5 -IGNORE_PREFIX = -#--------------------------------------------------------------------------- -# configuration options related to the HTML output -#--------------------------------------------------------------------------- -GENERATE_HTML = YES -HTML_OUTPUT = html -HTML_HEADER = -HTML_FOOTER = -HTML_STYLESHEET = -HTML_ALIGN_MEMBERS = YES -GENERATE_HTMLHELP = NO -GENERATE_CHI = NO -BINARY_TOC = NO -TOC_EXPAND = NO -DISABLE_INDEX = NO -ENUM_VALUES_PER_LINE = 4 -GENERATE_TREEVIEW = NO -TREEVIEW_WIDTH = 250 -#--------------------------------------------------------------------------- -# configuration options related to the LaTeX output -#--------------------------------------------------------------------------- -GENERATE_LATEX = NO -LATEX_OUTPUT = -COMPACT_LATEX = NO -PAPER_TYPE = a4wide -EXTRA_PACKAGES = -LATEX_HEADER = -PDF_HYPERLINKS = NO -USE_PDFLATEX = NO -LATEX_BATCHMODE = NO -#--------------------------------------------------------------------------- -# configuration options related to the RTF output -#--------------------------------------------------------------------------- -GENERATE_RTF = NO -RTF_OUTPUT = -COMPACT_RTF = NO -RTF_HYPERLINKS = NO -RTF_STYLESHEET_FILE = -RTF_EXTENSIONS_FILE = -#--------------------------------------------------------------------------- -# configuration options related to the man page output -#--------------------------------------------------------------------------- -GENERATE_MAN = NO -MAN_OUTPUT = -MAN_EXTENSION = -MAN_LINKS = NO -#--------------------------------------------------------------------------- -# configuration options related to the XML output -#--------------------------------------------------------------------------- -GENERATE_XML = NO -#--------------------------------------------------------------------------- -# Configuration options related to the preprocessor -#--------------------------------------------------------------------------- -ENABLE_PREPROCESSING = YES -MACRO_EXPANSION = NO -EXPAND_ONLY_PREDEF = NO -SEARCH_INCLUDES = YES -INCLUDE_PATH = -INCLUDE_FILE_PATTERNS = -PREDEFINED = -EXPAND_AS_DEFINED = -#--------------------------------------------------------------------------- -# Configuration::addtions related to external references -#--------------------------------------------------------------------------- -TAGFILES = /afs/cern.ch/atlas/software/dist/10.2.0/InstallArea/doc/AtlasPolicy.tag -GENERATE_TAGFILE = /afs/cern.ch/user/d/domizia/calibration4/InstallArea/doc/MdtCalibITools.tag -ALLEXTERNALS = NO -PERL_PATH = -#--------------------------------------------------------------------------- -# Configuration options related to the dot tool -#--------------------------------------------------------------------------- -HAVE_DOT = YES -CLASS_GRAPH = YES -COLLABORATION_GRAPH = YES -TEMPLATE_RELATIONS = YES -INCLUDE_GRAPH = YES -INCLUDED_BY_GRAPH = YES -GRAPHICAL_HIERARCHY = YES -DOT_PATH = -DOTFILE_DIRS = -MAX_DOT_GRAPH_WIDTH = 1024 -MAX_DOT_GRAPH_HEIGHT = 1024 -GENERATE_LEGEND = YES -DOT_CLEANUP = YES -DOT_IMAGE_FORMAT = gif -UML_LOOK = YES -#--------------------------------------------------------------------------- -# Configuration::addtions related to the search engine -#--------------------------------------------------------------------------- -SEARCHENGINE = NO diff --git a/MuonSpectrometer/MuonCalib/MdtCalib/MdtCalibITools/doc/packagedoc.h b/MuonSpectrometer/MuonCalib/MdtCalib/MdtCalibITools/doc/packagedoc.h deleted file mode 100644 index d8f1be674de6904ceb403b4fa16f69c2429524e9..0000000000000000000000000000000000000000 --- a/MuonSpectrometer/MuonCalib/MdtCalib/MdtCalibITools/doc/packagedoc.h +++ /dev/null @@ -1,27 +0,0 @@ -/* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration -*/ - -/** -@page MdtCalibITools_page MdtCalibITools Package -@author Niels.Van.Eldik@cern.ch - -@section MdtCalibITools_MdtCalibIToolsIntro Introduction -Interface classes for the various tools implemented in MdtCalibTools package. - -@section MdtCalibITools_MdtCalibIToolsOverview Class Overview -The interface classes provided by MdtCalibITools package are: - -- MuonCalib::IMdtCalibTool: Interface class for Mdt Calibration Tools -- MuonCalib::IMdtSegmentFitterTool: Interface class for Segment Fitter Tools -- MuonCalib::IMdtSegmentSelectorTool: Interface class for Segment Selector Tools -- MuonCalib::IPatternSelectorTool: Interface class for Pattern Selector Tools - - -Interface classes for the various tools implemented in MdtCalibTools package: - -IMdtCalibTool : Interface used for Tools that are called by the MuonCalibAlg. -IPatternSelectorTool : Interface for creator tools that create IPatternSelector implemenatations. -IMdtSegmentSelectorTool : Interface for creator tools that create IMdtSegmentSelector implemenatations. -IMdtSegmentFitterTool : Interface for creator tools that create IMdtSegmentFitter implemenatations. -*/ diff --git a/MuonSpectrometer/MuonCnv/MuonByteStream/CMakeLists.txt b/MuonSpectrometer/MuonCnv/MuonByteStream/CMakeLists.txt index 0a285740346c15db6ee7365ada8dc3c594263fd9..4a347e181a64759ff189a310d9736a3c1afba660 100644 --- a/MuonSpectrometer/MuonCnv/MuonByteStream/CMakeLists.txt +++ b/MuonSpectrometer/MuonCnv/MuonByteStream/CMakeLists.txt @@ -19,6 +19,7 @@ atlas_depends_on_subdirs( PUBLIC PRIVATE Control/StoreGate Control/AthViews + Trigger/TrigSteer/ViewAlgs MuonSpectrometer/MuonCablings/CSCcabling MuonSpectrometer/MuonCablings/RPCcablingInterface MuonSpectrometer/MuonCnv/MuonMDT_CnvTools @@ -37,7 +38,7 @@ atlas_add_component( MuonByteStream src/components/*.cxx INCLUDE_DIRS ${TDAQ-COMMON_INCLUDE_DIRS} ${CLHEP_INCLUDE_DIRS} DEFINITIONS ${CLHEP_DEFINITIONS} - LINK_LIBRARIES ${TDAQ-COMMON_LIBRARIES} ${CLHEP_LIBRARIES} AthenaBaseComps ByteStreamCnvSvcBaseLib ByteStreamData ByteStreamData_test GaudiKernel StoreGateLib SGtests AthenaPoolUtilities CSCcablingLib RPCcablingInterfaceLib MuonIdHelpersLib MuonRDO TrigSteeringEvent AthViews MuonMDT_CnvToolsLib MuonCSC_CnvToolsLib MuonRPC_CnvToolsLib MuonCnvToolInterfacesLib ) + LINK_LIBRARIES ${TDAQ-COMMON_LIBRARIES} ${CLHEP_LIBRARIES} AthenaBaseComps ByteStreamCnvSvcBaseLib ByteStreamData ByteStreamData_test GaudiKernel StoreGateLib SGtests AthenaPoolUtilities CSCcablingLib RPCcablingInterfaceLib MuonIdHelpersLib MuonRDO TrigSteeringEvent AthViews MuonMDT_CnvToolsLib MuonCSC_CnvToolsLib MuonRPC_CnvToolsLib MuonCnvToolInterfacesLib ViewAlgsLib) # Install files from the package: atlas_install_headers( MuonByteStream ) diff --git a/MuonSpectrometer/MuonCnv/MuonByteStream/src/MuonCacheCreator.cxx b/MuonSpectrometer/MuonCnv/MuonByteStream/src/MuonCacheCreator.cxx index 9881cb65d67835593e4e309342738be42303ae8e..8cb653b73a7abe5a953514c739b3afea5a5c8c4b 100644 --- a/MuonSpectrometer/MuonCnv/MuonByteStream/src/MuonCacheCreator.cxx +++ b/MuonSpectrometer/MuonCnv/MuonByteStream/src/MuonCacheCreator.cxx @@ -4,16 +4,13 @@ #include "MuonCacheCreator.h" -#include "AthViews/View.h" - /// Constructor MuonCacheCreator::MuonCacheCreator(const std::string &name,ISvcLocator *pSvcLocator): - AthReentrantAlgorithm(name,pSvcLocator), + IDCCacheCreatorBase(name,pSvcLocator), m_MdtCsmCacheKey(""), m_CscCacheKey(""), m_RpcCacheKey(""), - m_TgcCacheKey(""), - m_disableWarningCheck(false) + m_TgcCacheKey("") { declareProperty("MdtCsmCacheKey", m_MdtCsmCacheKey); declareProperty("CscCacheKey", m_CscCacheKey); @@ -23,52 +20,38 @@ MuonCacheCreator::MuonCacheCreator(const std::string &name,ISvcLocator *pSvcLoca StatusCode MuonCacheCreator::initialize() { ATH_CHECK( m_idHelperSvc.retrieve() ); - ATH_CHECK( m_MdtCsmCacheKey.initialize(!m_MdtCsmCacheKey.key().empty()) ); + ATH_CHECK( m_MdtCsmCacheKey.initialize(SG::AllowEmpty) ); if (!m_CscCacheKey.key().empty() && !m_idHelperSvc->hasCSC()) { ATH_MSG_WARNING("CscCacheKey is non-empty ("<<m_CscCacheKey.key()<<") but layout has no CSC chambers! Looks like something is wrongly configured."); - } else ATH_CHECK( m_CscCacheKey.initialize(!m_CscCacheKey.key().empty()) ); - ATH_CHECK( m_RpcCacheKey.initialize(!m_RpcCacheKey.key().empty()) ); - ATH_CHECK( m_TgcCacheKey.initialize(!m_TgcCacheKey.key().empty()) ); + } else ATH_CHECK( m_CscCacheKey.initialize(SG::AllowEmpty) ); + ATH_CHECK( m_RpcCacheKey.initialize(SG::AllowEmpty) ); + ATH_CHECK( m_TgcCacheKey.initialize(SG::AllowEmpty) ); + if(m_disableWarning) m_disableWarningCheck.store(true, std::memory_order_relaxed); return StatusCode::SUCCESS; } -bool MuonCacheCreator::isInsideView(const EventContext& context) const -{ - const IProxyDict* proxy = Atlas::getExtendedEventContext(context).proxy(); - const SG::View* view = dynamic_cast<const SG::View*>(proxy); - return view != nullptr; -} StatusCode MuonCacheCreator::execute (const EventContext& ctx) const { - if(!m_disableWarningCheck and !m_disableWarning.value()){ - if(isInsideView(ctx)){ - ATH_MSG_ERROR("CacheCreator is running inside a view, this is probably a misconfiguration"); - return StatusCode::FAILURE; - } - m_disableWarningCheck = true; //only check once - } + ATH_CHECK(checkInsideViewOnce(ctx)); // Create the MDT cache container int maxHashMDTs = m_idHelperSvc->mdtIdHelper().stationNameIndex("BME") != -1 ? m_idHelperSvc->mdtIdHelper().detectorElement_hash_max() : m_idHelperSvc->mdtIdHelper().module_hash_max(); if (!m_MdtCsmCacheKey.key().empty()) { - ATH_CHECK(createContainer(m_MdtCsmCacheKey, maxHashMDTs, ctx)); - ATH_MSG_DEBUG("Created cache container " << m_MdtCsmCacheKey); + ATH_CHECK(createContainer<false>(m_MdtCsmCacheKey, maxHashMDTs, ctx)); } // Create the CSC cache container if (m_idHelperSvc->hasCSC() && !m_CscCacheKey.key().empty()) { - ATH_CHECK(createContainer(m_CscCacheKey, m_idHelperSvc->cscIdHelper().module_hash_max(), ctx)); - ATH_MSG_DEBUG("Created cache container " << m_CscCacheKey); + //"false" is there to prevent second check on the cache name + ATH_CHECK(createContainer<false>(m_CscCacheKey, m_idHelperSvc->cscIdHelper().module_hash_max(), ctx)); } // Create the RPC cache container // Max should match 600 (hardcoded in RPC_RawDataProviderTool) if (!m_RpcCacheKey.key().empty()) { - ATH_CHECK(createContainer(m_RpcCacheKey, m_idHelperSvc->rpcIdHelper().module_hash_max(), ctx)); - ATH_MSG_DEBUG("Created cache container " << m_RpcCacheKey); + ATH_CHECK(createContainer<false>(m_RpcCacheKey, m_idHelperSvc->rpcIdHelper().module_hash_max(), ctx)); } // Create the TGC cache container if (!m_TgcCacheKey.key().empty()) { - ATH_CHECK(createContainer(m_TgcCacheKey, m_idHelperSvc->tgcIdHelper().module_hash_max(), ctx)); - ATH_MSG_DEBUG("Created cache container " << m_TgcCacheKey); + ATH_CHECK(createContainer<false>(m_TgcCacheKey, m_idHelperSvc->tgcIdHelper().module_hash_max(), ctx)); } return StatusCode::SUCCESS; } diff --git a/MuonSpectrometer/MuonCnv/MuonByteStream/src/MuonCacheCreator.h b/MuonSpectrometer/MuonCnv/MuonByteStream/src/MuonCacheCreator.h index 6af3df5db9a73f6889aca0c6ab6d9c3a2a6ed67c..12ce288fb72cf0b7d94fae372ccce219b1a8ab70 100644 --- a/MuonSpectrometer/MuonCnv/MuonByteStream/src/MuonCacheCreator.h +++ b/MuonSpectrometer/MuonCnv/MuonByteStream/src/MuonCacheCreator.h @@ -4,7 +4,7 @@ #pragma once -#include "AthenaBaseComps/AthReentrantAlgorithm.h" +#include "ViewAlgs/IDCCacheCreatorBase.h" #include "GaudiKernel/ServiceHandle.h" #include "MuonRDO/MdtCsm_Cache.h" #include "MuonRDO/CscRawDataCollection_Cache.h" @@ -12,9 +12,7 @@ #include "MuonRDO/TgcRdo_Cache.h" #include "MuonIdHelpers/IMuonIdHelperSvc.h" -#include <atomic> - -class MuonCacheCreator : public AthReentrantAlgorithm { +class MuonCacheCreator : public IDCCacheCreatorBase { public: /// Constructor @@ -30,9 +28,6 @@ class MuonCacheCreator : public AthReentrantAlgorithm { protected: - template<typename T> - StatusCode createContainer(const SG::WriteHandleKey<T>& , long unsigned int , const EventContext& ) const; - /// Write handle key for the MDT CSM cache container SG::WriteHandleKey<MdtCsm_Cache> m_MdtCsmCacheKey; SG::WriteHandleKey<CscRawDataCollection_Cache> m_CscCacheKey; @@ -40,21 +35,7 @@ protected: SG::WriteHandleKey<TgcRdo_Cache> m_TgcCacheKey; ServiceHandle<Muon::IMuonIdHelperSvc> m_idHelperSvc {this, "MuonIdHelperSvc", "Muon::MuonIdHelperSvc/MuonIdHelperSvc"}; BooleanProperty m_disableWarning{this,"DisableViewWarning",false}; - mutable std::atomic_bool m_disableWarningCheck; - bool isInsideView(const EventContext&) const; };//class MuonCacheCreator -// copied from http://acode-browser1.usatlas.bnl.gov/lxr/source/athena/InnerDetector/InDetRecAlgs/InDetPrepRawDataFormation/src/CacheCreator.h#0062 -// maybe should figure out if this code can be shared -template<typename T> -StatusCode MuonCacheCreator::createContainer(const SG::WriteHandleKey<T>& containerKey, long unsigned int size, const EventContext& ctx) const{ - if(containerKey.key().empty()){ - ATH_MSG_DEBUG( "Creation of container "<< containerKey.key() << " is disabled (no name specified)"); - return StatusCode::SUCCESS; - } - SG::WriteHandle<T> ContainerCacheKey(containerKey, ctx); - ATH_CHECK( ContainerCacheKey.recordNonConst ( std::make_unique<T>(IdentifierHash(size), nullptr) )); - ATH_MSG_DEBUG( "Container "<< containerKey.key() << " created to hold " << size ); - return StatusCode::SUCCESS; -} + diff --git a/MuonSpectrometer/MuonCnv/MuonRdoToPrepData/CMakeLists.txt b/MuonSpectrometer/MuonCnv/MuonRdoToPrepData/CMakeLists.txt index 64e2934e9db591fdfa95c86ce25771ef723880e8..32698b8279e0949cdfc59d3f715cb1ae8b710868 100644 --- a/MuonSpectrometer/MuonCnv/MuonRdoToPrepData/CMakeLists.txt +++ b/MuonSpectrometer/MuonCnv/MuonRdoToPrepData/CMakeLists.txt @@ -14,6 +14,7 @@ atlas_depends_on_subdirs( PUBLIC Control/StoreGate Control/AthViews DetectorDescription/Identifier + Trigger/TrigSteer/ViewAlgs Trigger/TrigEvent/TrigSteeringEvent DetectorDescription/IRegionSelector MuonSpectrometer/MuonReconstruction/MuonRecEvent/MuonPrepRawData @@ -23,7 +24,7 @@ atlas_depends_on_subdirs( PUBLIC atlas_add_component( MuonRdoToPrepData src/*.cxx src/components/*.cxx - LINK_LIBRARIES AthenaBaseComps GaudiKernel StoreGateLib SGtests Identifier TrigSteeringEvent IRegionSelector MuonPrepRawData MuonTrigCoinData AthViews MuonCnvToolInterfacesLib ) + LINK_LIBRARIES AthenaBaseComps GaudiKernel StoreGateLib SGtests Identifier TrigSteeringEvent IRegionSelector MuonPrepRawData MuonTrigCoinData AthViews MuonCnvToolInterfacesLib ViewAlgsLib ) # Install files from the package: atlas_install_headers( MuonRdoToPrepData ) diff --git a/MuonSpectrometer/MuonCnv/MuonRdoToPrepData/src/MuonPRDCacheCreator.cxx b/MuonSpectrometer/MuonCnv/MuonRdoToPrepData/src/MuonPRDCacheCreator.cxx index 463ba003112d075c7076cb757356428c1ca47cd3..4ccfa0061f7e52127240aa5c6399fd2cb006593c 100644 --- a/MuonSpectrometer/MuonCnv/MuonRdoToPrepData/src/MuonPRDCacheCreator.cxx +++ b/MuonSpectrometer/MuonCnv/MuonRdoToPrepData/src/MuonPRDCacheCreator.cxx @@ -8,7 +8,7 @@ /// Constructor MuonPRDCacheCreator::MuonPRDCacheCreator(const std::string &name,ISvcLocator *pSvcLocator): - AthReentrantAlgorithm(name,pSvcLocator), + IDCCacheCreatorBase(name,pSvcLocator), m_CscCacheKey(""), m_CscStripCacheKey(""), m_MdtCacheKey(""), @@ -32,15 +32,15 @@ MuonPRDCacheCreator::MuonPRDCacheCreator(const std::string &name,ISvcLocator *pS } StatusCode MuonPRDCacheCreator::initialize() { - ATH_CHECK( m_CscCacheKey.initialize( !m_CscCacheKey.key().empty() )); - ATH_CHECK( m_CscStripCacheKey.initialize( !m_CscStripCacheKey.key().empty() )); - ATH_CHECK( m_MdtCacheKey.initialize( !m_MdtCacheKey.key().empty() )); - ATH_CHECK( m_RpcCacheKey.initialize( !m_RpcCacheKey.key().empty() )); - ATH_CHECK( m_TgcCacheKey.initialize( !m_TgcCacheKey.key().empty() )); - ATH_CHECK( m_sTgcCacheKey.initialize( !m_sTgcCacheKey.key().empty() )); - ATH_CHECK( m_MmCacheKey.initialize( !m_MmCacheKey.key().empty() )); - ATH_CHECK( m_RpcCoinCacheKey.initialize( !m_RpcCoinCacheKey.key().empty() )); - ATH_CHECK( m_TgcCoinCacheKey.initialize( !m_TgcCoinCacheKey.key().empty() )); + ATH_CHECK( m_CscCacheKey.initialize( SG::AllowEmpty )); + ATH_CHECK( m_CscStripCacheKey.initialize( SG::AllowEmpty )); + ATH_CHECK( m_MdtCacheKey.initialize( SG::AllowEmpty )); + ATH_CHECK( m_RpcCacheKey.initialize( SG::AllowEmpty )); + ATH_CHECK( m_TgcCacheKey.initialize( SG::AllowEmpty )); + ATH_CHECK( m_sTgcCacheKey.initialize( SG::AllowEmpty )); + ATH_CHECK( m_MmCacheKey.initialize( SG::AllowEmpty )); + ATH_CHECK( m_RpcCoinCacheKey.initialize( SG::AllowEmpty )); + ATH_CHECK( m_TgcCoinCacheKey.initialize( SG::AllowEmpty )); ATH_CHECK(m_idHelperSvc.retrieve()); @@ -63,26 +63,13 @@ StatusCode MuonPRDCacheCreator::initialize() { if( !m_idHelperSvc->hasMM() && !m_MmCacheKey.key().empty() ){ ATH_MSG_WARNING("MM ID Helper is not available and MM PRD cache was requested - This will not be created"); } - + if(m_disableWarning) m_disableWarningCheck.store(true, std::memory_order_relaxed); return StatusCode::SUCCESS; } -bool MuonPRDCacheCreator::isInsideView(const EventContext& context) const -{ - const IProxyDict* proxy = Atlas::getExtendedEventContext(context).proxy(); - const SG::View* view = dynamic_cast<const SG::View*>(proxy); - return view != nullptr; -} - StatusCode MuonPRDCacheCreator::execute (const EventContext& ctx) const { - if(!m_disableWarning){ - if(isInsideView(ctx)){ - ATH_MSG_ERROR("CacheCreator is running inside a view, this is probably a misconfiguration"); - return StatusCode::FAILURE; - } - m_disableWarning = true; //only check once - } + ATH_CHECK(checkInsideViewOnce(ctx)); // Create all the cache containers (if the tools are available) // CSC diff --git a/MuonSpectrometer/MuonCnv/MuonRdoToPrepData/src/MuonPRDCacheCreator.h b/MuonSpectrometer/MuonCnv/MuonRdoToPrepData/src/MuonPRDCacheCreator.h index 8b06e325f0dffa012c2406de8adc83c8ab74171d..7fb064943f87f56fd9e5714b63a02a2c21ae8b9f 100644 --- a/MuonSpectrometer/MuonCnv/MuonRdoToPrepData/src/MuonPRDCacheCreator.h +++ b/MuonSpectrometer/MuonCnv/MuonRdoToPrepData/src/MuonPRDCacheCreator.h @@ -4,7 +4,7 @@ #pragma once -#include "AthenaBaseComps/AthReentrantAlgorithm.h" +#include "ViewAlgs/IDCCacheCreatorBase.h" #include "GaudiKernel/ServiceHandle.h" #include "MuonPrepRawData/MuonPrepDataCollection_Cache.h" @@ -13,7 +13,7 @@ // Class for setting up PRD cache containers -class MuonPRDCacheCreator : public AthReentrantAlgorithm { +class MuonPRDCacheCreator : public IDCCacheCreatorBase { public: /// Constructor @@ -28,9 +28,6 @@ class MuonPRDCacheCreator : public AthReentrantAlgorithm { virtual StatusCode execute (const EventContext& ctx) const override; protected: - - template<typename T> - StatusCode createContainer(const SG::WriteHandleKey<T>& , long unsigned int size, const EventContext& ) const; /// Write handle keys for the PRD caches SG::WriteHandleKey<CscPrepDataCollection_Cache> m_CscCacheKey; @@ -45,21 +42,7 @@ protected: ServiceHandle<Muon::IMuonIdHelperSvc> m_idHelperSvc {this, "MuonIdHelperSvc", "Muon::MuonIdHelperSvc/MuonIdHelperSvc"}; - mutable bool m_disableWarning = false; - bool isInsideView(const EventContext&) const; + bool m_disableWarning = false; };//class MuonPRDCacheCreator -// copied from http://acode-browser1.usatlas.bnl.gov/lxr/source/athena/InnerDetector/InDetRecAlgs/InDetPrepRawDataFormation/src/CacheCreator.h#0062 -// maybe should figure out if this code can be shared -template<typename T> -StatusCode MuonPRDCacheCreator::createContainer(const SG::WriteHandleKey<T>& containerKey, long unsigned int size, const EventContext& ctx) const{ - if(containerKey.key().empty()){ - ATH_MSG_DEBUG( "Creation of container (PRD) "<< containerKey.key() << " is disabled (no name specified)"); - return StatusCode::SUCCESS; - } - SG::WriteHandle<T> ContainerCacheKey(containerKey, ctx); - ATH_CHECK( ContainerCacheKey.recordNonConst ( std::make_unique<T>(size, nullptr ) )); - ATH_MSG_DEBUG( "Container (PRD) "<< containerKey.key() << " created to hold size " << size); - return StatusCode::SUCCESS; -} diff --git a/MuonSpectrometer/MuonConfig/python/MDT_DigitizationConfig.py b/MuonSpectrometer/MuonConfig/python/MDT_DigitizationConfig.py index d385cdba567f491567b342b60d28adb54054dca4..4826a2b8d2ec512857766a82a4a5b650d116d545 100644 --- a/MuonSpectrometer/MuonConfig/python/MDT_DigitizationConfig.py +++ b/MuonSpectrometer/MuonConfig/python/MDT_DigitizationConfig.py @@ -8,6 +8,7 @@ from OutputStreamAthenaPool.OutputStreamConfig import OutputStreamCfg from MuonConfig.MuonGeometryConfig import MuonGeoModelCfg from MuonConfig.MuonByteStreamCnvTestConfig import MdtDigitToMdtRDOCfg from MuonConfig.MuonCablingConfig import MDTCablingConfigCfg +from MuonConfig.MuonCalibConfig import MdtCalibrationDbToolCfg from Digitization.TruthDigitizationOutputConfig import TruthDigitizationOutputCfg from Digitization.PileUpToolsConfig import PileUpToolsCfg @@ -35,28 +36,40 @@ def MDT_RangeToolCfg(flags, name="MDT_Range", **kwargs): def RT_Relation_DB_DigiToolCfg(flags, name="RT_Relation_DB_DigiTool", **kwargs): """Return an RT_Relation_DB_DigiTool""" + acc = ComponentAccumulator() RT_Relation_DB_DigiTool = CompFactory.RT_Relation_DB_DigiTool - return RT_Relation_DB_DigiTool(name, **kwargs) + calibDbTool = acc.popToolsAndMerge(MdtCalibrationDbToolCfg(flags)) + kwargs.setdefault("CalibrationDbTool", calibDbTool) + acc.setPrivateTools(RT_Relation_DB_DigiTool(name, **kwargs)) + return acc def MDT_Response_DigiToolCfg(flags, name="MDT_Response_DigiTool",**kwargs): """Return a configured MDT_Response_DigiTool""" + acc = ComponentAccumulator() QballConfig = (flags.Digitization.SpecialConfiguration.get("MDT_QballConfig") == "True") kwargs.setdefault("DoQballGamma", QballConfig) MDT_Response_DigiTool = CompFactory.MDT_Response_DigiTool - return MDT_Response_DigiTool(name, **kwargs) + acc.setPrivateTools(MDT_Response_DigiTool(name, **kwargs)) + return acc def MDT_DigitizationToolCommonCfg(flags, name="MdtDigitizationTool", **kwargs): """Return ComponentAccumulator with common MdtDigitizationTool config""" from MuonConfig.MuonCondAlgConfig import MdtCondDbAlgCfg # MT-safe conditions access acc = MdtCondDbAlgCfg(flags) + if "GetT0FromBD" in kwargs and kwargs["GetT0FromBD"]: + calibDbTool = acc.popToolsAndMerge(MdtCalibrationDbToolCfg(flags)) + kwargs.setdefault("CalibrationDbTool", calibDbTool) + else: + kwargs.setdefault("CalibrationDbTool", '') kwargs.setdefault("MaskedStations", []) kwargs.setdefault("UseDeadChamberSvc", True) kwargs.setdefault("DiscardEarlyHits", True) kwargs.setdefault("UseTof", flags.Beam.Type != "cosmics") # "RT_Relation_DB_DigiTool" in jobproperties.Digitization.experimentalDigi() not migrated - kwargs.setdefault("DigitizationTool", MDT_Response_DigiToolCfg(flags)) + digiTool = acc.popToolsAndMerge(MDT_Response_DigiToolCfg(flags)) + kwargs.setdefault("DigitizationTool", digiTool) QballConfig = (flags.Digitization.SpecialConfiguration.get("MDT_QballConfig") == "True") kwargs.setdefault("DoQballCharge", QballConfig) if flags.Digitization.DoXingByXingPileUp: diff --git a/MuonSpectrometer/MuonConfig/python/MuonByteStreamCnvTestConfig.py b/MuonSpectrometer/MuonConfig/python/MuonByteStreamCnvTestConfig.py index f9f8f3d3a43ef4dc001a3560f4198ee6aca603a8..fdf5f1f4f73818f6810aaf5159a2f484324baa87 100644 --- a/MuonSpectrometer/MuonConfig/python/MuonByteStreamCnvTestConfig.py +++ b/MuonSpectrometer/MuonConfig/python/MuonByteStreamCnvTestConfig.py @@ -4,15 +4,23 @@ Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration """ from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator from AthenaConfiguration.ComponentFactory import CompFactory - +from MuonConfig.MuonGeometryConfig import MuonIdHelperSvcCfg +from MuonConfig.MuonCablingConfig import MDTCablingConfigCfg + +def MdtRDO_DecoderCfg(flags, name="Muon::MdtRDO_Decoder"): + acc = MuonIdHelperSvcCfg(flags) + acc.merge(MDTCablingConfigCfg(flags)) # To provide the Cabling map + Muon_MdtRDO_Decoder = CompFactory.Muon.MdtRDO_Decoder + mdtRDO_Decoder = Muon_MdtRDO_Decoder(name) + mdtRDO_Decoder.MuonIdHelperSvc = acc.getService("MuonIdHelperSvc") + acc.setPrivateTools(mdtRDO_Decoder) + return acc def MdtRdoToMdtDigitCfg(flags, name="MdtRdoToMdtDigitAlg", **kwargs): """Return ComponentAccumulator with configured MdtRdoToMdtDigit algorithm""" - acc = ComponentAccumulator() - from MuonConfig.MuonCablingConfig import MDTCablingConfigCfg - from MuonConfig.MuonCalibConfig import MdtCalibDbAlgCfg - acc.merge(MDTCablingConfigCfg(flags)) - acc.merge(MdtCalibDbAlgCfg(flags)) + acc = MuonIdHelperSvcCfg(flags) + decoderTool = acc.popToolsAndMerge(MdtRDO_DecoderCfg(flags)) + kwargs.setdefault("mdtRdoDecoderTool", decoderTool) if flags.Detector.OverlayMDT: kwargs.setdefault("MdtRdoContainer", flags.Overlay.BkgPrefix + "MDTCSM") kwargs.setdefault("MdtDigitContainer", flags.Overlay.BkgPrefix + "MDT_DIGITS") diff --git a/MuonSpectrometer/MuonConfig/python/MuonCalibConfig.py b/MuonSpectrometer/MuonConfig/python/MuonCalibConfig.py index b1c40b9bcc0eef13f87986b8bd862586dae1a9ed..e54e9fe9ecda4ae9785e5641e283c446fd12ce5b 100644 --- a/MuonSpectrometer/MuonConfig/python/MuonCalibConfig.py +++ b/MuonSpectrometer/MuonConfig/python/MuonCalibConfig.py @@ -3,6 +3,7 @@ # Based on : https://gitlab.cern.ch/atlas/athena/blob/master/MuonSpectrometer/MuonCnv/MuonCnvExample/python/MuonCalibConfig.py from MuonConfig.MuonCondAlgConfig import CscCondDbAlgCfg +from MuonConfig.MuonGeometryConfig import MuonDetectorCondAlgCfg from AthenaConfiguration.ComponentFactory import CompFactory from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator from IOVDbSvc.IOVDbSvcConfig import addFoldersSplitOnline @@ -99,7 +100,7 @@ def MdtCalibrationDbToolCfg(flags, **kwargs): return result def MdtCalibDbAlgCfg(flags,name="MdtCalibDbAlg",**kwargs): - result = ComponentAccumulator() + result = MuonDetectorCondAlgCfg(flags) # setup COOL folders acc, mdt_folder_name_appendix = _setupMdtCondDB(flags) diff --git a/MuonSpectrometer/MuonConfig/python/MuonGeometryConfig.py b/MuonSpectrometer/MuonConfig/python/MuonGeometryConfig.py index f880265dae93f0ca62f17094b2433609fe313db8..5257d12b90386f2ae1b307db2398e3a28e502adb 100644 --- a/MuonSpectrometer/MuonConfig/python/MuonGeometryConfig.py +++ b/MuonSpectrometer/MuonConfig/python/MuonGeometryConfig.py @@ -8,14 +8,19 @@ Muon__MuonIdHelperSvc=CompFactory.Muon.MuonIdHelperSvc AGDDtoGeoSvc=CompFactory.AGDDtoGeoSvc MuonAGDDTool, NSWAGDDTool=CompFactory.getComps("MuonAGDDTool","NSWAGDDTool",) -def MuonGeoModelCfg(flags): + +def MuonIdHelperSvcCfg(flags): acc = ComponentAccumulator() + acc.addService( Muon__MuonIdHelperSvc("MuonIdHelperSvc", + HasCSC=flags.Detector.GeometryCSC, + HasSTgc=flags.Detector.GeometrysTGC, + HasMM=flags.Detector.GeometryMM + ) ) + return acc - # get the GeoModelSvc and add MuonDetectorTool - gmsAcc=GeoModelCfg(flags ) - gms=gmsAcc.getPrimary() - acc.merge(gmsAcc) +def MuonDetectorToolCfg(flags): + acc = ComponentAccumulator() detTool = MuonDetectorTool( HasCSC=flags.Detector.GeometryCSC, HasSTgc=flags.Detector.GeometrysTGC, @@ -23,36 +28,8 @@ def MuonGeoModelCfg(flags): ) detTool.UseConditionDb = 1 detTool.UseIlinesFromGM = 1 - - enableAlignment = flags.Common.Project != 'AthSimulation' and not flags.Detector.SimulateMuon and not flags.Detector.OverlayMuon + enableAlignment = flags.Common.Project != 'AthSimulation' and not flags.Detector.SimulateMuon and not (flags.Detector.OverlayMuon and flags.Input.isMC) if enableAlignment: - # This is all migrated from MuonSpectrometer/MuonReconstruction/MuonRecExample/python/MuonAlignConfig.py - - from IOVDbSvc.IOVDbSvcConfig import addFolders - MuonAlignmentCondAlg=CompFactory.MuonAlignmentCondAlg - if (flags.Common.isOnline and not flags.Input.isMC): - acc.merge(addFolders( flags, ['/MUONALIGN/Onl/MDT/BARREL'], 'MUONALIGN', className='CondAttrListCollection')) - acc.merge(addFolders( flags, ['/MUONALIGN/Onl/MDT/ENDCAP/SIDEA'], 'MUONALIGN', className='CondAttrListCollection')) - acc.merge(addFolders( flags, ['/MUONALIGN/Onl/MDT/ENDCAP/SIDEC'], 'MUONALIGN', className='CondAttrListCollection')) - acc.merge(addFolders( flags, ['/MUONALIGN/Onl/TGC/SIDEA'], 'MUONALIGN', className='CondAttrListCollection')) - acc.merge(addFolders( flags, ['/MUONALIGN/Onl/TGC/SIDEC'], 'MUONALIGN', className='CondAttrListCollection')) - else: - acc.merge(addFolders( flags, ['/MUONALIGN/MDT/BARREL'], 'MUONALIGN_OFL', className='CondAttrListCollection')) - acc.merge(addFolders( flags, ['/MUONALIGN/MDT/ENDCAP/SIDEA'], 'MUONALIGN_OFL', className='CondAttrListCollection')) - acc.merge(addFolders( flags, ['/MUONALIGN/MDT/ENDCAP/SIDEC'], 'MUONALIGN_OFL', className='CondAttrListCollection')) - acc.merge(addFolders( flags, ['/MUONALIGN/TGC/SIDEA'], 'MUONALIGN_OFL', className='CondAttrListCollection')) - acc.merge(addFolders( flags, ['/MUONALIGN/TGC/SIDEC'], 'MUONALIGN_OFL', className='CondAttrListCollection')) - - MuonAlign = MuonAlignmentCondAlg() - if flags.Muon.MuonTrigger: MuonAlign.DoRecRoiSvcUpdate = True # this should be removed as soon as RPC/TGCRecRoiSvc are migrated to use the MuonDetectorCondAlg - MuonAlign.ParlineFolders = ["/MUONALIGN/MDT/BARREL", - "/MUONALIGN/MDT/ENDCAP/SIDEA", - "/MUONALIGN/MDT/ENDCAP/SIDEC", - "/MUONALIGN/TGC/SIDEA", - "/MUONALIGN/TGC/SIDEC"] - - acc.addCondAlgo(MuonAlign) - # Condition DB is needed only if A-lines or B-lines are requested if not (not flags.Muon.Align.UseALines and flags.Muon.Align.UseBLines=='none'): detTool.UseConditionDb = 1 @@ -66,24 +43,17 @@ def MuonGeoModelCfg(flags): elif flags.Muon.Align.UseBLines=='endcaps': detTool.EnableMdtDeformations = 3 - # here define if I-lines (CSC internal alignment) are enabled - if flags.Muon.Align.UseILines: + if flags.Muon.Align.UseILines: if 'HLT' in flags.IOVDb.GlobalTag: #logMuon.info("Reading CSC I-Lines from layout - special configuration for COMP200 in HLT setup.") - MuonAlign.ILinesFromCondDB = False detTool.UseIlinesFromGM = True detTool.EnableCscInternalAlignment = False else : #logMuon.info("Reading CSC I-Lines from conditions database.") - if (flags.Common.isOnline and not flags.Input.isMC): - acc.merge(addFolders( flags, ['/MUONALIGN/Onl/CSC/ILINES'], 'MUONALIGN', className='CondAttrListCollection')) + if (flags.Common.isOnline and not flags.Input.isMC): detTool.EnableCscInternalAlignment = True else: - acc.merge(addFolders( flags, ['/MUONALIGN/CSC/ILINES'], 'MUONALIGN_OFL', className='CondAttrListCollection')) - - MuonAlign.ParlineFolders += ["/MUONALIGN/CSC/ILINES"] - MuonAlign.ILinesFromCondDB = True detTool.UseIlinesFromGM = False detTool.EnableCscInternalAlignment = True @@ -96,10 +66,7 @@ def MuonGeoModelCfg(flags): else : #logMuon.info("Reading As-Built parameters from conditions database") detTool.EnableMdtAsBuiltParameters = 1 - acc.merge(addFolders( flags, '/MUONALIGN/MDT/ASBUILTPARAMS', 'MUONALIGN_OFL', className='CondAttrListCollection')) - MuonAlign.ParlineFolders += ["/MUONALIGN/MDT/ASBUILTPARAMS"] pass - ##### else: detTool.UseConditionDb = 0 @@ -116,27 +83,96 @@ def MuonGeoModelCfg(flags): nswAGDDTool.Volumes = ["NewSmallWheel"] nswAGDDTool.DefaultDetector = "Muon" AGDD2Geo.Builders += [ nswAGDDTool ] + #create=True is needed for the service to be initialised in the new style acc.addService(AGDD2Geo, create=True) - + # call fill cache of MuonDetectorTool such that all MdtReadoutElement caches are filled # already during initialize() -> this will increase memory -> needs to be measured detTool.FillCacheInitTime = 1 # turn on/off caching of MdtReadoutElement surfaces detTool.CachingFlag = 1 - if enableAlignment: - MuonDetectorCondAlg = CompFactory.MuonDetectorCondAlg - MuonDetectorManagerCond = MuonDetectorCondAlg() - MuonDetectorManagerCond.MuonDetectorTool = detTool - acc.addCondAlgo(MuonDetectorManagerCond) + acc.setPrivateTools(detTool) + return acc + +def MuonAlignmentCondAlgCfg(flags): + acc = MuonIdHelperSvcCfg(flags) + + # This is all migrated from MuonSpectrometer/MuonReconstruction/MuonRecExample/python/MuonAlignConfig.py + + from IOVDbSvc.IOVDbSvcConfig import addFolders + MuonAlignmentCondAlg=CompFactory.MuonAlignmentCondAlg + if (flags.Common.isOnline and not flags.Input.isMC): + acc.merge(addFolders( flags, ['/MUONALIGN/Onl/MDT/BARREL'], 'MUONALIGN', className='CondAttrListCollection')) + acc.merge(addFolders( flags, ['/MUONALIGN/Onl/MDT/ENDCAP/SIDEA'], 'MUONALIGN', className='CondAttrListCollection')) + acc.merge(addFolders( flags, ['/MUONALIGN/Onl/MDT/ENDCAP/SIDEC'], 'MUONALIGN', className='CondAttrListCollection')) + acc.merge(addFolders( flags, ['/MUONALIGN/Onl/TGC/SIDEA'], 'MUONALIGN', className='CondAttrListCollection')) + acc.merge(addFolders( flags, ['/MUONALIGN/Onl/TGC/SIDEC'], 'MUONALIGN', className='CondAttrListCollection')) + else: + acc.merge(addFolders( flags, ['/MUONALIGN/MDT/BARREL'], 'MUONALIGN_OFL', className='CondAttrListCollection')) + acc.merge(addFolders( flags, ['/MUONALIGN/MDT/ENDCAP/SIDEA'], 'MUONALIGN_OFL', className='CondAttrListCollection')) + acc.merge(addFolders( flags, ['/MUONALIGN/MDT/ENDCAP/SIDEC'], 'MUONALIGN_OFL', className='CondAttrListCollection')) + acc.merge(addFolders( flags, ['/MUONALIGN/TGC/SIDEA'], 'MUONALIGN_OFL', className='CondAttrListCollection')) + acc.merge(addFolders( flags, ['/MUONALIGN/TGC/SIDEC'], 'MUONALIGN_OFL', className='CondAttrListCollection')) + + MuonAlign = MuonAlignmentCondAlg() + if flags.Muon.MuonTrigger: MuonAlign.DoRecRoiSvcUpdate = True # this should be removed as soon as RPC/TGCRecRoiSvc are migrated to use the MuonDetectorCondAlg + MuonAlign.ParlineFolders = ["/MUONALIGN/MDT/BARREL", + "/MUONALIGN/MDT/ENDCAP/SIDEA", + "/MUONALIGN/MDT/ENDCAP/SIDEC", + "/MUONALIGN/TGC/SIDEA", + "/MUONALIGN/TGC/SIDEC"] + + # here define if I-lines (CSC internal alignment) are enabled + if flags.Muon.Align.UseILines: + if 'HLT' in flags.IOVDb.GlobalTag: + #logMuon.info("Reading CSC I-Lines from layout - special configuration for COMP200 in HLT setup.") + MuonAlign.ILinesFromCondDB = False + else : + #logMuon.info("Reading CSC I-Lines from conditions database.") + if (flags.Common.isOnline and not flags.Input.isMC): + acc.merge(addFolders( flags, ['/MUONALIGN/Onl/CSC/ILINES'], 'MUONALIGN', className='CondAttrListCollection')) + else: + acc.merge(addFolders( flags, ['/MUONALIGN/CSC/ILINES'], 'MUONALIGN_OFL', className='CondAttrListCollection')) + MuonAlign.ParlineFolders += ["/MUONALIGN/CSC/ILINES"] + MuonAlign.ILinesFromCondDB = True + + # here define if As-Built (MDT chamber alignment) are enabled + if flags.Muon.Align.UseAsBuilt: + if flags.IOVDb.DatabaseInstance == 'COMP200' or \ + 'HLT' in flags.IOVDb.GlobalTag or flags.Common.isOnline : + #logMuon.info("No MDT As-Built parameters applied.") + pass + else : + #logMuon.info("Reading As-Built parameters from conditions database") + acc.merge(addFolders( flags, '/MUONALIGN/MDT/ASBUILTPARAMS', 'MUONALIGN_OFL', className='CondAttrListCollection')) + MuonAlign.ParlineFolders += ["/MUONALIGN/MDT/ASBUILTPARAMS"] + pass + + acc.addCondAlgo(MuonAlign) + return acc + + +def MuonDetectorCondAlgCfg(flags): + acc = MuonAlignmentCondAlgCfg(flags) + MuonDetectorCondAlg = CompFactory.MuonDetectorCondAlg + MuonDetectorManagerCond = MuonDetectorCondAlg() + detTool = acc.popToolsAndMerge(MuonDetectorToolCfg(flags)) + MuonDetectorManagerCond.MuonDetectorTool = detTool + acc.addCondAlgo(MuonDetectorManagerCond) + return acc + + +def MuonGeoModelCfg(flags): + acc=GeoModelCfg(flags) + gms=acc.getPrimary() + detTool = acc.popToolsAndMerge(MuonDetectorToolCfg(flags)) gms.DetectorTools += [ detTool ] - - acc.addService( Muon__MuonIdHelperSvc("MuonIdHelperSvc", - HasCSC=flags.Detector.GeometryCSC, - HasSTgc=flags.Detector.GeometrysTGC, - HasMM=flags.Detector.GeometryMM - ) ) + enableAlignment = flags.Common.Project != 'AthSimulation' and not flags.Detector.SimulateMuon and not (flags.Detector.OverlayMuon and flags.Input.isMC) + if enableAlignment: + acc.merge(MuonDetectorCondAlgCfg(flags)) + acc.merge(MuonIdHelperSvcCfg(flags)) # This line can be removed once the configuration methods for all 258 components which directly use this service are updated!! return acc diff --git a/MuonSpectrometer/MuonDetDescr/MuonAGDD/src/MuonAGDDTool.cxx b/MuonSpectrometer/MuonDetDescr/MuonAGDD/src/MuonAGDDTool.cxx index 66f9790e635d17919ff51bd1673003d0b80bf939..6e1d23f9a3a66d02c27efb4923e8bc24bc9f35f5 100644 --- a/MuonSpectrometer/MuonDetDescr/MuonAGDD/src/MuonAGDDTool.cxx +++ b/MuonSpectrometer/MuonDetDescr/MuonAGDD/src/MuonAGDDTool.cxx @@ -156,7 +156,7 @@ StatusCode MuonAGDDTool::construct() bool MuonAGDDTool::WritePREsqlFile() const { - std::ifstream outfile(m_outFileName.c_str(), std::ifstream::in | std::ifstream::binary); + std::ifstream outfile(m_outFileName.value().c_str(), std::ifstream::in | std::ifstream::binary); std::vector<std::string> newoutfilelines; std::string outfileline; @@ -171,14 +171,14 @@ bool MuonAGDDTool::WritePREsqlFile() const } outfile.close(); - std::ofstream newoutfile(m_outFileName.c_str(), std::ofstream::out | std::ofstream::trunc); + std::ofstream newoutfile(m_outFileName.value().c_str(), std::ofstream::out | std::ofstream::trunc); for(auto it = newoutfilelines.begin(); it != newoutfilelines.end(); ++it) { if(it != newoutfilelines.begin()) newoutfile << "\n"; newoutfile << *it; } newoutfile.close(); - outfile.open(m_outFileName.c_str(), std::ifstream::in | std::ifstream::binary); + outfile.open(m_outFileName.value().c_str(), std::ifstream::in | std::ifstream::binary); int fileSize = 0; if(outfile.is_open()) diff --git a/MuonSpectrometer/MuonDetDescr/MuonAGDD/src/NSWAGDDTool.cxx b/MuonSpectrometer/MuonDetDescr/MuonAGDD/src/NSWAGDDTool.cxx index 4ae838e48938fb840830a22eeff38f6764fedb45..bc7c02a61b7a46182e3dba41c2c564a20b34cd14 100644 --- a/MuonSpectrometer/MuonDetDescr/MuonAGDD/src/NSWAGDDTool.cxx +++ b/MuonSpectrometer/MuonDetDescr/MuonAGDD/src/NSWAGDDTool.cxx @@ -144,7 +144,7 @@ StatusCode NSWAGDDTool::construct() bool NSWAGDDTool::WritePREsqlFile() const { - std::ifstream outfile(m_outFileName.c_str(), std::ifstream::in | std::ifstream::binary); + std::ifstream outfile(m_outFileName.value().c_str(), std::ifstream::in | std::ifstream::binary); std::vector<std::string> newoutfilelines; std::string outfileline; @@ -159,14 +159,14 @@ bool NSWAGDDTool::WritePREsqlFile() const } outfile.close(); - std::ofstream newoutfile(m_outFileName.c_str(), std::ofstream::out | std::ofstream::trunc); + std::ofstream newoutfile(m_outFileName.value().c_str(), std::ofstream::out | std::ofstream::trunc); for(auto it = newoutfilelines.begin(); it != newoutfilelines.end(); ++it) { if(it != newoutfilelines.begin()) newoutfile << "\n"; newoutfile << *it; } newoutfile.close(); - outfile.open(m_outFileName.c_str(), std::ifstream::in | std::ifstream::binary); + outfile.open(m_outFileName.value().c_str(), std::ifstream::in | std::ifstream::binary); int fileSize = 0; if(outfile.is_open()) diff --git a/MuonSpectrometer/MuonDigitization/CSC_Digitization/CSC_Digitization/CscDigitizationTool.h b/MuonSpectrometer/MuonDigitization/CSC_Digitization/CSC_Digitization/CscDigitizationTool.h index a4ddbadd6c5a8704229a1004239ec6258573fe90..ef250e8c32576ca92fd91fa573ecb1b144bddcdd 100644 --- a/MuonSpectrometer/MuonDigitization/CSC_Digitization/CSC_Digitization/CscDigitizationTool.h +++ b/MuonSpectrometer/MuonDigitization/CSC_Digitization/CSC_Digitization/CscDigitizationTool.h @@ -5,6 +5,8 @@ #ifndef MUONDIGITIZATION_CSCDIGITIZATIONTOOL_H #define MUONDIGITIZATION_CSCDIGITIZATIONTOOL_H +#include <memory> + #include "PileUpTools/PileUpToolBase.h" #include "GaudiKernel/ServiceHandle.h" @@ -22,6 +24,8 @@ #include "MuonSimData/CscSimDataCollection.h" #include "PileUpTools/PileUpMergeSvc.h" +#include "CSC_Digitizer.h" + // Author: Ketevi A. Assamagan // BNL, October 27, 2003 @@ -43,7 +47,7 @@ public: CscDigitizationTool(const std::string& type, const std::string& name, const IInterface* pIID); - ~CscDigitizationTool(); + ~CscDigitizationTool() = default; virtual StatusCode initialize() override final; @@ -89,7 +93,7 @@ private: SG::WriteHandleKey<CscDigitContainer> m_cscDigitContainerKey{this,"OutputObjectName","CSC_DIGITS","CSC digit container object"}; const MuonGM::MuonDetectorManager* m_geoMgr{nullptr}; - CSC_Digitizer* m_cscDigitizer{nullptr}; + std::unique_ptr<CSC_Digitizer> m_cscDigitizer{nullptr}; ServiceHandle<Muon::IMuonIdHelperSvc> m_idHelperSvc {this, "MuonIdHelperSvc", "Muon::MuonIdHelperSvc/MuonIdHelperSvc"}; diff --git a/MuonSpectrometer/MuonDigitization/CSC_Digitization/src/CscDigitizationTool.cxx b/MuonSpectrometer/MuonDigitization/CSC_Digitization/src/CscDigitizationTool.cxx index a1ae38121639d613c2dddf2aa2aa53b81dbdf9fe..6bf855c38b2855956650b4d0811530fe23bc4804 100644 --- a/MuonSpectrometer/MuonDigitization/CSC_Digitization/src/CscDigitizationTool.cxx +++ b/MuonSpectrometer/MuonDigitization/CSC_Digitization/src/CscDigitizationTool.cxx @@ -19,10 +19,6 @@ CscDigitizationTool::CscDigitizationTool(const std::string& type,const std::stri PileUpToolBase(type, name, pIID) { } -CscDigitizationTool::~CscDigitizationTool() { - delete m_cscDigitizer; -} - StatusCode CscDigitizationTool::initialize() { ATH_MSG_DEBUG ( "Initialized Properties :" ); @@ -57,11 +53,8 @@ StatusCode CscDigitizationTool::initialize() { /** CSC calibratin tool for the Condtiions Data base access */ ATH_CHECK(m_pcalib.retrieve()); - ICscCalibTool* cscCalibTool = &*(m_pcalib); - //initialize the CSC digitizer - CscHitIdHelper * cscHitHelper = CscHitIdHelper::GetHelper(); - m_cscDigitizer = new CSC_Digitizer(cscHitHelper, m_geoMgr, cscCalibTool); + m_cscDigitizer = std::make_unique<CSC_Digitizer>(CscHitIdHelper::GetHelper(), m_geoMgr, &*(m_pcalib)); m_cscDigitizer->setAmplification(m_amplification); m_cscDigitizer->setDebug ( msgLvl(MSG::DEBUG) ); m_cscDigitizer->setDriftVelocity(m_driftVelocity); @@ -69,13 +62,11 @@ StatusCode CscDigitizationTool::initialize() { if (m_NInterFixed) { m_cscDigitizer->setNInterFixed(); } - + m_cscDigitizer->setWindow(m_timeWindowLowerOffset, m_timeWindowUpperOffset); ATH_CHECK(m_cscDigitizer->initialize()); ATH_CHECK(m_idHelperSvc.retrieve()); - m_cscDigitizer->setWindow(m_timeWindowLowerOffset, m_timeWindowUpperOffset); - // check the input object name if (m_hitsContainerKey.key().empty()) { ATH_MSG_FATAL("Property InputObjectName not set !"); diff --git a/MuonSpectrometer/MuonReconstruction/MuonDataPrep/STgcClusterization/src/SimpleSTgcClusterBuilderTool.cxx b/MuonSpectrometer/MuonReconstruction/MuonDataPrep/STgcClusterization/src/SimpleSTgcClusterBuilderTool.cxx index 64a9a593d97b41d8d9d0f3532f42cb0733712ad8..f9662875fa74f54114c292be13e2f39a5e5c5100 100644 --- a/MuonSpectrometer/MuonReconstruction/MuonDataPrep/STgcClusterization/src/SimpleSTgcClusterBuilderTool.cxx +++ b/MuonSpectrometer/MuonReconstruction/MuonDataPrep/STgcClusterization/src/SimpleSTgcClusterBuilderTool.cxx @@ -138,7 +138,7 @@ StatusCode Muon::SimpleSTgcClusterBuilderTool::getClusters(std::vector<Muon::sTg // // memory allocated dynamically for the PrepRawData is managed by Event Store in the converters // - ATH_MSG_INFO("error on cluster " << sqrt((*covN)(0,0)) << " added error " << m_addError); + ATH_MSG_DEBUG("error on cluster " << sqrt((*covN)(0,0)) << " added error " << m_addError); sTgcPrepData* prdN = new sTgcPrepData(clusterId,hash,localPosition, rdoList, covN, cluster.at(0).detectorElement(), diff --git a/MuonSpectrometer/MuonReconstruction/MuonRecUtils/MuonLayerHough/CMakeLists.txt b/MuonSpectrometer/MuonReconstruction/MuonRecUtils/MuonLayerHough/CMakeLists.txt index 354c1f4e265335f710bf4495af0d972904c0948f..0dd19eed58738f8a4d6fb3d8367cc77f277fa7da 100644 --- a/MuonSpectrometer/MuonReconstruction/MuonRecUtils/MuonLayerHough/CMakeLists.txt +++ b/MuonSpectrometer/MuonReconstruction/MuonRecUtils/MuonLayerHough/CMakeLists.txt @@ -8,7 +8,9 @@ atlas_subdir( MuonLayerHough ) # Declare the package's dependencies: atlas_depends_on_subdirs( PUBLIC Control/CxxUtils + Control/AthenaKernel MuonSpectrometer/MuonStationIndex + GaudiKernel PRIVATE DetectorDescription/GeoPrimitives ) @@ -21,11 +23,11 @@ atlas_add_library( MuonLayerHough src/*.cxx PUBLIC_HEADERS MuonLayerHough PRIVATE_INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} ${EIGEN_INCLUDE_DIRS} - LINK_LIBRARIES CxxUtils MuonStationIndexLib + LINK_LIBRARIES CxxUtils MuonStationIndexLib GaudiKernel AthenaKernel PRIVATE_LINK_LIBRARIES ${ROOT_LIBRARIES} ${EIGEN_LIBRARIES} GeoPrimitives ) atlas_add_executable( MainLayerAnalysis exe/MainLayerAnalysis.cxx INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} ${EIGEN_INCLUDE_DIRS} - LINK_LIBRARIES ${ROOT_LIBRARIES} ${EIGEN_LIBRARIES} CxxUtils MuonStationIndexLib GeoPrimitives MuonLayerHough ) + LINK_LIBRARIES ${ROOT_LIBRARIES} ${EIGEN_LIBRARIES} CxxUtils GaudiKernel AthenaKernel MuonStationIndexLib GeoPrimitives MuonLayerHough ) diff --git a/MuonSpectrometer/MuonReconstruction/MuonRecUtils/MuonLayerHough/MuonLayerHough/LayerAnalysis.h b/MuonSpectrometer/MuonReconstruction/MuonRecUtils/MuonLayerHough/MuonLayerHough/LayerAnalysis.h index 2c471c222641e219cc15f723ab58203d249d53a1..7a5e16505a254ce5d51bf1635024f61a7b91d83a 100644 --- a/MuonSpectrometer/MuonReconstruction/MuonRecUtils/MuonLayerHough/MuonLayerHough/LayerAnalysis.h +++ b/MuonSpectrometer/MuonReconstruction/MuonRecUtils/MuonLayerHough/MuonLayerHough/LayerAnalysis.h @@ -5,12 +5,12 @@ #ifndef LAYERANALYSIS_H #define LAYERANALYSIS_H - #include "MuonLayerHough/HitNtuple.h" #include "MuonLayerHough/MuonLayerHoughSelector.h" #include "MuonLayerHough/MuonLayerHough.h" #include "MuonLayerHough/MuonRegionHough.h" #include "MuonStationIndex/MuonStationIndex.h" +#include "CxxUtils/checker_macros.h" class TH1F; class TH2F; @@ -40,8 +40,8 @@ namespace MuonHough { m_ntuple.initForRead(tree); } - void initialize(); - void analyse(); + void initialize ATLAS_NOT_THREAD_SAFE(); + void analyse ATLAS_NOT_THREAD_SAFE(); void finalize(); private: @@ -49,7 +49,7 @@ namespace MuonHough { void analysis( std::map<int,SectorData>& data ); void drawSector( int region, int sector, SectorData& data, MuonDetectorHough& detectorHough, MuonDetectorHough& detectorHoughTruth ); void calculateVariables(Plots* Plot); - void SetStyle(); + void SetStyle ATLAS_NOT_THREAD_SAFE(); int getMaxLayers(Muon::MuonStationIndex::DetectorRegionIndex region, int sector); void finishplot(TH1F* h); float linear_extrapolate(MuonLayerHough::Maximum ref, MuonLayerHough::Maximum ex); diff --git a/MuonSpectrometer/MuonReconstruction/MuonRecUtils/MuonLayerHough/MuonLayerHough/MuonLayerHough.h b/MuonSpectrometer/MuonReconstruction/MuonRecUtils/MuonLayerHough/MuonLayerHough/MuonLayerHough.h index 52d10cf5cca56867117ed03b36b714e69039e593..162adb0bdc5fb56548a15802683f04254bfed4d0 100644 --- a/MuonSpectrometer/MuonReconstruction/MuonRecUtils/MuonLayerHough/MuonLayerHough/MuonLayerHough.h +++ b/MuonSpectrometer/MuonReconstruction/MuonRecUtils/MuonLayerHough/MuonLayerHough/MuonLayerHough.h @@ -8,6 +8,7 @@ #include "MuonStationIndex/MuonStationIndex.h" #include "MuonLayerHough/Hit.h" #include "MuonLayerHough/MuonLayerHoughSelector.h" + #include <vector> #include <iostream> #include <string> @@ -132,7 +133,7 @@ namespace MuonHough { void associateHitsToMaximum( Maximum& maximum, const std::vector<Hit*>& hits ) const; /// calculates the first and last bin the hit should be filled in for a given theta bin - std::pair<int,int> range( float x, float y1, float y2, int bintheta ) const; + std::pair<int,int> range(const float x, const float y1, const float y2, const int bintheta) const; /// returns a pair with the position and angle corresponing to the input x,y values std::pair<float,float> maximum( float x, float y, int& posbin, int& thetabin ) const; diff --git a/MuonSpectrometer/MuonReconstruction/MuonRecUtils/MuonLayerHough/exe/MainLayerAnalysis.cxx b/MuonSpectrometer/MuonReconstruction/MuonRecUtils/MuonLayerHough/exe/MainLayerAnalysis.cxx index 09fa004ebcb4f0b05d436a873b8c63e729bbe8c9..6a6e9fc12992068256eb748df3c798c7ecdd84c2 100644 --- a/MuonSpectrometer/MuonReconstruction/MuonRecUtils/MuonLayerHough/exe/MainLayerAnalysis.cxx +++ b/MuonSpectrometer/MuonReconstruction/MuonRecUtils/MuonLayerHough/exe/MainLayerAnalysis.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 "MuonLayerHough/LayerAnalysis.h" @@ -13,17 +13,9 @@ #include <fstream> #include <TApplication.h> -int main( int argc, char* argv[]){ - +int main ATLAS_NOT_THREAD_SAFE(int argc, char* argv[]) { TApplication theApp("App", &argc, argv); - - //int data = 0; - // if( argc > 1 ) { - // TString str = argv[1]; - // data = str.Atoi(); - // } - //set the input text file TString filename = "input"; @@ -52,21 +44,10 @@ int main( int argc, char* argv[]){ TChain* ntupleToRead = new TChain("data") ; ntupleToRead->SetMakeClass(1); TString outName = "LayerAnalysis"; - //TString inName = "HitNtuple2"; TString postFix = filename; - // if( data == 0 ) postFix += "Cav"; - // else if( data == 1 ) postFix += "Zmumu"; - // else if( data == 2 ) postFix += "Overlay1"; - // else if( data == 3 ) postFix += "Overlay10"; - // else if( data == 4 ) postFix += "Overlay20"; - // else if( data == 5 ) postFix += "CavNSW"; - // else if( data == 6 ) postFix += "SingleNSW"; - // ntupleToRead->Add("HitNtuple.root"); - for (unsigned int i = 0; i < fileList.size(); i++) { ntupleToRead->Add(fileList.at(i).c_str()); } - // ntupleToRead->Add(inName+postFix+".root"); outName += "_" + postFix; outName += ".root"; TFile* output = new TFile(outName,"RECREATE"); diff --git a/MuonSpectrometer/MuonReconstruction/MuonRecUtils/MuonLayerHough/src/LayerAnalysis.cxx b/MuonSpectrometer/MuonReconstruction/MuonRecUtils/MuonLayerHough/src/LayerAnalysis.cxx index b2ad5242f959d6e1847c9947f036c60637ede772..832a3480b4a97e2ecdca24587327d3c9618b3b4f 100644 --- a/MuonSpectrometer/MuonReconstruction/MuonRecUtils/MuonLayerHough/src/LayerAnalysis.cxx +++ b/MuonSpectrometer/MuonReconstruction/MuonRecUtils/MuonLayerHough/src/LayerAnalysis.cxx @@ -3,6 +3,7 @@ */ #include "MuonLayerHough/LayerAnalysis.h" + #include "MuonLayerHough/MuonLayerHough.h" #include "MuonLayerHough/MuonRegionHough.h" #include "GeoPrimitives/GeoPrimitives.h" @@ -23,7 +24,6 @@ #include <set> #include <cmath> - #include <iostream> #include <cstdlib> #include <algorithm> @@ -45,7 +45,6 @@ namespace MuonHough { TH1::AddDirectory(false); initialize();//initialize all the plots Long64_t nentries = m_tree->GetEntries(); -// nentries = 10; m_ncalls = 0; std::cout << " analysing events " << nentries << std::endl; m_ntuple.initForRead(*m_tree); @@ -71,7 +70,6 @@ namespace MuonHough { if (m_DEBUG) nentries = 200;//for debugging purpose for( Long64_t evt=0; evt<nentries; ++evt ){ - //std::cout << "event: " << evt << std::endl; if (evt % 1000 == 0) std::cout << "event: " << evt << std::endl; m_tree->LoadTree(evt); m_tree->GetEntry(evt); @@ -100,7 +98,7 @@ namespace MuonHough { finalize(); } - void LayerAnalysis::initialize(){ + void LayerAnalysis::initialize() { SetStyle(); m_h_dtheta = new TH1F("dtheta", "RMS of the #Delta #theta for each clutser; #theta RMS", 315, -0.01, M_PI); m_h_dtheta_truth = new TH1F("dtheta_truth", "RMS of the #Delta #theta for each truth clutser; #theta RMS", 315, -M_PI, M_PI); @@ -178,10 +176,6 @@ namespace MuonHough { MuonLayerHough& houghTruth = detectorHoughTruth.hough(sit->first.sector(), region, layer); int chIndex = hough.m_descriptor.chIndex;//BIS, BIL, BMS, BML, BOS, BOL, BEE(6), EIS, EIL, EMS, EML, EOS, EOL, EES, EEL, CSS, CSL, - // int LayerIndexMax_temp = 0; - // if (region == 1){ LayerIndexMax_temp = 3;} - // else if (sit->first.sector()%2 == 0){ LayerIndexMax_temp = 5;}//small sectors - // else if (sit->first.sector()%2 != 0){ LayerIndexMax_temp = 4;}//large sectors if (m_DEBUG) std::cout << "DEBUG: start new cluster; position: sector " << sit->first.sector() << " region(A/B/C) " << region << " layer: " << layer << " chindex: " << chIndex << @@ -197,7 +191,6 @@ namespace MuonHough { hitsTruth.push_back(*hit); } }//end of lopoing all the hits - //if (hits.size() == 0){continue;}//only interested if there are hits to find maximum! hough.setDebug(false);//to supress output level hough.fillLayer2(hits);//fill all the layers with the weight houghTruth.fillLayer2(hitsTruth);//fill all the layers with the weight @@ -322,7 +315,6 @@ namespace MuonHough { << std::endl; h_dtheta_temp->Fill(plotMaximum_truth[i][j].theta); } - //h_dtheta_truth->Fill(h_dtheta_temp->GetRMS()); delete h_dtheta_temp;//remove the pinter if (int(plotMaximum_truth[i].size()) < 3){continue;}//just add protection @@ -446,62 +438,10 @@ namespace MuonHough { canvas0.Update(); canvas0.Write(); -////-----------------------------------This part is still disabled---------------------------- -// -// -// canvasName += "_zoom"; -// canvas = new TCanvas(canvasName,canvasName,1500,1100); -// canvas->Divide(1,3); -// for( int i=0;i<3;++i){ -// if( min[i] < 1e9 ){ -// double scale = ((rmax[i]-rmin[i])/12) / ((max[i]-min[i])/3.); -// if( scale < 1 ) { -// max[i] += 0.5*(max[i]-min[i])*scale; -// min[i] -= 0.5*(max[i]-min[i])*scale; -// }else{ -// rmax[i] += 0.5*(rmax[i]-rmin[i])/scale; -// rmin[i] -= 0.5*(rmax[i]-rmin[i])/scale; -// } -// //std::cout << " drawing " << i << " scale " << scale -// // << " range z " << min[i] << " " << max[i] << " r " << rmin[i] << " " << rmax[i] << std::endl; -// histName = "hist_"; -// histName += canvasName; -// histName += i; -// canvas->cd(3-i); -// double rangez = 120; -// double ranger = 30; -// if( region != 1 && i == 1 ){ -// rangez = 100; -// ranger = 10; -// } -// -// hist = new TH1F(histName,histName,100,rmin[i]-ranger,rmax[i]+ranger); -// hist->SetMinimum(min[i]-rangez); -// hist->SetMaximum(max[i]+rangez); -// hist->Draw(); -// for( unsigned int s=0;s<shapes[i].size();++s){ -// shapes[i][s]->Draw("SAME"); -// } -// } -// } -// canvas->Draw(); -// canvas->Update(); -// canvas->Draw(); -// canvas->Update(); -//// canvas->SaveAs(canvasName + ".pdf"); -// canvas->Write(); -// - - -//-------------------------------------------------------------------------------------------------------------- - - - canvasName += "_hough"; TCanvas canvas(canvasName,canvasName,1000,1000); Muon::MuonStationIndex::DetectorRegionIndex region_index = static_cast<Muon::MuonStationIndex::DetectorRegionIndex>(region);//have to convert type... const int iLayers = getMaxLayers(region_index, sector);//be careful here, only loop through the correct layers - //const int iLayers = region != 1 ? Muon::MuonStationIndex::LayerIndexMax : 3; // barrel only has three layers canvas.Divide(1,iLayers); for( int i=0;i < iLayers;++i){ @@ -517,21 +457,11 @@ namespace MuonHough { hists[pos]->SetFillStyle(3244); hists[pos]->SetFillColor(1); hists[pos]->Draw(); - // int chIndex = hough.m_descriptor.chIndex; histsTruth[pos]->SetLineColor(2); histsTruth[pos]->Draw("SAME"); - // float maxPos = fabs(hists[pos]->GetXaxis()->GetBinCenter(hists[pos]->GetMaximumBin())); - // float max = hists[pos]->GetBinContent(hists[pos]->GetMaximumBin()); - // - // if (max > 1) m_hMaximaHeightPerChIndex[chIndex]->Fill( maxPos, max); - // float truthMaxPos = fabs(histsTruth[pos]->GetXaxis()->GetBinCenter(histsTruth[pos]->GetMaximumBin())); - // float truthMax = histsTruth[pos]->GetBinContent(histsTruth[pos]->GetMaximumBin()); - // - // if (truthMax > 1) m_hMaximaHeightPerChIndexTruth[chIndex]->Fill( truthMaxPos, truthMax); } canvas.Draw(); canvas.Update(); - //canvas.SaveAs(canvasName + ".pdf"); canvas.Write(); } @@ -539,25 +469,6 @@ namespace MuonHough { for (auto Plot : m_hMaximaHeightPerChIndex){ if (Plot == 0) continue; calculateVariables(Plot);//for calculation efficiencies - // Plot->Reco->Write(); - // Plot->Truth->Write(); - // Plot->Matched->Write(); - // Plot->Efficiency->Write(); - // Plot->FakeEfficiency->Write(); - // Plot->Diff->Write(); - - // Plot->Reco->Draw("COLZTEXT"); - // gPad->SaveAs("../Output/"+ TString(Plot->Reco->GetName()) + ".pdf"); - // Plot->Truth->Draw("COLZTEXT"); - // gPad->SaveAs("../Output/"+ TString(Plot->Truth->GetName()) + ".pdf"); - // Plot->Matched->Draw("COLZ"); - // gPad->SaveAs("../Output/"+ TString(Plot->Matched->GetName()) + ".pdf"); - // Plot->Efficiency->Draw(); - // gPad->SaveAs("../Output/"+ TString(Plot->Efficiency->GetName()) + ".pdf"); - // Plot->FakeEfficiency->Draw(); - // gPad->SaveAs("../Output/"+ TString(Plot->FakeEfficiency->GetName()) + ".pdf"); - // Plot->Diff->Draw("COLZTEXT"); - // gPad->SaveAs("../Output/"+ TString(Plot->Diff->GetName()) + ".pdf"); delete Plot->Reco; delete Plot->Truth; delete Plot->Matched; delete Plot->Efficiency; delete Plot->FakeEfficiency; delete Plot->Diff; } @@ -570,7 +481,6 @@ namespace MuonHough { m_h_dtheta_truth->SetLineColor(2); m_h_dtheta_truth->Draw("SAME"); m_h_dtheta_truth->Write(); - //gPad->SaveAs("../Output/"+ TString(h_dtheta->GetName()) + ".pdf"); finishplot(m_h_diff_MI_e); finishplot(m_h_diff_MO_e); @@ -624,7 +534,6 @@ namespace MuonHough { gStyle->SetPadBorderMode(icol); gStyle->SetPadColor(icol); gStyle->SetStatColor(icol); - //gStyle->SetFillColor(icol); // don't use: white fill color for *all* objects // set the paper & margin sizes gStyle->SetPaperSize(20,26); // set margin sizes @@ -648,11 +557,8 @@ namespace MuonHough { gStyle->SetLabelFont(font,"z"); gStyle->SetTitleFont(fontT,"z"); gStyle->SetLabelSize(tsize,"x"); - //gStyle->SetTitleSize(tsize,"x"); gStyle->SetLabelSize(tsize,"y"); - //gStyle->SetTitleSize(tsize,"y"); gStyle->SetLabelSize(tsize,"z"); - //gStyle->SetTitleSize(tsize,"z"); // use bold lines and markers gStyle->SetMarkerStyle(20); gStyle->SetMarkerSize(1.5); @@ -660,16 +566,12 @@ namespace MuonHough { gStyle->SetLineStyleString(2,"[12 12]"); // postscript dashes gStyle->SetPalette(1);//colz color // get rid of X error bars - //gStyle->SetErrorX(0.001); // get rid of error bar caps gStyle->SetEndErrorSize(0.); // do not display any of the standard histogram decorations gStyle->SetOptTitle(1); - //gStyle->SetOptTitle(0); gStyle->SetOptStat(1111); - //gStyle->SetOptStat(0); gStyle->SetOptFit(1111); - //gStyle->SetOptFit(0); // put tick marks on top and RHS of plots gStyle->SetPadTickX(1); gStyle->SetPadTickY(1); @@ -677,7 +579,6 @@ namespace MuonHough { void LayerAnalysis::finishplot(TH1F* h){ TCanvas c1("c1","c1",700,600); - //c1.SetLogy(); c1.cd(); h->SetBinContent(h->GetNbinsX(), h->GetBinContent(h->GetNbinsX() + 1) + h->GetBinContent(h->GetNbinsX())); @@ -811,5 +712,3 @@ namespace MuonHough { } } - - diff --git a/MuonSpectrometer/MuonReconstruction/MuonRecUtils/MuonLayerHough/src/MuonLayerHough.cxx b/MuonSpectrometer/MuonReconstruction/MuonRecUtils/MuonLayerHough/src/MuonLayerHough.cxx index 1f0a23ed4f049aad292de7d2aaf9d45db2950fa3..5def865984d93e58c50bb6597e314215f749780b 100644 --- a/MuonSpectrometer/MuonReconstruction/MuonRecUtils/MuonLayerHough/src/MuonLayerHough.cxx +++ b/MuonSpectrometer/MuonReconstruction/MuonRecUtils/MuonLayerHough/src/MuonLayerHough.cxx @@ -1,20 +1,26 @@ /* - 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 "MuonLayerHough/MuonLayerHough.h" +#include "GaudiKernel/MsgStream.h" +#include "AthenaKernel/getMessageSvc.h" +#include <TString.h> // for Form + #include <memory.h> -#include <cmath> #include <bitset> #include <TH1.h> #include <iostream> -#include <stdlib.h> +#include <stdlib.h> namespace MuonHough { - MuonLayerHough::MuonLayerHough( const RegionDescriptor& descriptor ) : - max(0), maxhist(-1), maxbin(-1), m_debug(false), m_descriptor(descriptor) { + max(0), + maxhist(-1), + maxbin(-1), + m_debug(false), + m_descriptor(descriptor) { // calculate the number of bins m_nbins = (m_descriptor.yMaxRange-m_descriptor.yMinRange)/m_descriptor.yBinSize;//the same for all the cycles @@ -27,7 +33,6 @@ namespace MuonHough { reset(); } - MuonLayerHough::~MuonLayerHough() { for( unsigned int i=0;i<m_histos.size();++i ) delete[] m_histos[i]; } @@ -40,10 +45,7 @@ namespace MuonHough { } void MuonLayerHough::fill( float x, float y, float weight ) { - - // float x = m_doZ ? z : r; - // float y = m_doZ ? r : z; - + int cycles = m_histos.size(); for( int ci=0;ci<cycles;++ci ){ float dtheta = m_descriptor.thetaStep; @@ -66,12 +68,6 @@ namespace MuonHough { if( binmax - bincenter > 3 ) binmax = bincenter+3; if( binmax < 0 ) continue; - // int bincenter2 = bin(r,z); - // if( fabs(dthetaOffset) < 0.01 && bincenter != bincenter2 ) std::cout << " bad index " << bincenter - // << " recall " << bincenter2 << " zref " << zref - // << " refpos " << m_descriptor.referencePosition - // << " max " << m_nbins << " r " << r << " z " << z << std::endl; - if(binmin<0) binmin = 0; if( binmax >= m_nbins ) binmax = m_nbins-1; if( m_debug) std::cout << " filling " << x << " y " << binmin << " " << binmax << " w " << weight << " center " << bincenter @@ -92,9 +88,7 @@ namespace MuonHough { void MuonLayerHough::fillLayer( const std::vector<Hit*>& hits, bool subtract ) { if( hits.empty() ) return; - // float x = m_doZ ? z : r; - // float y = m_doZ ? r : z; - + // outer loop over cycles int cycles = m_histos.size(); for( int ci=0;ci<cycles;++ci ){ @@ -114,27 +108,11 @@ namespace MuonHough { std::pair<int,int> minMax = range((*it)->x,(*it)->ymin,(*it)->ymax,ci); int binmin = minMax.first; int binmax = minMax.second; - -// if( binmin - bincenter < -3 ) binmin = bincenter-3; -// if( binmin == bincenter ) binmin -= 1; -// if( binmax == bincenter ) binmax += 1; - // std::cout << " hit " << x << " ref " << m_descriptor.referencePosition << " theta " << theta1 << " offset " << dthetaOffset << " dt " << dtheta - // << " ymin " << y1 << " ymax " << y2 << " z01 " << z01 << " z11 " << z11 << " z02 " << zmin1 << " z12 " << zmin2 - // << " binmin " << binmin << " max " << binmax - // << " t01 " << 180*(theta1-dthetaOffset+dtheta)/M_PI << " t11 " << 180*(theta1-dthetaOffset-dtheta)/M_PI - // << " t01 " << tan(theta1-dthetaOffset+dtheta) << " t11 " << tan(theta1-dthetaOffset-dtheta) << std::endl; if( binmin >= m_nbins ) continue; -// if( binmax - bincenter > 3 ) binmax = bincenter+3; if( binmax < 0 ) continue; if(binmin<0) binmin = 0; if( binmax >= m_nbins ) binmax = m_nbins-1; - - // int bincenter2 = bin(r,z); - // if( fabs(dthetaOffset) < 0.01 && bincenter != bincenter2 ) std::cout << " bad index " << bincenter - // << " recall " << bincenter2 << " zref " << zref - // << " refpos " << m_descriptor.referencePosition - // << " max " << m_nbins << " r " << r << " z " << z << std::endl; if( m_debug ) { std::cout << " filling hit " << x << " refpos " << m_descriptor.referencePosition << " ymin " << y1 << " ymax " << y2 << " layer " << (*it)->layer << " binmin " << binmin << " max " << binmax; @@ -154,13 +132,10 @@ namespace MuonHough { if( binmin < prevbinmin && prevlayer == (*it)->layer ) { std::cout << "Error hits are out of order: min " << binmin << " max " << binmax << " lay " << (*it)->layer << std::endl; - //exit(1); } // if the max value of the previous hit is smaller than the current minvalue fill the histogram of the previous hit // do the same when reached last hit if( prevbinmax < binmin || prevlayer != (*it)->layer ) { - // std::cout << " filling " << binmin << " " << binmax << " w " << it->w << " center " << bincenter - // << " range " << (zmin-m_descriptor.yMinRange)*m_invbinsize << " " << (zmax-m_descriptor.yMinRange)*m_invbinsize << std::endl; if( m_debug ) std::cout << " filling range " << prevbinmin << " " << prevbinmax << " new min " << binmin << " " << binmax << " weight " << (*it)->w << std::endl; for( int n=prevbinmin;n<=prevbinmax;++n ) { unsigned int& val = m_histos[ci][n]; @@ -226,7 +201,6 @@ namespace MuonHough { for( int i=0;i<m_nbins;++i ) { if( subtract && -layerCounts[i] >= static_cast<int>(m_histos[ci][i]) ) m_histos[ci][i] = 0; else m_histos[ci][i] += layerCounts[i]; - //if( m_debug && layerCounts[i] != 0 ) std::cout << " filling layer " << prevlayer << " bin " << i << " val " << layerCounts[i] << " tot " << m_histos[ci][i] << std::endl; layerCounts[i] = 0; // reset bin } prevlayer = (*it)->layer; @@ -259,8 +233,6 @@ namespace MuonHough { else std::cout << std::endl; } int weight = sign*(*it)->w;// set the hit weight - //if (weight > sign){weight = weight * 2;}//could even boost the trigger weight here - // set bits to true for( ;binmin<=binmax;++binmin ) layerCounts[binmin] = weight; }//end of loopin gover hits @@ -324,7 +296,6 @@ namespace MuonHough { const float scale = 1. - 0.01*fabs(ci-cycles/2.0); // small deweighting of non pointing bins; weighting more on the central part for( int n=0;n<m_nbins;++n ) { const int val = m_histos[ci][n]; - //if( m_debug && val != 0 ) std::cout << " cycle " << ci << " bin " << n << " val " << val << std::endl; if( val < imaxval ) continue; if( scale*val > tmax ) { @@ -334,7 +305,6 @@ namespace MuonHough { } } } - //if( m_debug ) std::cout << " done loop over bins: cycle " << thetab << " total cylces " << cycles << " bin " << posb << " val " << tmax << std::endl; if( posb == -1 ) return false;//didn't find a max const float candidatePos = m_descriptor.yMinRange + m_binsize*posb; @@ -418,9 +388,7 @@ namespace MuonHough { float zmax = z0<z1?z1:z0; int binmin = (zmin-m_descriptor.yMinRange)/m_binsize-1; int binmax = (zmax-m_descriptor.yMinRange)/m_binsize+1; - // if( binmin - bincenter < -3 ) binmin = bincenter-3; if( binmin >= m_nbins ) continue; - // if( binmax - bincenter > 3 ) binmax = bincenter+3; if( binmax < 0 ) continue; if(binmin<0) binmin = 0; @@ -497,10 +465,11 @@ namespace MuonHough { } - std::pair<int,int> MuonLayerHough::range( float x, float y1, float y2, int bintheta ) const { + std::pair<int,int> MuonLayerHough::range(const float x, const float y1, const float y2, const int bintheta) const { int cycles = m_histos.size(); float dx = m_descriptor.referencePosition-x; float dtheta = m_descriptor.thetaStep; + if (dtheta<=0) throw std::runtime_error(Form("File: %s, Line: %d\nMuonLayerHough::range() - dtheta is not positive (%.4f)", __FILE__, __LINE__, dtheta)); float dthetaOffset = 2*dtheta*(bintheta-(cycles-1)/2.); float theta1 = atan2(x,y1)-dthetaOffset; @@ -518,7 +487,6 @@ namespace MuonHough { float zmin = std::min(zmin1,zmin2); float zmax = std::max(zmax1,zmax2); - //return std::make_pair<int,int>((zmin-m_descriptor.yMinRange)*m_invbinsize,(zmax-m_descriptor.yMinRange)*m_invbinsize); return std::make_pair<int,int>(floor((zmin-m_descriptor.yMinRange)*m_invbinsize), floor((zmax-m_descriptor.yMinRange)*m_invbinsize));//convert the output to bins } diff --git a/MuonSpectrometer/MuonReconstruction/MuonSegmentMakers/MuonSegmentMakerAlgs/CscSegmentMakers/CscSegmentMakers/ICscSegmentFinder.h b/MuonSpectrometer/MuonReconstruction/MuonSegmentMakers/MuonSegmentMakerAlgs/CscSegmentMakers/CscSegmentMakers/ICscSegmentFinder.h index 2761ce9186f6f4a9d7043d9b0313d2bbb398a700..ae55ee2c48e975892c3dbca93b981d7d356c7e36 100644 --- a/MuonSpectrometer/MuonReconstruction/MuonSegmentMakers/MuonSegmentMakerAlgs/CscSegmentMakers/CscSegmentMakers/ICscSegmentFinder.h +++ b/MuonSpectrometer/MuonReconstruction/MuonSegmentMakers/MuonSegmentMakerAlgs/CscSegmentMakers/CscSegmentMakers/ICscSegmentFinder.h @@ -1,19 +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 */ -// ICscSegmentFinder.h - #ifndef ICscSegmentFinder_H #define ICscSegmentFinder_H #include "GaudiKernel/IAlgTool.h" -//#include "MuonRecToolInterfaces/IMuonSegmentMaker.h" // added.. #include "MuonSegment/MuonSegmentCombinationCollection.h" #include "MuonSegment/MuonSegmentCombination.h" #include "MuonPrepRawData/CscPrepDataContainer.h" -//IMuonSegmentMaker.h namespace Muon { class MuonSegment; class MdtDriftCircleOnTrack; @@ -30,7 +26,6 @@ namespace Trk { static const InterfaceID IID_ICscSegmentFinder("ICscSegmentFinder", 1, 0); class ICscSegmentFinder : virtual public IAlgTool { - //class ICscSegmentFinder : public Muon::IMuonSegmentMaker { public: // Static methods diff --git a/MuonSpectrometer/MuonReconstruction/MuonTrackMakers/MuonTrackMakerTools/MuonTrackFinderTools/src/MuonRefitTool.cxx b/MuonSpectrometer/MuonReconstruction/MuonTrackMakers/MuonTrackMakerTools/MuonTrackFinderTools/src/MuonRefitTool.cxx index b8a0c7e8d8bdb1ca8f0d80922c950965b0323327..28a5a250145ab33eb98ca51ec4d2ee0435b68ba5 100644 --- a/MuonSpectrometer/MuonReconstruction/MuonTrackMakers/MuonTrackMakerTools/MuonTrackFinderTools/src/MuonRefitTool.cxx +++ b/MuonSpectrometer/MuonReconstruction/MuonTrackMakers/MuonTrackMakerTools/MuonTrackFinderTools/src/MuonRefitTool.cxx @@ -56,7 +56,12 @@ namespace Muon { ATH_CHECK( m_printer.retrieve() ); ATH_CHECK( m_edmHelperSvc.retrieve() ); ATH_CHECK( m_idHelperSvc.retrieve() ); - if( !m_alignErrorTool.empty() ) ATH_CHECK(m_alignErrorTool.retrieve()); + if (m_alignmentErrors) { + if( !m_alignErrorTool.empty() ) ATH_CHECK(m_alignErrorTool.retrieve()); + } + else { + m_alignErrorTool.disable(); + } ATH_CHECK( m_extrapolator.retrieve() ); ATH_CHECK( m_muonExtrapolator.retrieve() ); ATH_CHECK( m_trackFitter.retrieve() ); diff --git a/PhysicsAnalysis/JpsiUpsilonTools/share/configureServices.py b/PhysicsAnalysis/JpsiUpsilonTools/share/configureServices.py index aba323cafa1bd2c2728f78f3611fc7062f90ca7b..8f5d372b640fd872f6cac3fa27b3d6296da93d57 100644 --- a/PhysicsAnalysis/JpsiUpsilonTools/share/configureServices.py +++ b/PhysicsAnalysis/JpsiUpsilonTools/share/configureServices.py @@ -44,12 +44,19 @@ CountDeadModulesAfterLastHit=False from InDetRecExample.InDetJobProperties import InDetFlags +from InDetBoundaryCheckTool.InDetBoundaryCheckToolConf import InDet__InDetBoundaryCheckTool +BoundaryCheckTool = InDet__InDetBoundaryCheckTool( + name="InDetBoundaryCheckTool", + UsePixel=DetFlags.haveRIO.pixel_on(), + UseSCT=DetFlags.haveRIO.SCT_on(), + CheckBadSCT = InDetFlags.checkDeadElementsOnTrack() +) +ToolSvc += BoundaryCheckTool + from InDetTrackHoleSearch.InDetTrackHoleSearchConf import InDet__InDetTrackHoleSearchTool InDetHoleSearchTool = InDet__InDetTrackHoleSearchTool(name = "InDetHoleSearchTool", Extrapolator = InDetExtrapolator, - usePixel = DetFlags.haveRIO.pixel_on(), - useSCT = DetFlags.haveRIO.SCT_on(), - checkBadSCTChip = InDetFlags.checkDeadElementsOnTrack(), + BoundaryCheckTool=BoundaryCheckTool, #Commissioning = rec.Commissioning()) CountDeadModulesAfterLastHit = CountDeadModulesAfterLastHit) ToolSvc += InDetHoleSearchTool diff --git a/Projects/AnalysisBase/package_filters.txt b/Projects/AnalysisBase/package_filters.txt index 662a326ad049ffe96cdc30f51b882b1fbf02103e..71ecd1e1c8fbf1daf21495fea925f58a3fb25146 100644 --- a/Projects/AnalysisBase/package_filters.txt +++ b/Projects/AnalysisBase/package_filters.txt @@ -19,7 +19,6 @@ - PhysicsAnalysis/ElectronPhotonID/PhotonEfficiencyCorrection - PhysicsAnalysis/ElectronPhotonID/PhotonVertexSelection - PhysicsAnalysis/ElectronPhotonID/egammaMVACalibAnalysis -- Reconstruction/Jet/JetCalibTools - Reconstruction/Jet/JetMomentTools - Reconstruction/Jet/JetRec - Reconstruction/Jet/JetSubStructureMomentTools diff --git a/Projects/Athena/package_filters.txt b/Projects/Athena/package_filters.txt index 9f696a894ef5d094fc8c666ecbccacd1b238b4eb..06159fbba011aa5b4849c56c51c626a0bd046d8b 100644 --- a/Projects/Athena/package_filters.txt +++ b/Projects/Athena/package_filters.txt @@ -63,6 +63,3 @@ - LArCalorimeter/LArSim - PhysicsAnalysis/HiggsPhys/HSG5/HSG5DPDUtils -# remove unused mdt calibration package -- MuonSpectrometer/MuonCalib/MdtCalib/MdtCalibITools - diff --git a/Reconstruction/Jet/JetCalibTools/CMakeLists.txt b/Reconstruction/Jet/JetCalibTools/CMakeLists.txt index fdc6500235144d7e328130187750520ba3dd21af..d0ed595eed7dbab36490b4b6f43119da50173320 100644 --- a/Reconstruction/Jet/JetCalibTools/CMakeLists.txt +++ b/Reconstruction/Jet/JetCalibTools/CMakeLists.txt @@ -16,6 +16,7 @@ endif() # Declare the package's dependencies: atlas_depends_on_subdirs( PUBLIC + Control/AthToolSupport/AsgDataHandles Control/AthToolSupport/AsgTools Event/xAOD/xAODEventInfo Event/xAOD/xAODEventShape @@ -38,7 +39,7 @@ atlas_add_library( JetCalibToolsLib PUBLIC_HEADERS JetCalibTools INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} LINK_LIBRARIES ${ROOT_LIBRARIES} AsgTools xAODEventInfo xAODEventShape - xAODJet xAODTracking PATInterfaces JetInterface + xAODJet xAODTracking PATInterfaces JetInterface AsgDataHandlesLib PRIVATE_LINK_LIBRARIES xAODMuon PathResolver ) if( NOT XAOD_STANDALONE ) diff --git a/Reconstruction/Jet/JetCalibTools/JetCalibTools/JetCalibrationTool.h b/Reconstruction/Jet/JetCalibTools/JetCalibTools/JetCalibrationTool.h index 660a96793227be506973dc7089efd9ffb581c7dd..6dcca2db70cb8ad2012c3dc95ee061b8c4acc2aa 100644 --- a/Reconstruction/Jet/JetCalibTools/JetCalibTools/JetCalibrationTool.h +++ b/Reconstruction/Jet/JetCalibTools/JetCalibTools/JetCalibrationTool.h @@ -21,7 +21,7 @@ #include "xAODEventInfo/EventInfo.h" #include "xAODTracking/VertexContainer.h" #include "xAODEventShape/EventShape.h" -#include "StoreGate/ReadDecorHandleKey.h" +#include "AsgDataHandles/ReadDecorHandleKey.h" // JetCalibTools includes #include "JetCalibTools/IJetCalibrationTool.h" @@ -91,7 +91,9 @@ private: // ReadHandleKey(s) SG::ReadHandleKey<xAOD::EventInfo> m_rhkEvtInfo; SG::ReadHandleKey<xAOD::EventShape> m_rhkRhoKey; - SG::ReadHandleKey<xAOD::VertexContainer> m_rhkPV; + SG::ReadHandleKey<xAOD::VertexContainer> m_rhkPV {this, + "PrimaryVerticesContainerName", + "PrimaryVertices"}; SG::ReadDecorHandleKey<xAOD::EventInfo> m_rdhkEvtInfo {this ,"AveIntPerXKey" ,"EventInfo.AveIntPerXDecor" diff --git a/Reconstruction/Jet/JetCalibTools/Root/JetCalibrationTool.cxx b/Reconstruction/Jet/JetCalibTools/Root/JetCalibrationTool.cxx index 9c6c239c7c751ad9ed0c7aa7bd7a72badbb236c6..e20d0ea2d3acdf99e119341dd8706a3f2a6274b5 100644 --- a/Reconstruction/Jet/JetCalibTools/Root/JetCalibrationTool.cxx +++ b/Reconstruction/Jet/JetCalibTools/Root/JetCalibrationTool.cxx @@ -13,7 +13,7 @@ // JetCalibTools includes #include "JetCalibTools/JetCalibrationTool.h" #include "PathResolver/PathResolver.h" -#include "StoreGate/ReadDecorHandle.h" +#include "AsgDataHandles/ReadDecorHandle.h" // Constructors //////////////// @@ -22,7 +22,6 @@ JetCalibrationTool::JetCalibrationTool(const std::string& name) : JetCalibrationToolBase::JetCalibrationToolBase( name ), m_rhkEvtInfo("EventInfo"), m_rhkRhoKey(""), - m_rhkPV("PrimaryVertices"), m_jetAlgo(""), m_config(""), m_calibSeq(""), m_calibAreaTag(""), m_originScale(""), m_devMode(false), m_isData(true), m_timeDependentCalib(false), m_rhoKey("auto"), m_dir(""), m_eInfoName(""), m_globalConfig(NULL), m_doJetArea(true), m_doResidual(true), m_doOrigin(true), m_doGSC(true), m_gscDepth("auto"), m_jetPileupCorr(NULL), m_etaJESCorr(NULL), m_globalSequentialCorr(NULL), m_insituDataCorr(NULL), m_jetMassCorr(NULL), m_jetSmearCorr(NULL) @@ -39,7 +38,6 @@ JetCalibrationTool::JetCalibrationTool(const std::string& name) declareProperty( "OriginScale", m_originScale = "JetOriginConstitScaleMomentum"); declareProperty( "CalibArea", m_calibAreaTag = "00-04-82"); declareProperty( "rhkRhoKey", m_rhkRhoKey); - declareProperty( "PrimaryVerticesContainerName", m_rhkPV = "PrimaryVertices"); declareProperty( "GSCDepth", m_gscDepth); } diff --git a/Reconstruction/Jet/JetCalibTools/util/JetCalibTools_Example.cxx b/Reconstruction/Jet/JetCalibTools/util/JetCalibTools_Example.cxx index 956b10e6a7738fe1e3a8a4d9c71c1aa98fab18c0..9f5b17169784b648fd367c8e144c83e27ef249da 100644 --- a/Reconstruction/Jet/JetCalibTools/util/JetCalibTools_Example.cxx +++ b/Reconstruction/Jet/JetCalibTools/util/JetCalibTools_Example.cxx @@ -25,6 +25,7 @@ #include "xAODRootAccess/Init.h" #include "xAODRootAccess/TEvent.h" #include "xAODRootAccess/TStore.h" +#include <AsgTools/MessageCheck.h> #else #include "POOLRootAccess/TEvent.h" #include "StoreGate/StoreGateSvc.h" @@ -61,6 +62,9 @@ void usage() { int main(int argc, char* argv[]){ + using namespace asg::msgUserCode; + ANA_CHECK_SET_TYPE (int); + //--------------------------------------------- // Declaring input variables with default values //--------------------------------------------- @@ -125,9 +129,6 @@ int main(int argc, char* argv[]){ } else if(isData=="TRUE") isCollision = true; - // Set up the job for xAOD access: - static const char* APP_NAME = "JetCalibTools_Example"; - //-------------------- // Opening input file //-------------------- @@ -135,12 +136,12 @@ int main(int argc, char* argv[]){ // Create a TEvent object. #ifdef XAOD_STANDALONE - RETURN_CHECK( APP_NAME, xAOD::Init() ); + ANA_CHECK( xAOD::Init() ); xAOD::TEvent event( xAOD::TEvent::kClassAccess ); - RETURN_CHECK( APP_NAME, event.readFrom( ifile.get() ) ); + ANA_CHECK( event.readFrom( ifile.get() ) ); #else // Athena "Store" is the same StoreGate used by the TEvent POOL::TEvent event( POOL::TEvent::kClassAccess ); - CHECK_WITH_CONTEXT( event.readFrom( ifile.get() ), APP_NAME, 1 ); + ANA_CHECK( event.readFrom( ifile.get() ) ); #endif //---------------------------------- @@ -150,17 +151,13 @@ int main(int argc, char* argv[]){ // Call the constructor JetCalibrationTool jetCalibrationTool(name_JetCalibTools.c_str()); - CHECK_WITH_CONTEXT( jetCalibrationTool.setProperty("JetCollection",jetColl.c_str()), - APP_NAME, 1 ); + ANA_CHECK( jetCalibrationTool.setProperty("JetCollection",jetColl.c_str()) ); - CHECK_WITH_CONTEXT( jetCalibrationTool.setProperty("CalibSequence",calibSeq.c_str()), - APP_NAME, 1 ); + ANA_CHECK( jetCalibrationTool.setProperty("CalibSequence",calibSeq.c_str()) ); - CHECK_WITH_CONTEXT( jetCalibrationTool.setProperty("ConfigFile",jetCalibConfig.c_str()), - APP_NAME, 1 ); + ANA_CHECK( jetCalibrationTool.setProperty("ConfigFile",jetCalibConfig.c_str()) ); - CHECK_WITH_CONTEXT( jetCalibrationTool.setProperty("IsData",isCollision), - APP_NAME, 1 ); + ANA_CHECK( jetCalibrationTool.setProperty("IsData",isCollision) ); // Initialize the tool if(!(jetCalibrationTool.initialize().isSuccess())){ @@ -186,13 +183,13 @@ int main(int argc, char* argv[]){ // Retrieve jet container const xAOD::JetContainer* jets = 0; - CHECK_WITH_CONTEXT( event.retrieve( jets, jetColl + "Jets" ), APP_NAME, 1 ); + ANA_CHECK( event.retrieve( jets, jetColl + "Jets" ) ); // Shallow copy auto jets_shallowCopy = xAOD::shallowCopyContainer( *jets ); // Calibrate the shallow copy - CHECK_WITH_CONTEXT( jetCalibrationTool.applyCalibration( *(jets_shallowCopy.first) ), APP_NAME, 1 ); + ANA_CHECK( jetCalibrationTool.applyCalibration( *(jets_shallowCopy.first) ) ); delete jets_shallowCopy.first; delete jets_shallowCopy.second; diff --git a/Reconstruction/MuonIdentification/MuonCombinedRecExample/python/CombinedMuonTrackSummary.py b/Reconstruction/MuonIdentification/MuonCombinedRecExample/python/CombinedMuonTrackSummary.py index 43d625052d4f6288686b4365bfe940ec1537e98d..b63e6870ff1c0e4037d91d93633f7ff87dd0c356 100644 --- a/Reconstruction/MuonIdentification/MuonCombinedRecExample/python/CombinedMuonTrackSummary.py +++ b/Reconstruction/MuonIdentification/MuonCombinedRecExample/python/CombinedMuonTrackSummary.py @@ -21,13 +21,20 @@ atlasExtrapolator = getPublicTool('AtlasExtrapolator') muonTrackSummaryHelper = getPublicTool('MuonTrackSummaryHelperTool') +from InDetBoundaryCheckTool.InDetBoundaryCheckToolConf import InDet__InDetBoundaryCheckTool +CombinedMuonIDBoundaryCheckTool = InDet__InDetBoundaryCheckTool( + name="CombinedMuonIDBoundaryCheckTool", + UsePixel=DetFlags.haveRIO.pixel_on(), + UseSCT=DetFlags.haveRIO.SCT_on() +) +ToolSvc += CombinedMuonIDBoundaryCheckTool + # load InDetHoleSearchTool from InDetTrackHoleSearch.InDetTrackHoleSearchConf import InDet__InDetTrackHoleSearchTool ToolSvc += InDet__InDetTrackHoleSearchTool( \ name = "CombinedMuonIDHoleSearch", Extrapolator = atlasExtrapolator, - usePixel = DetFlags.haveRIO.pixel_on(), - useSCT = DetFlags.haveRIO.SCT_on(), + BoundaryCheckTool = CombinedMuonIDBoundaryCheckTool, CountDeadModulesAfterLastHit = True) import InDetRecExample.TrackingCommon as TrackingCommon @@ -113,5 +120,5 @@ if DetFlags.haveRIO.SCT_on(): sct_ConditionsSummaryToolSetup = SCT_ConditionsSummaryToolSetup() sct_ConditionsSummaryToolSetup.setup() InDetSCT_ConditionsSummaryTool = sct_ConditionsSummaryToolSetup.getTool() - ToolSvc.CombinedMuonIDHoleSearch.SctSummaryTool = InDetSCT_ConditionsSummaryTool + ToolSvc.CombinedMuonIDBoundaryCheckTool.SctSummaryTool = InDetSCT_ConditionsSummaryTool diff --git a/Reconstruction/RecoTools/TrackToVertex/src/TrackToVertex.cxx b/Reconstruction/RecoTools/TrackToVertex/src/TrackToVertex.cxx index ab072e6d8d55019909e8f921e84aed4f544926e2..61bd45a41de2404db01b59393c19e4cd74587388 100755 --- a/Reconstruction/RecoTools/TrackToVertex/src/TrackToVertex.cxx +++ b/Reconstruction/RecoTools/TrackToVertex/src/TrackToVertex.cxx @@ -38,17 +38,13 @@ Reco::TrackToVertex::~TrackToVertex() { } - - -// Athena standard methods - // initialize StatusCode Reco::TrackToVertex::initialize() { // Get the GeometryBuilder AlgTool if ( m_extrapolator.retrieve().isFailure() ) { ATH_MSG_WARNING( "Failed to retrieve tool " << m_extrapolator << " - extrapolations will not be performed." ); - } else + } else ATH_MSG_INFO( "Retrieved tool " << m_extrapolator); if(!m_ForceBeamSpotZero){ ATH_CHECK(m_beamSpotKey.initialize()); @@ -83,8 +79,8 @@ StatusCode Reco::TrackToVertex::finalize() const Trk::Perigee* Reco::TrackToVertex::perigeeAtVertex(const Rec::TrackParticle& tp) const { - - // retrieve the reconstructed Vertex from the TrackParticle + + // retrieve the reconstructed Vertex from the TrackParticle const Trk::VxCandidate* vxCandidate = tp.reconstructedVertex(); if (vxCandidate!=0) { // create a global position from this @@ -105,25 +101,32 @@ const Trk::Perigee* Reco::TrackToVertex::perigeeAtVertex(const xAOD::TrackPartic const Trk::Perigee* Reco::TrackToVertex::perigeeAtVertex(const xAOD::TrackParticle& tp, const Amg::Vector3D& gp) const { // preparation - Trk::PerigeeSurface persf(gp); - const Trk::Perigee* vertexPerigee = 0; + Trk::PerigeeSurface persf(gp); + const Trk::Perigee* vertexPerigee = nullptr; // retrieve the Perigee from the track particle const Trk::Perigee& trackparPerigee = tp.perigeeParameters(); - if ( trackparPerigee.associatedSurface() == persf) { - ATH_MSG_DEBUG("Perigee of TrackParticle is already expressed to given vertex, a copy is returned."); - return(trackparPerigee.clone()); - } else - vertexPerigee = dynamic_cast<const Trk::Perigee*>(m_extrapolator->extrapolateDirectly(trackparPerigee, persf)); + if (trackparPerigee.associatedSurface() == persf) { + ATH_MSG_DEBUG("Perigee of TrackParticle is already expressed to given " + "vertex, a copy is returned."); + return (trackparPerigee.clone()); + } else { + const Trk::TrackParameters* extrapResult = + m_extrapolator->extrapolateDirectly(trackparPerigee, persf); + if (extrapResult && extrapResult->surfaceType() == Trk::Surface::Perigee) { + vertexPerigee = static_cast<const Trk::Perigee*>(extrapResult); + } + } if (!vertexPerigee) - ATH_MSG_DEBUG("Extrapolation to Perigee failed, a NULL pointer is returned."); - return vertexPerigee; + ATH_MSG_DEBUG( + "Extrapolation to Perigee failed, a NULL pointer is returned."); + return vertexPerigee; } const Trk::Perigee* Reco::TrackToVertex::perigeeAtVertex(const Rec::TrackParticle& tp, const Amg::Vector3D& gp) const { // preparation - Trk::PerigeeSurface persf(gp); - const Trk::Perigee* vertexPerigee = 0; + Trk::PerigeeSurface persf(gp); + const Trk::Perigee* vertexPerigee = nullptr; // retrieve the Perigee from the track particle const Trk::Perigee* trackparPerigee = tp.measuredPerigee(); if (trackparPerigee){ @@ -131,43 +134,59 @@ const Trk::Perigee* Reco::TrackToVertex::perigeeAtVertex(const Rec::TrackParticl { ATH_MSG_DEBUG("Perigee of TrackParticle is already expressed to given vertex, a copy is returned."); return(trackparPerigee->clone()); - } else - vertexPerigee = dynamic_cast<const Trk::Perigee*>(m_extrapolator->extrapolateDirectly(*trackparPerigee, persf)); + } else { + const Trk::TrackParameters* extrapResult = + m_extrapolator->extrapolateDirectly(*trackparPerigee, persf); + if (extrapResult && + extrapResult->surfaceType() == Trk::Surface::Perigee) { + vertexPerigee = static_cast<const Trk::Perigee*>(extrapResult); + } + } } else { - ATH_MSG_DEBUG("No Perigee found in TrackParticle, a NULL pointer is returned."); - return 0; + ATH_MSG_DEBUG( + "No Perigee found in TrackParticle, a NULL pointer is returned."); + return nullptr; } - if (!vertexPerigee) - ATH_MSG_DEBUG("Extrapolation to Perigee failed, a NULL pointer is returned."); - return vertexPerigee; + if (!vertexPerigee){ + ATH_MSG_DEBUG( + "Extrapolation to Perigee failed, a NULL pointer is returned."); + } + return vertexPerigee; } const Trk::Perigee* Reco::TrackToVertex::perigeeAtVertex(const Trk::Track& track, const Amg::Vector3D& gp) const { - Trk::PerigeeSurface persf(gp); - const Trk::Perigee* vertexPerigee = dynamic_cast<const Trk::Perigee*>(m_extrapolator->extrapolate(track, persf)); - if (!vertexPerigee){ - const Trk::Perigee* trackPerigee = track.perigeeParameters(); - if ( trackPerigee && trackPerigee->associatedSurface() == persf ) - { - ATH_MSG_DEBUG("Perigee of Track is already expressed to given vertex, a copy is returned."); - vertexPerigee = trackPerigee->clone(); - } else - ATH_MSG_DEBUG("Extrapolation to Perigee failed, NULL pointer is returned."); - } + Trk::PerigeeSurface persf(gp); + const Trk::Perigee* vertexPerigee = nullptr; + const Trk::TrackParameters* extrapResult = + m_extrapolator->extrapolate(track, persf); + if (extrapResult && extrapResult->surfaceType() == Trk::Surface::Perigee) { + vertexPerigee = static_cast<const Trk::Perigee*>(extrapResult); + } + if (!vertexPerigee) { + const Trk::Perigee* trackPerigee = track.perigeeParameters(); + if (trackPerigee && trackPerigee->associatedSurface() == persf) { + ATH_MSG_DEBUG("Perigee of Track is already expressed to given vertex, a " + "copy is returned."); + vertexPerigee = trackPerigee->clone(); + } else{ + ATH_MSG_DEBUG( + "Extrapolation to Perigee failed, NULL pointer is returned."); + } + } return (vertexPerigee); } const Trk::Perigee* Reco::TrackToVertex::perigeeAtBeamspot(const Rec::TrackParticle& tp, const InDet::BeamSpotData* beamspot) const -{ +{ return perigeeAtVertex(tp, beamspot ? beamspot->beamVtx().position() : s_origin); } const Trk::Perigee* Reco::TrackToVertex::perigeeAtBeamspot(const xAOD::TrackParticle& tp, const InDet::BeamSpotData* beamspot) const -{ +{ return perigeeAtVertex(tp, beamspot ? beamspot->beamVtx().position() : s_origin); } @@ -180,8 +199,8 @@ const Trk::Perigee* Reco::TrackToVertex::perigeeAtBeamspot(const Trk::Track& tra const Trk::Perigee* Reco::TrackToVertex::perigeeAtBeamline(const Trk::Track& track, const InDet::BeamSpotData* beamspotptr) const { - - Amg::Vector3D beamspot(s_origin); + + Amg::Vector3D beamspot(s_origin); float tiltx = 0.0; float tilty = 0.0; if (beamspotptr) { @@ -195,9 +214,14 @@ const Trk::Perigee* Reco::TrackToVertex::perigeeAtBeamline(const Trk::Track& tra *amgTransf *= Amg::AngleAxis3D(tilty, Amg::Vector3D(0.,1.,0.)); *amgTransf *= Amg::AngleAxis3D(tiltx, Amg::Vector3D(1.,0.,0.)); // preparation - Trk::PerigeeSurface persf(amgTransf); - - const Trk::Perigee* vertexPerigee = dynamic_cast<const Trk::Perigee*>(m_extrapolator->extrapolate(track, persf)); + Trk::PerigeeSurface persf(amgTransf); + + const Trk::Perigee* vertexPerigee = nullptr; + const Trk::TrackParameters* extrapResult = + m_extrapolator->extrapolate(track, persf); + if (extrapResult && extrapResult->surfaceType() == Trk::Surface::Perigee) { + vertexPerigee = static_cast<const Trk::Perigee*>(extrapResult); + } if (!vertexPerigee) { // workaround. // try again using the first track parameter set, since the current extrapolator will @@ -207,24 +231,30 @@ const Trk::Perigee* Reco::TrackToVertex::perigeeAtBeamline(const Trk::Track& tra const DataVector<const Trk::TrackParameters> *track_parameter_list= track.trackParameters(); if (track_parameter_list) { for(const Trk::TrackParameters *trk_params: *track_parameter_list) { - if (!trk_params) continue; - vertexPerigee = dynamic_cast<const Trk::Perigee*>(m_extrapolator->extrapolate(*trk_params, persf)); + if (!trk_params) { + continue; + } + extrapResult = m_extrapolator->extrapolate(*trk_params, persf); + if (extrapResult && + extrapResult->surfaceType() == Trk::Surface::Perigee) { + vertexPerigee = static_cast<const Trk::Perigee*>(extrapResult); + } break; } } } - if (!vertexPerigee){ + if (!vertexPerigee) { const Trk::Perigee* trackPerigee = track.perigeeParameters(); - if ( trackPerigee && trackPerigee->associatedSurface() == persf ) - { - ATH_MSG_DEBUG("Perigee of Track is already expressed to given vertex, a copy is returned."); - vertexPerigee = trackPerigee->clone(); - } else{ - ATH_MSG_DEBUG("Extrapolation to Beamline Perigee failed, NULL pointer is returned."); - } + if (trackPerigee && trackPerigee->associatedSurface() == persf) { + ATH_MSG_DEBUG("Perigee of Track is already expressed to given vertex, a " + "copy is returned."); + vertexPerigee = trackPerigee->clone(); + } else { + ATH_MSG_DEBUG( + "Extrapolation to Beamline Perigee failed, NULL pointer is returned."); } - return (vertexPerigee); - + } + return (vertexPerigee); } const Trk::TrackParameters* Reco::TrackToVertex::trackAtBeamline(const Rec::TrackParticle& /*tp*/) const @@ -233,12 +263,12 @@ const Trk::TrackParameters* Reco::TrackToVertex::trackAtBeamline(const Rec::Trac return 0; //return m_extrapolator->extrapolate(tp, *m_beamLine); } - + const Trk::TrackParameters* Reco::TrackToVertex::trackAtBeamline(const xAOD::TrackParticle& tp, const InDet::BeamSpotData* beamspotptr) const { - - Amg::Vector3D beamspot(s_origin); + + Amg::Vector3D beamspot(s_origin); float tiltx = 0.0; float tilty = 0.0; if (beamspotptr) { @@ -252,7 +282,7 @@ const Trk::TrackParameters* Reco::TrackToVertex::trackAtBeamline(const xAOD::Tra *amgTransf *= Amg::AngleAxis3D(tilty, Amg::Vector3D(0.,1.,0.)); *amgTransf *= Amg::AngleAxis3D(tiltx, Amg::Vector3D(1.,0.,0.)); // preparation - Trk::PerigeeSurface persf(amgTransf); + Trk::PerigeeSurface persf(amgTransf); const Trk::TrackParameters* vertexPerigee = 0; // retrieve the Perigee from the track particle const Trk::Perigee& trackparPerigee = tp.perigeeParameters(); @@ -260,7 +290,7 @@ const Trk::TrackParameters* Reco::TrackToVertex::trackAtBeamline(const xAOD::Tra ATH_MSG_DEBUG("Perigee of TrackParticle is already expressed to given vertex, a copy is returned."); delete amgTransf; return(trackparPerigee.clone()); - } else + } else vertexPerigee = m_extrapolator->extrapolateDirectly(trackparPerigee, persf); if (!vertexPerigee){ ATH_MSG_DEBUG("Extrapolation to Beam Line failed, a NULL pointer is returned."); diff --git a/Reconstruction/egamma/egammaRec/python/EMCommonRefitter.py b/Reconstruction/egamma/egammaRec/python/EMCommonRefitter.py index 0afa22e13c1177145b1999697f1c28237c2af3d3..d5bee5db177f9dfdb19447a5c893b881f9f50e7b 100644 --- a/Reconstruction/egamma/egammaRec/python/EMCommonRefitter.py +++ b/Reconstruction/egamma/egammaRec/python/EMCommonRefitter.py @@ -51,17 +51,11 @@ def getGSFTrackFitter(): GsfMaterialConvolution=GsfMaterialUpdator, SurfaceBasedMaterialEffects=False) - from TrkMeasurementUpdator.TrkMeasurementUpdatorConf import ( - Trk__KalmanUpdatorAmg as ConfiguredKalmanUpdator) - - egTrkUpdator = ConfiguredKalmanUpdator('egTrkUpdator') - from TrkGaussianSumFilter.TrkGaussianSumFilterConf import ( Trk__GsfMeasurementUpdator) GsfMeasurementUpdator = Trk__GsfMeasurementUpdator( - name='GsfMeasurementUpdator', - Updator=egTrkUpdator) + name='GsfMeasurementUpdator') from TrkGaussianSumFilter.TrkGaussianSumFilterConf import ( Trk__GaussianSumFitter) diff --git a/Simulation/Digitization/python/DigitizationConfigFlags.py b/Simulation/Digitization/python/DigitizationConfigFlags.py index debcc204cc6b968ed8a3cdbbdb1e1aa3650b4c4d..57f81782e310fcc85d2f50c9613c86c5dba69684 100644 --- a/Simulation/Digitization/python/DigitizationConfigFlags.py +++ b/Simulation/Digitization/python/DigitizationConfigFlags.py @@ -63,6 +63,8 @@ def createDigitizationCfgFlags(): flags.addFlag("Digitization.TRTRangeCut", lambda prevFlags : float(GetFileMD(prevFlags.Input.Files).get('TRTRangeCut', 0.05))) # Write out truth information? flags.addFlag("Digitization.TruthOutput", False) + # Write out calorimeter digits + flags.addFlag("Digitization.AddCaloDigi", False) # Integer offset to random seed initialisation flags.addFlag("Digitization.RandomSeedOffset", 0) return flags diff --git a/Simulation/Digitization/share/Digitization.py b/Simulation/Digitization/share/Digitization.py index 342346ac376860e39bf2c02b730a2523a01ab11c..3cd623e030b8a6c7cbc61ad107940eb7db6a68ef 100755 --- a/Simulation/Digitization/share/Digitization.py +++ b/Simulation/Digitization/share/Digitization.py @@ -126,7 +126,8 @@ if DetFlags.writeRDOPool.any_on(): streamRDO = AthenaPoolOutputStream("StreamRDO", athenaCommonFlags.PoolRDOOutput.get_Value(), asAlg=True, eventInfoKey=eventInfoKey) from Digitization.DigiOutput import getStreamRDO_ItemList streamRDO.ItemList = getStreamRDO_ItemList(logDigitization_flags) - streamRDO.AcceptAlgs += [ digitizationFlags.digiSteeringConf.get_Value() ] + if digitizationFlags.digiSteeringConf.get_Value() == 'TestTruthJetFilter': + streamRDO.AcceptAlgs += [ digitizationFlags.digiSteeringConf.get_Value() ] streamRDO.OutputFile = athenaCommonFlags.PoolRDOOutput() ServiceMgr.AthenaPoolCnvSvc.PoolAttributes += [ "DatabaseName = '" + athenaCommonFlags.PoolRDOOutput() + "'; COMPRESSION_ALGORITHM = '2'" ] ServiceMgr.AthenaPoolCnvSvc.PoolAttributes += [ "DatabaseName = '" + athenaCommonFlags.PoolRDOOutput() + "'; COMPRESSION_LEVEL = '1'" ] diff --git a/Simulation/G4Extensions/Charginos/python/CharginosConfig.py b/Simulation/G4Extensions/Charginos/python/CharginosConfig.py index eaa569b12f4ba3f1ccbca5425a40e0dbcd07d4a3..cf7c2fb518292b306850b9f156c17d11ffe74db9 100644 --- a/Simulation/G4Extensions/Charginos/python/CharginosConfig.py +++ b/Simulation/G4Extensions/Charginos/python/CharginosConfig.py @@ -3,15 +3,16 @@ from AthenaCommon import CfgMgr def getCharginosPhysicsTool(name="CharginosPhysicsTool", **kwargs): from G4AtlasApps.SimFlags import simFlags - from AthenaCommon.SystemOfUnits import MeV,ns + from AthenaCommon.SystemOfUnits import MeV, ns, GeV # noqa: F401 + # Example specialConfiguration: {'AMSBC1Mass': '1200.16*GeV', 'AMSBN1Mass': '1200.0*GeV', 'AMSBC1Lifetime': '0.2*ns'} C1Mass = eval(simFlags.specialConfiguration.get_Value().get("AMSBC1Mass", None)) N1Mass = eval(simFlags.specialConfiguration.get_Value().get("AMSBN1Mass", None)) C1Lifetime = eval(simFlags.specialConfiguration.get_Value().get("AMSBC1Lifetime", "-1.0")) - kwargs.setdefault("CharginoPlusMass", C1Mass*MeV) # TODO check units + kwargs.setdefault("CharginoPlusMass", C1Mass) kwargs.setdefault("CharginoPlusStable", (C1Lifetime < 0)) if not (C1Lifetime < 0): - kwargs.setdefault("CharginoPlusLifetime", C1Lifetime*ns) + kwargs.setdefault("CharginoPlusLifetime", C1Lifetime) ##kwargs.setdefault("CharginoPlusMass", 101.0*GeV) ##kwargs.setdefault("CharginoPlusWidth", 0.0*MeV) ##kwargs.setdefault("CharginoPlusCharge", 1.*eplus) @@ -20,10 +21,10 @@ def getCharginosPhysicsTool(name="CharginosPhysicsTool", **kwargs): ##kwargs.setdefault("CharginoPlusLifetime", -1) ##kwargs.setdefault("CharginoPlusShortlived", False) - kwargs.setdefault("CharginoMinusMass", C1Mass*MeV) # TODO check units + kwargs.setdefault("CharginoMinusMass", C1Mass) kwargs.setdefault("CharginoMinusStable", (C1Lifetime < 0)) if not (C1Lifetime < 0): - kwargs.setdefault("CharginoMinusLifetime", C1Lifetime*ns) + kwargs.setdefault("CharginoMinusLifetime", C1Lifetime) ##kwargs.setdefault("CharginoMinusMass", 101.0*GeV) ##kwargs.setdefault("CharginoMinusWidth", 0.0*MeV) ##kwargs.setdefault("CharginoMinusCharge", 1.*eplus) @@ -32,7 +33,7 @@ def getCharginosPhysicsTool(name="CharginosPhysicsTool", **kwargs): ##kwargs.setdefault("CharginoMinusLifetime", -1) ##kwargs.setdefault("CharginoMinusShortlived", False) - kwargs.setdefault("NeutralinoMass", N1Mass*MeV) # TODO check units + kwargs.setdefault("NeutralinoMass", N1Mass) ##kwargs.setdefault("NeutralinoWidth", 0.0*MeV) ##kwargs.setdefault("NeutralinoCharge", 0.*eplus) ##kwargs.setdefault("NeutralinoPDGCode", 1000022) diff --git a/Simulation/G4Extensions/Gauginos/python/GauginosConfig.py b/Simulation/G4Extensions/Gauginos/python/GauginosConfig.py index 8dca17479cb92f426bab7d57e36016b217012457..ca04f29730b544c288b8eef7a3800f15f923b332 100644 --- a/Simulation/G4Extensions/Gauginos/python/GauginosConfig.py +++ b/Simulation/G4Extensions/Gauginos/python/GauginosConfig.py @@ -2,7 +2,9 @@ from AthenaCommon import CfgMgr def getGauginosPhysicsTool(name="GauginosPhysicsTool", **kwargs): + from AthenaCommon.SystemOfUnits import GeV,ns # noqa: F401 from G4AtlasApps.SimFlags import simFlags + # Example specialConfiguration {'GMSBSlepton': '100.0*GeV', 'GMSBGravitino': '1e-07*GeV', 'GMSBSleptonTime': '0.01*ns'} GMSBNeutralino = eval(simFlags.specialConfiguration.get_Value().get("GMSBNeutralino", "0*GeV")) GMSBTime = eval(simFlags.specialConfiguration.get_Value().get("GMSBLifeTime", "0*GeV")) kwargs.setdefault("NeutralinoMass", GMSBNeutralino) diff --git a/Simulation/G4Extensions/Sleptons/python/SleptonsConfig.py b/Simulation/G4Extensions/Sleptons/python/SleptonsConfig.py index 7e3944555d56182f9af72f35b85a723757b4382a..f662b7664cb5b658e58e77b4edb3e9df0c8e9ca0 100644 --- a/Simulation/G4Extensions/Sleptons/python/SleptonsConfig.py +++ b/Simulation/G4Extensions/Sleptons/python/SleptonsConfig.py @@ -1,6 +1,8 @@ # Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration from AthenaCommon import CfgMgr +from AthenaCommon.SystemOfUnits import GeV,ns # noqa: F401 +# Example specialConfiguration {'GMSBSlepton': '100.0*GeV', 'GMSBGravitino': '1e-07*GeV', 'GMSBSleptonTime': '0.01*ns'} """ Defining default settings for slepton/staus. Possible options are: diff --git a/Event/EventOverlay/OverlayByteStreamAlgs/CMakeLists.txt b/Simulation/Overlay/OverlayByteStreamUtils/CMakeLists.txt similarity index 86% rename from Event/EventOverlay/OverlayByteStreamAlgs/CMakeLists.txt rename to Simulation/Overlay/OverlayByteStreamUtils/CMakeLists.txt index 899ed6e11c7a89212223ce2c46a448f432c2ebe3..87f203488952884b690643986e501b54cbbd52ca 100644 --- a/Event/EventOverlay/OverlayByteStreamAlgs/CMakeLists.txt +++ b/Simulation/Overlay/OverlayByteStreamUtils/CMakeLists.txt @@ -1,13 +1,13 @@ # Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration # Declare the package name: -atlas_subdir( OverlayByteStreamAlgs ) +atlas_subdir( OverlayByteStreamUtils ) # External dependencies: find_package( ROOT COMPONENTS MathCore ) # Component(s) in the package: -atlas_add_component( OverlayByteStreamAlgs +atlas_add_component( OverlayByteStreamUtils src/*.cxx src/components/*.cxx INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} diff --git a/Event/EventOverlay/OverlayByteStreamAlgs/src/BSFilter.cxx b/Simulation/Overlay/OverlayByteStreamUtils/src/BSFilter.cxx similarity index 100% rename from Event/EventOverlay/OverlayByteStreamAlgs/src/BSFilter.cxx rename to Simulation/Overlay/OverlayByteStreamUtils/src/BSFilter.cxx diff --git a/Event/EventOverlay/OverlayByteStreamAlgs/src/BSFilter.h b/Simulation/Overlay/OverlayByteStreamUtils/src/BSFilter.h similarity index 86% rename from Event/EventOverlay/OverlayByteStreamAlgs/src/BSFilter.h rename to Simulation/Overlay/OverlayByteStreamUtils/src/BSFilter.h index bb52999ec6924e68cc3103ce7a81ce6c2b31b55c..3b9b128b0c3a5c5e7d850a914e99c181668bcf35 100644 --- a/Event/EventOverlay/OverlayByteStreamAlgs/src/BSFilter.h +++ b/Simulation/Overlay/OverlayByteStreamUtils/src/BSFilter.h @@ -2,8 +2,8 @@ Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration */ -#ifndef OVERLAYBYTESTREAMALGS_BSFILTER_H -#define OVERLAYBYTESTREAMALGS_BSFILTER_H +#ifndef OVERLAYBYTESTREAMUTILS_BSFILTER_H +#define OVERLAYBYTESTREAMUTILS_BSFILTER_H #include <string> #include <map> @@ -37,4 +37,4 @@ class BSFilter : public AthAlgorithm ServiceHandle< TrigConf::ITrigConfigSvc > m_trigConf; }; -#endif //OVERLAYBYTESTREAMALGS_BSFILTER_H +#endif // OVERLAYBYTESTREAMUTILS_BSFILTER_H diff --git a/Event/EventOverlay/OverlayByteStreamAlgs/src/ByteStreamMultipleOutputStreamCopyTool.cxx b/Simulation/Overlay/OverlayByteStreamUtils/src/ByteStreamMultipleOutputStreamCopyTool.cxx similarity index 100% rename from Event/EventOverlay/OverlayByteStreamAlgs/src/ByteStreamMultipleOutputStreamCopyTool.cxx rename to Simulation/Overlay/OverlayByteStreamUtils/src/ByteStreamMultipleOutputStreamCopyTool.cxx diff --git a/Event/EventOverlay/OverlayByteStreamAlgs/src/ByteStreamMultipleOutputStreamCopyTool.h b/Simulation/Overlay/OverlayByteStreamUtils/src/ByteStreamMultipleOutputStreamCopyTool.h similarity index 93% rename from Event/EventOverlay/OverlayByteStreamAlgs/src/ByteStreamMultipleOutputStreamCopyTool.h rename to Simulation/Overlay/OverlayByteStreamUtils/src/ByteStreamMultipleOutputStreamCopyTool.h index e5485fe7f23609288986e42eca27c251fa155b23..6545a7789a69918104b416a706c44a779eba56f8 100644 --- a/Event/EventOverlay/OverlayByteStreamAlgs/src/ByteStreamMultipleOutputStreamCopyTool.h +++ b/Simulation/Overlay/OverlayByteStreamUtils/src/ByteStreamMultipleOutputStreamCopyTool.h @@ -2,8 +2,8 @@ Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration */ -#ifndef OVERLAYBYTESTREAMALGS_BYTESTREAMMULTIPLEOUTPUTSTREAMCOPYTOOL_H -# define OVERLAYBYTESTREAMALGS_BYTESTREAMMULTIPLEOUTPUTSTREAMCOPYTOOL_H +#ifndef OVERLAYBYTESTREAMUTILS_BYTESTREAMMULTIPLEOUTPUTSTREAMCOPYTOOL_H +# define OVERLAYBYTESTREAMUTILS_BYTESTREAMMULTIPLEOUTPUTSTREAMCOPYTOOL_H /** * @file ByteStreamMultipleOutputStreamCopyTool.h * @@ -111,4 +111,4 @@ private: }; -#endif // OVERLAYBYTESTREAMALGS_BYTESTREAMMULTIPLEOUTPUTSTREAMCOPYTOOL_H +#endif // OVERLAYBYTESTREAMUTILS_BYTESTREAMMULTIPLEOUTPUTSTREAMCOPYTOOL_H diff --git a/Event/EventOverlay/OverlayByteStreamAlgs/src/components/OverlayByteStreamAlgs_entries.cxx b/Simulation/Overlay/OverlayByteStreamUtils/src/components/OverlayByteStreamUtils_entries.cxx similarity index 100% rename from Event/EventOverlay/OverlayByteStreamAlgs/src/components/OverlayByteStreamAlgs_entries.cxx rename to Simulation/Overlay/OverlayByteStreamUtils/src/components/OverlayByteStreamUtils_entries.cxx diff --git a/Simulation/SimuJobTransforms/share/skeleton.FilterHit.py b/Simulation/SimuJobTransforms/share/skeleton.FilterHit.py index b84d4eca1d7034eb9ade967b8c231aacfd8f9d86..a5a739aa446351fdb5dc2548d6a7af0e32025286 100644 --- a/Simulation/SimuJobTransforms/share/skeleton.FilterHit.py +++ b/Simulation/SimuJobTransforms/share/skeleton.FilterHit.py @@ -253,6 +253,14 @@ if hasattr(runArgs,'TruthReductionScheme'): McEventCollectionFilter.UseTRTHits = False except: filterHitLog.error('Trying to run on upgrade samples (no TRT) with an old tag of McEventCollectionFilter - job will fail.') + + ## For upgrade geometries the BCM has been removed, so should be switched off + if not DetFlags.detdescr.BCM_on(): + try: + McEventCollectionFilter.UseBCMHits = False + except: + filterHitLog.error('Trying to run on upgrade samples (no BCM) with an old version of McEventCollectionFilter - job will fail.') + if not DetFlags.detdescr.CSC_on(): try: McEventCollectionFilter.UseCSCHits = False diff --git a/Simulation/SimulationJobOptions/share/g4/postInclude.McEventCollection.py b/Simulation/SimulationJobOptions/share/g4/postInclude.McEventCollection.py new file mode 100644 index 0000000000000000000000000000000000000000..ef8dc2d20b079b190d20cd42ad8e54e94376dc21 --- /dev/null +++ b/Simulation/SimulationJobOptions/share/g4/postInclude.McEventCollection.py @@ -0,0 +1,10 @@ +######################################################### +######################################################### +from AthenaCommon.AlgSequence import AthSequencer +## configure Athena for POOL persistency +streamAlgs = ['StreamHITS'] +streamSeq = AthSequencer("AthOutSeq") +for stream in streamAlgs: + sSoutStream = getattr(streamSeq, stream, None) + if sSoutStream is not None: + sSoutStream.ItemList += [ "McEventCollection#*" ] diff --git a/Simulation/SimulationJobOptions/share/heavyIons/postInclude.HijingPars.py b/Simulation/SimulationJobOptions/share/heavyIons/postInclude.HijingPars.py index c35afbf9132875a8a996386f49254fd818f5f7f5..b029b307b7ce6942c52362befed80ae7cd63f20e 100644 --- a/Simulation/SimulationJobOptions/share/heavyIons/postInclude.HijingPars.py +++ b/Simulation/SimulationJobOptions/share/heavyIons/postInclude.HijingPars.py @@ -10,7 +10,7 @@ # is called. # ######################################################### -from AthenaCommon.AlgSequence import AlgSequence +from AthenaCommon.AlgSequence import AlgSequence, AthSequencer topSequence = AlgSequence() from AthenaCommon.DetFlags import DetFlags @@ -37,7 +37,7 @@ else: ## configure Athena for POOL persistency streamAlgs = ['StreamHITS','StreamRDO','StreamESD','StreamAOD'] -streamSeq = AlgSequence("Streams") +streamSeq = AthSequencer("AthOutSeq") for stream in streamAlgs: sSoutStream = getattr(streamSeq, stream, None) tSoutStream = getattr(topSequence, stream, None) diff --git a/Simulation/Tools/McEventCollectionFilter/src/McEventCollectionFilter.cxx b/Simulation/Tools/McEventCollectionFilter/src/McEventCollectionFilter.cxx index 0a6c9a1f712101a60a4c8446f66edcaf48ba89df..29b6fd61281d61ac2b6f2af16da72c62523e03ce 100644 --- a/Simulation/Tools/McEventCollectionFilter/src/McEventCollectionFilter.cxx +++ b/Simulation/Tools/McEventCollectionFilter/src/McEventCollectionFilter.cxx @@ -53,6 +53,7 @@ McEventCollectionFilter::McEventCollectionFilter(const std::string& name, ISvcLo , m_UseCSCHits(true) // On unless RUN3 symmetric layout , m_UseSTGCHits(false) // Off unless RUN3 layout , m_UseMMHits(false) // Off unless RUN3 layout + , m_UseBCMHits(true) //On unless RUN4 layout , m_RefBarcode(0) { declareProperty("TruthInput" , m_inputTruthCollection); @@ -83,6 +84,7 @@ McEventCollectionFilter::McEventCollectionFilter(const std::string& name, ISvcLo declareProperty("UseCSCHits" , m_UseCSCHits); declareProperty("UseSTGCHits" , m_UseSTGCHits); declareProperty("UseMMHits" , m_UseMMHits); + declareProperty("UseBCMHits" , m_UseBCMHits); } @@ -114,7 +116,7 @@ StatusCode McEventCollectionFilter::execute(){ //.......Reduce McEventCollection ATH_CHECK( ReduceMCEventCollection() ); - //.......to relink all Si hits to the new particle + //.......to relink all Pixel/SCT hits to the new particle ATH_CHECK( SiliconHitsTruthRelink() ); //.......to relink all TRT hits to the new particle @@ -145,6 +147,11 @@ StatusCode McEventCollectionFilter::execute(){ if(m_UseMMHits) { ATH_CHECK( MM_HitsTruthRelink() ); } + + //.......to relink all BCM hits to the new particle + if(m_UseBCMHits) { + ATH_CHECK( BCMHitsTruthRelink() ); + } ATH_MSG_DEBUG( "succeded McEventCollectionFilter ..... " ); @@ -251,7 +258,7 @@ StatusCode McEventCollectionFilter::ReduceMCEventCollection(){ //-------------------------------------------------------- StatusCode McEventCollectionFilter::SiliconHitsTruthRelink(){ //-------------------------------------------------------- - //.......to relink all Si hits to the new particle + //.......to relink all Pixel/SCT hits to the new particle //-------------------------------------------------------- // if(!m_inputPixelHits.isValid()) @@ -276,6 +283,16 @@ StatusCode McEventCollectionFilter::SiliconHitsTruthRelink(){ ATH_CHECK(this->SiHitsTruthRelink(m_inputSCTHits,m_outputSCTHits)); + return StatusCode::SUCCESS; +} + +//-------------------------------------------------------- +StatusCode McEventCollectionFilter::BCMHitsTruthRelink(){ + //-------------------------------------------------------- + //.......to relink BCM hits to the new particle + //-------------------------------------------------------- + // + if(!m_inputBCMHits.isValid()) { ATH_MSG_ERROR( "Could not find BCM SiHitCollection"); diff --git a/Simulation/Tools/McEventCollectionFilter/src/McEventCollectionFilter.h b/Simulation/Tools/McEventCollectionFilter/src/McEventCollectionFilter.h index 9e7dc44ed1a3c2e0b3579ef200e172d67782a9a1..28c363055ea4e1bdd127ef1d62fd4d005025b753 100644 --- a/Simulation/Tools/McEventCollectionFilter/src/McEventCollectionFilter.h +++ b/Simulation/Tools/McEventCollectionFilter/src/McEventCollectionFilter.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 MCEVENTCOLLECTIONFILTER_H @@ -48,6 +48,7 @@ private: StatusCode TGCHitsTruthRelink(); StatusCode STGC_HitsTruthRelink(); StatusCode MM_HitsTruthRelink(); + StatusCode BCMHitsTruthRelink(); SG::ReadHandle<McEventCollection> m_inputTruthCollection; SG::ReadHandle<SiHitCollection> m_inputBCMHits; @@ -79,6 +80,7 @@ private: bool m_UseCSCHits; bool m_UseSTGCHits; bool m_UseMMHits; + bool m_UseBCMHits; //--------------------- //std::string m_HitName; int m_RefBarcode; diff --git a/TileCalorimeter/TileSimAlgs/python/TileDigitsMakerConfig.py b/TileCalorimeter/TileSimAlgs/python/TileDigitsMakerConfig.py index 06070f59d8c289fea3fbfc21a97f58757276fef5..570a0c35fbafc6e212967dbc9a60040d1e97c4ad 100644 --- a/TileCalorimeter/TileSimAlgs/python/TileDigitsMakerConfig.py +++ b/TileCalorimeter/TileSimAlgs/python/TileDigitsMakerConfig.py @@ -148,8 +148,10 @@ def TileDigitsMakerOutputCfg(flags, **kwargs): tileDigitsContainer = tileDigitsMaker.getDefaultProperty('TileFilteredContainer') tileDigitsContainer = tileDigitsContainer.split('+').pop() - outputItemList = ['TileDigitsContainer#' + tileDigitsContainer] - + if flags.Digitization.AddCaloDigi: + outputItemList = ['TileDigitsContainer#*'] + else: + outputItemList = ['TileDigitsContainer#' + tileDigitsContainer] if flags.Output.doWriteRDO: if flags.Digitization.TruthOutput: diff --git a/Tools/PyJobTransforms/python/CommonRunArgsToFlags.py b/Tools/PyJobTransforms/python/CommonRunArgsToFlags.py index 3f39b78960ba1ba46dcc1e42dc96ee7382402401..02d7972ed5349f59ff49619aa7a7455ffc6a211b 100644 --- a/Tools/PyJobTransforms/python/CommonRunArgsToFlags.py +++ b/Tools/PyJobTransforms/python/CommonRunArgsToFlags.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 #Translate the commonly used runArgs into configFlags def commonRunArgsToFlags(runArgs,configFlags): @@ -18,4 +18,9 @@ def commonRunArgsToFlags(runArgs,configFlags): if hasattr(runArgs,"beamType"): configFlags.Beam.Type=runArgs.beamType - + ## Threading arguments + if hasattr(runArgs,"threads"): + configFlags.Concurrency.NumThreads = runArgs.threads + + if hasattr(runArgs,"concurrentEvents"): + configFlags.Concurrency.NumConcurrentEvents = runArgs.concurrentEvents diff --git a/Tools/PyJobTransforms/python/trfExe.py b/Tools/PyJobTransforms/python/trfExe.py index 4006a3709a84bdb8af491f3eeaf874853c8cade1..05a017c984d9c86e14e3b400097def28d66653aa 100755 --- a/Tools/PyJobTransforms/python/trfExe.py +++ b/Tools/PyJobTransforms/python/trfExe.py @@ -183,6 +183,7 @@ class transformExecutor(object): self._eventCount = None self._athenaMP = None self._athenaMT = None + self._athenaConcurrentEvents = None self._dbMonitor = None # Holder for execution information about any merges done by this executor in MP mode @@ -961,8 +962,8 @@ class athenaExecutor(scriptExecutor): raise trfExceptions.TransformExecutionException(trfExit.nameToCode('TRF_SETUP'), 'either --multithreaded nor --multiprocess command line option provided but ATHENA_CORE_NUMBER environment has not been set') - # Try to detect AthenaMT mode and number of threads - self._athenaMT = detectAthenaMTThreads(self.conf.argdict) + # Try to detect AthenaMT mode, number of threads and number of concurrent events + self._athenaMT, self._athenaConcurrentEvents = detectAthenaMTThreads(self.conf.argdict) # Try to detect AthenaMP mode and number of workers self._athenaMP = detectAthenaMPProcs(self.conf.argdict) diff --git a/Tools/PyJobTransforms/python/trfJobOptions.py b/Tools/PyJobTransforms/python/trfJobOptions.py index 26ff604b17763b6fe0600fa848298300b57bb85f..624f3dffb610374d1a8dca14e5bd1fa2ecb39cfa 100644 --- a/Tools/PyJobTransforms/python/trfJobOptions.py +++ b/Tools/PyJobTransforms/python/trfJobOptions.py @@ -204,6 +204,14 @@ class JobOptionsTemplate(object): if 'athenaMPEventsBeforeFork' in self._exe.conf.argdict: print('AthenaMPJobProps.AthenaMPFlags.EventsBeforeFork={0}'.format(self._exe.conf.argdict['athenaMPEventsBeforeFork'].value), file=runargsFile) if 'CA' in self._exe.conf.argdict: + print(os.linesep, '# Threading flags', file=runargsFile) + #Pass the number of threads + threads = self._exe._athenaMT + concurrentEvents = self._exe._athenaConcurrentEvents + msg.debug('Adding runarg {0!s}={1!r}'.format('threads', threads)) + print('{0}.{1!s} = {2!r}'.format(self._runArgsName, 'threads', threads), file=runargsFile) + msg.debug('Adding runarg {0!s}={1!r}'.format('concurrentEvents', concurrentEvents)) + print('{0}.{1!s} = {2!r}'.format(self._runArgsName, 'concurrentEvents', concurrentEvents), file=runargsFile) #ComponentAccumulator based config, import skeleton here: print(os.linesep, '# Import skeleton and execute it', file=runargsFile) print('from {0} import fromRunArgs'.format(self._exe._skeletonCA),file=runargsFile) diff --git a/Tools/PyJobTransforms/python/trfMTTools.py b/Tools/PyJobTransforms/python/trfMTTools.py index d5f4bbf816c0c892f66eea774ec971f2a818b088..1575df067d77fd35dbc5b98e73d4c583a762b950 100644 --- a/Tools/PyJobTransforms/python/trfMTTools.py +++ b/Tools/PyJobTransforms/python/trfMTTools.py @@ -18,9 +18,10 @@ import PyJobTransforms.trfExceptions as trfExceptions ## @brief Detect if AthenaMT has been requested # @param argdict Argument dictionary, used to access athenaopts for the job -# @return Integer with the number of threads, N.B. 0 means non-MT serial mode +# @return Two integers with the number of threads and number of concurrent events, N.B. 0 means non-MT serial mode def detectAthenaMTThreads(argdict = {}): athenaMTThreads = 0 + athenaConcurrentEvents = 0 # Try and detect if any AthenaMT has been enabled try: @@ -38,6 +39,15 @@ def detectAthenaMTThreads(argdict = {}): else: raise ValueError("--threads was set more than once in 'athenaopts'") msg.info('AthenaMT detected from "threads" setting with {0} threads for substep {1}'.format(athenaMTThreads,substep)) + + concurrentEventsArg = [opt.replace("--concurrent-events=", "") for opt in argdict['athenaopts'].value[substep] if '--concurrent-events' in opt] + if len(concurrentEventsArg) == 1: + athenaConcurrentEvents = int(concurrentEventsArg[0]) + if athenaConcurrentEvents < -1: + raise ValueError("--concurrent-events was set to a value less than -1") + msg.info('Custom concurrent event setting read from "concurrent-events" with {0} events for substep {1}'.format(athenaConcurrentEvents,substep)) + else: + athenaConcurrentEvents = athenaMTThreads if (athenaMTThreads == 0 and 'ATHENA_CORE_NUMBER' in os.environ and 'multithreaded' in argdict): @@ -45,8 +55,9 @@ def detectAthenaMTThreads(argdict = {}): if athenaMTThreads < -1: raise ValueError("ATHENA_CORE_NUMBER value was less than -1") msg.info('AthenaMT detected from ATHENA_CORE_NUMBER with {0} threads'.format(athenaMTThreads)) + athenaConcurrentEvents = athenaMTThreads except ValueError as errMsg: myError = 'Problem discovering AthenaMT setup: {0}'.format(errMsg) raise trfExceptions.TransformExecutionException(trfExit.nameToCode('TRF_EXEC_SETUP_FAIL'), myError) - return athenaMTThreads + return athenaMTThreads, athenaConcurrentEvents diff --git a/Tools/PyJobTransforms/test/test_HelloWorldTrf.sh b/Tools/PyJobTransforms/test/test_HelloWorldTrf.sh index 9d9a1cbe77ea091f7eeadf8539ed9609a5fae6a5..f5f19a3993001ca00d64d842dd9b831f10c13a41 100755 --- a/Tools/PyJobTransforms/test/test_HelloWorldTrf.sh +++ b/Tools/PyJobTransforms/test/test_HelloWorldTrf.sh @@ -1,2 +1,21 @@ #!/bin/bash + +set -e + +# ST test HelloWorld_tf.py --maxEvents=5 --CA + +grep 'runArgs.threads = 0' runargs.athena.py +grep 'runArgs.concurrentEvents = 0' runargs.athena.py + +# MT test 1 +HelloWorld_tf.py --maxEvents=5 --CA --athenaopts="--threads=2 --concurrent-events=1" + +grep 'runArgs.threads = 2' runargs.athena.py +grep 'runArgs.concurrentEvents = 1' runargs.athena.py + +# MT test 2 +ATHENA_CORE_NUMBER=2 HelloWorld_tf.py --maxEvents=5 --CA --multithreaded + +grep 'runArgs.threads = 2' runargs.athena.py +grep 'runArgs.concurrentEvents = 2' runargs.athena.py diff --git a/Tracking/Acts/ActsGeometry/ActsGeometry/ActsExtrapolationTool.h b/Tracking/Acts/ActsGeometry/ActsGeometry/ActsExtrapolationTool.h index 2be0eca267ffad316f940cc021b258423a3b5565..942549f678952093b50c41bd263e04205295a7e5 100644 --- a/Tracking/Acts/ActsGeometry/ActsGeometry/ActsExtrapolationTool.h +++ b/Tracking/Acts/ActsGeometry/ActsGeometry/ActsExtrapolationTool.h @@ -12,6 +12,11 @@ #include "GaudiKernel/Property.h" #include "GaudiKernel/EventContext.h" +// Need to include this early; otherwise, we run into errors with +// ReferenceWrapperAnyCompat in clang builds due the is_constructable +// specialization defined there getting implicitly instantiated earlier. +#include "Acts/Propagator/Propagator.hpp" + // PACKAGE #include "ActsGeometryInterfaces/IActsExtrapolationTool.h" #include "ActsGeometryInterfaces/IActsTrackingGeometryTool.h" diff --git a/Tracking/Acts/ActsPriVtxFinder/ActsPriVtxFinder/ActsAdaptiveMultiPriVtxFinderTool.h b/Tracking/Acts/ActsPriVtxFinder/ActsPriVtxFinder/ActsAdaptiveMultiPriVtxFinderTool.h index cfb416be91c90eadb1f7fbb522bdbe52a203c271..2093fe29d1f97ef553e5ba36a4a819106c9dce34 100644 --- a/Tracking/Acts/ActsPriVtxFinder/ActsPriVtxFinder/ActsAdaptiveMultiPriVtxFinderTool.h +++ b/Tracking/Acts/ActsPriVtxFinder/ActsPriVtxFinder/ActsAdaptiveMultiPriVtxFinderTool.h @@ -17,6 +17,11 @@ #include "TrkTrack/LinkToTrack.h" #include "InDetRecToolInterfaces/IVertexFinder.h" +// Need to include this early; otherwise, we run into errors with +// ReferenceWrapperAnyCompat in clang builds due the is_constructable +// specialization defined there getting implicitly instantiated earlier. +#include "Acts/Propagator/Propagator.hpp" + // PACKAGE #include "ActsGeometryInterfaces/IActsTrackingGeometryTool.h" #include "ActsGeometryInterfaces/IActsExtrapolationTool.h" diff --git a/Tracking/TrkDetDescr/TrkDetDescrTools/CMakeLists.txt b/Tracking/TrkDetDescr/TrkDetDescrTools/CMakeLists.txt index d4f4f8bdc2013fcf0da89bc3765aa744d67420c2..98e40a3fc130e53bb91df27fe7dead66cf03ccef 100644 --- a/Tracking/TrkDetDescr/TrkDetDescrTools/CMakeLists.txt +++ b/Tracking/TrkDetDescr/TrkDetDescrTools/CMakeLists.txt @@ -1,34 +1,10 @@ -################################################################################ -# Package: TrkDetDescrTools -################################################################################ +# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration # Declare the package name: atlas_subdir( TrkDetDescrTools ) -# Declare the package's dependencies: -atlas_depends_on_subdirs( PUBLIC - Control/AthenaBaseComps - DetectorDescription/GeoPrimitives - GaudiKernel - Tracking/TrkDetDescr/TrkDetDescrInterfaces - Tracking/TrkDetDescr/TrkDetDescrUtils - Tracking/TrkDetDescr/TrkGeometry - Tracking/TrkDetDescr/TrkVolumes - PRIVATE - AtlasGeometryCommon/SubDetectorEnvelopes - Event/EventPrimitives - Tracking/TrkDetDescr/TrkSurfaces ) - -# External dependencies: -find_package( Eigen ) - # Component(s) in the package: atlas_add_component( TrkDetDescrTools src/*.cxx src/components/*.cxx - INCLUDE_DIRS ${EIGEN_INCLUDE_DIRS} - LINK_LIBRARIES ${EIGEN_LIBRARIES} AthenaBaseComps GeoPrimitives GaudiKernel TrkDetDescrInterfaces TrkDetDescrUtils TrkGeometry TrkVolumes EventPrimitives TrkSurfaces ) - -# Install files from the package: -atlas_install_headers( TrkDetDescrTools ) - + LINK_LIBRARIES AthenaBaseComps EventPrimitives GaudiKernel GeoPrimitives SubDetectorEnvelopesLib TrkDetDescrInterfaces TrkDetDescrUtils TrkGeometry TrkSurfaces TrkVolumes ) diff --git a/Tracking/TrkExtrapolation/TrkExRungeKuttaIntersector/test/RungeKuttaIntersector_test.cxx b/Tracking/TrkExtrapolation/TrkExRungeKuttaIntersector/test/RungeKuttaIntersector_test.cxx index 54362474e96a6903574fe4deda194912f75ae278..27ebdcb3e8d3e0cae2eacc8b8fe3661b7dec3de6 100644 --- a/Tracking/TrkExtrapolation/TrkExRungeKuttaIntersector/test/RungeKuttaIntersector_test.cxx +++ b/Tracking/TrkExtrapolation/TrkExRungeKuttaIntersector/test/RungeKuttaIntersector_test.cxx @@ -321,7 +321,7 @@ void createAtlasFieldCacheCondObj(SGTest::TestStore &store) { SG::WriteCondHandle<AtlasFieldCacheCondObj> fieldHandle {fieldKey}; std::unique_ptr<MagField::AtlasFieldMap> fieldMap=getFieldMap("MagneticFieldMaps/bfieldmap_7730_20400_14m.root",7730,20400); auto fieldCondObj = std::make_unique<AtlasFieldCacheCondObj>(); - assert( fieldCondObj->initialize(1. /*solenoid current scale factor*/, 1. /*toroid current scale factor*/, fieldMap.release())); + fieldCondObj->initialize(1. /*solenoid current scale factor*/, 1. /*toroid current scale factor*/, fieldMap.release()); assert( fieldHandle.record(r1_1, std::move(fieldCondObj)).isSuccess()); } diff --git a/Tracking/TrkExtrapolation/TrkExSolenoidalIntersector/test/SolenoidParametrization_test.cxx b/Tracking/TrkExtrapolation/TrkExSolenoidalIntersector/test/SolenoidParametrization_test.cxx index 58f4d34803021296a0c8929b1756190b241e58d0..1c409cc93566679ebb425edf71e44d1a94272562 100644 --- a/Tracking/TrkExtrapolation/TrkExSolenoidalIntersector/test/SolenoidParametrization_test.cxx +++ b/Tracking/TrkExtrapolation/TrkExSolenoidalIntersector/test/SolenoidParametrization_test.cxx @@ -93,7 +93,7 @@ int main() auto fieldCondObj = std::make_unique<AtlasFieldCacheCondObj>(); // initialize cond obj with current scale factors and the field svc (needed to setup cache) - assert( fieldCondObj->initialize(1. /*solenoid current scale factor*/, 1. /*toroid current scale factor*/, fieldMap.get())); + fieldCondObj->initialize(1. /*solenoid current scale factor*/, 1. /*toroid current scale factor*/, fieldMap.get()); Trk::SolenoidParametrization sol (*fieldCondObj); test1 (sol, *fieldCondObj); diff --git a/Tracking/TrkExtrapolation/TrkExSolenoidalIntersector/test/SolenoidalIntersector_test.cxx b/Tracking/TrkExtrapolation/TrkExSolenoidalIntersector/test/SolenoidalIntersector_test.cxx index 07b7005d0ea72b591a8a2db4672f19705f1f7bb4..d2b1d588dafedf55c9d9cdf8725f02d677473eba 100644 --- a/Tracking/TrkExtrapolation/TrkExSolenoidalIntersector/test/SolenoidalIntersector_test.cxx +++ b/Tracking/TrkExtrapolation/TrkExSolenoidalIntersector/test/SolenoidalIntersector_test.cxx @@ -341,7 +341,7 @@ void createSolenoidParametrizationCondData(SGTest::TestStore &store) { { std::unique_ptr<MagField::AtlasFieldMap> fieldMap=getFieldMap("MagneticFieldMaps/bfieldmap_7730_20400_14m.root",7730,20400); auto fieldCondObj = std::make_unique<AtlasFieldCacheCondObj>(); - assert( fieldCondObj->initialize(1. /*solenoid current scale factor*/, 1. /*toroid current scale factor*/, fieldMap.release())); + fieldCondObj->initialize(1. /*solenoid current scale factor*/, 1. /*toroid current scale factor*/, fieldMap.release()); parm_ptr = std::make_unique<Trk::SolenoidParametrization>(*fieldCondObj); assert( fieldHandle.record(r1_1, std::move(fieldCondObj)).isSuccess()); diff --git a/Tracking/TrkFitter/TrkGaussianSumFilter/CMakeLists.txt b/Tracking/TrkFitter/TrkGaussianSumFilter/CMakeLists.txt index eebd6b6775dca818e1de84fd20278c2f151149d5..ddbed75050f15477daff17c495cd4040f6bde11b 100644 --- a/Tracking/TrkFitter/TrkGaussianSumFilter/CMakeLists.txt +++ b/Tracking/TrkFitter/TrkGaussianSumFilter/CMakeLists.txt @@ -4,39 +4,6 @@ # Declare the package name: atlas_subdir( TrkGaussianSumFilter ) - -# Declare the package's dependencies: -atlas_depends_on_subdirs( PUBLIC - Control/AthenaBaseComps - Control/AthContainers - DetectorDescription/GeoPrimitives - Event/EventPrimitives - GaudiKernel - Tracking/TrkDetDescr/TrkGeometry - Tracking/TrkDetDescr/TrkSurfaces - Tracking/TrkEvent/TrkEventPrimitives - Tracking/TrkEvent/TrkEventUtils - Tracking/TrkEvent/TrkMaterialOnTrack - Tracking/TrkEvent/TrkMultiComponentStateOnSurface - Tracking/TrkEvent/TrkParameters - Tracking/TrkExtrapolation/TrkExInterfaces - Tracking/TrkExtrapolation/TrkExUtils - Tracking/TrkFitter/TrkFitterInterfaces - Tracking/TrkFitter/TrkFitterUtils - Tracking/TrkTools/TrkToolInterfaces - PRIVATE - Control/CxxUtils - Tools/PathResolver - Tracking/TrkDetDescr/TrkDetElementBase - Tracking/TrkEvent/TrkCaloCluster_OnTrack - Tracking/TrkEvent/TrkMeasurementBase - Tracking/TrkEvent/TrkPrepRawData - Tracking/TrkEvent/TrkPseudoMeasurementOnTrack - Tracking/TrkEvent/TrkRIO_OnTrack - Tracking/TrkEvent/TrkTrack - Tracking/TrkEvent/TrkParametersBase - ) - # External dependencies: find_package( Eigen ) @@ -45,10 +12,11 @@ atlas_add_component( TrkGaussianSumFilter src/*.cxx src/components/*.cxx INCLUDE_DIRS ${EIGEN_INCLUDE_DIRS} - LINK_LIBRARIES ${EIGEN_LIBRARIES} AthenaBaseComps AthContainers GeoPrimitives EventPrimitives GaudiKernel TrkGeometry TrkSurfaces - TrkEventPrimitives TrkEventUtils TrkMaterialOnTrack TrkMultiComponentStateOnSurface TrkParameters TrkExInterfaces TrkExUtils TrkFitterInterfaces - TrkFitterUtils TrkToolInterfaces CxxUtils PathResolver TrkDetElementBase TrkCaloCluster_OnTrack TrkMeasurementBase TrkPrepRawData - TrkPseudoMeasurementOnTrack TrkRIO_OnTrack TrkTrack TrkParametersBase) + LINK_LIBRARIES ${EIGEN_LIBRARIES} AthenaBaseComps AthContainers GeoPrimitives EventPrimitives GaudiKernel + TrkGeometry TrkSurfaces TrkEventPrimitives TrkEventUtils TrkMaterialOnTrack TrkMultiComponentStateOnSurface + TrkParameters TrkExInterfaces TrkExUtils TrkFitterInterfaces TrkFitterUtils TrkToolInterfaces CxxUtils PathResolver TrkDetElementBase + TrkCaloCluster_OnTrack TrkMeasurementBase TrkPrepRawData TrkPseudoMeasurementOnTrack TrkRIO_OnTrack TrkTrack + TrkParametersBase KalmanParameterUpdatorLib) # Install files from the package: atlas_install_headers( TrkGaussianSumFilter ) diff --git a/Tracking/TrkFitter/TrkGaussianSumFilter/TrkGaussianSumFilter/GsfMeasurementUpdator.h b/Tracking/TrkFitter/TrkGaussianSumFilter/TrkGaussianSumFilter/GsfMeasurementUpdator.h index 6267abeb34c8112886f3ee87af43ed2d7775ecac..fe0416c1fd71612b25e2e81bab008ffcf1dc710e 100644 --- a/Tracking/TrkFitter/TrkGaussianSumFilter/TrkGaussianSumFilter/GsfMeasurementUpdator.h +++ b/Tracking/TrkFitter/TrkGaussianSumFilter/TrkGaussianSumFilter/GsfMeasurementUpdator.h @@ -13,12 +13,10 @@ #ifndef TrkGsfMeasurementUpdator_H #define TrkGsfMeasurementUpdator_H -#include "TrkEventPrimitives/FitQualityOnSurface.h" -#include "TrkGaussianSumFilter/MultiComponentStateAssembler.h" - #include "TrkGaussianSumFilter/IMultiStateMeasurementUpdator.h" -#include "TrkToolInterfaces/IUpdator.h" - +#include "TrkGaussianSumFilter/MultiComponentStateAssembler.h" +#include "TrkEventPrimitives/FitQualityOnSurface.h" +#include "KalmanParameterUpdator/KalmanParameterUpdator.h" #include "AthenaBaseComps/AthAlgTool.h" #include "GaudiKernel/IChronoStatSvc.h" #include "GaudiKernel/ServiceHandle.h" @@ -33,15 +31,6 @@ class GsfMeasurementUpdator , virtual public IMultiStateMeasurementUpdator { -private: - /** Private typedef for calling the correct updator member function depending - * of direction of fitting */ - typedef Trk::TrackParameters* (Trk::IUpdator::*Updator)( - const Trk::TrackParameters&, - const LocalParameters&, - const Amg::MatrixX&, - FitQualityOnSurface*&)const; - public: /** Constructor with parameters to be passed to AlgTool */ GsfMeasurementUpdator(const std::string&, @@ -69,22 +58,17 @@ public: const Trk::MeasurementBase&, std::unique_ptr<FitQualityOnSurface>& fitQoS) const override final; - /** Method for GSF smoother to calculate unbiased parameters of the - * multi-component state */ - virtual MultiComponentState getUnbiasedTrackParameters( - MultiComponentState&&, - const MeasurementBase&) const override final; /** Method for determining the chi2 of the multi-component state and the * number of degrees of freedom */ virtual const FitQualityOnSurface* fitQuality( const MultiComponentState&, - const MeasurementBase&) const override; + const MeasurementBase&) const override final; private: MultiComponentState calculateFilterStep(MultiComponentState&&, const MeasurementBase&, - const Updator) const; + int addRemoveFlag) const; MultiComponentState calculateFilterStep( MultiComponentState&&, @@ -97,10 +81,7 @@ private: Trk::MultiComponentState&& stateBeforeUpdate) const; private: - ToolHandle<IUpdator> m_updator{ this, - "Updator", - "Trk::KalmanUpdator/KalmanUpdator", - "" }; + KalmanParameterUpdator m_updator; }; } diff --git a/Tracking/TrkFitter/TrkGaussianSumFilter/TrkGaussianSumFilter/IMultiStateMeasurementUpdator.h b/Tracking/TrkFitter/TrkGaussianSumFilter/TrkGaussianSumFilter/IMultiStateMeasurementUpdator.h index 7b8df475912d7bbdc46acebdeb2f042d186c15f4..b6d724a2ed21ad88935dcb6df855968e1dca239e 100644 --- a/Tracking/TrkFitter/TrkGaussianSumFilter/TrkGaussianSumFilter/IMultiStateMeasurementUpdator.h +++ b/Tracking/TrkFitter/TrkGaussianSumFilter/TrkGaussianSumFilter/IMultiStateMeasurementUpdator.h @@ -50,12 +50,6 @@ public: const Trk::MeasurementBase&, std::unique_ptr<FitQualityOnSurface>& fitQoS) const = 0; - /** Method for reverse filters (smoothers) to determine the unbiased track - * parameters */ - virtual MultiComponentState getUnbiasedTrackParameters( - MultiComponentState&&, - const MeasurementBase&) const = 0; - /** Method for determining the chi2 of the track and the number of degrees of * freedom */ virtual const FitQualityOnSurface* fitQuality( diff --git a/Tracking/TrkFitter/TrkGaussianSumFilter/src/GsfMeasurementUpdator.cxx b/Tracking/TrkFitter/TrkGaussianSumFilter/src/GsfMeasurementUpdator.cxx index 5ffb33af9b5b74fbfde643566eaa7e59c37514df..a45724757206a55ff5d8059a4b3aba54823b6cb9 100644 --- a/Tracking/TrkFitter/TrkGaussianSumFilter/src/GsfMeasurementUpdator.cxx +++ b/Tracking/TrkFitter/TrkGaussianSumFilter/src/GsfMeasurementUpdator.cxx @@ -25,6 +25,7 @@ Trk::GsfMeasurementUpdator::GsfMeasurementUpdator(const std::string& type, const std::string& name, const IInterface* parent) : AthAlgTool(type, name, parent) + , m_updator{} { declareInterface<IMultiStateMeasurementUpdator>(this); } @@ -32,13 +33,6 @@ Trk::GsfMeasurementUpdator::GsfMeasurementUpdator(const std::string& type, StatusCode Trk::GsfMeasurementUpdator::initialize() { - // Retrieve the updator tool - if (m_updator.retrieve().isFailure()) { - ATH_MSG_FATAL( - "Could not retrieve measurement updator AlgTool ... Exiting!"); - return StatusCode::FAILURE; - } - ATH_MSG_INFO("Initialisation of " << name() << " was successful"); return StatusCode::SUCCESS; } @@ -56,9 +50,6 @@ Trk::GsfMeasurementUpdator::update( const Trk::MeasurementBase& measurement) const { MultiComponentState updatedState{}; - // Point to the correct member function of the linear fitter measurement - // updator for fitting in the direction of momentum - Updator updator = &Trk::IUpdator::addToState; // Check all components have associated error matricies Trk::MultiComponentState::iterator component = stateBeforeUpdate.begin(); bool rebuildStateWithErrors = false; @@ -73,31 +64,18 @@ Trk::GsfMeasurementUpdator::update( Trk::MultiComponentState stateWithInsertedErrors = rebuildState(std::move(stateBeforeUpdate)); // Perform the measurement update with the modified state - updatedState = calculateFilterStep( - std::move(stateWithInsertedErrors), measurement, updator); + updatedState = + calculateFilterStep(std::move(stateWithInsertedErrors), measurement, 1); return updatedState; } // Perform the measurement update updatedState = - calculateFilterStep(std::move(stateBeforeUpdate), measurement, updator); + calculateFilterStep(std::move(stateBeforeUpdate), measurement, 1); return updatedState; } -Trk::MultiComponentState -Trk::GsfMeasurementUpdator::getUnbiasedTrackParameters( - Trk::MultiComponentState&& stateBeforeUpdate, - const MeasurementBase& measurement) const -{ - // Point to the correct member function of the linear fitter measurement - // updator for fitting in the direction opposite to momentum (smoothing) - Updator updator = &Trk::IUpdator::removeFromState; - // Calculate the weight of each state after the measurement - return calculateFilterStep( - std::move(stateBeforeUpdate), measurement, updator); -} - const Trk::FitQualityOnSurface* Trk::GsfMeasurementUpdator::fitQuality(const MultiComponentState& updatedState, const MeasurementBase& measurement) const @@ -123,29 +101,24 @@ Trk::GsfMeasurementUpdator::fitQuality(const MultiComponentState& updatedState, // calculations depending on if the track parameters incorporate the // information contained in the measurement. I ALWAYS do this - hence the // fullStateFitQuality method is used - const Trk::FitQualityOnSurface* componentFitQuality = - m_updator->fullStateFitQuality(*trackParameters, - measurement.localParameters(), - measurement.localCovariance()); - - double componentChi2 = componentFitQuality->chiSquared(); - + Trk::FitQualityOnSurface componentFitQuality; + m_updator.stateFitQuality(componentFitQuality, + *trackParameters, + measurement.localParameters(), + measurement.localCovariance(), + 1); + + double componentChi2 = componentFitQuality.chiSquared(); chi2 += component->second * componentChi2; - - // The same measurement is included in each update so it is the same for - // each component + // The same measurement is included in each update if (component == updatedState.begin()) { - degreesOfFreedom = componentFitQuality->numberDoF(); + degreesOfFreedom = componentFitQuality.numberDoF(); } - - delete componentFitQuality; } if (std::isnan(chi2) || chi2 <= 0.) { - return nullptr; } - const Trk::FitQualityOnSurface* fitQualityOnSurface = new FitQualityOnSurface(chi2, degreesOfFreedom); @@ -156,65 +129,45 @@ Trk::MultiComponentState Trk::GsfMeasurementUpdator::calculateFilterStep( Trk::MultiComponentState&& stateBeforeUpdate, const Trk::MeasurementBase& measurement, - const Updator updator) const + int addRemoveFlag) const { - // state Assembler cache - MultiComponentStateAssembler::Cache cache; - if (stateBeforeUpdate.empty()) { ATH_MSG_WARNING("Cannot update multi-state with no components!"); return {}; } + // state Assembler cache + MultiComponentStateAssembler::Cache cache; + // Calculate the weight of each component after the measurement std::vector<Trk::ComponentParameters> stateWithNewWeights = PosteriorWeightsCalculator::weights(std::move(stateBeforeUpdate), measurement); - + if (stateWithNewWeights.empty()) { ATH_MSG_DEBUG("Cacluation of state posterior weights failed... Exiting!"); return {}; } - // Update each component using the specified updator - Trk::MultiComponentState::const_iterator component = - stateWithNewWeights.begin(); - - for (; component != stateWithNewWeights.end(); ++component) { - - Trk::FitQualityOnSurface* fitQuality = nullptr; + for (Trk::ComponentParameters& component : stateWithNewWeights) { - // Track updates using a pointer to the member function - std::unique_ptr<Trk::TrackParameters> updatedTrackParameters( - ((&(*m_updator))->*updator)(*(*component).first, - measurement.localParameters(), - measurement.localCovariance(), - fitQuality)); + auto fitQuality = std::make_unique<Trk::FitQualityOnSurface>(); + /// Update the component in place + bool updateSuccess = m_updator.filterStep(*(component.first), + *fitQuality, + measurement.localParameters(), + measurement.localCovariance(), + addRemoveFlag); - if (!updatedTrackParameters) { - ATH_MSG_DEBUG( - "Update of state with Measurement has failed 1... Exiting!"); - if (fitQuality) { - delete fitQuality; - } - continue; - } - if (fitQuality && fitQuality->chiSquared() <= 0.) { - ATH_MSG_DEBUG("Fit quality of update failed... Exiting!"); - delete fitQuality; - updatedTrackParameters.reset(); + // If we fail we need to erase the element + if (!updateSuccess || fitQuality->chiSquared() <= 0.) { + ATH_MSG_DEBUG("Update of state with Measurement has failed 1..."); + fitQuality.reset(); continue; } - // Clean up memory - delete fitQuality; - - // Updator does not change the weighting - ComponentParameters updatedComponentParameters( - std::move(updatedTrackParameters), component->second); - // Add component to state being prepared for assembly and check that it is - // valid - bool componentAdded = MultiComponentStateAssembler::addComponent( - cache, std::move(updatedComponentParameters)); + // Move component to state being prepared for assembly + bool componentAdded = + MultiComponentStateAssembler::addComponent(cache, std::move(component)); if (!componentAdded) { ATH_MSG_DEBUG( @@ -292,7 +245,8 @@ Trk::GsfMeasurementUpdator::calculateFilterStep( ATH_MSG_WARNING("Cannot update multi-state with no components!"); return {}; } else { - ATH_MSG_DEBUG("calculateFilterStep() starting with : " << stateBeforeUpdate.size() ); + ATH_MSG_DEBUG( + "calculateFilterStep() starting with : " << stateBeforeUpdate.size()); } // Calculate the weight of each component after the measurement @@ -304,81 +258,65 @@ Trk::GsfMeasurementUpdator::calculateFilterStep( ATH_MSG_DEBUG("Cacluation of state posterior weights failed... Exiting!"); return {}; } else { - ATH_MSG_DEBUG("calculateFilterStep() after new weights : " << stateWithNewWeights.size() ); + ATH_MSG_DEBUG("calculateFilterStep() after new weights : " + << stateWithNewWeights.size()); } - // Update each component using the specified updator - Trk::MultiComponentState::const_iterator component = - stateWithNewWeights.begin(); - double chiSquared = 0; int degreesOfFreedom = 0; + for (Trk::ComponentParameters& component : stateWithNewWeights) { - for (; component != stateWithNewWeights.end(); ++component) { - - if ( stateWithNewWeights.size() > 1 && - std::abs((*component).first->parameters()[Trk::qOverP]) > 0.033333) { + if (stateWithNewWeights.size() > 1 && + std::abs(component.first->parameters()[Trk::qOverP]) > 0.033333) { ATH_MSG_DEBUG( "About to update component with p<30 MeV...skipping component! (2)"); + continue; } - Trk::FitQualityOnSurface* componentFitQuality = nullptr; - // Track update alternates between update and getUnbiasedTrackParams - std::unique_ptr<Trk::TrackParameters> updatedTrackParameters( - m_updator->addToState(*(*component).first, - measurement.localParameters(), - measurement.localCovariance(), - componentFitQuality)); - - if (!updatedTrackParameters) { + + auto componentFitQuality = std::make_unique<Trk::FitQualityOnSurface>(); + /// Update the component in place + bool updateSuccess = m_updator.filterStep(*(component.first), + *componentFitQuality, + measurement.localParameters(), + measurement.localCovariance(), + 1); + + if (!updateSuccess) { ATH_MSG_DEBUG( "Update of state with Measurement has failed 2... Exiting!"); if (componentFitQuality) { - delete componentFitQuality; + componentFitQuality.reset(); } continue; } - if (invalidComponent(updatedTrackParameters.get())) { + if (invalidComponent(component.first.get())) { ATH_MSG_DEBUG("Invalid cov matrix after update... Exiting!"); - if ((*component).first->covariance()) { - ATH_MSG_DEBUG("Original has a COV\n " - << *(*component).first->covariance()); - } - if (updatedTrackParameters->covariance()) { - ATH_MSG_DEBUG("Result has a COV\n" - << *updatedTrackParameters->covariance()); - } - updatedTrackParameters.reset(); - delete componentFitQuality; + componentFitQuality.reset(); continue; } if (!componentFitQuality || componentFitQuality->chiSquared() <= 0.) { ATH_MSG_DEBUG("Fit quality of update failed... Exiting!"); - updatedTrackParameters.reset(); - delete componentFitQuality; + componentFitQuality.reset(); continue; } double componentChi2 = componentFitQuality->chiSquared(); - chiSquared += component->second * componentChi2; + chiSquared += component.second * componentChi2; - // The same measurement is included in each update so it is the same for - // each component - if (component == stateWithNewWeights.begin()) { + // The same measurement is included in each update + // so we can update the degree of freedom only + if (degreesOfFreedom == 0.0) { degreesOfFreedom = componentFitQuality->numberDoF(); } - // Clean up memory - delete componentFitQuality; + componentFitQuality.reset(); - // Updator does not change the weighting - ComponentParameters updatedComponentParameters( - std::move(updatedTrackParameters), component->second); // Add component to state being prepared for assembly and check that it is // valid - bool componentAdded = MultiComponentStateAssembler::addComponent( - cache, std::move(updatedComponentParameters)); + bool componentAdded = + MultiComponentStateAssembler::addComponent(cache, std::move(component)); if (!componentAdded) { ATH_MSG_DEBUG( @@ -386,7 +324,7 @@ Trk::GsfMeasurementUpdator::calculateFilterStep( } } - ATH_MSG_DEBUG("Assembeler cache size : " << cache.multiComponentState.size() ); + ATH_MSG_DEBUG("Assembler cache size : " << cache.multiComponentState.size()); Trk::MultiComponentState assembledUpdatedState = MultiComponentStateAssembler::assembledState(cache); @@ -394,7 +332,7 @@ Trk::GsfMeasurementUpdator::calculateFilterStep( if (assembledUpdatedState.empty()) { return {}; } else { - ATH_MSG_DEBUG("Assembeled size : " << assembledUpdatedState.size() ); + ATH_MSG_DEBUG("Assembler size : " << assembledUpdatedState.size()); } fitQoS = std::make_unique<FitQualityOnSurface>(chiSquared, degreesOfFreedom); diff --git a/Tracking/TrkFitter/TrkGaussianSumFilter/src/KLGaussianMixtureReduction.cxx b/Tracking/TrkFitter/TrkGaussianSumFilter/src/KLGaussianMixtureReduction.cxx index 9272a42af19f77befff4bd11e36ab1b2cbe4d533..96ccf1db1608fa3d43931583e2d10a005e346da6 100644 --- a/Tracking/TrkFitter/TrkGaussianSumFilter/src/KLGaussianMixtureReduction.cxx +++ b/Tracking/TrkFitter/TrkGaussianSumFilter/src/KLGaussianMixtureReduction.cxx @@ -3,6 +3,7 @@ */ #include "TrkGaussianSumFilter/KLGaussianMixtureReduction.h" #include "CxxUtils/features.h" +#include "CxxUtils/vec.h" #include "CxxUtils/vectorize.h" #include "TrkGaussianSumFilter/AlignedDynArray.h" #include <limits> @@ -241,224 +242,150 @@ findMerges(Component1D* componentsIn, /** * findMinimumIndex - * * For FindMinimumIndex at x86_64 we have * AVX2,SSE4.1,SSE2 versions * These assume that the number of elements is a multiple * of 8 and are to be used for sizeable inputs. - * * We also provide a default "scalar" implementation */ #if HAVE_FUNCTION_MULTIVERSIONING #if defined(__x86_64__) -#include <immintrin.h> -/* - * AVX2 intrinsics used : - * - * _mm256_set1_epi32 - * Broadcast 32-bit integer a to all elements of dst. - * - * _mm256_setr_epi32 - * Set packed 32-bit integers in dst with the supplied values in reverse order. - * - * _mm256_load_ps - * Load 256-bits (composed of 8 packed single-precision (32-bit) floating-point - * elements) from memory into dst. mem_addr must be aligned on a 32-byte - * boundary or a general-protection exception may be generated. - * - * _mm256_add_epi32 - * Add packed 32-bit integers in a and b, and store the results in dst. - * - * _mm256_cmp_ps - * Compare packed single-precision (32-bit) floating-point elements in a and b - * based on the comparison operand specified by imm8, and store the results in - * dst. - * - * _mm256_min_ps - * Compare packed single-precision (32-bit) floating-point elements in a and - * b, and store packed minimum values in dst. - * - * _mm256_blendv_epi8 - * Blend packed 8-bit integers from a and b using mask, and store the results - * in dst. - */ __attribute__((target("avx2"))) int32_t findMinimumIndex(const float* distancesIn, const int n) { + using namespace CxxUtils; float* array = (float*)__builtin_assume_aligned(distancesIn, alignment); - const __m256i increment = _mm256_set1_epi32(8); - __m256i indicesIn = _mm256_setr_epi32(0, 1, 2, 3, 4, 5, 6, 7); - __m256i minindices = indicesIn; - __m256 minvalues = _mm256_load_ps(array); + const vec<int, 8> increment = { 8, 8, 8, 8, 8, 8, 8, 8 }; + vec<int, 8> indicesIn = { 0, 1, 2, 3, 4, 5, 6, 7 }; + vec<int, 8> minindices = indicesIn; + vec<float, 8> minvalues{}; + vec<float, 8> values{}; + vload(minvalues, array); for (int i = 8; i < n; i += 8) { // Load next 8 elements - const __m256 values = _mm256_load_ps(array + i); + vload(values, array + i); // increment the indices - indicesIn = _mm256_add_epi32(indicesIn, increment); + indicesIn = indicesIn + increment; // Get a mask indicating when an element is less than the ones we have - __m256i lt = - _mm256_castps_si256(_mm256_cmp_ps(values, minvalues, _CMP_LT_OS)); - // b lend select the indices to update - minindices = _mm256_blendv_epi8(minindices, indicesIn, lt); - minvalues = _mm256_min_ps(values, minvalues); + vec<int, 8> lt = values < minvalues; + // blend select the indices to update + vselect(minindices, indicesIn, minindices, lt); + vmin(minvalues, values, minvalues); } // Do the final calculation scalar way - alignas(alignment) float distances[8]; - alignas(alignment) int32_t indices[8]; - _mm256_store_ps(distances, minvalues); - _mm256_store_si256((__m256i*)(indices), minindices); - int32_t minIndex = indices[0]; - float minDistance = distances[0]; + int32_t minIndex = minindices[0]; + float minDistance = minvalues[0]; for (int i = 1; i < 8; ++i) { - if (distances[i] < minDistance) { - minIndex = indices[i]; - minDistance = distances[i]; + if (minvalues[i] < minDistance) { + minIndex = minindices[i]; + minDistance = minvalues[i]; } } return minIndex; } -/* - * SSE intrinsics used - * _mm_set1_epi32 - * Broadcast 32-bit integer a to all elements of dst. - * - * _mm_setr_epi32 - * Set packed 32-bit integers in dst with the supplied values in reverse order. - * - * _mm_load_ps - * Set packed 32-bit integers in dst with the supplied values in reverse order. - * - * _mm_add_epi32 (a,b) - * Add packed 32-bit integers in a and b, and store the results in dst. - * - * _mm_min_ps (a,b) - * Compare packed single-precision (32-bit) floating-point elements in a and - * b, and store packed minimum values in dst. - * - * _mm_cmplt_ps ( a, b) - * Compare packed single-precision (32-bit) floating-point elements in a and b - * for less-than, and store the results in dst. - * - * _mm_castps_si128 - * Cast vector of type __m128 to type __m128i. This intrinsic is only used - * for compilation and does not generate any instructions, thus it has zero - * latency. - */ __attribute__((target("sse4.1"))) int32_t findMinimumIndex(const float* distancesIn, const int n) { + using namespace CxxUtils; float* array = (float*)__builtin_assume_aligned(distancesIn, alignment); // Do 2 vectors of 4 elements , so 8 at time - const __m128i increment = _mm_set1_epi32(8); - __m128i indices1 = _mm_setr_epi32(0, 1, 2, 3); - __m128i indices2 = _mm_setr_epi32(4, 5, 6, 7); - __m128i minindices1 = indices1; - __m128i minindices2 = indices2; - __m128 minvalues1 = _mm_load_ps(array); - __m128 minvalues2 = _mm_load_ps(array + 4); - + const vec<int, 4> increment = { 8, 8, 8, 8 }; + vec<int, 4> indices1 = { 0, 1, 2, 3 }; + vec<int, 4> indices2 = { 4, 5, 6, 7 }; + vec<int, 4> minindices1 = indices1; + vec<int, 4> minindices2 = indices2; + vec<float, 4> minvalues1; + vec<float, 4> minvalues2; + vload(minvalues1, array); + vload(minvalues2, array + 4); + vec<float, 4> values1; + vec<float, 4> values2; for (int i = 8; i < n; i += 8) { - // Load 8 elements at a time in 2 vectors of size 4 - const __m128 values1 = _mm_load_ps(array + i); // first 4 - const __m128 values2 = _mm_load_ps(array + i + 4); // second 4 - // Handle the first 4 - indices1 = _mm_add_epi32(indices1, increment); - __m128i lt1 = _mm_castps_si128(_mm_cmplt_ps(values1, minvalues1)); - minindices1 = _mm_blendv_epi8(minindices1, indices1, lt1); - minvalues1 = _mm_min_ps(values1, minvalues1); - // Handle the second 4 - indices2 = _mm_add_epi32(indices2, increment); - __m128i lt2 = _mm_castps_si128(_mm_cmplt_ps(values2, minvalues2)); - minindices2 = _mm_blendv_epi8(minindices2, indices2, lt2); - minvalues2 = _mm_min_ps(values2, minvalues2); + // Load 8 elements at a time + vload(values1, array + i); // first 4 + vload(values2, array + i + 4); // second 4 + // 1 + indices1 = indices1 + increment; + vec<int, 4> lt1 = values1 < minvalues1; + vselect(minindices1, indices1, minindices1, lt1); + vmin(minvalues1, values1, minvalues1); + // 2 + indices2 = indices2 + increment; + vec<int, 4> lt2 = values2 < minvalues2; + vselect(minindices2, indices2, minindices2, lt2); + vmin(minvalues2, values2, minvalues2); } - // Compare //1 with //2 - __m128i lt = _mm_castps_si128(_mm_cmplt_ps(minvalues1, minvalues2)); - minindices1 = _mm_blendv_epi8(minindices2, minindices1, lt); - minvalues1 = _mm_min_ps(minvalues2, minvalues1); - - // Do the final 4 scalar way - alignas(alignment) float distances[4]; - alignas(alignment) int32_t indices[4]; - _mm_store_ps(distances, minvalues1); - _mm_store_si128((__m128i*)(indices), minindices1); - - int32_t minIndex = indices[0]; - float minDistance = distances[0]; - for (int i = 1; i < 4; ++i) { - if (distances[i] < minDistance) { - minIndex = indices[i]; - minDistance = distances[i]; + vec<int, 4> lt = minvalues1 < minvalues2; + vselect(minindices1, minindices1, minindices2, lt); + vmin(minvalues1, minvalues1, minvalues2); + /* + * Do the final calculation scalar way + */ + size_t minIndex = minindices1[0]; + float minvalue = minvalues1[0]; + for (size_t i = 1; i < 4; ++i) { + const float value = minvalues1[i]; + if (value < minvalue) { + minvalue = value; + minIndex = minindices1[i]; } } return minIndex; } /* * SSE2 does not have a blend/select instruction. - * To create one - * We AND & - * - a with the NOT of the mask - * - b with the mask - * - The we OR the above 2 */ -static inline __m128i -SSE2_mm_blendv_epi8(__m128i a, __m128i b, __m128i mask) -{ - return _mm_or_si128(_mm_andnot_si128(mask, a), _mm_and_si128(mask, b)); -} __attribute__((target("sse2"))) int32_t findMinimumIndex(const float* distancesIn, const int n) { + using namespace CxxUtils; float* array = (float*)__builtin_assume_aligned(distancesIn, alignment); - // Do 2 vectors of 4 elements, so 8 at a time - const __m128i increment = _mm_set1_epi32(8); - __m128i indices1 = _mm_setr_epi32(0, 1, 2, 3); - __m128i indices2 = _mm_setr_epi32(4, 5, 6, 7); - __m128i minindices1 = indices1; - __m128i minindices2 = indices2; - __m128 minvalues1 = _mm_load_ps(array); - __m128 minvalues2 = _mm_load_ps(array + 4); - + const vec<int, 4> increment = { 8, 8, 8, 8 }; + vec<int, 4> indices1 = { 0, 1, 2, 3 }; + vec<int, 4> indices2 = { 4, 5, 6, 7 }; + vec<int, 4> minindices1 = indices1; + vec<int, 4> minindices2 = indices2; + vec<float, 4> minvalues1; + vec<float, 4> minvalues2; + vload(minvalues1, array); + vload(minvalues2, array + 4); + vec<float, 4> values1; + vec<float, 4> values2; for (int i = 8; i < n; i += 8) { - // Load 8 elements at a time in 2 vectors of size 4 - const __m128 values1 = _mm_load_ps(array + i); // first 4 - const __m128 values2 = _mm_load_ps(array + i + 4); // second 4 - // Handle the first 4 - indices1 = _mm_add_epi32(indices1, increment); - __m128i lt1 = _mm_castps_si128(_mm_cmplt_ps(values1, minvalues1)); - minindices1 = SSE2_mm_blendv_epi8(minindices1, indices1, lt1); - minvalues1 = _mm_min_ps(values1, minvalues1); - // Handle the second 4 - indices2 = _mm_add_epi32(indices2, increment); - __m128i lt2 = _mm_castps_si128(_mm_cmplt_ps(values2, minvalues2)); - minindices2 = SSE2_mm_blendv_epi8(minindices2, indices2, lt2); - minvalues2 = _mm_min_ps(values2, minvalues2); + // Load 8 elements at a time + vload(values1, array + i); // first 4 + vload(values2, array + i + 4); // second 4 + // 1 + indices1 = indices1 + increment; + vec<int, 4> lt1 = values1 < minvalues1; + vselect(minindices1, indices1, minindices1, lt1); + vmin(minvalues1, values1, minvalues1); + // 2 + indices2 = indices2 + increment; + vec<int, 4> lt2 = values2 < minvalues2; + vselect(minindices2, indices2, minindices2, lt2); + vmin(minvalues2, values2, minvalues2); } - // Compare //1 with //2 - __m128i lt = _mm_castps_si128(_mm_cmplt_ps(minvalues1, minvalues2)); - minindices1 = SSE2_mm_blendv_epi8(minindices2, minindices1, lt); - minvalues1 = _mm_min_ps(minvalues2, minvalues1); - - // Do the final 4 scalar way - alignas(alignment) float distances[4]; - alignas(alignment) int32_t indices[4]; - _mm_store_ps(distances, minvalues1); - _mm_store_si128((__m128i*)(indices), minindices1); - - int32_t minIndex = indices[0]; - float minDistance = distances[0]; - for (int i = 1; i < 4; ++i) { - if (distances[i] < minDistance) { - minIndex = indices[i]; - minDistance = distances[i]; + vec<int, 4> lt = minvalues1 < minvalues2; + vselect(minindices1, minindices1, minindices2, lt); + vmin(minvalues1, minvalues1, minvalues2); + /* + * Do the final calculation scalar way + */ + size_t minIndex = minindices1[0]; + float minvalue = minvalues1[0]; + for (size_t i = 1; i < 4; ++i) { + const float value = minvalues1[i]; + if (value < minvalue) { + minvalue = value; + minIndex = minindices1[i]; } } - return minIndex; } #endif // end of x86_64 versions diff --git a/Tracking/TrkFitter/TrkGlobalChi2Fitter/TrkGlobalChi2Fitter/GXFTrackState.h b/Tracking/TrkFitter/TrkGlobalChi2Fitter/TrkGlobalChi2Fitter/GXFTrackState.h index 19e4a05a587e9a15770fc96bae2c1f315e5d397b..eae768c1a9baa444dc1019ea7f934ff7136b7a49 100755 --- a/Tracking/TrkFitter/TrkGlobalChi2Fitter/TrkGlobalChi2Fitter/GXFTrackState.h +++ b/Tracking/TrkFitter/TrkGlobalChi2Fitter/TrkGlobalChi2Fitter/GXFTrackState.h @@ -28,32 +28,41 @@ namespace Trk { class GXFTrackState { public: - GXFTrackState(); + GXFTrackState() = delete; GXFTrackState(GXFTrackState &); - ~GXFTrackState(); - GXFTrackState(const MeasurementBase *, const TrackParameters * trackpar = nullptr, bool ownmb = false); - GXFTrackState(const TrackParameters *); - GXFTrackState(GXFMaterialEffects *, const TrackParameters * trackpar = nullptr); - GXFTrackState & operator=(GXFTrackState & rhs); + GXFTrackState(std::unique_ptr<const MeasurementBase>, std::unique_ptr<const TrackParameters>); + GXFTrackState(const TrackParameters *, TrackState::TrackStateType = TrackState::Hole); + GXFTrackState(GXFMaterialEffects *, const TrackParameters * trackpar); + GXFTrackState & operator=(GXFTrackState &) = delete; + + void setMeasurement(std::unique_ptr<const MeasurementBase>); + const MeasurementBase *measurement(void); + const MeasurementBase *takeMeasurement(void); - void setMeasurement(const MeasurementBase *); - const MeasurementBase *measurement(bool takeownership = false); TrackState::TrackStateType trackStateType(); void setTrackStateType(TrackState::TrackStateType); - void setTrackParameters(const TrackParameters *); - const TrackParameters *trackParameters(bool takeownership = false); - void setMaterialEffects(GXFMaterialEffects *); + + void setTrackParameters(std::unique_ptr<const TrackParameters>); + const TrackParameters *trackParameters(void); + const TrackParameters *takeTrackParameters(void); + GXFMaterialEffects *materialEffects(); const Surface *surface(); - void setJacobian(TransportJacobian *); + void setJacobian(TransportJacobian &); Eigen::Matrix<double, 5, 5> & jacobian(); Amg::MatrixX & derivatives(); void setDerivatives(Amg::MatrixX &); - AmgSymMatrix(5) * trackCovariance(bool takeownership = false); + void setTrackCovariance(AmgSymMatrix(5) *); - const FitQualityOnSurface *fitQuality(bool takeownership = false); - void setFitQuality(const FitQualityOnSurface *); + AmgSymMatrix(5) & trackCovariance(void); + bool hasTrackCovariance(void); + void zeroTrackCovariance(void); + + void setFitQuality(std::unique_ptr<const FitQualityOnSurface>); + const FitQualityOnSurface *fitQuality(void); + const FitQualityOnSurface *takeFitQuality(void); + TrackState::MeasurementType measurementType(); void setMeasurementType(TrackState::MeasurementType); @@ -75,24 +84,26 @@ namespace Trk { void setMeasuresPhi(bool); private: - const MeasurementBase *m_measurement; //!< The measurement defining the track state + std::unique_ptr<const MeasurementBase> m_measurement; //!< The measurement defining the track state TrackState::TrackStateType m_tsType; //!< type of track state, eg Fittable, Outlier, Scatterer, Brem, Hole - const TrackParameters *m_trackpar; //!< track parameters - GXFMaterialEffects *m_materialEffects; //!< Material effects on track (ie scatterer, brem) + std::unique_ptr<const TrackParameters> m_trackpar; //!< track parameters + std::unique_ptr<GXFMaterialEffects> m_materialEffects; //!< Material effects on track (ie scatterer, brem) Eigen::Matrix<double, 5, 5> m_jacobian; //!< Transport jacobian wrt previous state - Amg::MatrixX * m_derivs; //!< Derivatives of local parameters wrt fit parameters - AmgSymMatrix(5) * m_covariancematrix; //!< Covariance matrix of track parameters at this surface - const FitQualityOnSurface *m_fitqual; + Amg::MatrixX m_derivs; //!< Derivatives of local parameters wrt fit parameters + + AmgSymMatrix(5) m_covariancematrix; //!< Covariance matrix of track parameters at this surface + bool m_covariance_set; + + std::unique_ptr<const FitQualityOnSurface> m_fitqual; double m_measerror[5]; //!< Measurement errors (corrected for stereo angle) double m_sinstereo; //!< stereo angle TrackState::MeasurementType m_mType; //!< Measurement type, eg pixel, SCT, ... bool m_recalib; //!< Has this measurement already been recalibrated? - bool m_owntp; - bool m_ownmb; - bool m_ownfq; - bool m_owncov; bool m_measphi; Amg::Vector3D m_globpos; + + public: + EIGEN_MAKE_ALIGNED_OPERATOR_NEW }; inline Eigen::Matrix<double, 5, 5> & GXFTrackState::jacobian() { @@ -100,25 +111,23 @@ namespace Trk { } inline Amg::MatrixX & GXFTrackState::derivatives() { - return *m_derivs; + return m_derivs; } - inline AmgSymMatrix(5) * GXFTrackState::trackCovariance(bool takeownership) { - AmgSymMatrix(5) * tmpcov = m_covariancematrix; - if (takeownership) { - m_owncov = false; - } - return tmpcov; + inline AmgSymMatrix(5) & GXFTrackState::trackCovariance(void) { + return m_covariancematrix; } - inline const TrackParameters *GXFTrackState::trackParameters(bool takeownership) { - if (takeownership) - m_owntp = false; - return m_trackpar; + inline const TrackParameters *GXFTrackState::trackParameters(void) { + return m_trackpar.get(); + } + + inline const TrackParameters *GXFTrackState::takeTrackParameters(void) { + return m_trackpar.get(); } inline GXFMaterialEffects *GXFTrackState::materialEffects() { - return m_materialEffects; + return m_materialEffects.get(); } inline TrackState::MeasurementType GXFTrackState::measurementType() { diff --git a/Tracking/TrkFitter/TrkGlobalChi2Fitter/TrkGlobalChi2Fitter/GXFTrajectory.h b/Tracking/TrkFitter/TrkGlobalChi2Fitter/TrkGlobalChi2Fitter/GXFTrajectory.h index 5ee0720db437e4a81e0e7a2c4f50331a2c8af8ff..049844cbe79ad3c2a6a690483e25662812c03f20 100644 --- a/Tracking/TrkFitter/TrkGlobalChi2Fitter/TrkGlobalChi2Fitter/GXFTrajectory.h +++ b/Tracking/TrkFitter/TrkGlobalChi2Fitter/TrkGlobalChi2Fitter/GXFTrajectory.h @@ -6,6 +6,7 @@ #define TRK_GXFTRAJECTORY_H #include "TrkGlobalChi2Fitter/GXFTrackState.h" +#include "TrkGeometry/MagneticFieldProperties.h" namespace Trk { class MeasurementBase; @@ -30,8 +31,7 @@ namespace Trk { GXFTrajectory & operator=(GXFTrajectory & rhs); bool addMeasurementState(GXFTrackState *, int index = -1); - void addHoleState(const TrackParameters *); - void addMaterialState(GXFTrackState *, int index = -1, bool owntp = false); + void addMaterialState(GXFTrackState *, int index = -1); void setReferenceParameters(const TrackParameters *); void setScatteringAngles(std::vector < std::pair < double, double > >&); @@ -73,9 +73,9 @@ namespace Trk { bool converged(); int prefit(); void resetReferenceParameters(); - double chi2(); + double chi2() const; double prevchi2(); - int nDOF(); + int nDOF() const; Amg::VectorX & residuals(); Amg::VectorX & errors(); @@ -90,8 +90,11 @@ namespace Trk { std::vector < std::pair < const Layer *, const Layer *>>&upstreamMaterialLayers(); + void resetCovariances(void); + std::unique_ptr<const FitQuality> quality(void) const; + bool m_straightline; - MagneticFieldProperties *m_fieldprop; + MagneticFieldProperties m_fieldprop = Trk::FullField; private: std::vector < GXFTrackState * >m_states; //!< The vector of track states, i.e. measurements, scatterers, brem points, and holes diff --git a/Tracking/TrkFitter/TrkGlobalChi2Fitter/TrkGlobalChi2Fitter/GlobalChi2Fitter.h b/Tracking/TrkFitter/TrkGlobalChi2Fitter/TrkGlobalChi2Fitter/GlobalChi2Fitter.h index e2f7baf142de1602adc0554cf3b9867450c6f778..acc512b82540eb4835d42487d29c97fc66c92033 100755 --- a/Tracking/TrkFitter/TrkGlobalChi2Fitter/TrkGlobalChi2Fitter/GlobalChi2Fitter.h +++ b/Tracking/TrkFitter/TrkGlobalChi2Fitter/TrkGlobalChi2Fitter/GlobalChi2Fitter.h @@ -526,12 +526,12 @@ namespace Trk { void calculateTrackErrors(GXFTrajectory &, Amg::SymMatrixX &, bool) const; - TransportJacobian *numericalDerivatives( + std::unique_ptr<TransportJacobian> numericalDerivatives( const EventContext& ctx, const TrackParameters *, const Surface *, PropDirection, - const MagneticFieldProperties * + const MagneticFieldProperties ) const; virtual int iterationsOfLastFit() const; @@ -604,7 +604,6 @@ namespace Trk { double m_scalefactor; bool m_redoderivs; bool m_reintoutl; - TrackFitInputPreparator *m_inputPreparator; int m_maxit; bool m_acceleration; bool m_numderiv; @@ -615,8 +614,6 @@ namespace Trk { bool m_useCaloTG = false; bool m_rejectLargeNScat = false; - MagneticFieldProperties *m_fieldpropnofield; - MagneticFieldProperties *m_fieldpropfullfield; ParticleMasses m_particleMasses; /* diff --git a/Tracking/TrkFitter/TrkGlobalChi2Fitter/src/GXFTrackState.cxx b/Tracking/TrkFitter/TrkGlobalChi2Fitter/src/GXFTrackState.cxx index 0836e3b85a2d789514c5779f5333a679d30c5477..4a6fff9172cafc781652d75a8bd228cfc765bf4d 100644 --- a/Tracking/TrkFitter/TrkGlobalChi2Fitter/src/GXFTrackState.cxx +++ b/Tracking/TrkFitter/TrkGlobalChi2Fitter/src/GXFTrackState.cxx @@ -19,42 +19,18 @@ // #include <string> namespace Trk { - GXFTrackState::GXFTrackState(): - m_measurement(nullptr), - m_tsType(TrackState::Fittable), - m_trackpar(nullptr), - m_materialEffects(nullptr), - m_jacobian {}, - m_derivs(nullptr), - m_covariancematrix(nullptr), - m_fitqual(nullptr), - m_sinstereo(0), - m_mType(TrackState::unidentified), - m_recalib(false), - m_owntp(false), - m_ownmb(false), - m_ownfq(false), - m_owncov(false), - m_measphi(false) - { - m_measerror[0] = m_measerror[1] = m_measerror[2] = m_measerror[3] = m_measerror[4] = -1; - } - GXFTrackState::GXFTrackState(GXFTrackState & rhs): - m_measurement(rhs.m_measurement != nullptr ? (rhs.m_ownmb ? rhs.m_measurement->clone() : rhs.m_measurement) : nullptr), + m_measurement(rhs.m_measurement != nullptr ? std::unique_ptr<const MeasurementBase>(rhs.m_measurement->clone()) : nullptr), m_tsType(rhs.m_tsType), - m_trackpar(rhs.m_trackpar), - m_materialEffects(rhs.m_materialEffects != nullptr ? new GXFMaterialEffects(*rhs. m_materialEffects) : nullptr), - m_derivs(rhs.m_derivs != nullptr ? new Amg::MatrixX(*rhs.m_derivs) : nullptr), - m_covariancematrix(rhs.m_covariancematrix != nullptr ? (rhs.m_owncov ? new AmgSymMatrix(5) (*rhs.m_covariancematrix) : rhs.m_covariancematrix) : nullptr), - m_fitqual(rhs.m_fitqual != nullptr ? (rhs.m_ownfq ? new FitQualityOnSurface(*rhs.m_fitqual) : rhs.m_fitqual) : nullptr), + m_trackpar(std::unique_ptr<const TrackParameters>(rhs.m_trackpar != nullptr ? rhs.m_trackpar->clone() : nullptr)), + m_materialEffects(std::unique_ptr<GXFMaterialEffects>(rhs.m_materialEffects != nullptr ? new GXFMaterialEffects(*rhs. m_materialEffects) : nullptr)), + m_derivs(rhs.m_derivs), + m_covariancematrix(rhs.m_covariancematrix), + m_covariance_set(rhs.m_covariance_set), + m_fitqual(rhs.m_fitqual ? std::make_unique<const FitQualityOnSurface>(*rhs.m_fitqual) : nullptr), m_sinstereo(rhs.m_sinstereo), m_mType(rhs.m_mType), m_recalib(rhs.m_recalib), - m_owntp(false), - m_ownmb(rhs.m_ownmb), - m_ownfq(rhs.m_ownfq), - m_owncov(rhs.m_owncov), m_measphi(rhs.m_measphi) { for (int i = 0; i < 5; i++) { @@ -66,47 +42,41 @@ namespace Trk { } GXFTrackState::GXFTrackState( - const MeasurementBase * measurement, - const TrackParameters * trackpar, - bool ownmb + std::unique_ptr<const MeasurementBase> measurement, + std::unique_ptr<const TrackParameters> trackpar ): - m_measurement(measurement), + m_measurement(std::move(measurement)), m_tsType(TrackState::Fittable), - m_trackpar(trackpar), + m_trackpar(std::move(trackpar)), m_materialEffects(nullptr), m_jacobian {}, - m_derivs(nullptr), - m_covariancematrix(nullptr), + m_derivs(), + m_covariancematrix(), + m_covariance_set(false), m_fitqual(nullptr), m_sinstereo(0), m_mType(TrackState::unidentified), m_recalib(false), - m_owntp(false), - m_ownmb(ownmb), - m_ownfq(false), - m_owncov(false), m_measphi(false) { m_measerror[0] = m_measerror[1] = m_measerror[2] = m_measerror[3] = m_measerror[4] = -1; } GXFTrackState::GXFTrackState( - const TrackParameters * trackpar + const TrackParameters * trackpar, + TrackState::TrackStateType tsType ): m_measurement(nullptr), - m_tsType(TrackState::Hole), - m_trackpar(trackpar), + m_tsType(tsType), + m_trackpar(std::unique_ptr<const TrackParameters>(trackpar != nullptr ? trackpar->clone() : nullptr)), m_materialEffects(nullptr), m_jacobian {}, - m_derivs(nullptr), - m_covariancematrix(nullptr), + m_derivs(), + m_covariancematrix(), + m_covariance_set(false), m_fitqual(nullptr), m_sinstereo(0), m_mType(TrackState::unidentified), m_recalib(false), - m_owntp(false), - m_ownmb(false), - m_ownfq(false), - m_owncov(false), m_measphi(false) { m_measerror[0] = m_measerror[1] = m_measerror[2] = m_measerror[3] = m_measerror[4] = -1; @@ -118,19 +88,16 @@ namespace Trk { ): m_measurement(nullptr), m_tsType(TrackState::Scatterer), - m_trackpar(trackpar), - m_materialEffects(mef), + m_trackpar(std::unique_ptr<const TrackParameters>(trackpar != nullptr ? trackpar->clone() : nullptr)), + m_materialEffects(std::unique_ptr<GXFMaterialEffects>(mef)), m_jacobian {}, - m_derivs(nullptr), - m_covariancematrix(nullptr), + m_derivs(), + m_covariancematrix(), + m_covariance_set(false), m_fitqual(nullptr), m_sinstereo(0), m_mType(TrackState::unidentified), m_recalib(false), - m_owntp(false), - m_ownmb(false), - m_ownfq(false), - m_owncov(false), m_measphi(false) { m_measerror[0] = m_measerror[1] = m_measerror[2] = m_measerror[3] = m_measerror[4] = -1; @@ -140,130 +107,30 @@ namespace Trk { } } - Trk::GXFTrackState::~GXFTrackState() { - if (m_ownmb) { - delete m_measurement; - } - - if (m_owntp) { - delete m_trackpar; - } - - delete m_materialEffects; - - if (m_owncov) { - delete m_covariancematrix; - } - - if (m_ownfq) { - delete m_fitqual; - } - - delete m_derivs; - } - - GXFTrackState & GXFTrackState::operator =(GXFTrackState & rhs) { - if (this != &rhs) { - if (m_ownmb) { - delete m_measurement; - } - - if (m_owntp) { - delete m_trackpar; - } - - m_measurement = rhs.m_measurement != nullptr ? (rhs.m_ownmb ? rhs.m_measurement->clone() : rhs.m_measurement) : nullptr; - m_tsType = rhs.m_tsType; - m_trackpar = rhs.m_trackpar; - m_materialEffects = rhs.m_materialEffects != nullptr ? new GXFMaterialEffects(*rhs.m_materialEffects) : nullptr; - m_derivs = rhs.m_derivs != nullptr ? new Amg::MatrixX(*rhs.m_derivs) : nullptr; - - delete m_covariancematrix; - - m_covariancematrix = ( - rhs.m_covariancematrix != nullptr ? ( - rhs.m_owncov ? - new AmgSymMatrix(5) (*rhs.m_covariancematrix) : - rhs.m_covariancematrix - ) : nullptr - ); - - m_fitqual = rhs.m_fitqual != nullptr ? (rhs.m_ownfq ? new FitQualityOnSurface(*rhs.m_fitqual) : rhs.m_fitqual) : nullptr; - m_sinstereo = rhs.m_sinstereo; - m_mType = rhs.m_mType; - m_recalib = rhs.m_recalib; - m_owntp = false; - m_ownmb = rhs.m_ownmb; - m_ownfq = rhs.m_ownfq; - m_owncov = rhs.m_owncov; - m_measphi = rhs.m_measphi; - - for (int i = 0; i < 5; i++) { - m_measerror[i] = rhs.m_measerror[i]; - for (int j = 0; j < 5; j++) { - m_jacobian(i, j) = rhs.m_jacobian(i, j); - } - } - } - - return *this; - } - - void GXFTrackState::setMeasurement(const MeasurementBase * meas) { - if (m_ownmb) { - delete m_measurement; - } - - m_measurement = meas; + void GXFTrackState::setMeasurement(std::unique_ptr<const MeasurementBase> meas) { + m_measurement = std::move(meas); m_recalib = true; - m_ownmb = true; } - const MeasurementBase *GXFTrackState::measurement(bool takeownership) { - const MeasurementBase *meas = m_measurement; - - if ((meas != nullptr) && !m_ownmb && takeownership) { - meas = meas->clone(); - } - if (takeownership) { - m_ownmb = false; - } - return meas; + const MeasurementBase *GXFTrackState::measurement(void) { + return m_measurement.get(); + } + + const MeasurementBase *GXFTrackState::takeMeasurement(void) { + return m_measurement.get(); } - void - GXFTrackState::setTrackParameters(const TrackParameters * par) { - if ((m_trackpar != nullptr) && m_owntp) { - delete m_trackpar; - } - m_trackpar = par; - m_owntp = true; + void GXFTrackState::setTrackParameters(std::unique_ptr<const TrackParameters> par) { + m_trackpar = std::move(par); } - void - GXFTrackState::setMaterialEffects(GXFMaterialEffects * mef) { - - delete m_materialEffects; - - m_materialEffects = mef; - } - - void - GXFTrackState::setJacobian(TransportJacobian * jac) { - for (int i = 0; i < 5; i++) { - for (int j = 0; j < 5; j++) { - m_jacobian(i, j) = (*jac)(i, j); - } - } - delete jac; + void GXFTrackState::setJacobian(TransportJacobian & jac) { + m_jacobian = jac; } void GXFTrackState::setDerivatives(Amg::MatrixX & deriv) { - - delete m_derivs; - - m_derivs = new Amg::MatrixX(deriv); + m_derivs = deriv; } void @@ -308,29 +175,24 @@ namespace Trk { void GXFTrackState::setTrackCovariance(AmgSymMatrix(5) * covmat) { - if ((m_covariancematrix != nullptr) && m_owncov) { - delete m_covariancematrix; - } - m_covariancematrix = covmat; - if (covmat != nullptr) { - m_owncov = true; + if (covmat == nullptr) { + m_covariance_set = false; + } else { + m_covariance_set = true; + m_covariancematrix = *covmat; } } - void - GXFTrackState::setFitQuality(const FitQualityOnSurface * fitqual) { - if ((m_fitqual != nullptr) && m_ownfq) { - delete m_fitqual; - } - m_fitqual = fitqual; - m_ownfq = true; + void GXFTrackState::setFitQuality(std::unique_ptr<const FitQualityOnSurface> fitqual) { + m_fitqual = std::move(fitqual); } - const FitQualityOnSurface *GXFTrackState::fitQuality(bool takeownership) { - if (takeownership) { - m_ownfq = false; - } - return m_fitqual; + const FitQualityOnSurface *GXFTrackState::fitQuality(void) { + return m_fitqual.get(); + } + + const FitQualityOnSurface *GXFTrackState::takeFitQuality(void) { + return m_fitqual.get(); } int @@ -378,4 +240,13 @@ namespace Trk { GXFTrackState::setRecalibrated(bool isrecal) { m_recalib = isrecal; } + + bool GXFTrackState::hasTrackCovariance(void) { + return m_covariance_set; + } + + void GXFTrackState::zeroTrackCovariance(void) { + m_covariance_set = true; + m_covariancematrix.setZero(); + } } diff --git a/Tracking/TrkFitter/TrkGlobalChi2Fitter/src/GXFTrajectory.cxx b/Tracking/TrkFitter/TrkGlobalChi2Fitter/src/GXFTrajectory.cxx index 1b20623bd4e38bde3dbfec9c777fb1e9cf1ec524..e6458f85b35bb680febb44de94d7ceeb245b92ae 100644 --- a/Tracking/TrkFitter/TrkGlobalChi2Fitter/src/GXFTrajectory.cxx +++ b/Tracking/TrkFitter/TrkGlobalChi2Fitter/src/GXFTrajectory.cxx @@ -15,7 +15,6 @@ using CLHEP::HepVector; namespace Trk { GXFTrajectory::GXFTrajectory() { m_straightline = true; - m_fieldprop = nullptr; m_ndof = 0; m_nperpars = -1; m_nscatterers = 0; @@ -234,18 +233,9 @@ namespace Trk { return true; } - void GXFTrajectory::addHoleState(const TrackParameters * par) { - GXFTrackState *state = new GXFTrackState(par); - m_states.push_back(state); - } - - void GXFTrajectory::addMaterialState(GXFTrackState * state, int index, bool owntp) { + void GXFTrajectory::addMaterialState(GXFTrackState * state, int index) { const TrackParameters *par = state->trackParameters(); GXFMaterialEffects *meff = state->materialEffects(); - - if (owntp) { - state->setTrackParameters(par); - } if (index == -1) { m_states.push_back(state); @@ -521,7 +511,7 @@ namespace Trk { return m_nperpars + numberOfBrems() + 2 * numberOfScatterers(); } - double GXFTrajectory::chi2() { + double GXFTrajectory::chi2() const { return m_chi2; } @@ -537,7 +527,7 @@ namespace Trk { m_prevchi2 = chi2; } - int GXFTrajectory::nDOF() { + int GXFTrajectory::nDOF() const { return m_ndof; } @@ -671,15 +661,8 @@ namespace Trk { GXFTrackState *firstmeasstate = nullptr; GXFTrackState *lastmeasstate = nullptr; - for (auto & hit : trackStates()) { - if ( - hit->measurementType() == TrackState::Pseudo && - hit->trackStateType() == TrackState::GeneralOutlier - ) { - continue; - } - - if (hit->measurement(false) != nullptr) { + for (GXFTrackState * hit : trackStates()) { + if (hit->measurement() != nullptr) { if (firstmeasstate == nullptr) { firstmeasstate = hit; } @@ -713,4 +696,14 @@ namespace Trk { return false; } + + void GXFTrajectory::resetCovariances(void) { + for (GXFTrackState *hit : trackStates()) { + hit->setTrackCovariance(nullptr); + } + } + + std::unique_ptr<const FitQuality> GXFTrajectory::quality(void) const { + return std::make_unique<const FitQuality>(chi2(), nDOF()); + } } diff --git a/Tracking/TrkFitter/TrkGlobalChi2Fitter/src/GlobalChi2Fitter.cxx b/Tracking/TrkFitter/TrkGlobalChi2Fitter/src/GlobalChi2Fitter.cxx index 64e6cb74a504d92a7ef870278ebf5facc893632b..5502b0f6f8b05c12ca66f2e3acaab969624ade12 100644 --- a/Tracking/TrkFitter/TrkGlobalChi2Fitter/src/GlobalChi2Fitter.cxx +++ b/Tracking/TrkFitter/TrkGlobalChi2Fitter/src/GlobalChi2Fitter.cxx @@ -145,9 +145,7 @@ namespace Trk { m_calotool("Rec::MuidMaterialEffectsOnTrackProvider/MuidMaterialEffectsOnTrackProvider"), m_calotoolparam(""), m_trackingGeometrySvc("", n), - m_DetID(nullptr), - m_fieldpropnofield(new MagneticFieldProperties(Trk::NoField)), - m_fieldpropfullfield(new MagneticFieldProperties(Trk::FullField)) + m_DetID(nullptr) { declareProperty("ExtrapolationTool", m_extrapolator); declareProperty("MeasurementUpdateTool", m_updator); @@ -255,13 +253,11 @@ namespace Trk { } ATH_MSG_INFO("fixed momentum: " << m_p); - m_inputPreparator = new TrackFitInputPreparator; return StatusCode::SUCCESS; } StatusCode GlobalChi2Fitter::finalize() { - delete m_inputPreparator; ATH_MSG_INFO("finalize()"); ATH_MSG_INFO(m_fit_status[S_FITS] << " attempted track fits"); @@ -299,7 +295,7 @@ namespace Trk { ); } - trajectory.m_fieldprop = trajectory.m_straightline ? m_fieldpropnofield : m_fieldpropfullfield; + trajectory.m_fieldprop = trajectory.m_straightline ? Trk::NoField : Trk::FullField; bool firstismuon = isMuonTrack(intrk1); @@ -519,7 +515,7 @@ namespace Trk { Amg::MatrixX covMatrix(1, 1); covMatrix(0, 0) = 100; - PseudoMeasurementOnTrack *newpseudo = new PseudoMeasurementOnTrack( + std::unique_ptr<const PseudoMeasurementOnTrack> newpseudo = std::make_unique<const PseudoMeasurementOnTrack>( LocalParameters( DefinedParameter(updpar->parameters()[Trk::locY], Trk::locY) ), @@ -528,7 +524,7 @@ namespace Trk { ); delete updpar; - pseudostate->setMeasurement(newpseudo); + pseudostate->setMeasurement(std::move(newpseudo)); double errors[5]; errors[0] = errors[2] = errors[3] = errors[4] = -1; errors[1] = 10; @@ -728,7 +724,7 @@ namespace Trk { *matsurf, propdir, false, - *trajectory.m_fieldprop, + trajectory.m_fieldprop, Trk::nonInteracting ); @@ -740,7 +736,7 @@ namespace Trk { *matsurf, propdir, false, - *trajectory.m_fieldprop, + trajectory.m_fieldprop, Trk::nonInteracting ); } @@ -865,7 +861,7 @@ namespace Trk { calomeots[0].associatedSurface(), Trk::alongMomentum, false, - *trajectory.m_fieldprop, + trajectory.m_fieldprop, Trk::nonInteracting ); @@ -888,7 +884,7 @@ namespace Trk { calomeots[2].associatedSurface(), Trk::oppositeMomentum, false, - *trajectory.m_fieldprop, + trajectory.m_fieldprop, Trk::nonInteracting ); @@ -898,8 +894,7 @@ namespace Trk { return nullptr; } - TransportJacobian *jac1 = nullptr; - TransportJacobian *jac2 = nullptr; + std::unique_ptr<TransportJacobian> jac1, jac2; std::unique_ptr<const TrackParameters> elosspar; double firstscatphi = 0; @@ -943,6 +938,7 @@ namespace Trk { PropDirection propdir = !firstismuon ? oppositeMomentum : alongMomentum; + TransportJacobian *tmp_jac1 = jac1.get(); tmpelosspar = m_propagator->propagateParameters( ctx, *tmppar1, @@ -950,13 +946,13 @@ namespace Trk { associatedSurface(), propdir, false, - *trajectory.m_fieldprop, - jac1, + trajectory.m_fieldprop, + tmp_jac1, Trk::nonInteracting ); + if (jac1.get() != tmp_jac1) jac1.reset(tmp_jac1); if (m_numderiv) { - delete jac1; jac1 = numericalDerivatives( ctx, firstscatpar, @@ -968,7 +964,6 @@ namespace Trk { delete tmppar1; if ((tmpelosspar == nullptr) || (jac1 == nullptr)) { - delete jac1; delete tp_closestmuon; delete firstscatpar; delete lastscatpar; @@ -994,6 +989,7 @@ namespace Trk { delete tmpelosspar; } + TransportJacobian * tmp_jac2 = jac2.get(); const TrackParameters *scat2 = m_propagator->propagateParameters( ctx, *elosspar2, @@ -1002,13 +998,13 @@ namespace Trk { calomeots[2].associatedSurface(), propdir, false, - *trajectory.m_fieldprop, - jac2, + trajectory.m_fieldprop, + tmp_jac2, Trk::nonInteracting ); + if (jac2.get() != tmp_jac2) jac2.reset(tmp_jac2); if (m_numderiv) { - delete jac2; jac2 = numericalDerivatives( ctx, elosspar2, @@ -1025,8 +1021,6 @@ namespace Trk { delete elosspar2; if ((scat2 == nullptr) || (jac2 == nullptr)) { delete scat2; - delete jac1; - delete jac2; delete tp_closestmuon; delete firstscatpar; delete lastscatpar; @@ -1043,10 +1037,8 @@ namespace Trk { } } - delete jac1; - delete jac2; - - jac1 = jac2 = nullptr; + jac1.reset(nullptr); + jac2.reset(nullptr); Amg::MatrixX jac4(2, 2); jac4(0, 0) = jac3[0][2]; @@ -1208,9 +1200,9 @@ namespace Trk { elossmeff->setSigmaDeltaE(calomeots[1].energyLoss()->sigmaDeltaE()); - trajectory.addMaterialState(new GXFTrackState(firstscatmeff, firstscatpar), -1, true); - trajectory.addMaterialState(new GXFTrackState(elossmeff, elosspar.release()), -1, true); - trajectory.addMaterialState(new GXFTrackState(secondscatmeff, lastscatpar), -1, true); + trajectory.addMaterialState(new GXFTrackState(firstscatmeff, firstscatpar), -1); + trajectory.addMaterialState(new GXFTrackState(elossmeff, elosspar.release()), -1); + trajectory.addMaterialState(new GXFTrackState(secondscatmeff, lastscatpar), -1); if (!firstismuon) { for (auto & i : tmp_matvec) { @@ -1285,18 +1277,17 @@ namespace Trk { tpar->position().perp() > 9000 && std::abs(tpar->position().z()) < 13000 ) { - const TrackParameters *pseudopar = tpar->clone(); + std::unique_ptr<const TrackParameters> pseudopar(tpar->clone()); Amg::MatrixX covMatrix(1, 1); covMatrix(0, 0) = 100; - PseudoMeasurementOnTrack *newpseudo = new PseudoMeasurementOnTrack( + std::unique_ptr<const PseudoMeasurementOnTrack> newpseudo = std::make_unique<const PseudoMeasurementOnTrack>( LocalParameters(DefinedParameter(pseudopar->parameters()[Trk::locY], Trk::locY)), covMatrix, pseudopar->associatedSurface() ); - GXFTrackState *pseudostate = new GXFTrackState(newpseudo, pseudopar, true); - pseudostate->setTrackParameters(pseudopar); + GXFTrackState *pseudostate = new GXFTrackState(std::move(newpseudo), std::move(pseudopar)); pseudostate->setMeasurementType(TrackState::Pseudo); double errors[5]; @@ -1431,7 +1422,7 @@ namespace Trk { calomeots[0].associatedSurface(), Trk::alongMomentum, false, - *trajectory.m_fieldprop, + trajectory.m_fieldprop, Trk::nonInteracting)); delete lastidpar; @@ -1447,7 +1438,7 @@ namespace Trk { calomeots[1].associatedSurface(), Trk::alongMomentum, false, - *trajectory.m_fieldprop, + trajectory.m_fieldprop, Trk::nonInteracting)); if (!tmppar) { @@ -1482,7 +1473,7 @@ namespace Trk { calomeots[2].associatedSurface(), Trk::alongMomentum, false, - *trajectory.m_fieldprop, + trajectory.m_fieldprop, Trk::nonInteracting)); if (!lastscatpar) { @@ -1496,7 +1487,7 @@ namespace Trk { calomeots[2].associatedSurface(), Trk::oppositeMomentum, false, - *trajectory.m_fieldprop, + trajectory.m_fieldprop, Trk::nonInteracting ) ); @@ -1512,7 +1503,7 @@ namespace Trk { calomeots[1].associatedSurface(), Trk::oppositeMomentum, false, - *trajectory.m_fieldprop, + trajectory.m_fieldprop, Trk::nonInteracting ) ); @@ -1541,7 +1532,7 @@ namespace Trk { calomeots[0].associatedSurface(), Trk::oppositeMomentum, false, - *trajectory.m_fieldprop, + trajectory.m_fieldprop, Trk::nonInteracting ) ); @@ -1584,9 +1575,9 @@ namespace Trk { dp = 1000 * (lastscatpar->parameters()[Trk::qOverP] - firstscatpar->parameters()[Trk::qOverP]); elossmeff->setdelta_p(dp); - trajectory.addMaterialState(new GXFTrackState(firstscatmeff.release(), firstscatpar.release()), -1, true); - trajectory.addMaterialState(new GXFTrackState(elossmeff.release(), elosspar.release()), -1, true); - trajectory.addMaterialState(new GXFTrackState(secondscatmeff.release(), lastscatpar.release()), -1, true); + trajectory.addMaterialState(new GXFTrackState(firstscatmeff.release(), firstscatpar.release()), -1); + trajectory.addMaterialState(new GXFTrackState(elossmeff.release(), elosspar.release()), -1); + trajectory.addMaterialState(new GXFTrackState(secondscatmeff.release(), lastscatpar.release()), -1); GXFTrackState *secondscatstate = trajectory.trackStates().back(); const Surface *triggersurf1 = nullptr; @@ -1741,17 +1732,24 @@ namespace Trk { std::abs((*itStates2)->measurementOnTrack()->globalPosition().z()) < 10000 ) ) { - const TrackParameters* par2 = - (((*itStates2)->trackParameters() != nullptr) && nphi > 99) - ? (*itStates2)->trackParameters()->clone() - : m_propagator->propagateParameters( - ctx, - *secondscatstate->trackParameters(), - (*itStates2)->measurementOnTrack()->associatedSurface(), - alongMomentum, - false, - *trajectory.m_fieldprop, - Trk::nonInteracting); + std::unique_ptr<const TrackParameters> par2; + + if (((*itStates2)->trackParameters() != nullptr) && nphi > 99) { + par2.reset((*itStates2)->trackParameters()->clone()); + } else { + par2.reset( + m_propagator->propagateParameters( + ctx, + *secondscatstate->trackParameters(), + (*itStates2)->measurementOnTrack()->associatedSurface(), + alongMomentum, + false, + trajectory.m_fieldprop, + Trk::nonInteracting + ) + ); + } + if (par2 == nullptr) { continue; } @@ -1765,8 +1763,7 @@ namespace Trk { par2->associatedSurface() ); - firstpseudostate = new GXFTrackState(newpseudo, par2, true); - firstpseudostate->setTrackParameters(par2); + firstpseudostate = new GXFTrackState(std::unique_ptr<const MeasurementBase>(newpseudo), std::move(par2)); firstpseudostate->setMeasurementType(TrackState::Pseudo); double errors[5]; @@ -1804,11 +1801,11 @@ namespace Trk { Amg::MatrixX covMatrix(1, 1); covMatrix(0, 0) = 100; - PseudoMeasurementOnTrack *newpseudo = new PseudoMeasurementOnTrack( + std::unique_ptr<const PseudoMeasurementOnTrack> newpseudo = std::make_unique<const PseudoMeasurementOnTrack>( LocalParameters(DefinedParameter(0, Trk::locY)), covMatrix, slsurf ); - pseudostate1 = new GXFTrackState(newpseudo, nullptr, true); + pseudostate1 = new GXFTrackState(std::move(newpseudo), nullptr); pseudostate1->setMeasurementType(TrackState::Pseudo); double errors[5]; @@ -1832,11 +1829,11 @@ namespace Trk { Amg::MatrixX covMatrix(1, 1); covMatrix(0, 0) = 100; - PseudoMeasurementOnTrack *newpseudo = new PseudoMeasurementOnTrack( + std::unique_ptr<const PseudoMeasurementOnTrack> newpseudo = std::make_unique<const PseudoMeasurementOnTrack>( LocalParameters(DefinedParameter(0, Trk::locY)), covMatrix, slsurf ); - pseudostate2 = new GXFTrackState(newpseudo, nullptr, true); + pseudostate2 = new GXFTrackState(std::move(newpseudo), nullptr); pseudostate2->setMeasurementType(TrackState::Pseudo); double errors[5]; @@ -1895,12 +1892,12 @@ namespace Trk { Amg::MatrixX covMatrix(1, 1); covMatrix(0, 0) = 100; - PseudoMeasurementOnTrack *newpseudo = new PseudoMeasurementOnTrack( + std::unique_ptr<const PseudoMeasurementOnTrack> newpseudo = std::make_unique<const PseudoMeasurementOnTrack>( LocalParameters(DefinedParameter(par2->parameters()[Trk::locY], Trk::locY)), covMatrix, par2->associatedSurface() ); - firstpseudostate->setMeasurement(newpseudo); + firstpseudostate->setMeasurement(std::move(newpseudo)); firstpseudostate->setRecalibrated(false); } @@ -1958,8 +1955,7 @@ namespace Trk { trajectory.m_straightline = (!cache.m_field_cache.solenoidOn() && !cache.m_field_cache.toroidOn()); } - trajectory.m_fieldprop = - trajectory.m_straightline ? m_fieldpropnofield : m_fieldpropfullfield; + trajectory.m_fieldprop = trajectory.m_straightline ? Trk::NoField : Trk::FullField; return std::unique_ptr<Track>( fitIm(ctx, cache, inputTrack, runOutlier, matEffects)); @@ -2012,7 +2008,7 @@ namespace Trk { trajectory.m_straightline = (!cache.m_field_cache.solenoidOn() && !cache.m_field_cache.toroidOn()); } - trajectory.m_fieldprop = trajectory.m_straightline ? m_fieldpropnofield : m_fieldpropfullfield; + trajectory.m_fieldprop = trajectory.m_straightline ? Trk::NoField : Trk::FullField; if (inputTrack.trackStateOnSurfaces()->empty()) { ATH_MSG_WARNING("Track with zero track states, cannot perform fit"); @@ -2310,14 +2306,14 @@ namespace Trk { Amg::MatrixX covMatrix(1, 1); covMatrix(0, 0) = 100; - PseudoMeasurementOnTrack *newpseudo = new PseudoMeasurementOnTrack( + std::unique_ptr<const PseudoMeasurementOnTrack> newpseudo = std::make_unique<const PseudoMeasurementOnTrack>( LocalParameters(DefinedParameter(updpar->parameters()[Trk::locY], Trk::locY)), covMatrix, pseudopar->associatedSurface() ); delete updpar; - pseudostate->setMeasurement(newpseudo); + pseudostate->setMeasurement(std::move(newpseudo)); double errors[5]; errors[0] = errors[2] = errors[3] = errors[4] = -1; errors[1] = 10; @@ -2450,7 +2446,7 @@ namespace Trk { trajectory.m_straightline = (!cache.m_field_cache.solenoidOn() && !cache.m_field_cache.toroidOn()); } - trajectory.m_fieldprop = trajectory.m_straightline ? m_fieldpropnofield : m_fieldpropfullfield; + trajectory.m_fieldprop = trajectory.m_straightline ? Trk::NoField : Trk::FullField; const TrackParameters *minpar = inputTrack.perigeeParameters(); @@ -2599,7 +2595,7 @@ namespace Trk { trajectory.m_straightline = (!cache.m_field_cache.solenoidOn() && !cache.m_field_cache.toroidOn()); } - trajectory.m_fieldprop = trajectory.m_straightline ? m_fieldpropnofield : m_fieldpropfullfield; + trajectory.m_fieldprop = trajectory.m_straightline ? Trk::NoField : Trk::FullField; MeasurementSet rots; @@ -2691,26 +2687,26 @@ namespace Trk { Amg::MatrixX covMatrix(1, 1); covMatrix(0, 0) = 100; - PseudoMeasurementOnTrack *newpseudo = new PseudoMeasurementOnTrack( + std::unique_ptr<const PseudoMeasurementOnTrack> newpseudo = std::make_unique<const PseudoMeasurementOnTrack>( LocalParameters(DefinedParameter(firstpar->parameters()[Trk::locY], Trk::locY)), covMatrix, firstpar->associatedSurface() ); - trajectory.trackStates().front()->setMeasurement(newpseudo); + trajectory.trackStates().front()->setMeasurement(std::move(newpseudo)); } if (trajectory.trackStates().back()->measurementType() == TrackState::Pseudo) { Amg::MatrixX covMatrix(1, 1); covMatrix(0, 0) = 100; - PseudoMeasurementOnTrack *newpseudo = new PseudoMeasurementOnTrack( + std::unique_ptr<const PseudoMeasurementOnTrack> newpseudo = std::make_unique<const PseudoMeasurementOnTrack>( LocalParameters(DefinedParameter(lastpar->parameters()[Trk::locY], Trk::locY)), covMatrix, lastpar->associatedSurface() ); - trajectory.trackStates().back()->setMeasurement(newpseudo); + trajectory.trackStates().back()->setMeasurement(std::move(newpseudo)); } if (!trajectory.m_straightline) { @@ -2747,13 +2743,13 @@ namespace Trk { Amg::MatrixX covMatrix(1, 1); covMatrix(0, 0) = 100; - PseudoMeasurementOnTrack *newpseudo = new PseudoMeasurementOnTrack( + std::unique_ptr<const PseudoMeasurementOnTrack> newpseudo = std::make_unique<const PseudoMeasurementOnTrack>( LocalParameters(DefinedParameter(firstpar->parameters()[Trk::locY], Trk::locY)), covMatrix, firstpar->associatedSurface() ); - trajectory.trackStates().front()->setMeasurement(newpseudo); + trajectory.trackStates().front()->setMeasurement(std::move(newpseudo)); double errors[5]; errors[0] = errors[2] = errors[3] = errors[4] = -1; errors[1] = 10; @@ -2766,13 +2762,13 @@ namespace Trk { Amg::MatrixX covMatrix(1, 1); covMatrix(0, 0) = 100; - PseudoMeasurementOnTrack *newpseudo = new PseudoMeasurementOnTrack( + std::unique_ptr<const PseudoMeasurementOnTrack> newpseudo = std::make_unique<const PseudoMeasurementOnTrack>( LocalParameters(DefinedParameter(lastpar->parameters()[Trk::locY], Trk::locY)), covMatrix, lastpar->associatedSurface() ); - trajectory.trackStates().back()->setMeasurement(newpseudo); + trajectory.trackStates().back()->setMeasurement(std::move(newpseudo)); double errors[5]; errors[0] = errors[2] = errors[3] = errors[4] = -1; errors[1] = 10; @@ -2889,8 +2885,7 @@ namespace Trk { newmeff, copytp ? tsos->trackParameters()->clone() : tsos->trackParameters() ), - index, - copytp + index ); } @@ -2938,7 +2933,10 @@ namespace Trk { for (int i = 0; i < imax; i++) { const MeasurementBase *measbase2 = ((seg != nullptr) && m_decomposesegments) ? seg->measurement(i) : measbase; const TrackParameters *newtrackpar = ((seg != nullptr) && m_decomposesegments) ? nullptr : trackpar; - GXFTrackState *ptsos = new GXFTrackState(measbase2, newtrackpar); + GXFTrackState *ptsos = new GXFTrackState( + std::unique_ptr<const MeasurementBase>(measbase2->clone()), + std::unique_ptr<const TrackParameters>(newtrackpar != nullptr ? newtrackpar->clone() : nullptr) + ); const Amg::MatrixX & covmat = measbase2->localCovariance(); double sinstereo = 0; double errors[5]; @@ -3661,8 +3659,7 @@ namespace Trk { * Create a new track state in the internal representation and load it * with any and all information we might have. */ - - GXFTrackState *matstate = new GXFTrackState(meff); + GXFTrackState *matstate = new GXFTrackState(meff, nullptr); matstate->setPosition(intersect); trajectory.addMaterialState(matstate); @@ -3966,18 +3963,19 @@ namespace Trk { ) { if (firstsistate == nullptr) { if (oldstates[i]->trackParameters() == nullptr) { - const TrackParameters* tmppar = m_propagator->propagateParameters( + std::unique_ptr<const TrackParameters> tmppar(m_propagator->propagateParameters( ctx, - *refpar, - *oldstates[i]->surface(), - alongMomentum, - false, - *trajectory.m_fieldprop, - Trk::nonInteracting); - + *refpar, + *oldstates[i]->surface(), + alongMomentum, + false, + trajectory.m_fieldprop, + Trk::nonInteracting + )); + if (tmppar == nullptr) return; - oldstates[i]->setTrackParameters(tmppar); + oldstates[i]->setTrackParameters(std::move(tmppar)); } firstsistate = oldstates[i]; } @@ -4000,17 +3998,17 @@ namespace Trk { * enough. */ if (lastsistate->trackParameters() == nullptr) { - const TrackParameters *tmppar = m_propagator->propagateParameters( + std::unique_ptr<const TrackParameters> tmppar(m_propagator->propagateParameters( *refpar, *lastsistate->surface(), alongMomentum, false, - *trajectory.m_fieldprop, + trajectory.m_fieldprop, Trk::nonInteracting - ); + )); if (tmppar == nullptr) return; - lastsistate->setTrackParameters(tmppar); + lastsistate->setTrackParameters(std::move(tmppar)); } /* @@ -4120,7 +4118,7 @@ namespace Trk { return; } - state->setTrackParameters(tp); + state->setTrackParameters(std::unique_ptr<const TrackParameters>(tp)); } // When acceleration is enabled, material collection starts from first hit refpar2 = tp; @@ -4467,7 +4465,7 @@ namespace Trk { calomeots[i].associatedSurface(), propdir, false, - *trajectory.m_fieldprop, + trajectory.m_fieldprop, nonInteracting ); @@ -4525,7 +4523,7 @@ namespace Trk { calomeots[i].associatedSurface(), propdir, false, - *trajectory.m_fieldprop, + trajectory.m_fieldprop, nonInteracting ); @@ -4678,7 +4676,7 @@ namespace Trk { firstmuonhit->associatedSurface(), oppositeMomentum, false, - *trajectory.m_fieldprop, + trajectory.m_fieldprop, nonInteracting ); @@ -4998,7 +4996,7 @@ namespace Trk { } } - trajectory.m_fieldprop = trajectory.m_straightline ? m_fieldpropnofield : m_fieldpropfullfield; + trajectory.m_fieldprop = trajectory.m_straightline ? Trk::NoField : Trk::FullField; cache.m_lastiter = 0; Amg::SymMatrixX lu; @@ -5177,7 +5175,7 @@ namespace Trk { *matsurf, propdir, false, - *trajectory.m_fieldprop, + trajectory.m_fieldprop, Trk::nonInteracting ); @@ -5189,7 +5187,7 @@ namespace Trk { *matsurf, propdir, false, - *trajectory.m_fieldprop, + trajectory.m_fieldprop, Trk::nonInteracting ); @@ -5238,7 +5236,7 @@ namespace Trk { persurf, Trk::anyDirection, false, - *trajectory.m_fieldprop, + trajectory.m_fieldprop, Trk::nonInteracting ); @@ -5592,14 +5590,14 @@ namespace Trk { Amg::MatrixX covMatrix(1, 1); covMatrix(0, 0) = 100; - PseudoMeasurementOnTrack *newpseudo = new PseudoMeasurementOnTrack( + std::unique_ptr<const PseudoMeasurementOnTrack> newpseudo = std::make_unique<const PseudoMeasurementOnTrack>( LocalParameters(DefinedParameter(currenttrackpar->parameters()[Trk::locY], Trk::locY)), covMatrix, currenttrackpar->associatedSurface() ); - state->setMeasurement(newpseudo); - measbase = newpseudo; + state->setMeasurement(std::move(newpseudo)); + measbase = state->measurement(); } double *errors = state->measurementErrors(); @@ -6492,15 +6490,13 @@ namespace Trk { double dcerror = sqrt(oldrot->prepRawData()->localCovariance()(Trk::driftRadius, Trk::driftRadius)); double trackradius = state->trackParameters()->parameters()[Trk::driftRadius]; - const Trk::RIO_OnTrack * newrot = nullptr; + std::unique_ptr<const Trk::RIO_OnTrack> newrot = nullptr; double distance = std::abs(std::abs(trackradius) - dcradius); if (distance < scalefactor * dcerror && (olderror > 1. || trackradius * oldradius < 0)) { - newrot = m_ROTcreator->correct(*oldrot->prepRawData(), *state->trackParameters()); - } - - if (distance > scalefactor * dcerror && olderror < 1.) { - newrot = m_broadROTcreator->correct(*oldrot->prepRawData(), *state->trackParameters()); + newrot.reset(m_ROTcreator->correct(*oldrot->prepRawData(), *state->trackParameters())); + } else if (distance > scalefactor * dcerror && olderror < 1.) { + newrot.reset(m_broadROTcreator->correct(*oldrot->prepRawData(), *state->trackParameters())); } if (newrot != nullptr) { @@ -6518,7 +6514,7 @@ namespace Trk { double oldres = res[measno]; double newres = newradius - state->trackParameters()->parameters()[Trk::driftRadius]; errors[0] = newerror; - state->setMeasurement(newrot); + state->setMeasurement(std::move(newrot)); for (int i = 0; i < nfitpars; i++) { if (weightderiv(measno, i) == 0) { @@ -6634,9 +6630,9 @@ namespace Trk { if (statetype == TrackState::Fittable) { TrackState::MeasurementType hittype = state->measurementType(); - if ((hittype == TrackState::Pixel || hittype == TrackState::SCT) && (state->trackCovariance() != nullptr)) { + if ((hittype == TrackState::Pixel || hittype == TrackState::SCT) && state->hasTrackCovariance()) { double *errors = state->measurementErrors(); - AmgSymMatrix(5) & trackcov = *state->trackCovariance(); + AmgSymMatrix(5) & trackcov = state->trackCovariance(); const Amg::MatrixX & hitcov = state->measurement()->localCovariance(); double sinstereo = state->sinStereo(); double cosstereo = (sinstereo == 0) ? 1 : sqrt(1 - sinstereo * sinstereo); @@ -6719,7 +6715,7 @@ namespace Trk { parameterVector[Trk::phi], parameterVector[Trk::theta], parameterVector[Trk::qOverP], - new AmgSymMatrix(5)(*state_maxsipull->trackCovariance()) + state_maxsipull->hasTrackCovariance() ? new AmgSymMatrix(5)(state_maxsipull->trackCovariance()) : nullptr ) ); @@ -6865,7 +6861,7 @@ namespace Trk { olderror[1] << " newerror_1=" << newerror[1] ); - state_maxsipull->setMeasurement(broadrot.release()); + state_maxsipull->setMeasurement(std::move(broadrot)); state_maxsipull->setSinStereo(newsinstereo); state_maxsipull->setMeasurementErrors(newerror); } else if ( @@ -7069,15 +7065,16 @@ namespace Trk { ParticleHypothesis matEffects) const { // Convert internal track state into "official" TrackStateOnSurface - const TrackParameters *trackpar = state->trackParameters(true); - const MeasurementBase *measurement = state->measurement(true); - const FitQualityOnSurface *fitQual = state->fitQuality(true); + const TrackParameters *trackpar = state->trackParameters() != nullptr ? state->takeTrackParameters()->clone() : nullptr; + const MeasurementBase *measurement = state->measurement() != nullptr ? state->takeMeasurement()->clone() : nullptr; + const FitQualityOnSurface *fitQual = state->fitQuality() != nullptr ? state->takeFitQuality()->clone() : nullptr; + GXFMaterialEffects *gxfmeff = state->materialEffects(); const MaterialEffectsBase *mateff = nullptr; TrackState::TrackStateType tstype = state->trackStateType(); std::bitset<TrackStateOnSurface::NumberOfTrackStateOnSurfaceTypes> typePattern; - if (state->trackCovariance() != nullptr) { + if (state->hasTrackCovariance()) { state->setTrackCovariance(nullptr); } @@ -7240,7 +7237,7 @@ namespace Trk { layer->surfaceRepresentation(), propdir, true, - *oldtrajectory.m_fieldprop, + oldtrajectory.m_fieldprop, nonInteracting ); @@ -7274,8 +7271,9 @@ namespace Trk { } if (startfactor > 0.5) { const TrackParameters *updatedpar = m_matupdator->update(firstmeasstate->trackParameters(), *startlayer, oppositeMomentum, matEffects); + if ((updatedpar != nullptr) && updatedpar != firstmeasstate->trackParameters()) { - firstmeasstate->setTrackParameters(updatedpar); + firstmeasstate->setTrackParameters(std::unique_ptr<const TrackParameters>(updatedpar->clone())); } } } @@ -7296,8 +7294,9 @@ namespace Trk { if (endfactor > 0.5) { const TrackParameters *updatedpar = m_matupdator->update(lastmeasstate->trackParameters(), *endlayer, alongMomentum, matEffects); + if ((updatedpar != nullptr) && updatedpar != lastmeasstate->trackParameters()) { - lastmeasstate->setTrackParameters(updatedpar); + lastmeasstate->setTrackParameters(std::unique_ptr<const TrackParameters>(updatedpar->clone())); } } } @@ -7309,7 +7308,7 @@ namespace Trk { PerigeeSurface(Amg::Vector3D(0, 0, 0)), oppositeMomentum, false, - *oldtrajectory.m_fieldprop, + oldtrajectory.m_fieldprop, nonInteracting ); } @@ -7377,7 +7376,7 @@ namespace Trk { hit->measurementType() == TrackState::Pseudo && hit->trackStateType() == TrackState::GeneralOutlier ) { - if (hit->trackCovariance() != nullptr) { + if (hit->hasTrackCovariance()) { hit->setTrackCovariance(nullptr); } continue; @@ -7424,8 +7423,6 @@ namespace Trk { } GlobalChi2Fitter::~GlobalChi2Fitter() { - delete m_fieldpropnofield; - delete m_fieldpropfullfield; } FitterStatusCode GlobalChi2Fitter::calculateTrackParameters( @@ -7444,7 +7441,7 @@ namespace Trk { for (int hitno = nstatesupstream - 1; hitno >= 0; hitno--) { TrackState::TrackStateType prevtstype = prevstate != nullptr ? prevstate->trackStateType() : TrackState::AnyState; - TransportJacobian *jac = nullptr; + std::unique_ptr<TransportJacobian> jac; const Surface *surf = states[hitno]->surface(); const TrackParameters *currenttrackpar = nullptr; Trk::PropDirection propdir = Trk::oppositeMomentum; @@ -7465,17 +7462,19 @@ namespace Trk { bool curvpar = false; if (calcderiv && !m_numderiv) { + TransportJacobian * tmp_jac = jac.get(); currenttrackpar = m_propagator->propagateParameters( ctx, *prevtrackpar, *surf, propdir, false, - *trajectory.m_fieldprop, - jac, + trajectory.m_fieldprop, + tmp_jac, Trk::nonInteracting, curvpar ); + if (jac.get() != tmp_jac) jac.reset(tmp_jac); } else { currenttrackpar = m_propagator->propagateParameters( ctx, @@ -7483,18 +7482,15 @@ namespace Trk { *surf, propdir, false, - *trajectory.m_fieldprop, + trajectory.m_fieldprop, Trk::nonInteracting, curvpar ); } if (currenttrackpar == nullptr) { - if (jac != nullptr) { - delete jac; - jac = nullptr; - } - + jac.reset(nullptr); + propdir = ( propdir == Trk::oppositeMomentum ? Trk::alongMomentum : @@ -7502,17 +7498,19 @@ namespace Trk { ); if (calcderiv && !m_numderiv) { + TransportJacobian * tmp_jac = jac.get(); currenttrackpar = m_propagator->propagateParameters( ctx, *prevtrackpar, *surf, propdir, false, - *trajectory.m_fieldprop, - jac, + trajectory.m_fieldprop, + tmp_jac, Trk::nonInteracting, curvpar ); + if (jac.get() != tmp_jac) jac.reset(tmp_jac); } else { currenttrackpar = m_propagator->propagateParameters( ctx, @@ -7520,7 +7518,7 @@ namespace Trk { *surf, propdir, false, - *trajectory.m_fieldprop, + trajectory.m_fieldprop, Trk::nonInteracting, curvpar ); @@ -7528,9 +7526,7 @@ namespace Trk { } if ((currenttrackpar != nullptr) && m_numderiv && calcderiv) { - delete jac; - jac = numericalDerivatives( - ctx, prevtrackpar, surf, propdir, trajectory.m_fieldprop); + jac = numericalDerivatives(ctx, prevtrackpar, surf, propdir, trajectory.m_fieldprop); } if ( @@ -7546,11 +7542,6 @@ namespace Trk { if (currenttrackpar == nullptr) { ATH_MSG_DEBUG("propagation failed, prev par: " << *prevtrackpar << " pos: " << prevtrackpar->position() << " destination surface: " << *surf); - - - delete jac; - - if ( hitno != nstatesupstream - 1 && (prevtstype == TrackState::Scatterer || prevtstype == TrackState::Brem) @@ -7568,7 +7559,7 @@ namespace Trk { delete prevtrackpar; } - states[hitno]->setTrackParameters(currenttrackpar); + states[hitno]->setTrackParameters(std::unique_ptr<const TrackParameters>(currenttrackpar)); surf = states[hitno]->surface(); if (calcderiv && (jac == nullptr)) { @@ -7587,7 +7578,7 @@ namespace Trk { } } - states[hitno]->setJacobian(jac); + states[hitno]->setJacobian(*jac); } GXFMaterialEffects *meff = states[hitno]->materialEffects(); @@ -7636,7 +7627,7 @@ namespace Trk { bremno = trajectory.numberOfUpstreamBrems(); for (int hitno = nstatesupstream; hitno < (int) states.size(); hitno++) { - TransportJacobian *jac = nullptr; + std::unique_ptr<TransportJacobian> jac; const Surface *surf = states[hitno]->surface(); const TrackParameters *currenttrackpar = nullptr; Trk::PropDirection propdir = Trk::alongMomentum; @@ -7651,17 +7642,19 @@ namespace Trk { bool curvpar = false; if (calcderiv && !m_numderiv) { + TransportJacobian * tmp_jac = jac.get(); currenttrackpar = m_propagator->propagateParameters( ctx, *prevtrackpar, *surf, propdir, false, - *trajectory.m_fieldprop, - jac, + trajectory.m_fieldprop, + tmp_jac, Trk::nonInteracting, curvpar ); + if (jac.get() != tmp_jac) jac.reset(tmp_jac); } else { currenttrackpar = m_propagator->propagateParameters( ctx, @@ -7669,7 +7662,7 @@ namespace Trk { *surf, propdir, false, - *trajectory.m_fieldprop, + trajectory.m_fieldprop, Trk::nonInteracting, curvpar ); @@ -7681,24 +7674,23 @@ namespace Trk { Trk::alongMomentum : Trk::oppositeMomentum ); - - if (jac != nullptr) { - delete jac; - jac = nullptr; - } + + jac.reset(nullptr); if (calcderiv && !m_numderiv) { + TransportJacobian * tmp_jac = jac.get(); currenttrackpar = m_propagator->propagateParameters( ctx, *prevtrackpar, *surf, propdir, false, - *trajectory.m_fieldprop, - jac, + trajectory.m_fieldprop, + tmp_jac, Trk::nonInteracting, curvpar ); + if (jac.get() != tmp_jac) jac.reset(tmp_jac); } else { currenttrackpar = m_propagator->propagateParameters( ctx, @@ -7706,7 +7698,7 @@ namespace Trk { *surf, propdir, false, - *trajectory.m_fieldprop, + trajectory.m_fieldprop, Trk::nonInteracting, curvpar ); @@ -7714,7 +7706,6 @@ namespace Trk { } if ((currenttrackpar != nullptr) && m_numderiv && calcderiv) { - delete jac; jac = numericalDerivatives(ctx, prevtrackpar, surf, propdir, trajectory.m_fieldprop); } @@ -7734,10 +7725,6 @@ namespace Trk { ATH_MSG_DEBUG("propagation failed, prev par: " << *prevtrackpar << " pos: " << prevtrackpar-> position() << " destination surface: " << *surf); - - delete jac; - - return FitterStatusCode::ExtrapolationFailure; } @@ -7757,7 +7744,7 @@ namespace Trk { } } - states[hitno]->setJacobian(jac); + states[hitno]->setJacobian(*jac); } if (calcderiv && (jac == nullptr)) { @@ -7818,7 +7805,7 @@ namespace Trk { delete oldpar; } - states[hitno]->setTrackParameters(currenttrackpar); + states[hitno]->setTrackParameters(std::unique_ptr<const TrackParameters>(currenttrackpar)); prevtrackpar = currenttrackpar; } @@ -8058,19 +8045,17 @@ namespace Trk { continue; } - if (state->trackCovariance() == nullptr) { - AmgMatrix(5, 5) * newcov = new AmgMatrix(5, 5); - newcov->setZero(); - state->setTrackCovariance(newcov); + if (!state->hasTrackCovariance()) { + state->zeroTrackCovariance(); } - AmgMatrix(5, 5) & trackerrmat = *state->trackCovariance(); + AmgMatrix(5, 5) & trackerrmat = state->trackCovariance(); if ((prevstate != nullptr) && (prevstate->trackStateType() == TrackState::Fittable || prevstate->trackStateType() == TrackState::GeneralOutlier) && !onlylocal) { Eigen::Matrix<double, 5, 5> & jac = state->jacobian(); - AmgMatrix(5, 5) & prevcov = *states[indices[stateno - 1]]->trackCovariance(); + AmgMatrix(5, 5) & prevcov = states[indices[stateno - 1]]->trackCovariance(); trackerrmat = jac * prevcov * jac.transpose(); } else { @@ -8120,47 +8105,53 @@ namespace Trk { trackerrmat(4, 4) = 1e-20; } - const TrackParameters *trackpar = nullptr; const TrackParameters *tmptrackpar = state->trackParameters(); - AmgMatrix(5, 5) * trkerrmat = state->trackCovariance(true); + AmgMatrix(5, 5) * trkerrmat; + + if (state->hasTrackCovariance()) { + trkerrmat = new AmgSymMatrix(5)(state->trackCovariance()); + } else { + trkerrmat = nullptr; + } + const AmgVector(5) & tpars = tmptrackpar->parameters(); - trackpar = + std::unique_ptr<const TrackParameters> trackpar( tmptrackpar->associatedSurface().createTrackParameters(tpars[0], tpars[1], tpars[2], tpars[3], tpars[4], - trkerrmat); - state->setTrackParameters(trackpar); - const FitQualityOnSurface *fitQual = nullptr; + trkerrmat) + ); + state->setTrackParameters(std::move(trackpar)); + std::unique_ptr<const FitQualityOnSurface> fitQual = nullptr; if (state->trackStateType() == TrackState::Fittable) { if (errorok && trajectory.nDOF() > 0) { - fitQual = m_updator->fullStateFitQuality(*trackpar, - measurement-> - localParameters(), - measurement-> - localCovariance()); + fitQual.reset(m_updator->fullStateFitQuality( + *state->trackParameters(), + measurement->localParameters(), + measurement->localCovariance() + )); } else { - fitQual = - new FitQualityOnSurface(0, state->numberOfMeasuredParameters()); + fitQual = std::make_unique<const FitQualityOnSurface>(0, state->numberOfMeasuredParameters()); } } - state->setFitQuality(fitQual); + state->setFitQuality(std::move(fitQual)); } prevstate = state; hitno++; } } - TransportJacobian* + std::unique_ptr<TransportJacobian> GlobalChi2Fitter::numericalDerivatives( const EventContext& ctx, const TrackParameters* prevpar, const Surface* surf, PropDirection propdir, - const MagneticFieldProperties* fieldprop) const + const MagneticFieldProperties fieldprop) const { ParamDefsAccessor paraccessor; double J[25] = { @@ -8170,7 +8161,7 @@ namespace Trk { 0, 0, 0, 1, 0, 0, 0, 0, 0, 1 }; - TransportJacobian *jac = new TransportJacobian(J); + std::unique_ptr<TransportJacobian> jac = std::make_unique<TransportJacobian>(J); const TrackParameters *tmpprevpar = prevpar; double eps[5] = { 0.01, 0.01, 0.00001, 0.00001, 0.000000001 @@ -8212,68 +8203,80 @@ namespace Trk { correctAngles(vecminuseps[Trk::phi], vecminuseps[Trk::theta]); correctAngles(vecpluseps[Trk::phi], vecpluseps[Trk::theta]); - const TrackParameters *parpluseps = - tmpprevpar->associatedSurface().createTrackParameters(vecpluseps[0], - vecpluseps[1], - vecpluseps[2], - vecpluseps[3], - vecpluseps[4], - nullptr); - const TrackParameters *parminuseps = - tmpprevpar->associatedSurface().createTrackParameters(vecminuseps[0], - vecminuseps[1], - vecminuseps[2], - vecminuseps[3], - vecminuseps[4], - nullptr); - const TrackParameters* newparpluseps = m_propagator->propagateParameters( - ctx, - *parpluseps, - *surf, - propdir, - false, - *fieldprop, - Trk::nonInteracting); - const TrackParameters* newparminuseps = m_propagator->propagateParameters( - ctx, - *parminuseps, - *surf, - propdir, - false, - *fieldprop, - Trk::nonInteracting); - PropDirection propdir2 = - (propdir == - Trk::alongMomentum) ? Trk::oppositeMomentum : Trk::alongMomentum; - if (newparpluseps == nullptr) { - newparpluseps = m_propagator->propagateParameters( + std::unique_ptr<const TrackParameters> parpluseps( + tmpprevpar->associatedSurface().createTrackParameters( + vecpluseps[0], + vecpluseps[1], + vecpluseps[2], + vecpluseps[3], + vecpluseps[4], + nullptr + ) + ); + std::unique_ptr<const TrackParameters> parminuseps( + tmpprevpar->associatedSurface().createTrackParameters( + vecminuseps[0], + vecminuseps[1], + vecminuseps[2], + vecminuseps[3], + vecminuseps[4], + nullptr + ) + ); + + std::unique_ptr<const TrackParameters> newparpluseps( + m_propagator->propagateParameters( ctx, *parpluseps, *surf, - propdir2, + propdir, false, - *fieldprop, - Trk::nonInteracting); - } - if (newparminuseps == nullptr) { - newparminuseps = m_propagator->propagateParameters( + fieldprop, + Trk::nonInteracting + ) + ); + std::unique_ptr<const TrackParameters> newparminuseps( + m_propagator->propagateParameters( ctx, *parminuseps, *surf, - propdir2, + propdir, false, - *fieldprop, - Trk::nonInteracting); + fieldprop, + Trk::nonInteracting + ) + ); + + PropDirection propdir2 = + (propdir == + Trk::alongMomentum) ? Trk::oppositeMomentum : Trk::alongMomentum; + if (newparpluseps == nullptr) { + newparpluseps.reset( + m_propagator->propagateParameters( + ctx, + *parpluseps, + *surf, + propdir2, + false, + fieldprop, + Trk::nonInteracting + ) + ); + } + if (newparminuseps == nullptr) { + newparminuseps.reset( + m_propagator->propagateParameters( + ctx, + *parminuseps, + *surf, + propdir2, + false, + fieldprop, + Trk::nonInteracting + ) + ); } - delete parpluseps; - delete parminuseps; if ((newparpluseps == nullptr) || (newparminuseps == nullptr)) { - delete newparpluseps; - delete newparminuseps; - delete jac; - if (tmpprevpar != prevpar) { - delete tmpprevpar; - } return nullptr; } @@ -8303,11 +8306,6 @@ namespace Trk { (*jac) (j, i) = diff / (2 * eps[i]); } - delete newparpluseps; - delete newparminuseps; - } - if (tmpprevpar != prevpar) { - delete tmpprevpar; } return jac; } diff --git a/Tracking/TrkTools/KalmanParameterUpdator/CMakeLists.txt b/Tracking/TrkTools/KalmanParameterUpdator/CMakeLists.txt new file mode 100644 index 0000000000000000000000000000000000000000..82a50fd075fbb36069719d2b84eae2ee5489effa --- /dev/null +++ b/Tracking/TrkTools/KalmanParameterUpdator/CMakeLists.txt @@ -0,0 +1,19 @@ +################################################################################ +# Package: TrkMeasurementUpdator +################################################################################ + +# Declare the package name: +atlas_subdir( KalmanParameterUpdator ) + + +# External dependencies: +find_package( Eigen ) + +# Component(s) in the package: +atlas_add_library( KalmanParameterUpdatorLib + src/*.cxx + PUBLIC_HEADERS KalmanParameterUpdator + INCLUDE_DIRS ${EIGEN_INCLUDE_DIRS} + LINK_LIBRARIES ${EIGEN_LIBRARIES} GeoPrimitives EventPrimitives TrkEventPrimitives TrkParameters) + + diff --git a/Tracking/TrkTools/KalmanParameterUpdator/KalmanParameterUpdator/ATLAS_CHECK_THREAD_SAFETY b/Tracking/TrkTools/KalmanParameterUpdator/KalmanParameterUpdator/ATLAS_CHECK_THREAD_SAFETY new file mode 100644 index 0000000000000000000000000000000000000000..8f1f6e63f25c412638181b87fb7da35c5a2e031c --- /dev/null +++ b/Tracking/TrkTools/KalmanParameterUpdator/KalmanParameterUpdator/ATLAS_CHECK_THREAD_SAFETY @@ -0,0 +1 @@ +Tracking/TrkTools/KalmanParameterUpdator diff --git a/Tracking/TrkTools/KalmanParameterUpdator/KalmanParameterUpdator/KalmanParameterUpdator.h b/Tracking/TrkTools/KalmanParameterUpdator/KalmanParameterUpdator/KalmanParameterUpdator.h new file mode 100644 index 0000000000000000000000000000000000000000..a14a944039aec3048b347138ff8f254c4b674ed9 --- /dev/null +++ b/Tracking/TrkTools/KalmanParameterUpdator/KalmanParameterUpdator/KalmanParameterUpdator.h @@ -0,0 +1,253 @@ +/* + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration +*/ + +/** + * @file KalmanParameterUpdator.h + * @date 31/07/2020 + * @author Anthony Morley, Christos Anastopoulos + * + * Implementation of the gain formalist for Kalman filters + * allowing updating of parameters. + * + * Started from /based on KalmanUpdatorAmg + */ + +#ifndef TRK_KALMANPARAMETERUPDATOR_H +#define TRK_KALMANPARAMETERUPDATOR_H + +#include "EventPrimitives/EventPrimitives.h" +#include "TrkEventPrimitives/FitQualityOnSurface.h" +#include "TrkEventPrimitives/ParamDefs.h" +#include "TrkEventPrimitives/ProjectionMatricesSet.h" +#include "TrkParameters/TrackParameters.h" + +namespace Trk { + +class KalmanParameterUpdator +{ +public: + enum RangeCheckDef + { + absoluteCheck = 0, + differentialCheck = 1 + }; + + KalmanParameterUpdator(); + + /// calling the appropriate implementation for this rank of the measurement + /// perform a filter step. + /// Updates (in place) the current TrackParameters and FitQualityOnSurface + /// to represent the predicted state containing + /// the measurement LocalParameters and covariance. + /// For prediction sign should be 1 for smoothing -1. + bool filterStep(TrackParameters& trackParameters, + FitQualityOnSurface& fitQos, + const LocalParameters& measurement, + const Amg::MatrixX& measCovariance, + const int sign) const; + + bool stateFitQuality(FitQualityOnSurface& updatedFitQoS, + const TrackParameters& trkPar, + const LocalParameters& position, + const Amg::MatrixX& covariance, + int predFull) const; + +private: + /// 1D version + bool calculateFilterStep_1D(TrackParameters& TP, + const AmgSymMatrix(5) & trkCov, + double measPar, + double measCov, + int paramKey, + int updateDirection, + FitQualityOnSurface& fQ) const; + + /// Templated version + template<int DIM> + bool calculateFilterStep_T(TrackParameters& TP, + const AmgSymMatrix(5) & trkCov, + const AmgVector(DIM) & measPar, + const AmgSymMatrix(DIM) & measCov, + int paramKey, + int updateDirection, + FitQualityOnSurface& fQ) const; + + /// 5D version + bool calculateFilterStep_5D(TrackParameters& TP, + const AmgSymMatrix(5) & trkCov, + const AmgVector(5) & measPar, + const AmgSymMatrix(5) & measCov, + int updateDirection, + FitQualityOnSurface& fQ) const; + /// Chi2 1D version + bool makeChi2_1D(FitQualityOnSurface& updatedFitQoS, + const AmgVector(5) & trkPar, + const AmgSymMatrix(5) & trkCov, + double valRio, + double rioCov, + int paramKey, + int sign) const; + + /// Chi2 templated version + template<int DIM> + bool makeChi2_T(FitQualityOnSurface& updatedFitQoS, + const AmgVector(5) & trkPar, + const AmgSymMatrix(5) & trkCov, + const AmgVector(DIM) & measPar, + const AmgSymMatrix(DIM) & covPar, + int paramKey, + int sign) const; + + /// Avoid multiplications with sparse H matrices by cutting 2D rows&columns + /// out of the full cov matrix. + template<int DIM> + AmgSymMatrix(DIM) projection_T(const AmgSymMatrix(5) &, int key) const; + + bool consistentParamDimensions(const LocalParameters&, + const int nLocCoord) const; + + /** Absolute phi values should be in [-pi, pi] + absolute theta values should be in [0, +pi] + phi differences should also be in [-pi, pi] - else go other way round, + theta differences should be smaller than pi but can be negative + => other constraint than absolute theta. + */ + bool thetaPhiWithinRange_5D( + const AmgVector(5) & V, + const KalmanParameterUpdator::RangeCheckDef rcd) const; + + //!< Test if theta angle is inside boundaries. No differential-check option. + bool thetaWithinRange_5D(const AmgVector(5) & V) const; + + /// method correcting the calculated angles back to their defined ranges phi + /// (-pi, pi) and theta (0, pi). + bool correctThetaPhiRange_5D( + AmgVector(5) &, + AmgSymMatrix(5) &, + const KalmanParameterUpdator::RangeCheckDef) const; + +private: + AmgVector(5) m_cov0Vec; + AmgSymMatrix(5) m_unitMatrix; + ProjectionMatricesSet m_reMatrices; +}; + +template<int DIM> +bool +KalmanParameterUpdator::calculateFilterStep_T(TrackParameters& TP, + const AmgSymMatrix(5) & trkCov, + const AmgVector(DIM) & measPar, + const AmgSymMatrix(DIM) & measCov, + int paramKey, + int sign, + FitQualityOnSurface& fQ) const +{ + // get the parameter vector + const AmgVector(5)& trkPar = TP.parameters(); + // reduction matrix + AmgMatrix(DIM, 5) H = + m_reMatrices.expansionMatrix(paramKey).block<DIM, 5>(0, 0); + // the projected parameters from the TrackParameters + AmgVector(DIM) projTrkPar; + if (paramKey == 3 || paramKey == 7 || paramKey == 15) { + projTrkPar = trkPar.block<DIM, 1>(0, 0); + } else { + projTrkPar = H * trkPar; + } + + // reduction matrix H, Kalman gain K, residual r, combined covariance R + // residual after reduction + const AmgVector(DIM) r = measPar - projTrkPar; + // combined covariance after reduction + const AmgSymMatrix(DIM) R = + (sign * measCov + projection_T<DIM>(trkCov, paramKey)).inverse(); + // Kalman gain matrix + const AmgMatrix(5, DIM) K = trkCov * H.transpose() * R; + const AmgMatrix(5, 5) M = m_unitMatrix - K * H; + // --- compute local filtered state + const AmgVector(5) newPar = trkPar + K * r; + // --- compute filtered covariance matrix + // C = M * trkCov * M.T() +/- K * covRio * K.T() + const AmgSymMatrix(5) newCov = + M * trkCov * M.transpose() + sign * K * measCov * K.transpose(); + const double chiSquared = + (sign > 0) ? r.transpose() * R * r : r.transpose() * (-R) * r; + // create the FQSonSurface + fQ = FitQualityOnSurface(chiSquared, DIM); + // In place update of parameters + TP.updateParameters(newPar, newCov); + return true; +} + +template<int DIM> +bool +Trk::KalmanParameterUpdator::makeChi2_T(FitQualityOnSurface& updatedFitQoS, + const AmgVector(5) & trkPar, + const AmgSymMatrix(5) & trkCov, + const AmgVector(DIM) & measPar, + const AmgSymMatrix(DIM) & covPar, + int paramKey, + int sign) const +{ // sign: -1 = updated, +1 = predicted parameters. + + const AmgMatrix(DIM, 5) H = + m_reMatrices.expansionMatrix(paramKey).block<DIM, 5>(0, 0); + const AmgVector(DIM) r = measPar - H * trkPar; + // get the projected matrix + AmgSymMatrix(DIM) R = sign * projection_T<DIM>(trkCov, paramKey); + R += covPar; + // calcualte the chi2 value + double chiSquared = 0.0; + if (R.determinant() != 0.0) { + chiSquared = r.transpose() * R.inverse() * r; + } + updatedFitQoS = FitQualityOnSurface(chiSquared, DIM); + return true; +} + +template<int DIM> +AmgSymMatrix(DIM) Trk::KalmanParameterUpdator::projection_T( + const AmgSymMatrix(5) & M, + int key) const +{ + if (key == 3 || key == 7 || + key == 15) { // shortcuts for the most common use cases + return M.block<DIM, DIM>(0, 0); + } else { + Eigen::Matrix<int, DIM, 1, 0, DIM, 1> iv; + iv.setZero(); + for (int i = 0, k = 0; i < 5; ++i) { + if (key & (1 << i)) + iv[k++] = i; + } + AmgSymMatrix(DIM) covSubMatrix; + covSubMatrix.setZero(); + for (int i = 0; i < DIM; ++i) { + for (int j = 0; j < DIM; ++j) { + covSubMatrix(i, j) = M(iv(i), iv(j)); + } + } + return covSubMatrix; + } +} + +inline bool +KalmanParameterUpdator::thetaPhiWithinRange_5D( + const AmgVector(5) & V, + const KalmanParameterUpdator::RangeCheckDef rcd) const +{ + static const AmgVector(2) thetaMin(0.0, -M_PI); + return ((std::abs(V(Trk::phi)) <= M_PI) && (V(Trk::theta) >= thetaMin(rcd)) && + (V(Trk::theta) <= M_PI)); +} + +inline bool +KalmanParameterUpdator::thetaWithinRange_5D(const AmgVector(5) & V) const +{ + return (V(Trk::theta) >= 0.0 && (V(Trk::theta) <= M_PI)); +} + +} // end of namespace Trk + +#endif // TRK_KALMANPARAMETERUPDATOR_H diff --git a/Tracking/TrkTools/KalmanParameterUpdator/src/KalmanParameterUpdator.cxx b/Tracking/TrkTools/KalmanParameterUpdator/src/KalmanParameterUpdator.cxx new file mode 100644 index 0000000000000000000000000000000000000000..8f917b76e939dada2f73f7fb4003ceb931b969ce --- /dev/null +++ b/Tracking/TrkTools/KalmanParameterUpdator/src/KalmanParameterUpdator.cxx @@ -0,0 +1,322 @@ +/* + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration +*/ + +#include "KalmanParameterUpdator/KalmanParameterUpdator.h" +#include "TrkEventPrimitives/FitQualityOnSurface.h" +#include "TrkEventPrimitives/LocalParameters.h" +#include "TrkEventPrimitives/ParamDefs.h" + +#include <cmath> + +namespace { +constexpr double s_thetaGainDampingValue = 0.1; +} + +Trk::KalmanParameterUpdator::KalmanParameterUpdator() + : m_unitMatrix(AmgMatrix(5, 5)::Identity()) + , m_reMatrices(5) +{ + + m_cov0Vec << 250., 250., 0.25, 0.25, 0.000001; +} +bool +Trk::KalmanParameterUpdator::filterStep(TrackParameters& trackParameters, + FitQualityOnSurface& fitQos, + const LocalParameters& measurement, + const Amg::MatrixX& measCovariance, + const int sign) const +{ + + const AmgSymMatrix(5)* trkCov = trackParameters.covariance(); + if (!trkCov) { + return false; + } + + int nLocCoord = measCovariance.cols(); + if (!consistentParamDimensions(measurement, nLocCoord)) { + return false; + } + + switch (nLocCoord) { + case 1: { + return calculateFilterStep_1D(trackParameters, + *trkCov, + measurement(0), + measCovariance(0, 0), + measurement.parameterKey(), + sign, + fitQos); + } + case 2: { + return calculateFilterStep_T<2>(trackParameters, + *trkCov, + measurement.block<2, 1>(0, 0), + measCovariance.block<2, 2>(0, 0), + measurement.parameterKey(), + sign, + fitQos); + } + case 3: { + return calculateFilterStep_T<3>(trackParameters, + *trkCov, + measurement.block<3, 1>(0, 0), + measCovariance.block<3, 3>(0, 0), + measurement.parameterKey(), + sign, + fitQos); + } + case 4: { + return calculateFilterStep_T<4>(trackParameters, + *trkCov, + measurement.block<4, 1>(0, 0), + measCovariance.block<4, 4>(0, 0), + measurement.parameterKey(), + sign, + fitQos); + } + case 5: { + return calculateFilterStep_5D(trackParameters, + *trkCov, + measurement.block<5, 1>(0, 0), + measCovariance.block<5, 5>(0, 0), + sign, + fitQos); + } + default: { + return false; + } + } +} +bool +Trk::KalmanParameterUpdator::stateFitQuality(FitQualityOnSurface& updatedFitQoS, + const TrackParameters& trkPar, + const LocalParameters& position, + const Amg::MatrixX& covariance, + int predFull) const +{ + if (!trkPar.covariance()) { + return false; + } + // For the LocalPos. version, need to get # meas. coord. from covariance + // matrix. + int nLocCoord = covariance.cols(); + switch (nLocCoord) { + case 1: { + return makeChi2_1D(updatedFitQoS, + trkPar.parameters(), + (*trkPar.covariance()), + position[Trk::locX], + covariance(0, 0), + 1, + predFull); + } + case 2: { + return makeChi2_T<2>(updatedFitQoS, + trkPar.parameters(), + (*trkPar.covariance()), + position, + covariance.block<2, 2>(0, 0), + 3, + predFull); + } + default: { + return false; + } + } +} + +// calculations for Kalman updator and inverse Kalman filter +bool +Trk::KalmanParameterUpdator::calculateFilterStep_1D( + TrackParameters& TP, + const AmgSymMatrix(5) & trkCov, + double measPar, + double measCov, + int paramKey, + int sign, + Trk::FitQualityOnSurface& fitQoS) const +{ + + int mk = 0; + if (paramKey != 1) { + for (int i = 0; i < 5; ++i) { + if (paramKey & (1 << i)) { + mk = i; + break; + } + } + } + // get the parameters from the + const AmgVector(5)& trkPar = TP.parameters(); + // use measuring coordinate (variable "mk") instead of reduction matrix + double r = measPar - trkPar(mk); + double R = (sign * measCov) + trkCov(mk, mk); + if (R == 0.0) { + return false; + } + R = 1. / R; + // --- compute Kalman gain matrix + AmgMatrix(5, 1) K = trkCov.block<5, 1>(0, mk) * R; + // --- compute local filtered state, here = TP+K*r = TP + TCov * H.T * R * r + AmgVector(5) newPar = trkPar + trkCov.col(mk) * R * r; + + if (!thetaWithinRange_5D(newPar)) { + + if (mk != Trk::theta && + (std::abs(R * r) > 1.0 || + trkCov(Trk::theta, Trk::theta) > 0.1 * m_cov0Vec(Trk::theta))) { + + AmgVector(5) dampedCov = trkCov.col(mk); + + dampedCov(Trk::theta) = dampedCov(Trk::theta) * s_thetaGainDampingValue; + + newPar = trkPar + dampedCov * R * r; + + K(Trk::theta, 0) = K(Trk::theta, 0) * s_thetaGainDampingValue; + } + } + // --- compute covariance matrix of local filteres state + AmgMatrix(5, 5) KtimesH; + KtimesH.setZero(); + KtimesH.col(mk) = K; + AmgMatrix(5, 5) M = m_unitMatrix - KtimesH; + AmgSymMatrix(5) newCov = + M * trkCov * M.transpose() + sign * K * measCov * K.transpose(); + + if ((!thetaPhiWithinRange_5D(newPar, + Trk::KalmanParameterUpdator::absoluteCheck)) + ? !correctThetaPhiRange_5D( + newPar, newCov, Trk::KalmanParameterUpdator::absoluteCheck) + : false) { + return false; + } + + double predictedResidual = (sign < 0) ? r : (measPar - newPar(mk)); + const AmgSymMatrix(5)& updatedCov = + (sign < 0) ? trkCov : // when removing, the input are updated par + newCov; // when adding, chi2 is made from upd. par + + // for both signs (add/remove) the chi2 is now calculated like for updated + // states + double chiSquared = measCov - updatedCov(mk, mk); + if (chiSquared != 0.0) { + // get chi2 = r.T() * R^-1 * r + chiSquared = predictedResidual * predictedResidual / chiSquared; + } + fitQoS = FitQualityOnSurface(chiSquared, 1); + // In place update of parameters + TP.updateParameters(newPar, newCov); + return true; +} + +bool +Trk::KalmanParameterUpdator::calculateFilterStep_5D( + TrackParameters& TP, + const AmgSymMatrix(5) & trkCov, + const AmgVector(5) & measPar, + const AmgSymMatrix(5) & measCov, + int sign, + FitQualityOnSurface& fQ) const +{ + // get the parameter vector + const AmgVector(5)& trkPar = TP.parameters(); + // Kalman gain K, residual r, combined covariance R + const AmgVector(5) r = measPar - trkPar; + // for full safety in Eigen see + // http://eigen.tuxfamily.org/dox/classEigen_1_1FullPivLU.html + const AmgSymMatrix(5) R = (sign * measCov + trkCov).inverse(); + const AmgMatrix(5, 5) K = trkCov * R; + const AmgMatrix(5, 5) M = m_unitMatrix - K; + // --- compute local filtered state + AmgVector(5) newPar = trkPar + K * r; + // --- compute filtered covariance matrix + const AmgSymMatrix(5) newCov = + trkCov.similarity(M) + sign * measCov.similarity(K); + double chiSquared = + (sign > 0) ? r.transpose() * R * r : r.transpose() * (-R) * r; + // create the FQSonSurface + fQ = FitQualityOnSurface(chiSquared, 5); + TP.updateParameters(newPar, newCov); + return true; +} + +bool +Trk::KalmanParameterUpdator::makeChi2_1D(FitQualityOnSurface& updatedFitQoS, + const AmgVector(5) & trkPar, + const AmgSymMatrix(5) & trkCov, + double valRio, + double rioCov, + int paramKey, + int sign) const +{ + int mk = 0; + if (paramKey != 1) { + for (int i = 0; i < 5; ++i) { + if (paramKey & (1 << i)) { + mk = i; + break; + } + } + } + // sign: -1 = updated, +1 = predicted parameters. + double r = valRio - trkPar(mk); + // if (mk==3) catchPiPi; + double chiSquared = rioCov + sign * trkCov(mk, mk); + if (chiSquared == 0.0) { + return false; + } + chiSquared = r * r / chiSquared; + updatedFitQoS = FitQualityOnSurface(chiSquared, 1); + return true; +} + +bool +Trk::KalmanParameterUpdator::consistentParamDimensions( + const Trk::LocalParameters& P, + const int dimCov) const +{ + return P.dimension() == dimCov; +} + +bool +Trk::KalmanParameterUpdator::correctThetaPhiRange_5D( + AmgVector(5) & V, + AmgSymMatrix(5) & M, + const KalmanParameterUpdator::RangeCheckDef rcd) const +{ + static const AmgVector(2) thetaMin(0.0, -M_PI); + + // correct theta coordinate + if (V(Trk::theta) < thetaMin((int)rcd) || V(Trk::theta) > M_PI) { + // absolute theta: repair if between -pi and +2pi. + // differential theta: repair if between -pi and +pi + if ((V(Trk::theta) < -M_PI) || + (V(Trk::theta) > (rcd == Trk::KalmanParameterUpdator::differentialCheck + ? M_PI + : 2 * M_PI))) { + return false; + } + if (V(Trk::theta) > M_PI) { + V(Trk::theta) = 2 * M_PI - V(Trk::theta); + V(Trk::phi) += (V(Trk::phi) > 0.0) ? -M_PI : M_PI; + } else if (V(Trk::theta) < 0.0) { + V(Trk::theta) = -V(Trk::theta); + V(Trk::phi) += (V(Trk::phi) > 0.0) ? -M_PI : M_PI; + } + // correct also cov matrix: + M.fillSymmetric(0, 3, -M(0, 3)); // cov(polar,locX) + M.fillSymmetric(1, 3, -M(1, 3)); // cov(polar,locY) + M.fillSymmetric(2, 3, -M(2, 3)); // cov(polar,azimuthal) + M.fillSymmetric(3, 4, -M(3, 4)); // cov(polar,qOverP) + } + + // correct phi coordinate if necessary + if ((V(Trk::phi) > M_PI)) { + V(Trk::phi) = fmod(V(Trk::phi) + M_PI, 2 * M_PI) - M_PI; + } else if ((V(Trk::phi) < -M_PI)) { + V(Trk::phi) = fmod(V(Trk::phi) - M_PI, 2 * M_PI) + M_PI; + } + + return true; +} diff --git a/Tracking/TrkTools/TrkTrackSummaryTool/python/AtlasTrackSummaryTool.py b/Tracking/TrkTools/TrkTrackSummaryTool/python/AtlasTrackSummaryTool.py index 2c8f21f1f8c384917002ef27346854810f51d291..a85426e275d7964016d1be2101d83d47d14f0362 100755 --- a/Tracking/TrkTools/TrkTrackSummaryTool/python/AtlasTrackSummaryTool.py +++ b/Tracking/TrkTools/TrkTrackSummaryTool/python/AtlasTrackSummaryTool.py @@ -43,14 +43,24 @@ class AtlasTrackSummaryTool( Trk__TrackSummaryTool ): ToolSvc += AtlasPrdAssociationTool #print AtlasPrdAssociationTool + # + # Setup Boundary Check Tool + # + from InDetBoundaryCheckTool.InDetBoundaryCheckToolConf import InDet__InDetBoundaryCheckTool + AtlasBoundaryCheckTool = InDet__InDetBoundaryCheckTool( + name="AtlasBoundaryCheckTool", + UsePixel = DetFlags.haveRIO.pixel_on(), + UseSCT = DetFlags.haveRIO.SCT_on() + ) + ToolSvc += AtlasBoundaryCheckTool + # # Loading Configurable HoleSearchTool # from InDetTrackHoleSearch.InDetTrackHoleSearchConf import InDet__InDetTrackHoleSearchTool AtlasHoleSearchTool = InDet__InDetTrackHoleSearchTool(name = "AtlasHoleSearchTool", Extrapolator = AtlasExtrapolator, - usePixel = DetFlags.haveRIO.pixel_on(), - useSCT = DetFlags.haveRIO.SCT_on() + BoundaryCheckTool=AtlasBoundaryCheckTool ) ToolSvc += AtlasHoleSearchTool #print AtlasHoleSearchTool diff --git a/Tracking/TrkVertexFitter/TrkVertexFitterUtils/test/ImpactPoint3dEstimator_test.cxx b/Tracking/TrkVertexFitter/TrkVertexFitterUtils/test/ImpactPoint3dEstimator_test.cxx index a840d7c9b9912b44375489f631b979bbbb82c561..78ae4f18635fa47787c04f1879adf10fe0075ef5 100644 --- a/Tracking/TrkVertexFitter/TrkVertexFitterUtils/test/ImpactPoint3dEstimator_test.cxx +++ b/Tracking/TrkVertexFitter/TrkVertexFitterUtils/test/ImpactPoint3dEstimator_test.cxx @@ -157,7 +157,7 @@ void createNewtonTrkDistanceFinderCondData(SGTest::TestStore &store) { { std::unique_ptr<MagField::AtlasFieldMap> fieldMap=getFieldMap("MagneticFieldMaps/bfieldmap_7730_20400_14m.root",7730,20400); auto fieldCondObj = std::make_unique<AtlasFieldCacheCondObj>(); - assert( fieldCondObj->initialize(1. /*solenoid current scale factor*/, 1. /*toroid current scale factor*/, fieldMap.release())); + fieldCondObj->initialize(1. /*solenoid current scale factor*/, 1. /*toroid current scale factor*/, fieldMap.release()); assert( fieldHandle.record(r1_1, std::move(fieldCondObj)).isSuccess()); } } diff --git a/Tracking/TrkVertexFitter/TrkVertexSeedFinderUtils/src/GaussianTrackDensity.cxx b/Tracking/TrkVertexFitter/TrkVertexSeedFinderUtils/src/GaussianTrackDensity.cxx index 7be55385a3cb8c6763de926c6767f5e23bc6af79..146e7e668c011e8134bf8989217cfa14faacc421 100644 --- a/Tracking/TrkVertexFitter/TrkVertexSeedFinderUtils/src/GaussianTrackDensity.cxx +++ b/Tracking/TrkVertexFitter/TrkVertexSeedFinderUtils/src/GaussianTrackDensity.cxx @@ -112,14 +112,11 @@ namespace Trk const double d0SignificanceCut = m_d0MaxSignificance * m_d0MaxSignificance; const double z0SignificanceCut = m_z0MaxSignificance * m_z0MaxSignificance; - for (const TrackParameters* iparam : perigeeList) - { - const Perigee* itrk = dynamic_cast<const Perigee*>(iparam); - if (itrk != nullptr) - { - density.addTrack (*itrk, - d0SignificanceCut, - z0SignificanceCut); + for (const TrackParameters* iparam : perigeeList) { + if (iparam && iparam->surfaceType() == Trk::Surface::Perigee) { + density.addTrack(*(static_cast<const Perigee*>(iparam)), + d0SignificanceCut, + z0SignificanceCut); } } } @@ -129,12 +126,12 @@ namespace Trk GaussianTrackDensity::TrackEntry::TrackEntry(double c0, double c1, double c2, - double zMin, double zMax) + double zMin, double zMax) : c_0(c0), c_1(c1), c_2(c2), lowerBound(zMin), upperBound(zMax) { } // Dummy constructor for binary search - GaussianTrackDensity::TrackEntry::TrackEntry(double z) + GaussianTrackDensity::TrackEntry::TrackEntry(double z) : c_0(0), c_1(0), c_2(0), lowerBound(z), upperBound(z) { } @@ -149,10 +146,10 @@ namespace Trk double GaussianTrackDensity::TrackDensity::trackDensity (double z) const { double firstDeriv, secondDeriv = 0; // unused in this case - double density = 0; + double density = 0; // use the existing trackDensity method to avoid duplication of logic - trackDensity(z,density,firstDeriv,secondDeriv); - return density; + trackDensity(z,density,firstDeriv,secondDeriv); + return density; } @@ -168,14 +165,14 @@ namespace Trk { TrackDensityEval densityResult(z); for (const auto & trackAndPerigeePair : m_lowerMap){ - densityResult.addTrack(trackAndPerigeePair.first); + densityResult.addTrack(trackAndPerigeePair.first); } density = densityResult.density(); firstDerivative = densityResult.firstDerivative(); - secondDerivative = densityResult.secondDerivative(); + secondDerivative = densityResult.secondDerivative(); } - std::pair<double,double> + std::pair<double,double> GaussianTrackDensity::TrackDensity::globalMaximumWithWidth (MsgStream& msg) const { // strategy: @@ -200,7 +197,7 @@ namespace Trk double slope = 0.0; double curvature = 0.0; trackDensity( trialZ, density, slope, curvature ); - if ( curvature >= 0.0 || density <= 0.0 ) continue; + if ( curvature >= 0.0 || density <= 0.0 ) continue; updateMaximum( trialZ, density, curvature, maximumPosition, maximumDensity, maxCurvature); trialZ += stepSize( density, slope, curvature ); trackDensity( trialZ, density, slope, curvature ); diff --git a/Tracking/TrkVertexFitter/TrkVertexSeedFinderUtils/test/NewtonTrkDistanceFinder_test.cxx b/Tracking/TrkVertexFitter/TrkVertexSeedFinderUtils/test/NewtonTrkDistanceFinder_test.cxx index 26e529b58fa8dc04e1c341b278d5642bde034066..be7fb26d3caf07f678c6b387d01d086fa3a7bca9 100644 --- a/Tracking/TrkVertexFitter/TrkVertexSeedFinderUtils/test/NewtonTrkDistanceFinder_test.cxx +++ b/Tracking/TrkVertexFitter/TrkVertexSeedFinderUtils/test/NewtonTrkDistanceFinder_test.cxx @@ -133,7 +133,7 @@ void createNewtonTrkDistanceFinderCondData(SGTest::TestStore &store) { { std::unique_ptr<MagField::AtlasFieldMap> fieldMap=getFieldMap("MagneticFieldMaps/bfieldmap_7730_20400_14m.root",7730,20400); auto fieldCondObj = std::make_unique<AtlasFieldCacheCondObj>(); - assert( fieldCondObj->initialize(1. /*solenoid current scale factor*/, 1. /*toroid current scale factor*/, fieldMap.release())); + fieldCondObj->initialize(1. /*solenoid current scale factor*/, 1. /*toroid current scale factor*/, fieldMap.release()); assert( fieldHandle.record(r1_1, std::move(fieldCondObj)).isSuccess()); } } diff --git a/Tracking/TrkVertexFitter/TrkVertexSeedFinderUtils/test/SeedNewtonTrkDistanceFinder_test.cxx b/Tracking/TrkVertexFitter/TrkVertexSeedFinderUtils/test/SeedNewtonTrkDistanceFinder_test.cxx index 22ff9744f713391cb33b51c573b79d79637c30fe..ad910f01235d38ca3006623af0cccdff7fb8467e 100644 --- a/Tracking/TrkVertexFitter/TrkVertexSeedFinderUtils/test/SeedNewtonTrkDistanceFinder_test.cxx +++ b/Tracking/TrkVertexFitter/TrkVertexSeedFinderUtils/test/SeedNewtonTrkDistanceFinder_test.cxx @@ -140,7 +140,7 @@ void createNewtonTrkDistanceFinderCondData(SGTest::TestStore &store) { { std::unique_ptr<MagField::AtlasFieldMap> fieldMap=getFieldMap("MagneticFieldMaps/bfieldmap_7730_20400_14m.root",7730,20400); auto fieldCondObj = std::make_unique<AtlasFieldCacheCondObj>(); - assert( fieldCondObj->initialize(1. /*solenoid current scale factor*/, 1. /*toroid current scale factor*/, fieldMap.release())); + fieldCondObj->initialize(1. /*solenoid current scale factor*/, 1. /*toroid current scale factor*/, fieldMap.release()); assert( fieldHandle.record(r1_1, std::move(fieldCondObj)).isSuccess()); } } diff --git a/Tracking/TrkVertexFitter/TrkVertexSeedFinderUtils/test/Trk2DDistanceFinder_test.cxx b/Tracking/TrkVertexFitter/TrkVertexSeedFinderUtils/test/Trk2DDistanceFinder_test.cxx index 062e116d362fab8a3dfa432eb02103ce454e6eac..8b63ea0e03bc7f5f43ab39aaf7700e171004e894 100644 --- a/Tracking/TrkVertexFitter/TrkVertexSeedFinderUtils/test/Trk2DDistanceFinder_test.cxx +++ b/Tracking/TrkVertexFitter/TrkVertexSeedFinderUtils/test/Trk2DDistanceFinder_test.cxx @@ -146,7 +146,7 @@ void createNewtonTrkDistanceFinderCondData(SGTest::TestStore &store) { { std::unique_ptr<MagField::AtlasFieldMap> fieldMap=getFieldMap("MagneticFieldMaps/bfieldmap_7730_20400_14m.root",7730,20400); auto fieldCondObj = std::make_unique<AtlasFieldCacheCondObj>(); - assert( fieldCondObj->initialize(1. /*solenoid current scale factor*/, 1. /*toroid current scale factor*/, fieldMap.release())); + fieldCondObj->initialize(1. /*solenoid current scale factor*/, 1. /*toroid current scale factor*/, fieldMap.release()); assert( fieldHandle.record(r1_1, std::move(fieldCondObj)).isSuccess()); } } diff --git a/Tracking/TrkVertexFitter/TrkVertexSeedFinderUtils/test/Trk2dDistanceSeeder_test.cxx b/Tracking/TrkVertexFitter/TrkVertexSeedFinderUtils/test/Trk2dDistanceSeeder_test.cxx index 092b263580100a8314c78a28778f0e554cb32ebf..c44be7730464425084b14289083330a3d6146e4b 100644 --- a/Tracking/TrkVertexFitter/TrkVertexSeedFinderUtils/test/Trk2dDistanceSeeder_test.cxx +++ b/Tracking/TrkVertexFitter/TrkVertexSeedFinderUtils/test/Trk2dDistanceSeeder_test.cxx @@ -165,7 +165,7 @@ void createNewtonTrkDistanceFinderCondData(SGTest::TestStore &store) { { std::unique_ptr<MagField::AtlasFieldMap> fieldMap=getFieldMap("MagneticFieldMaps/bfieldmap_7730_20400_14m.root",7730,20400); auto fieldCondObj = std::make_unique<AtlasFieldCacheCondObj>(); - assert( fieldCondObj->initialize(1. /*solenoid current scale factor*/, 1. /*toroid current scale factor*/, fieldMap.release())); + fieldCondObj->initialize(1. /*solenoid current scale factor*/, 1. /*toroid current scale factor*/, fieldMap.release()); assert( fieldHandle.record(r1_1, std::move(fieldCondObj)).isSuccess()); } } diff --git a/Trigger/TrigAlgorithms/TrigCaloRec/src/HLTCaloCellMaker.cxx b/Trigger/TrigAlgorithms/TrigCaloRec/src/HLTCaloCellMaker.cxx index 7966ff386d1a406159ef92cb20688a6308d64ea5..131c2e98954e3ac382d60c64ce4d526cec51c6ef 100644 --- a/Trigger/TrigAlgorithms/TrigCaloRec/src/HLTCaloCellMaker.cxx +++ b/Trigger/TrigAlgorithms/TrigCaloRec/src/HLTCaloCellMaker.cxx @@ -67,7 +67,7 @@ StatusCode HLTCaloCellMaker::execute( const EventContext& context ) const { // datahandle if ( m_roiMode ) { if ( roiCollection->size() > 1 ) - ATH_MSG_INFO ( "roiMode but multiple rois found, will only use the first one"); + ATH_MSG_DEBUG ( "roiMode but multiple rois found, will only use the first one"); SG::WriteHandle<CaloConstCellContainer > cellContainer = SG::WriteHandle< CaloConstCellContainer > ( m_cellContainerKey, context ); auto cdv = std::make_unique<CaloConstCellContainer>(SG::VIEW_ELEMENTS); @@ -75,7 +75,7 @@ StatusCode HLTCaloCellMaker::execute( const EventContext& context ) const { auto clEta = Monitored::Collection ("Cells_eta",*cdv,&CaloCell::eta); auto clPhi = Monitored::Collection ("Cells_phi",*cdv,&CaloCell::phi); for( const TrigRoiDescriptor* roiDescriptor : *roiCollection) { - ATH_MSG_INFO ( "Running on RoI " << *roiDescriptor<< " FS="<<roiDescriptor->isFullscan()); + ATH_MSG_DEBUG ( "Running on RoI " << *roiDescriptor<< " FS="<<roiDescriptor->isFullscan()); if ( roiDescriptor->isFullscan() ) { ATH_CHECK(m_dataAccessSvc->loadFullCollections( context, *cdv )); cdv->setHasCalo(CaloCell_ID::LAREM); diff --git a/Trigger/TrigAlgorithms/TrigMuonEF/src/MuonFilterAlg.cxx b/Trigger/TrigAlgorithms/TrigMuonEF/src/MuonFilterAlg.cxx index cc2d14c33fbcf15ac3d8ab51a1bc4c43181d9edc..f11b334d1bcba44b9f367e0c042a7c2de0102671 100644 --- a/Trigger/TrigAlgorithms/TrigMuonEF/src/MuonFilterAlg.cxx +++ b/Trigger/TrigAlgorithms/TrigMuonEF/src/MuonFilterAlg.cxx @@ -7,7 +7,7 @@ #include "MuonFilterAlg.h" MuonFilterAlg::MuonFilterAlg(const std::string& name, ISvcLocator* pSvcLocator ) -:AthAlgorithm(name, pSvcLocator) +:AthReentrantAlgorithm(name, pSvcLocator) { @@ -26,12 +26,12 @@ StatusCode MuonFilterAlg::finalize() return StatusCode::SUCCESS; } -StatusCode MuonFilterAlg::execute() +StatusCode MuonFilterAlg::execute(const EventContext& ctx) const { bool pass = false; //Get muon container - SG::ReadHandle<xAOD::MuonContainer> rh_muons(m_muonContainerKey); + SG::ReadHandle<xAOD::MuonContainer> rh_muons(m_muonContainerKey, ctx); if(!rh_muons.isValid()){ ATH_MSG_ERROR("Could not find muons with name: "<<m_muonContainerKey.key()); return StatusCode::FAILURE; @@ -46,7 +46,7 @@ StatusCode MuonFilterAlg::execute() if(nCBmuons==0) pass = true; ATH_MSG_DEBUG("Found: "<<muons->size()<<" muons; pass="<<pass); - setFilterPassed(pass); + setFilterPassed(pass, ctx); return StatusCode::SUCCESS; } diff --git a/Trigger/TrigAlgorithms/TrigMuonEF/src/MuonFilterAlg.h b/Trigger/TrigAlgorithms/TrigMuonEF/src/MuonFilterAlg.h index d73a427fd9472175f525ac8f7da3594447aeac88..42ac73098a86a635780b743c0b58f49e00b5f008 100644 --- a/Trigger/TrigAlgorithms/TrigMuonEF/src/MuonFilterAlg.h +++ b/Trigger/TrigAlgorithms/TrigMuonEF/src/MuonFilterAlg.h @@ -7,11 +7,11 @@ #ifndef TRIGMUONEF_MUONFILTERALG_H #define TRIGMUONEF_MUONFILTERALG_H -#include "AthenaBaseComps/AthAlgorithm.h" +#include "AthenaBaseComps/AthReentrantAlgorithm.h" #include "StoreGate/ReadHandleKey.h" #include "xAODMuon/MuonContainer.h" -class MuonFilterAlg : public AthAlgorithm +class MuonFilterAlg : public AthReentrantAlgorithm { public : @@ -25,7 +25,7 @@ class MuonFilterAlg : public AthAlgorithm StatusCode finalize(); /** execute the filter alg */ - StatusCode execute(); + StatusCode execute(const EventContext& ctx) const; private : diff --git a/Trigger/TrigAlgorithms/TrigT2BeamSpot/TrigT2BeamSpot/T2VertexBeamSpot.h b/Trigger/TrigAlgorithms/TrigT2BeamSpot/TrigT2BeamSpot/T2VertexBeamSpot.h index 21bc51b5fdb6ecb5ed72aa4c2a819f69bc74343b..66b394a62deeba81b0bb3d02faea843e8a6e215b 100644 --- a/Trigger/TrigAlgorithms/TrigT2BeamSpot/TrigT2BeamSpot/T2VertexBeamSpot.h +++ b/Trigger/TrigAlgorithms/TrigT2BeamSpot/TrigT2BeamSpot/T2VertexBeamSpot.h @@ -104,7 +104,7 @@ namespace PESA { virtual StatusCode initialize() final; - SG::ReadHandleKeyArray<TrackCollection> m_trackCollections; /*Input list of track collection names which should be used for the algorithms*/ + SG::ReadHandleKey<TrackCollection> m_trackCollectionKey; /*track collection name which should be used for the algorithms*/ //The same as in Run2 (m_vertexCollName) SG::WriteHandleKey<TrigVertexCollection> m_outputVertexCollectionKey; diff --git a/Trigger/TrigAlgorithms/TrigT2BeamSpot/src/T2VertexBeamSpot.cxx b/Trigger/TrigAlgorithms/TrigT2BeamSpot/src/T2VertexBeamSpot.cxx index 0d65b6ebb719f866055ddf6a6c379cc8b5866c71..b64d686df2874d185416c142e3618648d6e94e9c 100644 --- a/Trigger/TrigAlgorithms/TrigT2BeamSpot/src/T2VertexBeamSpot.cxx +++ b/Trigger/TrigAlgorithms/TrigT2BeamSpot/src/T2VertexBeamSpot.cxx @@ -53,10 +53,10 @@ HLT::TEVec getAllTEs(const std::vector<HLT::TEVec>& tes_in){ T2VertexBeamSpot::T2VertexBeamSpot( const std::string& name, ISvcLocator* pSvcLocator ) : HLT::AllTEAlgo(name, pSvcLocator){ - declareProperty( "TrackCollections", m_trackCollections = {"TrigFastTrackFinder_Tracks"} ); - declareProperty( "VertexCollection", m_outputVertexCollectionKey = "myVertices" ); + declareProperty( "TrackCollection", m_trackCollectionKey = "TrigFastTrackFinder_Tracks" ); + declareProperty( "VertexCollection", m_outputVertexCollectionKey = "myVertices" ); - declareProperty("vertexCollName", m_vertexCollName = "TrigBeamSpotVertex"); + declareProperty("vertexCollName", m_vertexCollName = "TrigBeamSpotVertex"); @@ -161,7 +161,7 @@ HLT::ErrorCode T2VertexBeamSpot::hltExecute( std::vector< HLT::TEVec >& tes_in, auto nPerVecTEHighPTTracks = Monitored::Scalar<unsigned>("nPerVecTEHighPTTracks"); //Loop over Trigger Elements - for ( HLT::TriggerElement* TE : iTE){ + for ( HLT::TriggerElement* TE : iTE){ //Monitor how long does it take to loop over each trigger element auto tTE = Monitored::Timer("TIME_EachTE"); @@ -183,7 +183,7 @@ HLT::ErrorCode T2VertexBeamSpot::hltExecute( std::vector< HLT::TEVec >& tes_in, m_beamSpotTool->selectTracks( tracks, mySelectedTrackCollection, nTracks ); //Increment counters per TE - nPerTETracks += nTracks[0]; + nPerTETracks += nTracks[0]; nPerTEPassedTracks += nTracks[1]; nPerTEHighPTTracks += nTracks[2]; } @@ -216,14 +216,14 @@ HLT::ErrorCode T2VertexBeamSpot::hltExecute( std::vector< HLT::TEVec >& tes_in, } //End part of track selection - ATH_MSG_DEBUG( "Number of all Tracks: "<< nAllTracks <<" Selected Tracks: " << nSelectedTracks << " highPt Tracks: " << nHighPtTracks ); + ATH_MSG_DEBUG( "Number of all Tracks: "<< nAllTracks <<" Selected Tracks: " << nSelectedTracks << " highPt Tracks: " << nHighPtTracks ); if ( !m_beamSpotTool->isHighPTTrack( nHighPtTracks ) ) { ATH_MSG_DEBUG( " No seed tracks for vertex"); break; } - + m_beamSpotTool->eventStage( hasSeedTrack ); @@ -258,7 +258,7 @@ HLT::ErrorCode T2VertexBeamSpot::hltExecute( std::vector< HLT::TEVec >& tes_in, HLT::TEVec allTEs = getAllTEs(tes_in); ATH_MSG_DEBUG( "n of all TEs: " << allTEs.size() ); - //Check how many vertices passed the selection + //Check how many vertices passed the selection unsigned int nPassedVtx = m_beamSpotTool->m_NvtxPass; //Save all events, or only those events which pass the Npv cuts (if activated)! @@ -397,10 +397,10 @@ StatusCode T2VertexBeamSpot::initialize() { return StatusCode::FAILURE; } - ATH_CHECK( m_trackCollections.initialize() ); + ATH_CHECK( m_trackCollectionKey.initialize() ); - ATH_CHECK( m_outputVertexCollectionKey.initialize() ); + ATH_CHECK( m_outputVertexCollectionKey.initialize() ); ATH_CHECK( m_eventInfoKey.initialize() ); @@ -420,7 +420,7 @@ StatusCode T2VertexBeamSpot::execute(){ - //Reset monitored variables from previous event + //Reset monitored variables from previous event m_beamSpotTool->resetMonitoredVariables(); // Initialize booleans for event stats m_beamSpotTool->m_eventStageFlag = std::vector<bool>( numStatistics, false ); @@ -462,22 +462,20 @@ StatusCode T2VertexBeamSpot::execute(){ auto nTotalPassedTracks = Monitored::Scalar<unsigned>("nTotalPassedTracks"); auto nTotalHighPTTracks = Monitored::Scalar<unsigned>("nTotalHighPTTracks"); //Loop over track collections and select tracks - for (SG::ReadHandleKey<TrackCollection> trackCollectionKey : m_trackCollections) { - SG::ReadHandle<TrackCollection> trackCollection (trackCollectionKey); - ATH_CHECK(trackCollection.isValid()); + SG::ReadHandle<TrackCollection> trackCollection (m_trackCollectionKey); + ATH_CHECK(trackCollection.isValid()); - //Dereference tracks - const TrackCollection* tracks = trackCollection.cptr(); + //Dereference tracks + const TrackCollection* tracks = trackCollection.cptr(); - //Select tracks - std::vector<unsigned> trackCounter(3,0);//returning all tracks[0]/passed tracks[1]/ hipt tracks[2] counts - m_beamSpotTool->selectTracks( tracks, mySelectedTrackCollection, trackCounter ); + //Select tracks + std::vector<unsigned> trackCounter(3,0);//returning all tracks[0]/passed tracks[1]/ hipt tracks[2] counts + m_beamSpotTool->selectTracks( tracks, mySelectedTrackCollection, trackCounter ); - //FIXME: make a counter class - nTotalTracks += trackCounter[0]; - nTotalPassedTracks += trackCounter[1]; - nTotalHighPTTracks += trackCounter[2]; - } + //FIXME: make a counter class + nTotalTracks += trackCounter[0]; + nTotalPassedTracks += trackCounter[1]; + nTotalHighPTTracks += trackCounter[2]; //Store counts for all/highPt/selected tracks nAllTracks = nTotalTracks; diff --git a/Trigger/TrigAlgorithms/TrigT2CaloCommon/python/CaloDef.py b/Trigger/TrigAlgorithms/TrigT2CaloCommon/python/CaloDef.py index 75586fc0e253c84802aac1629392540ff8649b0c..c9e9100b8470306e655f4e5a5b72cae5cf03c4c2 100644 --- a/Trigger/TrigAlgorithms/TrigT2CaloCommon/python/CaloDef.py +++ b/Trigger/TrigAlgorithms/TrigT2CaloCommon/python/CaloDef.py @@ -110,7 +110,7 @@ def createFastCaloSequence(EMRoIDecisions, doRinger=False, ClustersName="HLT_Fas def clusterFSInputMaker( ): """Creates the inputMaker for FS in menu""" - RoIs = 'FSJETRoI' + RoIs = 'HLT_FSJETRoI' from AthenaConfiguration.ComponentFactory import CompFactory InputMakerAlg = CompFactory.InputMakerForRoI("IMclusterFS", RoIsLink="initialRoI") InputMakerAlg.RoITool = CompFactory.ViewCreatorInitialROITool() @@ -118,11 +118,11 @@ def clusterFSInputMaker( ): return InputMakerAlg -def HLTCellMaker(RoIs='FSJETRoI', outputName="CaloCells", algSuffix=""): +def HLTCellMaker(RoIs='HLT_FSJETRoI', outputName="CaloCells", algSuffix=""): cellMakerAlgo = _algoHLTCaloCell(name="HLTCaloCellMaker"+algSuffix, inputEDM=RoIs, outputEDM=outputName, RoIMode=True) return cellMakerAlgo -def HLTFSCellMakerRecoSequence(RoIs='FSJETRoI'): +def HLTFSCellMakerRecoSequence(RoIs='HLT_FSJETRoI'): cellMaker = HLTCellMaker(RoIs, outputName="CaloCellsFS", algSuffix="FS") RecoSequence = parOR("ClusterRecoSequenceFS", [cellMaker]) return (RecoSequence, cellMaker.CellsName) diff --git a/Trigger/TrigAnalysis/TrigBunchCrossingTool/CMakeLists.txt b/Trigger/TrigAnalysis/TrigBunchCrossingTool/CMakeLists.txt index 05ba7baf390283aff64f989f516ee870284099f5..834dee0deff3d2596a97caefac4b54c89a544d2a 100644 --- a/Trigger/TrigAnalysis/TrigBunchCrossingTool/CMakeLists.txt +++ b/Trigger/TrigAnalysis/TrigBunchCrossingTool/CMakeLists.txt @@ -46,18 +46,5 @@ atlas_add_test( ut_static_bunch_tool_test LINK_LIBRARIES ${ROOT_LIBRARIES} AsgTools xAODEventInfo xAODTrigger TrigConfL1Data TrigAnalysisInterfaces ) -atlas_add_test( ut_web_bunch_tool_test - SOURCES - test/ut_web_bunch_tool_test.cxx - Root/BunchCrossing.cxx - Root/BunchTrain.cxx - Root/BunchCrossingToolBase.cxx - Root/WebBunchCrossingTool.cxx - Root/count_bunch_neighbors.cxx - INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} - LINK_LIBRARIES ${ROOT_LIBRARIES} AsgTools xAODEventInfo xAODTrigger - TrigConfL1Data TrigAnalysisInterfaces - PROPERTIES TIMEOUT 300 ) - # Install files from the package: atlas_install_python_modules( python/*.py POST_BUILD_CMD ${ATLAS_FLAKE8} ) diff --git a/Trigger/TrigAnalysis/TrigBunchCrossingTool/Root/LinkDef.h b/Trigger/TrigAnalysis/TrigBunchCrossingTool/Root/LinkDef.h deleted file mode 100644 index 5f532852a5d31cfe1748189f2bb4530640b92a2c..0000000000000000000000000000000000000000 --- a/Trigger/TrigAnalysis/TrigBunchCrossingTool/Root/LinkDef.h +++ /dev/null @@ -1,35 +0,0 @@ -// Dear emacs, this is -*- c++ -*- - -/* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration -*/ - -// $Id: LinkDef.h 618129 2014-09-23 11:37:00Z krasznaa $ -#ifndef TRIGBUNCHCROSSINGTOOL_LINKDEF_H -#define TRIGBUNCHCROSSINGTOOL_LINKDEF_H - -// Local include(s): -#include "TrigBunchCrossingTool/BunchCrossingToolBase.h" -#include "TrigBunchCrossingTool/D3PDBunchCrossingTool.h" -#include "TrigBunchCrossingTool/StaticBunchCrossingTool.h" -#include "TrigBunchCrossingTool/WebBunchCrossingTool.h" - -#ifdef __CINT__ - -#pragma link off all globals; -#pragma link off all classes; -#pragma link off all functions; - -#pragma link C++ nestedclass; - -// Extra dictionary for reading the configuration data: -#pragma link C++ class vector<float>+; - -// Dictionaries for the concrete tools: -#pragma link C++ class Trig::BunchCrossingToolBase+; -#pragma link C++ class Trig::D3PDBunchCrossingTool+; -#pragma link C++ class Trig::StaticBunchCrossingTool+; -#pragma link C++ class Trig::WebBunchCrossingTool+; - -#endif // __CINT__ -#endif // TRIGBUNCHCROSSINGTOOL_LINKDEF_H diff --git a/Trigger/TrigAnalysis/TrigBunchCrossingTool/Root/WebBunchCrossingTool.cxx b/Trigger/TrigAnalysis/TrigBunchCrossingTool/Root/WebBunchCrossingTool.cxx deleted file mode 100644 index 56e6bcc8bbecbb06bf1cb8aa9c0b0cb71b4ae737..0000000000000000000000000000000000000000 --- a/Trigger/TrigAnalysis/TrigBunchCrossingTool/Root/WebBunchCrossingTool.cxx +++ /dev/null @@ -1,644 +0,0 @@ -/* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration -*/ - -// $Id: WebBunchCrossingTool.cxx 745783 2016-05-10 06:47:18Z krasznaa $ - -// System include(s): -#include <sstream> -#include <iostream> - -// ROOT include(s): -#include "TSocket.h" -#include "TUrl.h" -#include "TString.h" - -// xAOD include(s): -#include "xAODEventInfo/EventInfo.h" - -// Local include(s): -#include "TrigBunchCrossingTool/WebBunchCrossingTool.h" -#include "TrigBunchCrossingTool/BunchCrossing.h" -#include "json/elements.h" -#include "json/reader.h" - -namespace Trig { - - /// Address of the default trigger configuration server - static const char* TRIGCONF_ADDRESS = "atlas-trigconf.cern.ch"; - /// Folder for the bunchgroup configuration - static const char* TRIGCONF_BGFOLDER = "bunchgroups"; - /// Port of the trigger configuration web server - static const Int_t TRIGCONF_PORT = 80; - /// Default timeout in miliseconds for reading the webpages - static const Long_t TRIGCONF_TIMEOUT = 20000; - /// Code of the collision bunch crossings - static const Int_t COLLISION_BUNCHGROUP_INDEX = 1; - /// First index of the unpaired bunch crossings - static const Int_t UNPAIRED_BUNCHGROUP_1_INDEX = 4; - /// Second index of the unpaired bunch crossings - static const Int_t UNPAIRED_BUNCHGROUP_2_INDEX = 5; - - /// Output operator for IOV objects - MsgStream& operator<< ( MsgStream& stream, - const WebBunchCrossingTool::IOV& iov ); - - WebBunchCrossingTool::WebBunchCrossingTool( const std::string& name ) - : BunchCrossingToolBase( name ), - m_bgkey( -1 ), m_iov( 0, 0 ), m_knownConfigs(), - m_configMap() { - - declareProperty( "ServerAddress", m_serverAddress = TRIGCONF_ADDRESS ); - declareProperty( "ServerTimeout", m_serverTimeout = TRIGCONF_TIMEOUT ); - } - - /** - * This is the fairly complicated function which (if necessary) loads the - * configuration belonging to BG key "bgkey" from either the internal cache - * of the tool, or from the atlas-trigconf.cern.ch webpage directly. - * - * @param bgkey The bunch group key that should be loaded - * @returns <code>StatusCode::SUCCESS</code> if the operation was successful, - * or <code>StatusCode::FAILURE</code> if it wasn't - */ - StatusCode WebBunchCrossingTool::loadConfig( int bgkey ) { - - // - // Check if this is the currently loaded configuration or not: - // - if( bgkey == m_bgkey ) { - ATH_MSG_VERBOSE( "BGKey " << bgkey << " already loaded" ); - return StatusCode::SUCCESS; - } - - // Set the IOV to an invalid state. Since whatever happens next, we - // can't know for sure which IOV the loaded configuration corresponds to. - m_iov = IOV( 0, 0 ); - - // - // If not loaded, check if its configuration is already known: - // - std::map< int, std::pair< std::vector< int >, - std::vector< int > > >::const_iterator - conf_itr = m_knownConfigs.find( bgkey ); - if( conf_itr != m_knownConfigs.end() ) { - - ATH_MSG_DEBUG( "BGKey " << bgkey - << " already known, loading from cache" ); - - // Let the base class load this configuration: - ATH_CHECK( loadSingleBunches( conf_itr->second.first ) ); - ATH_CHECK( loadBunchTrains( conf_itr->second.first ) ); - ATH_CHECK( loadUnpairedBunches( conf_itr->second.second, - conf_itr->second.second ) ); - m_bgkey = bgkey; - - // Print the configuration to give some feedback to the user: - ATH_MSG_INFO( "Loaded bunch group key " << m_bgkey ); - printConfig(); - - // Return gracefully: - return StatusCode::SUCCESS; - } - - // Let the user know what we're doing: - ATH_MSG_DEBUG( "Requesting new BG key (" << bgkey << ") from database" ); - - // - // If this is a completely unknown configuration, read the JSON - // configuration from the webpage: - // - std::ostringstream conn; - conn << TRIGCONF_BGFOLDER << "?key=" << bgkey << "&type=json"; - const std::string json_data = readJSONConfig( conn.str().c_str() ); - ATH_MSG_VERBOSE( "JSON data: " << json_data ); - - // - // Parse the JSON data: - // - std::istringstream json_stream( json_data ); - json::Array bgsets; - try { - json::Reader::Read( bgsets, json_stream ); - } catch( const json::Reader::ParseException& e ) { - ATH_MSG_ERROR( "JSON parse exception on string: " - << json_data ); - ATH_MSG_ERROR( "What: " << e.what() << ", line/offset: " - << e.m_locTokenBegin.m_nLine + 1 << "/" - << e.m_locTokenBegin.m_nLineOffset + 1 ); - return StatusCode::FAILURE; - } catch( const json::Reader::ScanException& e ) { - ATH_MSG_ERROR( "JSON scan exception on string: " - << json_data ); - ATH_MSG_ERROR( "What: " << e.what() << ", line/offset: " - << e.m_locError.m_nLine + 1 << "/" - << e.m_locError.m_nLineOffset + 1 ); - return StatusCode::FAILURE; - } catch(...) { - ATH_MSG_ERROR( "Unknown exception caught while parsing JSON string: " - << json_data ); - return StatusCode::FAILURE; - } - - // BCIDs of the collision bunch crossings: - std::vector< int > filledBcids; - // BCIDs of the unpaired bunch crossings: - std::vector< int > unpairedBcids; - - // - // Now interpret the JSON data: - // - try { - - // A little sanity check: - if( bgsets.Size() != 1 ) { - ATH_MSG_ERROR( "Unexpected size (" << bgsets.Size() - << ") for the configuration" ); - return StatusCode::FAILURE; - } - - // Access the only bunhgroup set: - const json::Object& bgset = bgsets[ 0 ]; - const json::Array& bunchGroups = bgset[ "code" ]; - - // Make a check on the BG key provided: - const json::Number& jsbgkey = bgset[ "bgkey" ]; - if( static_cast< int >( jsbgkey.Value() ) != bgkey ) { - ATH_MSG_ERROR( "The webpage provided the configuration of the " - "wrong BGKey!" ); - ATH_MSG_ERROR( "Provided key " << jsbgkey.Value() - << ", should've been: " << bgkey ); - return StatusCode::FAILURE; - } - - // Another sanity check: - if( ( bunchGroups.Size() != 8 ) && ( bunchGroups.Size() != 16 ) ) { - ATH_MSG_ERROR( "Received information about " - << bunchGroups.Size() << " bunch groups " - << "(!=8|16)" ); - return StatusCode::FAILURE; - } - - // Select the collision bunch group: - const json::Array& jbcids = bunchGroups[ COLLISION_BUNCHGROUP_INDEX ]; - - // Add each collision bcid to our std::vector: - json::Array::const_iterator itr = jbcids.Begin(); - json::Array::const_iterator end = jbcids.End(); - for( ; itr != end; ++itr ) { - const json::Number& bcid = *itr; - filledBcids.push_back( static_cast< int >( bcid.Value() ) ); - } - - // Select the first unpaired bunch group: - const json::Array& jbcids1 = - bunchGroups[ UNPAIRED_BUNCHGROUP_1_INDEX ]; - itr = jbcids1.Begin(); - end = jbcids1.End(); - for( ; itr != end; ++itr ) { - const json::Number& bcid = *itr; - unpairedBcids.push_back( static_cast< int >( bcid.Value() ) ); - } - - // Select the second unpaired bunch group: - const json::Array& jbcids2 = - bunchGroups[ UNPAIRED_BUNCHGROUP_2_INDEX ]; - itr = jbcids2.Begin(); - end = jbcids2.End(); - for( ; itr != end; ++itr ) { - const json::Number& bcid = *itr; - unpairedBcids.push_back( static_cast< int >( bcid.Value() ) ); - } - - } catch( const json::Exception& ex ) { - ATH_MSG_ERROR( "Caught JSON exception while parsing configuration" ); - ATH_MSG_ERROR( "What: " << ex.what() ); - return StatusCode::FAILURE; - } - - // - // Now let the base class interpret the configuration: - // - ATH_CHECK( loadSingleBunches( filledBcids ) ); - ATH_CHECK( loadBunchTrains( filledBcids ) ); - ATH_CHECK( loadUnpairedBunches( unpairedBcids, unpairedBcids ) ); - - // Remember which BG key we just loaded: - m_bgkey = bgkey; - m_knownConfigs[ bgkey ] = std::make_pair( filledBcids, unpairedBcids ); - // Unfortunately we don't get IOVs (at least not meaningful ones) in this - // case. - - // Print the configuration to give some feedback to the user: - ATH_MSG_INFO( "Loaded bunch group key " << m_bgkey ); - printConfig(); - - // Return gracefully: - return StatusCode::SUCCESS; - } - - /** - * This function can be used to load the bunch structure information for a - * given run and luminosity block number. - * - * First the function checks in its cache which BG key this period - * corresponds to. If the requested luminosity block is already known in the - * cache, then the function asks loadConfig(int) to load the configuration. - * If the luminosity block is not known, the function reads the configuration - * for the entire run from the webpage, and lets cacheJSONConfig(...) load it - * into the internal cache. After the new configuration is cached, the - * function calls itself recursively, because this time it will know right - * away what to do. - * - * @param run The run number of the data you're analysing - * @param lb The luminosity block number of the data you're analysing - * @returns <code>StatusCode::SUCCESS</code> if the configuration was loaded - * successfully, or <code>StatusCode::FAILURE</code> if it wasn't - */ - StatusCode WebBunchCrossingTool::loadConfig( unsigned int run, - unsigned int lb ) { - - // Check if we already have this configuration loaded: - if( m_iov == IOV( run, lb ) ) { - return StatusCode::SUCCESS; - } - - // Check if the configuration for this LB is already known: - const IOV iov( run, lb ); - std::map< std::pair< IOV, IOV >, int >::const_iterator c_itr = - m_configMap.begin(); - std::map< std::pair< IOV, IOV >, int >::const_iterator c_end = - m_configMap.end(); - for( ; c_itr != c_end; ++c_itr ) { - if( ( c_itr->first.first <= iov ) && - ( iov < c_itr->first.second ) ) { - // Load the configuration for this BG key (which should be cached - // by now): - ATH_CHECK( loadConfig( c_itr->second ) ); - // Remember the IOV that we just loaded: - m_iov = IOV( run, lb ); - // Return gracefully: - return StatusCode::SUCCESS; - } - } - - // Let the user know what we're doing: - ATH_MSG_DEBUG( "Requesting new run (" << run << ") from database" ); - - // - // Read the full configuration for the run in question from the webpage: - // - std::ostringstream conn; - conn << TRIGCONF_BGFOLDER << "?run=" << run << "&type=json"; - const std::string json_data = readJSONConfig( conn.str().c_str() ); - ATH_MSG_VERBOSE( "JSON data: " << json_data ); - - // Cache this configuration: - ATH_CHECK( cacheJSONConfig( json_data ) ); - - // Instead of trying to find the appropriate entry from the configuration - // cache here, let's just call this very same function again. Now the - // first check should find the requested configuration as being in the - // cache. - ATH_CHECK( loadConfig( run, lb ) ); - - // Return gracefully: - return StatusCode::SUCCESS; - } - - /// This function takes care of keeping the tool up to date with the correct - /// configuration for the currently loaded event. It needs the EventInfo - /// object to do so. - /// - /// @return <code>StatusCode::SUCCESS</code> if the right configuration could - /// be loaded, or <code>StatusCode::FAILURE</code> if not. - /// - StatusCode WebBunchCrossingTool::beginEvent() { - - // Get the EventInfo object: - const xAOD::EventInfo* ei = 0; - ATH_CHECK( evtStore()->retrieve( ei, "EventInfo" ) ); - - // Make sure the right configuration is loaded: - ATH_CHECK( loadConfig( ei->runNumber(), ei->lumiBlock() ) ); - - // Return gracefully: - return StatusCode::SUCCESS; - } - - /** - * I "stole" the implementation of this function from TGHtmlBrowser.cxx. - * Unfortunately ROOT doesn't publish this code to the outside user, so the - * best I could do was to copy-paste it. - * - * The function checks the size of the page "config" on - * http://atlas-trigconf.cern.ch/, so that the readJSONConfig(...) function - * knows how big a memory space to allocate for it. The code doesn't ever - * use the function directly actually. - * - * @param config A page on http://atlas-trigconf.cern.ch/ - * @returns The size of the page in the number of characters - */ - size_t WebBunchCrossingTool::readSize( const char* config ) const { - - // Create a fixed size buffer for the answer of the page: - static const Int_t BUF_SIZE = 4096; - char buf[ BUF_SIZE ]; - - // Construct the message asking for the size of the page: - TString message = "HEAD "; - message += "http://" + m_serverAddress + "/"; - message += config; - message += " HTTP/1.0"; - message += "\r\n"; - message += "User-Agent: ROOT-TWebFile/1.1"; - message += "\r\n\r\n"; - - // Connect to the server: - TSocket socket( m_serverAddress.c_str(), TRIGCONF_PORT ); - if( ! socket.IsValid() ) { - return 0; - } - ATH_MSG_VERBOSE( "Valid socket opened for address: " << m_serverAddress - << " and port: " << TRIGCONF_PORT ); - - // Ask for the information: - if( socket.SendRaw( message.Data(), message.Length() ) == -1 ) { - return 0; - } - ATH_MSG_VERBOSE( "Request sent for getting the page size" ); - - // Wait for data to become available on the socket: - if( socket.Select( TSocket::kRead, m_serverTimeout ) != 1 ) { - ATH_MSG_ERROR( "Couldn't get answer within the " - << m_serverTimeout << " ms timeout" ); - return 0; - } - - // Now read the data: - if( socket.RecvRaw( buf, BUF_SIZE ) == -1 ) { - return 0; - } - ATH_MSG_VERBOSE( "Buffer size message received" ); - - // Extract the size of the page from the reply: - TString reply( buf ); - Ssiz_t idx = reply.Index( "Content-length:", 0, TString::kIgnoreCase ); - if( idx > 0 ) { - idx += 15; - TString slen = reply( idx, reply.Length() - idx ); - return ( size_t ) atol( slen.Data() ); - } - - return 0; - } - - /** - * This function reads any one of the pages from - * http://atlas-trigconf.cern.ch/ and returns its contents as an std::string. - * It could in principle be used to read any of the pages on the server, but - * the code only uses it to read the JSON configurations of the bunch - * structure. - * - * The function relies on the functionality of readSize(...) to first figure - * out how much space to reserve for the download. - * - * I could've returned the page contents as a char* pointer, but didn't want - * to introduce too much manual memory management into the code... - * - * The function is basically a copy-paste of the readRemote(...) function of - * TGHtmlBrowser.cxx. - * - * @param config A page on http://atlas-trigconf.cern.ch/ - * @returns The contents of the requested page - */ - std::string - WebBunchCrossingTool::readJSONConfig( const char* config ) const { - - // The buffer we're going to read the page into: - char *buf = 0; - - // Check how big a buffer to allocate: - Ssiz_t size = readSize( config ); - if( size <= 0 ) size = 1024*1024; - - // Construct the message asking for the page: - TString message = "GET "; - message += "http://" + m_serverAddress + "/"; - message += config; - message += "\r\n"; - - // Connect to the server: - TSocket socket( m_serverAddress.c_str(), TRIGCONF_PORT ); - if( ! socket.IsValid() ) { - return ""; - } - ATH_MSG_VERBOSE( "Valid socket opened for address: " << m_serverAddress - << " and port: " << TRIGCONF_PORT ); - - // Ask for the webpage: - if( socket.SendRaw( message.Data(), message.Length() ) == -1 ) { - return ""; - } - ATH_MSG_VERBOSE( "Request sent for getting the page" ); - - // Wait for data to become available on the socket: - if( socket.Select( TSocket::kRead, m_serverTimeout ) != 1 ) { - ATH_MSG_ERROR( "Couldn't get answer within the " - << m_serverTimeout << " ms timeout" ); - return ""; - } - - // Read the answer of the server: - buf = ( char* ) calloc( size + 1, sizeof( char ) ); - if( socket.RecvRaw( buf, size ) == -1 ) { - free( buf ); - return ""; - } - ATH_MSG_VERBOSE( "Page received" ); - - // Construct the result, and free up all reserved memory: - std::string result( buf ); - free( buf ); - - return result; - } - - /** - * This function receives a JSON configuration string, extracts and stores - * all the configurations it finds in it. - * - * @param data A JSON string - * @returns <code>StatusCode::SUCCESS</code> if the decoding was successful, - * or <code>StatusCode::FAILURE</code> if it wasn't - */ - StatusCode WebBunchCrossingTool::cacheJSONConfig( const std::string& data ) { - - // - // Parse the JSON data: - // - std::istringstream stream( data ); - json::Array bgsets; - try { - json::Reader::Read( bgsets, stream ); - } catch( const json::Reader::ParseException& e ) { - ATH_MSG_ERROR( "JSON parse exception on string: " - << data ); - ATH_MSG_ERROR( "What: " << e.what() << ", line/offset: " - << e.m_locTokenBegin.m_nLine + 1 << "/" - << e.m_locTokenBegin.m_nLineOffset + 1 ); - return StatusCode::FAILURE; - } catch( const json::Reader::ScanException& e ) { - ATH_MSG_ERROR( "JSON scan exception on string: " - << data ); - ATH_MSG_ERROR( "What: " << e.what() << ", line/offset: " - << e.m_locError.m_nLine + 1 << "/" - << e.m_locError.m_nLineOffset + 1 ); - return StatusCode::FAILURE; - } catch(...) { - ATH_MSG_ERROR( "Unknown exception caught while parsing JSON string: " - << data ); - return StatusCode::FAILURE; - } - - // - // Now interpret the JSON data: - // - try { - - // - // Loop over all the configurations: - // - json::Array::const_iterator itr = bgsets.Begin(); - json::Array::const_iterator end = bgsets.End(); - for( ; itr != end; ++itr ) { - - // Access the various parameters of the configuration: - const json::Array& bunchGroups = ( *itr )[ "code" ]; - const json::Number& bgkey = ( *itr )[ "bgkey" ]; - const json::Array& iovs = ( *itr )[ "iov" ]; - const json::Number& run1 = iovs[ 0 ][ 0 ]; - const json::Number& lb1 = iovs[ 0 ][ 1 ]; - const json::Number& run2 = iovs[ 1 ][ 0 ]; - const json::Number& lb2 = iovs[ 1 ][ 1 ]; - - // A sanity check: - if( ( bunchGroups.Size() != 8 ) && ( bunchGroups.Size() != 16 ) ) { - ATH_MSG_ERROR( "Received information about " - << bunchGroups.Size() << " bunch groups " - << "(!=8|16)" ); - return StatusCode::FAILURE; - } - - // BCIDs of the collision bunch crossings: - std::vector< int > filledBcids; - // BCIDs of the unpaired bunch crossings: - std::vector< int > unpairedBcids; - - // Select the collision bunch group: - const json::Array& jbcids = - bunchGroups[ COLLISION_BUNCHGROUP_INDEX ]; - - // Add each collision bcid to our std::vector: - json::Array::const_iterator itr = jbcids.Begin(); - json::Array::const_iterator end = jbcids.End(); - for( ; itr != end; ++itr ) { - const json::Number& bcid = *itr; - filledBcids.push_back( static_cast< int >( bcid.Value() ) ); - } - - // Select the first unpaired bunch group: - const json::Array& jbcids1 = - bunchGroups[ UNPAIRED_BUNCHGROUP_1_INDEX ]; - itr = jbcids1.Begin(); - end = jbcids1.End(); - for( ; itr != end; ++itr ) { - const json::Number& bcid = *itr; - unpairedBcids.push_back( static_cast< int >( bcid.Value() ) ); - } - - // Select the second unpaired bunch group: - const json::Array& jbcids2 = - bunchGroups[ UNPAIRED_BUNCHGROUP_2_INDEX ]; - itr = jbcids2.Begin(); - end = jbcids2.End(); - for( ; itr != end; ++itr ) { - const json::Number& bcid = *itr; - unpairedBcids.push_back( static_cast< int >( bcid.Value() ) ); - } - - // Cache this configuration: - m_knownConfigs[ static_cast< int >( bgkey.Value() ) ] = - std::make_pair( filledBcids, unpairedBcids ); - IOV iov_begin( static_cast< unsigned int >( run1.Value() ), - static_cast< unsigned int >( lb1.Value() ) ); - IOV iov_end( static_cast< unsigned int >( run2.Value() ), - static_cast< unsigned int >( lb2.Value() ) ); - m_configMap[ std::make_pair( iov_begin, iov_end ) ] = - static_cast< int >( bgkey.Value() ); - - ATH_MSG_DEBUG( "Cached configuration for IOV range: " - << iov_begin << " - " << iov_end ); - - } - - } catch( const json::Exception& ex ) { - ATH_MSG_ERROR( "Caught JSON exception while parsing configuration" ); - ATH_MSG_ERROR( "What: " << ex.what() ); - return StatusCode::FAILURE; - } - - // Return gracefully: - return StatusCode::SUCCESS; - } - - WebBunchCrossingTool::IOV::IOV( unsigned int run, unsigned int lb ) - : m_run( run ), m_lb( lb ) { - - } - - unsigned int WebBunchCrossingTool::IOV::run() const { - - return m_run; - } - - unsigned int WebBunchCrossingTool::IOV::lb() const { - - return m_lb; - } - - bool WebBunchCrossingTool::IOV::operator< ( const IOV& rhs ) const { - - if( run() != rhs.run() ) { - return run() < rhs.run(); - } else if( lb() != rhs.lb() ) { - return lb() < rhs.lb(); - } else { - return false; - } - } - - bool WebBunchCrossingTool::IOV::operator<= ( const IOV& rhs ) const { - - if( run() != rhs.run() ) { - return run() < rhs.run(); - } else if( lb() != rhs.lb() ) { - return lb() < rhs.lb(); - } else { - return true; - } - } - - bool WebBunchCrossingTool::IOV::operator== ( const IOV& rhs ) const { - - return ( ( run() == rhs.run() ) && ( lb() == rhs.lb() ) ); - } - - MsgStream& operator<< ( MsgStream& stream, - const WebBunchCrossingTool::IOV& iov ) { - - stream << "[run:" << iov.run() << "; lb:" << iov.lb() << "]"; - return stream; - } - -} // namespace Trig diff --git a/Trigger/TrigAnalysis/TrigBunchCrossingTool/Root/json/README b/Trigger/TrigAnalysis/TrigBunchCrossingTool/Root/json/README deleted file mode 100644 index e2660b65a5d2a23f5592d3370661c1f5cb717af0..0000000000000000000000000000000000000000 --- a/Trigger/TrigAnalysis/TrigBunchCrossingTool/Root/json/README +++ /dev/null @@ -1,10 +0,0 @@ -I've extracted these source files from a package called CAJUN. See here -for details: - -http://cajun-jsonapi.sourceforge.net/ - -However I did need to make some changes in the code to be able to compile it -without warnings inside Athena. So I do consider this an improved version of -the original. - - Attila Krasznahorkay diff --git a/Trigger/TrigAnalysis/TrigBunchCrossingTool/Root/json/elements.h b/Trigger/TrigAnalysis/TrigBunchCrossingTool/Root/json/elements.h deleted file mode 100644 index 3a4a2acc752d159631e0f6ae1639dd552c004db8..0000000000000000000000000000000000000000 --- a/Trigger/TrigAnalysis/TrigBunchCrossingTool/Root/json/elements.h +++ /dev/null @@ -1,265 +0,0 @@ -// Dear emacs, this is -*- c++ -*- -// $Id: elements.h 445480 2011-06-25 18:01:30Z krasznaa $ -/********************************************** - -License: BSD -Project Webpage: http://cajun-jsonapi.sourceforge.net/ -Author: Terry Caton - -***********************************************/ -#ifndef TRIGBUNCHCROSSINGTOOL_JSON_ELEMENTS_H -#define TRIGBUNCHCROSSINGTOOL_JSON_ELEMENTS_H - -// STL include(s): -#include <deque> -#include <list> -#include <string> -#include <stdexcept> - -/* - -TODO: -* better documentation (doxygen?) -* Unicode support -* parent element accessors - -*/ - -namespace json { - - - ///////////////////////////////////////////////// - // forward declarations (more info further below) - class Visitor; - class ConstVisitor; - - template <typename ValueTypeT> - class TrivialType_T; - - typedef TrivialType_T<double> Number; - typedef TrivialType_T<bool> Boolean; - typedef TrivialType_T<std::string> String; - - class Object; - class Array; - class Null; - - - - ///////////////////////////////////////////////////////////////////////// - // Exception - base class for all JSON-related runtime errors - class Exception : public std::runtime_error { - public: - Exception(const std::string& sMessage); - }; - - - ///////////////////////////////////////////////////////////////////////// - // UnknownElement - provides a typesafe surrogate for any of the JSON- - // sanctioned element types. This class allows the Array and Object - // class to effectively contain a heterogeneous set of child elements. - // The cast operators provide convenient implicit downcasting, while - // preserving dynamic type safety by throwing an exception during a - // a bad cast. - // The object & array element index operators (operators [std::string] - // and [size_t]) provide convenient, quick access to child elements. - // They are a logical extension of the cast operators. These child - // element accesses can be chained together, allowing the following - // (when document structure is well-known): - // String str = objInvoices[1]["Customer"]["Company"]; - class UnknownElement { - - public: - UnknownElement(); - UnknownElement( const UnknownElement& unknown ); - UnknownElement( const Object& object ); - UnknownElement( const Array& array ); - UnknownElement( const Number& number ); - UnknownElement( const Boolean& boolean ); - UnknownElement( const String& string ); - UnknownElement( const Null& null ); - - ~UnknownElement(); - - UnknownElement& operator = ( const UnknownElement& unknown ); - - // implicit cast to actual element type. throws on failure - operator const Object& () const; - operator const Array& () const; - operator const Number& () const; - operator const Boolean& () const; - operator const String& () const; - operator const Null& () const; - - // implicit cast to actual element type. *converts* on failure, and always returns success - operator Object& (); - operator Array& (); - operator Number& (); - operator Boolean& (); - operator String& (); - operator Null& (); - - // provides quick access to children when real element type is object - UnknownElement& operator[] ( const std::string& key ); - const UnknownElement& operator[] ( const std::string& key ) const; - - // provides quick access to children when real element type is array - UnknownElement& operator[] ( size_t index ); - const UnknownElement& operator[] ( size_t index ) const; - - // implements visitor pattern - void Accept( ConstVisitor& visitor ) const; - void Accept( Visitor& visitor ); - - // tests equality. first checks type, then value if possible - bool operator == ( const UnknownElement& element ) const; - - private: - class Imp; - - template <typename ElementTypeT> - class Imp_T; - - class CastVisitor; - class ConstCastVisitor; - - template <typename ElementTypeT> - class CastVisitor_T; - - template <typename ElementTypeT> - class ConstCastVisitor_T; - - template <typename ElementTypeT> - const ElementTypeT& CastTo() const; - - template <typename ElementTypeT> - ElementTypeT& ConvertTo(); - - Imp* m_pImp; - }; - - - ///////////////////////////////////////////////////////////////////////////////// - // Array - mimics std::deque<UnknownElement>. The array contents are effectively - // heterogeneous thanks to the ElementUnknown class. push_back has been replaced - // by more generic insert functions. - class Array { - - public: - typedef std::deque< UnknownElement > Elements; - typedef Elements::iterator iterator; - typedef Elements::const_iterator const_iterator; - - iterator Begin(); - iterator End(); - const_iterator Begin() const; - const_iterator End() const; - - iterator Insert( const UnknownElement& element, iterator itWhere ); - iterator Insert( const UnknownElement& element ); - iterator Erase( iterator itWhere ); - void Resize( size_t newSize ); - void Clear(); - - size_t Size() const; - bool Empty() const; - - UnknownElement& operator[] ( size_t index ); - const UnknownElement& operator[] ( size_t index ) const; - - bool operator == (const Array& array) const; - - private: - Elements m_Elements; - }; - - - ///////////////////////////////////////////////////////////////////////////////// - // Object - mimics std::map<std::string, UnknownElement>. The member value - // contents are effectively heterogeneous thanks to the UnknownElement class - class Object { - - public: - struct Member { - Member( const std::string& nameIn = std::string(), - const UnknownElement& elementIn = UnknownElement() ); - - bool operator == ( const Member& member ) const; - - std::string name; - UnknownElement element; - }; - - typedef std::list<Member> Members; // map faster, but does not preserve order - typedef Members::iterator iterator; - typedef Members::const_iterator const_iterator; - - bool operator == ( const Object& object ) const; - - iterator Begin(); - iterator End(); - const_iterator Begin() const; - const_iterator End() const; - - size_t Size() const; - bool Empty() const; - - iterator Find( const std::string& name ); - const_iterator Find( const std::string& name ) const; - - iterator Insert( const Member& member ); - iterator Insert( const Member& member, iterator itWhere ); - iterator Erase( iterator itWhere ); - void Clear(); - - UnknownElement& operator []( const std::string& name ); - const UnknownElement& operator []( const std::string& name ) const; - - private: - class Finder; - - Members m_Members; - }; - - - ///////////////////////////////////////////////////////////////////////////////// - // TrivialType_T - class template for encapsulates a simple data type, such as - // a string, number, or boolean. Provides implicit const & noncost cast operators - // for that type, allowing "DataTypeT type = trivialType;" - template <typename DataTypeT> - class TrivialType_T { - - public: - TrivialType_T( const DataTypeT& t = DataTypeT() ); - - operator DataTypeT&(); - operator const DataTypeT&() const; - - DataTypeT& Value(); - const DataTypeT& Value() const; - - bool operator == ( const TrivialType_T<DataTypeT>& trivial ) const; - - private: - DataTypeT m_tValue; - }; - - - ///////////////////////////////////////////////////////////////////////////////// - // Null - doesn't do much of anything but satisfy the JSON spec. It is the default - // element type of UnknownElement - class Null { - - public: - bool operator == ( const Null& trivial ) const; - }; - - -} // End namespace - -#ifndef __CINT__ -// Include the implementation: -#include "elements.inl" -#endif // __CINT__ - -#endif // TRIGBUNCHCROSSINGTOOL_JSON_ELEMENTS_H diff --git a/Trigger/TrigAnalysis/TrigBunchCrossingTool/Root/json/elements.inl b/Trigger/TrigAnalysis/TrigBunchCrossingTool/Root/json/elements.inl deleted file mode 100644 index 05f8e26c64225d9f3c82d6e670242beeba190ec0..0000000000000000000000000000000000000000 --- a/Trigger/TrigAnalysis/TrigBunchCrossingTool/Root/json/elements.inl +++ /dev/null @@ -1,442 +0,0 @@ -// Dear emacs, this is -*- c++ -*- -// $Id: elements.inl 630795 2014-11-25 04:05:50Z ssnyder $ -/********************************************** - -License: BSD -Project Webpage: http://cajun-jsonapi.sourceforge.net/ -Author: Terry Caton - -***********************************************/ -#ifndef TRIGBUNCHCROSSINGTOOL_JSON_ELEMENTS_INL -#define TRIGBUNCHCROSSINGTOOL_JSON_ELEMENTS_INL - -// STL include(s): -#include <cassert> -#include <algorithm> -#include <map> - -// Local include(s): -#include "visitor.h" -#include "reader.h" - -/* - -TODO: -* better documentation - -*/ - -namespace json { - - inline Exception::Exception( const std::string& sMessage ) : - std::runtime_error( sMessage ) {} - - - ///////////////////////// - // UnknownElement members - - class UnknownElement::Imp { - - public: - virtual ~Imp() {} - virtual Imp* Clone() const = 0; - - virtual bool Compare( const Imp& imp ) const = 0; - - virtual void Accept( ConstVisitor& visitor ) const = 0; - virtual void Accept( Visitor& visitor ) = 0; - }; - - - template <typename ElementTypeT> - class UnknownElement::Imp_T : public UnknownElement::Imp { - - public: - Imp_T( const ElementTypeT& element ) : m_Element( element ) {} - virtual Imp* Clone() const { return new Imp_T<ElementTypeT>(*this); } - - virtual void Accept( ConstVisitor& visitor ) const { visitor.Visit(m_Element); } - virtual void Accept( Visitor& visitor ) { visitor.Visit(m_Element); } - - virtual bool Compare( const Imp& imp ) const { - ConstCastVisitor_T<ElementTypeT> castVisitor; - imp.Accept(castVisitor); - return castVisitor.m_pElement && - m_Element == *castVisitor.m_pElement; - } - - private: - ElementTypeT m_Element; - }; - - - class UnknownElement::ConstCastVisitor : public ConstVisitor { - - virtual void Visit( const Array& ) {} - virtual void Visit( const Object& ) {} - virtual void Visit( const Number& ) {} - virtual void Visit( const String& ) {} - virtual void Visit( const Boolean& ) {} - virtual void Visit( const Null& ) {} - }; - - template <typename ElementTypeT> - class UnknownElement::ConstCastVisitor_T : public ConstCastVisitor { - - public: - ConstCastVisitor_T() : m_pElement( 0 ) {} - - virtual void Visit( const Array& x ) { - if( typeid( x ) == typeid( *m_pElement ) ) { - m_pElement = reinterpret_cast< const ElementTypeT* >( &x ); - } - } - virtual void Visit( const Object& x ) { - if( typeid( x ) == typeid( *m_pElement ) ) { - m_pElement = reinterpret_cast< const ElementTypeT* >( &x ); - } - } - virtual void Visit( const Number& x ) { - if( typeid( x ) == typeid( *m_pElement ) ) { - m_pElement = reinterpret_cast< const ElementTypeT* >( &x ); - } - } - virtual void Visit( const String& x ) { - if( typeid( x ) == typeid( *m_pElement ) ) { - m_pElement = reinterpret_cast< const ElementTypeT* >( &x ); - } - } - virtual void Visit( const Boolean& x ) { - if( typeid( x ) == typeid( *m_pElement ) ) { - m_pElement = reinterpret_cast< const ElementTypeT* >( &x ); - } - } - virtual void Visit( const Null& x ) { - if( typeid( x ) == typeid( *m_pElement ) ) { - m_pElement = reinterpret_cast< const ElementTypeT* >( &x ); - } - } - - const ElementTypeT* m_pElement; - }; - - - class UnknownElement::CastVisitor : public Visitor { - - virtual void Visit( Array& ) {} - virtual void Visit( Object& ) {} - virtual void Visit( Number& ) {} - virtual void Visit( String& ) {} - virtual void Visit( Boolean& ) {} - virtual void Visit( Null& ) {} - }; - - template <typename ElementTypeT> - class UnknownElement::CastVisitor_T : public CastVisitor { - - public: - CastVisitor_T() : m_pElement( 0 ) {} - - virtual void Visit( Array& x ) { - if( typeid( x ) == typeid( *m_pElement ) ) { - m_pElement = reinterpret_cast< ElementTypeT* >( &x ); - } - } - virtual void Visit( Object& x ) { - if( typeid( x ) == typeid( *m_pElement ) ) { - m_pElement = reinterpret_cast< ElementTypeT* >( &x ); - } - } - virtual void Visit( Number& x ) { - if( typeid( x ) == typeid( *m_pElement ) ) { - m_pElement = reinterpret_cast< ElementTypeT* >( &x ); - } - } - virtual void Visit( String& x ) { - if( typeid( x ) == typeid( *m_pElement ) ) { - m_pElement = reinterpret_cast< ElementTypeT* >( &x ); - } - } - virtual void Visit( Boolean& x ) { - if( typeid( x ) == typeid( *m_pElement ) ) { - m_pElement = reinterpret_cast< ElementTypeT* >( &x ); - } - } - virtual void Visit( Null& x ) { - if( typeid( x ) == typeid( *m_pElement ) ) { - m_pElement = reinterpret_cast< ElementTypeT* >( &x ); - } - } - - ElementTypeT* m_pElement; - }; - - - inline UnknownElement::UnknownElement() : m_pImp( new Imp_T<Null>( Null() ) ) {} - inline UnknownElement::UnknownElement( const UnknownElement& unknown ) : m_pImp( unknown.m_pImp->Clone()) {} - inline UnknownElement::UnknownElement( const Object& object ) : m_pImp( new Imp_T<Object>(object) ) {} - inline UnknownElement::UnknownElement( const Array& array ) : m_pImp( new Imp_T<Array>(array) ) {} - inline UnknownElement::UnknownElement( const Number& number ) : m_pImp( new Imp_T<Number>(number) ) {} - inline UnknownElement::UnknownElement( const Boolean& boolean ) : m_pImp( new Imp_T<Boolean>(boolean) ) {} - inline UnknownElement::UnknownElement( const String& string ) : m_pImp( new Imp_T<String>(string) ) {} - inline UnknownElement::UnknownElement( const Null& null ) : m_pImp( new Imp_T<Null>(null) ) {} - - inline UnknownElement::~UnknownElement() { delete m_pImp; } - - inline UnknownElement::operator const Object& () const { return CastTo<Object>(); } - inline UnknownElement::operator const Array& () const { return CastTo<Array>(); } - inline UnknownElement::operator const Number& () const { return CastTo<Number>(); } - inline UnknownElement::operator const Boolean& () const { return CastTo<Boolean>(); } - inline UnknownElement::operator const String& () const { return CastTo<String>(); } - inline UnknownElement::operator const Null& () const { return CastTo<Null>(); } - - inline UnknownElement::operator Object& () { return ConvertTo<Object>(); } - inline UnknownElement::operator Array& () { return ConvertTo<Array>(); } - inline UnknownElement::operator Number& () { return ConvertTo<Number>(); } - inline UnknownElement::operator Boolean& () { return ConvertTo<Boolean>(); } - inline UnknownElement::operator String& () { return ConvertTo<String>(); } - inline UnknownElement::operator Null& () { return ConvertTo<Null>(); } - - inline UnknownElement& UnknownElement::operator = ( const UnknownElement& unknown ) { - if (this != &unknown) { - delete m_pImp; - m_pImp = unknown.m_pImp->Clone(); - } - return *this; - } - - inline UnknownElement& UnknownElement::operator[] ( const std::string& key ) { - // the people want an object. make us one if we aren't already - Object& object = ConvertTo<Object>(); - return object[key]; - } - - inline const UnknownElement& - UnknownElement::operator[] ( const std::string& key ) const { - // throws if we aren't an object - const Object& object = CastTo<Object>(); - return object[key]; - } - - inline UnknownElement& UnknownElement::operator[] ( size_t index ) { - // the people want an array. make us one if we aren't already - Array& array = ConvertTo<Array>(); - return array[index]; - } - - inline const UnknownElement& UnknownElement::operator[] ( size_t index ) const { - // throws if we aren't an array - const Array& array = CastTo<Array>(); - return array[index]; - } - - template <typename ElementTypeT> - const ElementTypeT& UnknownElement::CastTo() const { - ConstCastVisitor_T<ElementTypeT> castVisitor; - m_pImp->Accept(castVisitor); - if (castVisitor.m_pElement == 0) - throw Exception("Bad cast"); - return *castVisitor.m_pElement; - } - - template <typename ElementTypeT> - ElementTypeT& UnknownElement::ConvertTo() { - CastVisitor_T<ElementTypeT> castVisitor; - m_pImp->Accept(castVisitor); - if (castVisitor.m_pElement == 0) { - // we're not the right type. fix it & try again - *this = ElementTypeT(); - m_pImp->Accept(castVisitor); - } - - return *castVisitor.m_pElement; - } - - inline void UnknownElement::Accept( ConstVisitor& visitor ) const { m_pImp->Accept(visitor); } - inline void UnknownElement::Accept( Visitor& visitor ) { m_pImp->Accept(visitor); } - - - inline bool UnknownElement::operator == ( const UnknownElement& element ) const { - return m_pImp->Compare(*element.m_pImp); - } - - - ////////////////// - // Object members - - inline Object::Member::Member( const std::string& nameIn, - const UnknownElement& elementIn ) : - name(nameIn), element(elementIn) {} - - inline bool Object::Member::operator == ( const Member& member ) const { - return name == member.name && - element == member.element; - } - - class Object::Finder : public std::unary_function<Object::Member, bool> { - - public: - Finder( const std::string& name ) : m_name(name) {} - bool operator () ( const Object::Member& member ) { - return member.name == m_name; - } - - private: - std::string m_name; - }; - - - - inline Object::iterator Object::Begin() { return m_Members.begin(); } - inline Object::iterator Object::End() { return m_Members.end(); } - inline Object::const_iterator Object::Begin() const { return m_Members.begin(); } - inline Object::const_iterator Object::End() const { return m_Members.end(); } - - inline size_t Object::Size() const { return m_Members.size(); } - inline bool Object::Empty() const { return m_Members.empty(); } - - inline Object::iterator Object::Find( const std::string& name ) { - return std::find_if(m_Members.begin(), m_Members.end(), Finder(name)); - } - - inline Object::const_iterator Object::Find( const std::string& name ) const { - return std::find_if(m_Members.begin(), m_Members.end(), Finder(name)); - } - - inline Object::iterator Object::Insert( const Member& member ) { - return Insert(member, End()); - } - - inline Object::iterator Object::Insert( const Member& member, iterator itWhere ) { - iterator it = Find(member.name); - if (it != m_Members.end()) - throw Exception("Object member already exists: " + member.name); - - it = m_Members.insert(itWhere, member); - return it; - } - - inline Object::iterator Object::Erase( iterator itWhere ) { - return m_Members.erase(itWhere); - } - - inline UnknownElement& Object::operator []( const std::string& name ) { - - iterator it = Find(name); - if (it == m_Members.end()) { - Member member(name); - it = Insert(member, End()); - } - return it->element; - } - - inline const UnknownElement& Object::operator []( const std::string& name ) const { - const_iterator it = Find(name); - if (it == End()) - throw Exception("Object member not found: " + name); - return it->element; - } - - inline void Object::Clear() { - m_Members.clear(); - } - - inline bool Object::operator == ( const Object& object ) const { - return m_Members == object.m_Members; - } - - - ///////////////// - // Array members - - inline Array::iterator Array::Begin() { return m_Elements.begin(); } - inline Array::iterator Array::End() { return m_Elements.end(); } - inline Array::const_iterator Array::Begin() const { return m_Elements.begin(); } - inline Array::const_iterator Array::End() const { return m_Elements.end(); } - - inline Array::iterator Array::Insert( const UnknownElement& element, - iterator itWhere ) { - return m_Elements.insert(itWhere, element); - } - - inline Array::iterator Array::Insert( const UnknownElement& element ) { - return Insert( element, End() ); - } - - inline Array::iterator Array::Erase( iterator itWhere ) { - return m_Elements.erase(itWhere); - } - - inline void Array::Resize( size_t newSize ) { - m_Elements.resize(newSize); - } - - inline size_t Array::Size() const { return m_Elements.size(); } - inline bool Array::Empty() const { return m_Elements.empty(); } - - inline UnknownElement& Array::operator[] ( size_t index ) { - size_t nMinSize = index + 1; // zero indexed - if (m_Elements.size() < nMinSize) - m_Elements.resize(nMinSize); - return m_Elements[index]; - } - - inline const UnknownElement& Array::operator[] ( size_t index ) const { - if (index >= m_Elements.size()) - throw Exception("Array out of bounds"); - return m_Elements[index]; - } - - inline void Array::Clear() { - m_Elements.clear(); - } - - inline bool Array::operator == (const Array& array) const { - return m_Elements == array.m_Elements; - } - - - //////////////////////// - // TrivialType_T members - - template <typename DataTypeT> - TrivialType_T<DataTypeT>::TrivialType_T( const DataTypeT& t ) : - m_tValue(t) {} - - template <typename DataTypeT> - TrivialType_T<DataTypeT>::operator DataTypeT&() { - return Value(); - } - - template <typename DataTypeT> - TrivialType_T<DataTypeT>::operator const DataTypeT&() const { - return Value(); - } - - template <typename DataTypeT> - DataTypeT& TrivialType_T<DataTypeT>::Value() { - return m_tValue; - } - - template <typename DataTypeT> - const DataTypeT& TrivialType_T<DataTypeT>::Value() const { - return m_tValue; - } - - template <typename DataTypeT> - bool TrivialType_T<DataTypeT>::operator == ( const TrivialType_T<DataTypeT>& trivial ) const { - return m_tValue == trivial.m_tValue; - } - - - - ////////////////// - // Null members - - inline bool Null::operator == (const Null& /*trivial*/) const { - return true; - } - -} // End namespace - -#endif // TRIGBUNCHCROSSINGTOOL_JSON_ELEMENTS_INL diff --git a/Trigger/TrigAnalysis/TrigBunchCrossingTool/Root/json/reader.h b/Trigger/TrigAnalysis/TrigBunchCrossingTool/Root/json/reader.h deleted file mode 100644 index 0bee7cfeb949f57ca4cd7447ffe156252983da5d..0000000000000000000000000000000000000000 --- a/Trigger/TrigAnalysis/TrigBunchCrossingTool/Root/json/reader.h +++ /dev/null @@ -1,132 +0,0 @@ -// Dear emacs, this is -*- c++ -*- -// $Id: reader.h 780643 2016-10-27 03:39:39Z ssnyder $ -/********************************************** - -License: BSD -Project Webpage: http://cajun-jsonapi.sourceforge.net/ -Author: Terry Caton - -***********************************************/ -#ifndef TRIGBUNCHCROSSINGTOOL_JSON_READER_H -#define TRIGBUNCHCROSSINGTOOL_JSON_READER_H - -// STL include(s): -#include <iostream> -#include <vector> - -// Local include(s): -//#include "elements.h" - -namespace json { - - class Reader { - - public: - // this structure will be reported in one of the exceptions defined below - struct Location { - Location(); - - unsigned int m_nLine; // document line, zero-indexed - unsigned int m_nLineOffset; // character offset from beginning of line, zero indexed - unsigned int m_nDocOffset; // character offset from entire document, zero indexed - }; - - // thrown during the first phase of reading. generally catches low-level problems such - // as errant characters or corrupt/incomplete documents - class ScanException : public Exception { - public: - ScanException( const std::string& sMessage, - const Reader::Location& locError ) : - Exception(sMessage), - m_locError(locError) {} - - Reader::Location m_locError; - }; - - // thrown during the second phase of reading. generally catches higher-level problems such - // as missing commas or brackets - class ParseException : public Exception { - - public: - ParseException( const std::string& sMessage, - const Reader::Location& locTokenBegin, - const Reader::Location& locTokenEnd ) : - Exception(sMessage), - m_locTokenBegin(locTokenBegin), - m_locTokenEnd(locTokenEnd) {} - - Reader::Location m_locTokenBegin; - Reader::Location m_locTokenEnd; - }; - - // if you know what the document looks like, call one of these... - static void Read( Object& object, std::istream& istr ); - static void Read( Array& array, std::istream& istr ); - static void Read( String& string, std::istream& istr ); - static void Read( Number& number, std::istream& istr ); - static void Read( Boolean& boolean, std::istream& istr ); - static void Read( Null& null, std::istream& istr ); - - // ...otherwise, if you don't know, call this & visit it - static void Read( UnknownElement& elementRoot, std::istream& istr ); - - private: - struct Token { - enum Type { - TOKEN_OBJECT_BEGIN, // { - TOKEN_OBJECT_END, // } - TOKEN_ARRAY_BEGIN, // [ - TOKEN_ARRAY_END, // ] - TOKEN_NEXT_ELEMENT, // , - TOKEN_MEMBER_ASSIGN, // : - TOKEN_STRING, // "xxx" - TOKEN_NUMBER, // [+/-]000.000[e[+/-]000] - TOKEN_BOOLEAN, // true -or- false - TOKEN_NULL // null - }; - - Type nType; - std::string sValue; - - // for malformed file debugging - Reader::Location locBegin; - Reader::Location locEnd; - }; - - class InputStream; - class TokenStream; - typedef std::vector<Token> Tokens; - - template <typename ElementTypeT> - static void Read_i( ElementTypeT& element, std::istream& istr ); - - // scanning istream into token sequence - void Scan( Tokens& tokens, InputStream& inputStream ); - - void EatWhiteSpace( InputStream& inputStream ); - void MatchString( std::string& sValue, InputStream& inputStream ); - void MatchNumber( std::string& sNumber, InputStream& inputStream ); - void MatchExpectedString( const std::string& sExpected, - InputStream& inputStream ); - - // parsing token sequence into element structure - void Parse( UnknownElement& element, TokenStream& tokenStream ); - void Parse( Object& object, TokenStream& tokenStream ); - void Parse( Array& array, TokenStream& tokenStream ); - void Parse( String& string, TokenStream& tokenStream ); - void Parse( Number& number, TokenStream& tokenStream ); - void Parse( Boolean& boolean, TokenStream& tokenStream ); - void Parse( Null& null, TokenStream& tokenStream ); - - const std::string& MatchExpectedToken( Token::Type nExpected, - TokenStream& tokenStream ); - }; - -} // End namespace - -#ifndef __CINT__ -// Include the implementation: -#include "reader.inl" -#endif // __CINT__ - -#endif // TRIGBUNCHCROSSINGTOOL_JSON_READER_H diff --git a/Trigger/TrigAnalysis/TrigBunchCrossingTool/Root/json/reader.inl b/Trigger/TrigAnalysis/TrigBunchCrossingTool/Root/json/reader.inl deleted file mode 100644 index 18cb1ca0f1091577c02dbb5b0c27d1cfa60811d5..0000000000000000000000000000000000000000 --- a/Trigger/TrigAnalysis/TrigBunchCrossingTool/Root/json/reader.inl +++ /dev/null @@ -1,513 +0,0 @@ -// Dear emacs, this is -*- c++ -*- -// $Id: reader.inl 630795 2014-11-25 04:05:50Z ssnyder $ -/********************************************** - -License: BSD -Project Webpage: http://cajun-jsonapi.sourceforge.net/ -Author: Terry Caton - -***********************************************/ -#ifndef TRIGBUNCHCROSSINGTOOL_JSON_READER_INL -#define TRIGBUNCHCROSSINGTOOL_JSON_READER_INL - -// STL include(s): -#include <cassert> -#include <set> -#include <sstream> - -/* - -TODO: -* better documentation -* unicode character decoding - -*/ - -namespace json { - - inline std::istream& operator >> ( std::istream& istr, UnknownElement& elementRoot ) { - Reader::Read(elementRoot, istr); - return istr; - } - - inline Reader::Location::Location() : - m_nLine(0), - m_nLineOffset(0), - m_nDocOffset(0) - {} - - - ////////////////////// - // Reader::InputStream - class Reader::InputStream // would be cool if we could inherit from std::istream & override "get" - { - public: - InputStream( std::istream& iStr ) : - m_iStr(iStr) {} - - // protect access to the input stream, so we can keeep track of document/line offsets - char Get(); // big, define outside - char Peek() { - assert(m_iStr.eof() == false); // enforce reading of only valid stream data - return m_iStr.peek(); - } - - bool EOS() { - m_iStr.peek(); // apparently eof flag isn't set until a character read is attempted. whatever. - return m_iStr.eof(); - } - - const Location& GetLocation() const { return m_Location; } - - private: - std::istream& m_iStr; - Location m_Location; - }; - - inline char Reader::InputStream::Get() { - - assert(m_iStr.eof() == false); // enforce reading of only valid stream data - int c = m_iStr.get(); - - ++m_Location.m_nDocOffset; - if (c == '\n') { - ++m_Location.m_nLine; - m_Location.m_nLineOffset = 0; - } - else { - ++m_Location.m_nLineOffset; - } - - return c; - } - - - ////////////////////// - // Reader::TokenStream - class Reader::TokenStream { - - public: - TokenStream( const Tokens& tokens ); - - const Token& Peek(); - const Token& Get(); - - bool EOS() const; - - private: - const Tokens& m_Tokens; - Tokens::const_iterator m_itCurrent; - }; - - - inline Reader::TokenStream::TokenStream( const Tokens& tokens ) : - m_Tokens(tokens), - m_itCurrent(tokens.begin()) - {} - - inline const Reader::Token& Reader::TokenStream::Peek() { - assert(m_itCurrent != m_Tokens.end()); - return *(m_itCurrent); - } - - inline const Reader::Token& Reader::TokenStream::Get() { - assert(m_itCurrent != m_Tokens.end()); - return *(m_itCurrent++); - } - - inline bool Reader::TokenStream::EOS() const { - return m_itCurrent == m_Tokens.end(); - } - - /////////////////// - // Reader (finally) - inline void Reader::Read( Object& object, std::istream& istr ) { Read_i(object, istr); } - inline void Reader::Read( Array& array, std::istream& istr ) { Read_i(array, istr); } - inline void Reader::Read( String& string, std::istream& istr ) { Read_i(string, istr); } - inline void Reader::Read( Number& number, std::istream& istr ) { Read_i(number, istr); } - inline void Reader::Read( Boolean& boolean, std::istream& istr ) { Read_i(boolean, istr); } - inline void Reader::Read( Null& null, std::istream& istr ) { Read_i(null, istr); } - inline void Reader::Read( UnknownElement& unknown, std::istream& istr ) { Read_i(unknown, istr); } - - - template <typename ElementTypeT> - void Reader::Read_i(ElementTypeT& element, std::istream& istr) { - - Reader reader; - - Tokens tokens; - InputStream inputStream(istr); - reader.Scan(tokens, inputStream); - - TokenStream tokenStream(tokens); - reader.Parse(element, tokenStream); - - if (tokenStream.EOS() == false) { - const Token& token = tokenStream.Peek(); - std::string sMessage = "Expected End of token stream; found " + token.sValue; - throw ParseException(sMessage, token.locBegin, token.locEnd); - } - } - - inline void Reader::Scan( Tokens& tokens, InputStream& inputStream ) { - - while (EatWhiteSpace(inputStream), // ignore any leading white space... - inputStream.EOS() == false) // ...before checking for EOS - { - // if all goes well, we'll create a token each pass - Token token; - token.locBegin = inputStream.GetLocation(); - - // gives us null-terminated string - std::string sChar; - sChar.push_back(inputStream.Peek()); - - switch (sChar[0]) { - - case '{': - token.sValue = sChar[0]; - MatchExpectedString(sChar, inputStream); - token.nType = Token::TOKEN_OBJECT_BEGIN; - break; - - case '}': - token.sValue = sChar[0]; - MatchExpectedString(sChar, inputStream); - token.nType = Token::TOKEN_OBJECT_END; - break; - - case '[': - token.sValue = sChar[0]; - MatchExpectedString(sChar, inputStream); - token.nType = Token::TOKEN_ARRAY_BEGIN; - break; - - case ']': - token.sValue = sChar[0]; - MatchExpectedString(sChar, inputStream); - token.nType = Token::TOKEN_ARRAY_END; - break; - - case ',': - token.sValue = sChar[0]; - MatchExpectedString(sChar, inputStream); - token.nType = Token::TOKEN_NEXT_ELEMENT; - break; - - case ':': - token.sValue = sChar[0]; - MatchExpectedString(sChar, inputStream); - token.nType = Token::TOKEN_MEMBER_ASSIGN; - break; - - case '"': - MatchString(token.sValue, inputStream); - token.nType = Token::TOKEN_STRING; - break; - - case '-': - case '0': - case '1': - case '2': - case '3': - case '4': - case '5': - case '6': - case '7': - case '8': - case '9': - MatchNumber(token.sValue, inputStream); - token.nType = Token::TOKEN_NUMBER; - break; - - case 't': - token.sValue = "true"; - MatchExpectedString(token.sValue, inputStream); - token.nType = Token::TOKEN_BOOLEAN; - break; - - case 'f': - token.sValue = "false"; - MatchExpectedString(token.sValue, inputStream); - token.nType = Token::TOKEN_BOOLEAN; - break; - - case 'n': - token.sValue = "null"; - MatchExpectedString(token.sValue, inputStream); - token.nType = Token::TOKEN_NULL; - break; - - default: { - std::string sErrorMessage = "Unexpected character in stream: " + sChar; - throw ScanException(sErrorMessage, inputStream.GetLocation()); - } - } - - token.locEnd = inputStream.GetLocation(); - tokens.push_back(token); - } - } - - - inline void Reader::EatWhiteSpace( InputStream& inputStream ) { - while (inputStream.EOS() == false && - ::isspace(inputStream.Peek())) - inputStream.Get(); - } - - inline void Reader::MatchExpectedString( const std::string& sExpected, - InputStream& inputStream ) { - - std::string::const_iterator it(sExpected.begin()), - itEnd(sExpected.end()); - for ( ; it != itEnd; ++it) { - if (inputStream.EOS() || // did we reach the end before finding what we're looking for... - inputStream.Get() != *it) // ...or did we find something different? - { - std::string sMessage = "Expected string: " + sExpected; - throw ScanException(sMessage, inputStream.GetLocation()); - } - } - - // all's well if we made it here, return quietly - } - - inline void Reader::MatchString( std::string& string, InputStream& inputStream ) { - - MatchExpectedString("\"", inputStream); - - while (inputStream.EOS() == false && - inputStream.Peek() != '"') { - - char c = inputStream.Get(); - - // escape? - if (c == '\\' && - inputStream.EOS() == false) // shouldn't have reached the end yet - { - c = inputStream.Get(); - switch (c) { - case '/': string.push_back('/'); break; - case '"': string.push_back('"'); break; - case '\\': string.push_back('\\'); break; - case 'b': string.push_back('\b'); break; - case 'f': string.push_back('\f'); break; - case 'n': string.push_back('\n'); break; - case 'r': string.push_back('\r'); break; - case 't': string.push_back('\t'); break; - case 'u': // TODO: what do we do with this? - default: { - std::string sMessage = "Unrecognized escape sequence found in string: \\"; - sMessage.push_back( c ); - throw ScanException(sMessage, inputStream.GetLocation()); - } - } - } - else { - string.push_back(c); - } - } - - // eat the last '"' that we just peeked - MatchExpectedString("\"", inputStream); - } - - - inline void Reader::MatchNumber( std::string& sNumber, InputStream& inputStream ) { - - const char sNumericChars[] = "0123456789.eE-+"; - std::set<char> numericChars; - numericChars.insert(sNumericChars, sNumericChars + sizeof(sNumericChars)); - - while (inputStream.EOS() == false && - numericChars.find(inputStream.Peek()) != numericChars.end()) { - sNumber.push_back(inputStream.Get()); - } - } - - - inline void Reader::Parse( UnknownElement& element, Reader::TokenStream& tokenStream ) { - if (tokenStream.EOS()) { - std::string sMessage = "Unexpected end of token stream"; - throw ParseException(sMessage, Location(), Location()); // nowhere to point to - } - - const Token& token = tokenStream.Peek(); - switch (token.nType) { - case Token::TOKEN_OBJECT_BEGIN: - { - // implicit non-const cast will perform conversion for us (if necessary) - Object& object = element; - Parse(object, tokenStream); - break; - } - - case Token::TOKEN_ARRAY_BEGIN: - { - Array& array = element; - Parse(array, tokenStream); - break; - } - - case Token::TOKEN_STRING: - { - String& string = element; - Parse(string, tokenStream); - break; - } - - case Token::TOKEN_NUMBER: - { - Number& number = element; - Parse(number, tokenStream); - break; - } - - case Token::TOKEN_BOOLEAN: - { - Boolean& boolean = element; - Parse(boolean, tokenStream); - break; - } - - case Token::TOKEN_NULL: - { - Null& null = element; - Parse(null, tokenStream); - break; - } - - default: - { - std::string sMessage = "Unexpected token: " + token.sValue; - throw ParseException(sMessage, token.locBegin, token.locEnd); - } - } - } - - - inline void Reader::Parse( Object& object, Reader::TokenStream& tokenStream ) { - - MatchExpectedToken(Token::TOKEN_OBJECT_BEGIN, tokenStream); - - bool bContinue = (tokenStream.EOS() == false && - tokenStream.Peek().nType != Token::TOKEN_OBJECT_END); - while (bContinue) - { - Object::Member member; - - // first the member name. save the token in case we have to throw an exception - const Token& tokenName = tokenStream.Peek(); - member.name = MatchExpectedToken(Token::TOKEN_STRING, tokenStream); - - // ...then the key/value separator... - MatchExpectedToken(Token::TOKEN_MEMBER_ASSIGN, tokenStream); - - // ...then the value itself (can be anything). - Parse(member.element, tokenStream); - - // try adding it to the object (this could throw) - try - { - object.Insert(member); - } - catch (Exception&) - { - // must be a duplicate name - std::string sMessage = "Duplicate object member token: " + member.name; - throw ParseException(sMessage, tokenName.locBegin, tokenName.locEnd); - } - - bContinue = (tokenStream.EOS() == false && - tokenStream.Peek().nType == Token::TOKEN_NEXT_ELEMENT); - if (bContinue) - MatchExpectedToken(Token::TOKEN_NEXT_ELEMENT, tokenStream); - } - - MatchExpectedToken(Token::TOKEN_OBJECT_END, tokenStream); - } - - - inline void Reader::Parse(Array& array, Reader::TokenStream& tokenStream) { - - MatchExpectedToken(Token::TOKEN_ARRAY_BEGIN, tokenStream); - - bool bContinue = (tokenStream.EOS() == false && - tokenStream.Peek().nType != Token::TOKEN_ARRAY_END); - while (bContinue) - { - // ...what's next? could be anything - Array::iterator itElement = array.Insert(UnknownElement()); - UnknownElement& element = *itElement; - Parse(element, tokenStream); - - bContinue = (tokenStream.EOS() == false && - tokenStream.Peek().nType == Token::TOKEN_NEXT_ELEMENT); - if (bContinue) - MatchExpectedToken(Token::TOKEN_NEXT_ELEMENT, tokenStream); - } - - MatchExpectedToken(Token::TOKEN_ARRAY_END, tokenStream); - } - - - inline void Reader::Parse(String& string, Reader::TokenStream& tokenStream) { - string = MatchExpectedToken(Token::TOKEN_STRING, tokenStream); - } - - - inline void Reader::Parse(Number& number, Reader::TokenStream& tokenStream) { - - const Token& currentToken = tokenStream.Peek(); // might need this later for throwing exception - const std::string& sValue = MatchExpectedToken(Token::TOKEN_NUMBER, tokenStream); - - std::istringstream iStr(sValue); - double dValue; - iStr >> dValue; - - // did we consume all characters in the token? - if (iStr.eof() == false) - { - std::string sMessage = "Unexpected character in NUMBER token: "; - sMessage.push_back( iStr.peek() ); - throw ParseException(sMessage, currentToken.locBegin, currentToken.locEnd); - } - - number = dValue; - } - - - inline void Reader::Parse(Boolean& boolean, Reader::TokenStream& tokenStream) { - const std::string& sValue = MatchExpectedToken(Token::TOKEN_BOOLEAN, tokenStream); - boolean = (sValue == "true" ? true : false); - } - - - inline void Reader::Parse(Null&, Reader::TokenStream& tokenStream) { - MatchExpectedToken(Token::TOKEN_NULL, tokenStream); - } - - - inline const std::string& Reader::MatchExpectedToken(Token::Type nExpected, - Reader::TokenStream& tokenStream) { - - if (tokenStream.EOS()) - { - std::string sMessage = "Unexpected End of token stream"; - throw ParseException(sMessage, Location(), Location()); // nowhere to point to - } - - const Token& token = tokenStream.Get(); - if (token.nType != nExpected) - { - std::string sMessage = "Unexpected token: " + token.sValue; - throw ParseException(sMessage, token.locBegin, token.locEnd); - } - - return token.sValue; - } - -} // End namespace - -#endif // TRIGBUNCHCROSSINGTOOL_JSON_READER_INL diff --git a/Trigger/TrigAnalysis/TrigBunchCrossingTool/Root/json/visitor.h b/Trigger/TrigAnalysis/TrigBunchCrossingTool/Root/json/visitor.h deleted file mode 100644 index 5ef8076f377e4a6e6014c5e7b770429c0b755ce8..0000000000000000000000000000000000000000 --- a/Trigger/TrigAnalysis/TrigBunchCrossingTool/Root/json/visitor.h +++ /dev/null @@ -1,48 +0,0 @@ -// Dear emacs, this is -*- c++ -*- -// $Id: visitor.h 630795 2014-11-25 04:05:50Z ssnyder $ -/********************************************** - -License: BSD -Project Webpage: http://cajun-jsonapi.sourceforge.net/ -Author: Terry Caton - -***********************************************/ -#ifndef TRIGBUNCHCROSSINGTOOL_JSON_VISITOR_H -#define TRIGBUNCHCROSSINGTOOL_JSON_VISITOR_H - -// Local include(s): -#ifndef TRIGBUNCHCROSSINGTOOL_JSON_ELEMENTS_H -#include "elements.h" -#endif - -namespace json { - - class Visitor { - - public: - virtual ~Visitor() {} - - virtual void Visit( Array& array ) = 0; - virtual void Visit( Object& object ) = 0; - virtual void Visit( Number& number ) = 0; - virtual void Visit( String& string ) = 0; - virtual void Visit( Boolean& boolean ) = 0; - virtual void Visit( Null& null ) = 0; - }; - - class ConstVisitor { - - public: - virtual ~ConstVisitor() {} - - virtual void Visit( const Array& array ) = 0; - virtual void Visit( const Object& object ) = 0; - virtual void Visit( const Number& number ) = 0; - virtual void Visit( const String& string ) = 0; - virtual void Visit( const Boolean& boolean ) = 0; - virtual void Visit( const Null& null ) = 0; - }; - -} // End namespace - -#endif // TRIGBUNCHCROSSINGTOOL_JSON_VISITOR_H diff --git a/Trigger/TrigAnalysis/TrigBunchCrossingTool/TrigBunchCrossingTool/WebBunchCrossingTool.h b/Trigger/TrigAnalysis/TrigBunchCrossingTool/TrigBunchCrossingTool/WebBunchCrossingTool.h deleted file mode 100644 index 67d7b33055f216764113335ee601f55c227b978f..0000000000000000000000000000000000000000 --- a/Trigger/TrigAnalysis/TrigBunchCrossingTool/TrigBunchCrossingTool/WebBunchCrossingTool.h +++ /dev/null @@ -1,120 +0,0 @@ -// Dear emacs, this is -*- c++ -*- - -/* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration -*/ - -// $Id: WebBunchCrossingTool.h 657759 2015-03-30 11:08:15Z krasznaa $ -#ifndef TRIGBUNCHCROSSINGTOOL_WEBBUNCHCROSSINGTOOL_H -#define TRIGBUNCHCROSSINGTOOL_WEBBUNCHCROSSINGTOOL_H - -// STL include(s): -#include <string> -#include <map> -#include <vector> - -// Local include(s): -#include "BunchCrossingToolBase.h" - -namespace Trig { - - /** - * @short Bunch crossing tool reading the configuration from the web - * - * The atlas-trigconf.cern.ch webpage now provides the bunch crossing - * configuration as JSON data as well. This tool can be used to read this - * configuration directly from the webpage. - * - * Internally the tool uses ROOT's TSocket to communicate with the webpage. - * - * The tool tries to minimise the times it needs to contact the webserver, - * but still, it's not supposed to be the fastest implementation of the - * interface. - * - * @author Attila Krasznahorkay <Attila.Krasznahorkay@cern.ch> - * - * $Revision: 657759 $ - * $Date: 2015-03-30 13:08:15 +0200 (Mon, 30 Mar 2015) $ - */ - class WebBunchCrossingTool : public BunchCrossingToolBase { - - /// Create a proper constructor for Athena - ASG_TOOL_CLASS( WebBunchCrossingTool, Trig::IBunchCrossingTool ) - - public: - /// Default constructor - WebBunchCrossingTool( const std::string& name = "WebBunchCrossingTool" ); - - /// Load a given bunch group key - StatusCode loadConfig( int bgkey ); - /// Load the configuration of a given LB - StatusCode loadConfig( unsigned int run, unsigned int lb ); - - /** - * @short Simplified IOV class - * - * This class is used internally to represent one IOV time. - * atlas-trigconf.cern.ch assigns a pair of [run,lb] pairs to each - * BGKey. This C++ implementation follows the same idea. - * - * It's made public, otherwise the dictionary generator chokes - * on the class... - * - * @author Attila Krasznahorkay <Attila.Krasznahorkay@cern.ch> - * - * $Revision: 657759 $ - * $Date: 2015-03-30 13:08:15 +0200 (Mon, 30 Mar 2015) $ - */ - class IOV { - public: - /// Constructor with run and lb numbers - IOV( unsigned int run = 0, unsigned int lb = 0 ); - /// Get the run number of this IOV - unsigned int run() const; - /// Get the luminosity block number of this IOV - unsigned int lb() const; - /// Comparison operator - bool operator< ( const IOV& rhs ) const; - /// Comparison operator - bool operator<=( const IOV& rhs ) const; - /// Comparison operator - bool operator==( const IOV& rhs ) const; - private: - unsigned int m_run; ///< The run number of the IOV - unsigned int m_lb; ///< The luminosity block number of this IOV - }; // class IOV - - protected: - /// Function called at the beginning of each event - virtual StatusCode beginEvent(); - - private: - /// Read the size of the data from a given configuration - size_t readSize( const char* config ) const; - /// Read the JSON configuration of a given setup - std::string readJSONConfig( const char* config ) const; - /// Cache the configuration from this piece of data - StatusCode cacheJSONConfig( const std::string& data ); - - /// Name of the server to download the information from - std::string m_serverAddress; - /// Timeout allowed on the server to respond - int m_serverTimeout; - - int m_bgkey; ///< The BG key loaded last - IOV m_iov; ///< The IOV loaded last - /// The currently loaded known configs - std::map< int, std::pair< std::vector< int >, - std::vector< int > > > m_knownConfigs; - /// Map assigning configurations to IOVs - /// The explicit scope for the IOV class is for ROOT 5's benefit. - /// Rootcint has issues understanding the code without the explicit - /// scope declaration in the old ROOT release. - std::map< std::pair< Trig::WebBunchCrossingTool::IOV, - Trig::WebBunchCrossingTool::IOV >, int > m_configMap; - - }; // class WebBunchCrossingTool - -} // namespace Trig - -#endif // TRIGBUNCHCROSSINGTOOL_WEBBUNCHCROSSINGTOOL_H diff --git a/Trigger/TrigAnalysis/TrigBunchCrossingTool/src/components/TrigBunchCrossingTool_entries.cxx b/Trigger/TrigAnalysis/TrigBunchCrossingTool/src/components/TrigBunchCrossingTool_entries.cxx index 5ccfefb8ed6462188d099cf53d4305727edbf181..6ea753ea1487fad6aaa0cebb80feebe87ad875e2 100644 --- a/Trigger/TrigAnalysis/TrigBunchCrossingTool/src/components/TrigBunchCrossingTool_entries.cxx +++ b/Trigger/TrigAnalysis/TrigBunchCrossingTool/src/components/TrigBunchCrossingTool_entries.cxx @@ -1,5 +1,8 @@ +/* + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration +*/ + #include "TrigBunchCrossingTool/StaticBunchCrossingTool.h" -#include "TrigBunchCrossingTool/WebBunchCrossingTool.h" #include "TrigBunchCrossingTool/D3PDBunchCrossingTool.h" #include "TrigBunchCrossingTool/xAODBunchCrossingTool.h" #include "TrigBunchCrossingTool/TrigConfBunchCrossingTool.h" @@ -8,11 +11,9 @@ #include "../LHCBunchCrossingTool.h" DECLARE_COMPONENT( Trig::StaticBunchCrossingTool ) -DECLARE_COMPONENT( Trig::WebBunchCrossingTool ) DECLARE_COMPONENT( Trig::D3PDBunchCrossingTool ) DECLARE_COMPONENT( Trig::xAODBunchCrossingTool ) DECLARE_COMPONENT( Trig::TrigConfBunchCrossingTool ) DECLARE_COMPONENT( Trig::MCBunchCrossingTool ) DECLARE_COMPONENT( Trig::LHCBunchCrossingTool ) - diff --git a/Trigger/TrigAnalysis/TrigBunchCrossingTool/test/ut_trigconf_bunch_tool_test.cxx b/Trigger/TrigAnalysis/TrigBunchCrossingTool/test/ut_trigconf_bunch_tool_test.cxx index b34c30f6c12b21161c8f6149853612510bc7e654..eaa306f4fdf51bb091f609e6f09eed5652028312 100644 --- a/Trigger/TrigAnalysis/TrigBunchCrossingTool/test/ut_trigconf_bunch_tool_test.cxx +++ b/Trigger/TrigAnalysis/TrigBunchCrossingTool/test/ut_trigconf_bunch_tool_test.cxx @@ -1,9 +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 */ -// $Id: ut_trigconf_bunch_tool_test.cxx 748399 2016-05-19 14:55:47Z krasznaa $ - // System include(s): #include <memory> @@ -11,13 +9,12 @@ #include <TFile.h> #include <TClass.h> #include <TError.h> +#include <TSystem.h> // xAOD include(s): -#ifdef ROOTCORE -# include "xAODRootAccess/Init.h" -# include "xAODRootAccess/TEvent.h" -# include "xAODRootAccess/tools/Message.h" -#endif // ROOTCORE +#include "xAODRootAccess/Init.h" +#include "xAODRootAccess/TEvent.h" +#include "xAODRootAccess/tools/Message.h" // Local include(s): #include "TrigBunchCrossingTool/TrigConfBunchCrossingTool.h" @@ -55,10 +52,10 @@ int main() { "READ" ) ); if( ! ifile.get() ) { Error( APP_NAME, XAOD_MESSAGE( "Couldn't open file: %s" ), - ASG_TEST_FILE_DATA ); + gSystem->Getenv( "ASG_TEST_FILE_DATA" ) ); return 1; } - Info( APP_NAME, "Opened file: %s", ASG_TEST_FILE_DATA ); + Info( APP_NAME, "Opened file: %s", gSystem->Getenv( "ASG_TEST_FILE_DATA" ) ); // Set up the reading of an example file: xAOD::TEvent event; diff --git a/Trigger/TrigAnalysis/TrigBunchCrossingTool/test/ut_web_bunch_tool_test.cxx b/Trigger/TrigAnalysis/TrigBunchCrossingTool/test/ut_web_bunch_tool_test.cxx deleted file mode 100644 index 6ddfcf44ff3c3c1f290ae729f0ffd65a096b8388..0000000000000000000000000000000000000000 --- a/Trigger/TrigAnalysis/TrigBunchCrossingTool/test/ut_web_bunch_tool_test.cxx +++ /dev/null @@ -1,85 +0,0 @@ -/* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration -*/ - -// $Id: ut_web_bunch_tool_test.cxx 745783 2016-05-10 06:47:18Z krasznaa $ - -// System include(s): -#include <iostream> - -// Local include(s): -#include "TrigBunchCrossingTool/WebBunchCrossingTool.h" - -#include "TInterpreter.h" -#include "CxxUtils/ubsan_suppress.h" - -/// A little helper macro -#define SIMPLE_CHECK( EXP ) \ - do { \ - if( ! EXP.isSuccess() ) { \ - std::cerr << "Failed to execute: " << #EXP << std::endl; \ - return 1; \ - } \ - } while( 0 ) - -/// Another helper macro for evaluating logical tests -#define SIMPLE_ASSERT( EXP ) \ - do { \ - const bool result = EXP; \ - if( ! result ) { \ - std::cerr << "Expression \"" << #EXP << "\" failed the evaluation" \ - << std::endl; \ - return 1; \ - } \ - } while( 0 ) - -int main() { - - // Suppress known ubsan warning provoked by TInterpreter. - CxxUtils::ubsan_suppress ([]() { TInterpreter::Instance(); } ); - - // Create the tool to be tested: - Trig::WebBunchCrossingTool tool; - SIMPLE_CHECK( tool.setProperty( "OutputLevel", MSG::DEBUG ) ); - SIMPLE_CHECK( tool.setProperty( "ServerAddress", - "atlas-trigconf.cern.ch" ) ); - SIMPLE_CHECK( tool.setProperty( "ServerTimeout", "60000" ) ); - - // Try to load some configurations by key: - SIMPLE_CHECK( tool.loadConfig( 104 ) ); - SIMPLE_CHECK( tool.loadConfig( 109 ) ); - - // Now ask some questions about the last configuration: - SIMPLE_ASSERT( tool.isFilled( 7 ) ); - SIMPLE_ASSERT( tool.isInTrain( 13 ) ); - SIMPLE_ASSERT( tool.distanceFromFront( 1 ) == 0 ); - SIMPLE_ASSERT( tool.distanceFromFront( 163 ) == 300 ); - SIMPLE_ASSERT( tool.gapBeforeTrain( 157 ) == 2700 ); - SIMPLE_ASSERT( tool.bunchTrainSpacing() == 150 ); - - // Try to load some configurations by run and lumiblock: - SIMPLE_CHECK( tool.loadConfig( 194367, 10 ) ); - SIMPLE_CHECK( tool.loadConfig( 284154, 40 ) ); - SIMPLE_CHECK( tool.loadConfig( 209109, 10 ) ); - SIMPLE_CHECK( tool.loadConfig( 209109, 20 ) ); - - // Now ask some questions about the last configuration: - SIMPLE_ASSERT( tool.isFilled( 68 ) ); - SIMPLE_ASSERT( tool.isInTrain( 148 ) ); - SIMPLE_ASSERT( tool.distanceFromFront( 66 ) == 0 ); - SIMPLE_ASSERT( tool.distanceFromFront( 238 ) == 300 ); - SIMPLE_ASSERT( tool.gapBeforeTrain( 146 ) == 250 ); - SIMPLE_ASSERT( tool.bunchTrainSpacing() == 50 ); - - // Check a 8b4e configuration: - SIMPLE_CHECK( tool.loadConfig( 334849, 100 ) ); - SIMPLE_ASSERT( tool.isFilled( 200 ) ); - SIMPLE_ASSERT( tool.isInTrain( 210 ) ); - SIMPLE_ASSERT( tool.distanceFromFront( 232 ) == 0 ); - SIMPLE_ASSERT( tool.distanceFromFront( 250 ) == 150 ); - SIMPLE_ASSERT( tool.gapBeforeTrain( 270 ) == 125 ); - SIMPLE_ASSERT( tool.bunchTrainSpacing() == 25 ); - - // Return gracefully: - return 0; -} diff --git a/Trigger/TrigAnalysis/TrigBunchCrossingTool/test/ut_web_xaod_bunch_tool_test.cxx b/Trigger/TrigAnalysis/TrigBunchCrossingTool/test/ut_web_xaod_bunch_tool_test.cxx deleted file mode 100644 index b053b68e5a65ff696cf925ee2c92aed6f580921c..0000000000000000000000000000000000000000 --- a/Trigger/TrigAnalysis/TrigBunchCrossingTool/test/ut_web_xaod_bunch_tool_test.cxx +++ /dev/null @@ -1,103 +0,0 @@ -/* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration -*/ - -// $Id: ut_web_xaod_bunch_tool_test.cxx 625753 2014-11-03 13:40:15Z krasznaa $ - -// System include(s): -#include <iostream> -#include <memory> - -// ROOT include(s): -#include <TFile.h> -#include <TError.h> - -// xAOD include(s): -#ifdef ROOTCORE -# include "xAODRootAccess/Init.h" -# include "xAODRootAccess/TEvent.h" -#endif // ROOTCORE - -// Local include(s): -#include "TrigBunchCrossingTool/WebBunchCrossingTool.h" - -/// A little helper macro -#define SIMPLE_CHECK( EXP ) \ - do { \ - if( ! EXP.isSuccess() ) { \ - std::cerr << "Failed to execute: " << #EXP << std::endl; \ - return 1; \ - } \ - } while( 0 ) - -/// Another helper macro for evaluating logical tests -#define SIMPLE_ASSERT( EXP ) \ - do { \ - const bool result = EXP; \ - if( ! result ) { \ - std::cerr << "Expression \"" << #EXP << "\" failed the evaluation" \ - << std::endl; \ - return 1; \ - } \ - } while( 0 ) - -int main() { - - // The name of the application: - static const char* APP_NAME = "ut_web_xaod_bunch_tool_test"; - - // Initialise the environment for xAOD reading: - SIMPLE_CHECK( xAOD::Init( APP_NAME ) ); - - // Open the input file: - static const char* FNAME = - "/afs/cern.ch/atlas/project/PAT/xAODs/r5597/" - "data12_8TeV.00204158.physics_JetTauEtmiss.recon.AOD.r5597/" - "AOD.01495682._003054.pool.root.1"; - std::unique_ptr< ::TFile > ifile( ::TFile::Open( FNAME, "READ" ) ); - if( ! ifile.get() ) { - ::Error( APP_NAME, "Couldn't open file: %s", FNAME ); - return 1; - } - ::Info( APP_NAME, "Opened file: %s", FNAME ); - - // Set up the reading of an example file: - xAOD::TEvent event; - SIMPLE_CHECK( event.readFrom( ifile.get() ) ); - - // Create the tool to be tested: - Trig::WebBunchCrossingTool tool; - SIMPLE_CHECK( tool.setProperty( "OutputLevel", MSG::INFO ) ); - SIMPLE_CHECK( tool.setProperty( "ServerAddress", - "atlas-trigconf.cern.ch" ) ); - - // Loop over the events in the file: - const ::Long64_t entries = event.getEntries(); - for( ::Long64_t entry = 0; entry < entries; ++entry ) { - - // Load the event: - if( event.getEntry( entry ) < 0 ) { - ::Error( APP_NAME, "Couldn't load event %i from the input file", - static_cast< int >( entry ) ); - return 1; - } - - // Print some status info: - if( ! ( entry % 100 ) ) { - ::Info( APP_NAME, "Processing event %i / %i", - static_cast< int >( entry ), - static_cast< int >( entries ) ); - } - - // Now ask some questions about the loaded configuration: - SIMPLE_ASSERT( tool.isFilled( 7 ) ); - SIMPLE_ASSERT( tool.isInTrain( 13 ) ); - SIMPLE_ASSERT( tool.distanceFromFront( 146 ) == 0 ); - SIMPLE_ASSERT( tool.distanceFromFront( 238 ) == 300 ); - SIMPLE_ASSERT( tool.gapBeforeTrain( 148 ) == 250 ); - SIMPLE_ASSERT( tool.bunchTrainSpacing() == 50 ); - } - - // Return gracefully: - return 0; -} diff --git a/Trigger/TrigAnalysis/TrigDecisionTool/TrigDecisionTool/ChainGroup.icc b/Trigger/TrigAnalysis/TrigDecisionTool/TrigDecisionTool/ChainGroup.icc index 43d822bf279cfef18502209ebdd4cdbe2d1fda54..24065ca93391e50715290b985fedaf66f2635ecd 100644 --- a/Trigger/TrigAnalysis/TrigDecisionTool/TrigDecisionTool/ChainGroup.icc +++ b/Trigger/TrigAnalysis/TrigDecisionTool/TrigDecisionTool/ChainGroup.icc @@ -16,7 +16,7 @@ std::vector< TrigCompositeUtils::LinkInfo<CONTAINER> > Trig::ChainGroup::feature ATH_MSG_ERROR("featureCollectionMode may only be called with: " "TrigDefs::lastFeatureOfType - stop exploring each route through the navigation once a feature matching all requirements is found. " "TrigDefs::allFeaturesOfType - always fully explore each route throught the navigation graph and collect all matching features."); - errState = true; + errState = true; } // TODO when we decide what happens to CacheGlobalMemory - this needs to be updated to use a ReadHandle @@ -47,7 +47,7 @@ std::vector< TrigCompositeUtils::LinkInfo<CONTAINER> > Trig::ChainGroup::feature } // For each chain, collect Navigation information - std::vector< ElementLinkVector<TrigCompositeUtils::DecisionContainer> > allLinearNavigationPaths; + TrigCompositeUtils::NavGraph navGraph; // Loop over HLT chains TrigCompositeUtils::DecisionIDContainer chainIDs; @@ -59,10 +59,10 @@ std::vector< TrigCompositeUtils::LinkInfo<CONTAINER> > Trig::ChainGroup::feature // Obtain navigation routes for passed chains // Final parameter TRUE as the chain passed (has its ID in terminusNode) - TrigCompositeUtils::recursiveGetDecisions(terminusNode, allLinearNavigationPaths, fchain->getChainHashId(), true); + TrigCompositeUtils::recursiveGetDecisions(terminusNode, navGraph, fchain->getChainHashId(), true); - ATH_MSG_DEBUG("Added all passed navigation paths for chain " << fchain->getChainName() - << ", total paths:" << allLinearNavigationPaths.size()); + ATH_MSG_DEBUG("Added all passed navigation data for chain " << fchain->getChainName() + << ", total nodes:" << navGraph.nodes() << " total edges:" << navGraph.edges()); if (condition == TrigDefs::includeFailedDecisions) { std::vector<const TrigCompositeUtils::Decision*> rejectedDecisionNodes = @@ -73,11 +73,11 @@ std::vector< TrigCompositeUtils::LinkInfo<CONTAINER> > Trig::ChainGroup::feature for (const TrigCompositeUtils::Decision* rejectedNode : rejectedDecisionNodes) { // Final parameter FALSE as the chain failed here (its ID was removed from rejectedNode) - TrigCompositeUtils::recursiveGetDecisions(rejectedNode, allLinearNavigationPaths, fchain->getChainHashId(), false); + TrigCompositeUtils::recursiveGetDecisions(rejectedNode, navGraph, fchain->getChainHashId(), false); } - ATH_MSG_DEBUG("Added all failed navigation paths for chain " << fchain->getChainName() - << ", total paths:" << allLinearNavigationPaths.size()); + ATH_MSG_DEBUG("Added all failed navigation data for chain " << fchain->getChainName() + << ", total nodes:" << navGraph.nodes() << " total edges:" << navGraph.edges()); } } else { @@ -85,23 +85,19 @@ std::vector< TrigCompositeUtils::LinkInfo<CONTAINER> > Trig::ChainGroup::feature } } - if (allLinearNavigationPaths.size() == 0) { - ATH_MSG_DEBUG("No navigation paths found for this chain group of " << names().size() << " chains."); + if (navGraph.edges() == 0) { + ATH_MSG_DEBUG("No navigation path data found for this chain group of " << names().size() << " chains. " + << "Total nodes:" << navGraph.nodes() << " total edges:" << navGraph.edges()); } if (msg().level() <= MSG::VERBOSE) { - size_t count = 0; - for (const ElementLinkVector<TrigCompositeUtils::DecisionContainer>& path : allLinearNavigationPaths) { - ATH_MSG_VERBOSE("Printing path " << ++count << " of " << allLinearNavigationPaths.size() << ", path has " << path.size() << " elements."); - for (const ElementLink<TrigCompositeUtils::DecisionContainer>& node : path) { - ATH_MSG_VERBOSE(" -- " << node.dataID() << " #" << node.index()); - } - } + navGraph.printAllPaths(msg(), MSG::VERBOSE); } const bool lastFeatureOfTypeFlag = (featureCollectionMode == TrigDefs::lastFeatureOfType); + std::vector<TrigCompositeUtils::LinkInfo<CONTAINER>> returnVector = - TrigCompositeUtils::getFeaturesOfType<CONTAINER>(allLinearNavigationPaths, containerSGKey, lastFeatureOfTypeFlag, navElementLinkKey, chainIDs); + TrigCompositeUtils::recursiveGetFeaturesOfType<CONTAINER>(navGraph, containerSGKey, lastFeatureOfTypeFlag, navElementLinkKey, chainIDs); // Check for missing navigation data if requesting the default "feature" links if (navElementLinkKey == TrigCompositeUtils::featureString()) { diff --git a/Trigger/TrigAnalysis/TrigInDetAnalysis/TrigInDetAnalysis/TIDAChain.h b/Trigger/TrigAnalysis/TrigInDetAnalysis/TrigInDetAnalysis/TIDAChain.h index fefd19330f313841885dfe95e3e9a7db1ecf876b..f29a7dd742c75dcf1abb3d0ddfebc1175187de74 100644 --- a/Trigger/TrigAnalysis/TrigInDetAnalysis/TrigInDetAnalysis/TIDAChain.h +++ b/Trigger/TrigAnalysis/TrigInDetAnalysis/TrigInDetAnalysis/TIDAChain.h @@ -60,6 +60,10 @@ public: TIDA::Roi& back() { return m_roi.back(); } TIDA::Roi& operator[](int i) { return m_roi.at(i); } + TIDA::Roi& at(int i) { return m_roi.at(i); } + + const TIDA::Roi& operator[](int i) const { return m_roi.at(i); } + const TIDA::Roi& at(int i) const { return m_roi.at(i); } private: diff --git a/Trigger/TrigAnalysis/TrigInDetAnalysis/TrigInDetAnalysis/TIDAEvent.h b/Trigger/TrigAnalysis/TrigInDetAnalysis/TrigInDetAnalysis/TIDAEvent.h index 508676633ecfdb37911c5d5ecab67893b538816f..1eeed988937db6c37bf2799418ed016440193a3e 100644 --- a/Trigger/TrigAnalysis/TrigInDetAnalysis/TrigInDetAnalysis/TIDAEvent.h +++ b/Trigger/TrigAnalysis/TrigInDetAnalysis/TrigInDetAnalysis/TIDAEvent.h @@ -76,6 +76,8 @@ public: const std::vector<TIDA::Chain>& chains() const { return m_chains; }; std::vector<TIDA::Chain>& chains() { return m_chains; }; + const TIDA::Chain* chain( const std::string& s ) const; + //void setTruthMap(TrigInDetTrackTruthMap truthmap) { // m_truthmap = truthmap; //} diff --git a/Trigger/TrigAnalysis/TrigInDetAnalysis/TrigInDetAnalysis/TIDARoi.h b/Trigger/TrigAnalysis/TrigInDetAnalysis/TrigInDetAnalysis/TIDARoi.h index 834893c81db605ebff019113ac27c9ccd2890d40..361fb79edb5dd612c14af22e8687ca0312231c8e 100644 --- a/Trigger/TrigAnalysis/TrigInDetAnalysis/TrigInDetAnalysis/TIDARoi.h +++ b/Trigger/TrigAnalysis/TrigInDetAnalysis/TrigInDetAnalysis/TIDARoi.h @@ -101,6 +101,7 @@ inline std::ostream& operator<<( std::ostream& s, const TIDA::Roi& r ) { for ( unsigned i=0 ; i<r.tracks().size() ; i++ ) s << "\n\t\t\t" << r.tracks()[i]; for ( unsigned i=0 ; i<r.user().size() ; i++ ) s << "\n\t\t\t" << r.user()[i]; for ( unsigned i=0 ; i<r.objects().size() ; i++ ) s << "\n\t\t\t" << r.objects()[i]; + s << "\tvertices: " << r.vertices().size(); for ( unsigned i=0 ; i<r.vertices().size() ; i++ ) s << "\n\t\t\t" << r.vertices()[i]; return s; } diff --git a/Trigger/TrigAnalysis/TrigInDetAnalysis/src/TIDAEvent.cxx b/Trigger/TrigAnalysis/TrigInDetAnalysis/src/TIDAEvent.cxx index e9576e66016ce3ec8428ebd27d8bdd799c8d0bc9..3be6edf04531629c5d5cd60104e23d94d73b36bb 100644 --- a/Trigger/TrigAnalysis/TrigInDetAnalysis/src/TIDAEvent.cxx +++ b/Trigger/TrigAnalysis/TrigInDetAnalysis/src/TIDAEvent.cxx @@ -52,3 +52,9 @@ void TIDA::Event::erase( const std::string& name ) { + +const TIDA::Chain* TIDA::Event::chain( const std::string& s ) const { + /// could use std::find(), but would need to define an equality operator or lambda + for( size_t i=m_chains.size() ; i-- ; ) if ( m_chains[i].name()==s ) return &m_chains[i]; + return 0; +} diff --git a/Trigger/TrigAnalysis/TrigInDetAnalysis/src/TIDARoi.cxx b/Trigger/TrigAnalysis/TrigInDetAnalysis/src/TIDARoi.cxx index 8e3f0990c76ce59fe4e31a7ec58b17fdded9f8db..ee8159d8816416878cf1ada2ca4a2bdf448e5266 100644 --- a/Trigger/TrigAnalysis/TrigInDetAnalysis/src/TIDARoi.cxx +++ b/Trigger/TrigAnalysis/TrigInDetAnalysis/src/TIDARoi.cxx @@ -21,7 +21,7 @@ TIDA::Roi::~Roi() { } void TIDA::Roi::addTracks( const std::vector<TIDA::Track*>& trackp) { - clear(); + m_tracks.clear(); m_tracks.reserve(trackp.size()); for ( unsigned i=0 ; i<trackp.size() ; i++ ) m_tracks.push_back(*trackp[i]); } diff --git a/Trigger/TrigAnalysis/TrigInDetAnalysisExample/TrigInDetAnalysisExample/T_AnalysisConfigMT_Tier0.h b/Trigger/TrigAnalysis/TrigInDetAnalysisExample/TrigInDetAnalysisExample/T_AnalysisConfigMT_Tier0.h index 938129828f10bb17d7366bb0dce7604a94283a32..0c8268a234e4c12970fa50cf1f5e880360d87638 100644 --- a/Trigger/TrigAnalysis/TrigInDetAnalysisExample/TrigInDetAnalysisExample/T_AnalysisConfigMT_Tier0.h +++ b/Trigger/TrigAnalysis/TrigInDetAnalysisExample/TrigInDetAnalysisExample/T_AnalysisConfigMT_Tier0.h @@ -250,9 +250,8 @@ protected: m_first = false; - m_provider->msg(MSG::VERBOSE) << " using beam position\tx=" << xbeam << "\ty=" << ybeam << endmsg; - - if (m_provider->msg().level() <= MSG::VERBOSE) { + if ( m_provider->msg().level() <= MSG::VERBOSE ) { + m_provider->msg(MSG::VERBOSE) << " using beam position\tx=" << xbeam << "\ty=" << ybeam << endmsg; std::vector<std::string> configuredChains = (*(m_tdt))->getListOfTriggers("L2_.*, EF_.*, HLT_.*"); @@ -278,8 +277,10 @@ protected: /// get chain ChainString& chainName = (*chainitr); - m_provider->msg(MSG::INFO) << "process chain " << chainName << endmsg; - + if (m_provider->msg().level() <= MSG::VERBOSE) { + m_provider->msg(MSG::VERBOSE) << "process chain " << chainName << endmsg; + } + if ( chainName.head() == "" ) { std::string selectChain; @@ -338,10 +339,10 @@ protected: // m_chainNames.insert( m_chainNames.end(), chains.begin(), chains.end() ); m_chainNames = chains; - for ( unsigned ic=0 ; ic<m_chainNames.size() ; ic++ ) m_provider->msg(MSG::VERBOSE) << "Analyse chain " << m_chainNames[ic] << endmsg; - - // for ( unsigned ic=0 ; ic<m_chainNames.size() ; ic++ ) std::cout << "loop():: Analyse chain " << m_chainNames[ic] << std::endl; - + if(m_provider->msg().level() <= MSG::VERBOSE) { + for ( size_t ic=m_chainNames.size() ; ic-- ; ) m_provider->msg(MSG::VERBOSE) << "Analyse chain " << m_chainNames[ic] << endmsg; + } + } /// end of first event setup @@ -514,38 +515,12 @@ protected: std::vector<double> refbeamspot; std::vector<double> testbeamspot; + /// fetch offline vertices ... - - //std::vector<TIDA::Vertex> vertices; - m_provider->msg(MSG::VERBOSE) << "fetching AOD Primary vertex container" << endmsg; - const xAOD::VertexContainer* xaodVtxCollection = 0; - - if ( m_provider->evtStore()->retrieve( xaodVtxCollection, "PrimaryVertices" ).isFailure()) { - m_provider->msg(MSG::WARNING) << "xAOD Primary vertex container not found with key " << "PrimaryVertices" << endmsg; - } - - if ( xaodVtxCollection!=0 ) { - - m_provider->msg(MSG::VERBOSE) << "xAOD Primary vertex container " << xaodVtxCollection->size() << " entries" << endmsg; - - xAOD::VertexContainer::const_iterator vtxitr = xaodVtxCollection->begin(); - for ( ; vtxitr != xaodVtxCollection->end(); vtxitr++ ) { - if ( (*vtxitr)->nTrackParticles()>0 && (*vtxitr)->vertexType()!=0 ) { - vertices.push_back( TIDA::Vertex( (*vtxitr)->x(), - (*vtxitr)->y(), - (*vtxitr)->z(), - /// variances - (*vtxitr)->covariancePosition()(Trk::x,Trk::x), - (*vtxitr)->covariancePosition()(Trk::y,Trk::y), - (*vtxitr)->covariancePosition()(Trk::z,Trk::z), - (*vtxitr)->nTrackParticles(), - /// quality - (*vtxitr)->chiSquared(), - (*vtxitr)->numberDoF() ) ); - } - } + if ( !this->select( vertices, "PrimaryVertices" ) ) { + m_provider->msg(MSG::VERBOSE) << "could not retrieve vertex collection " "PrimaryVertices" << std::endl; } /// add the truth particles if needed @@ -680,6 +655,18 @@ protected: chain.back().addTracks(testtracks); + if ( vtx_name!="" ) { + + /// MT Vertex access + + m_provider->msg(MSG::VERBOSE) << "\tFetch xAOD::VertexContainer with key " << vtx_name << endmsg; + + std::vector<TIDA::Vertex> tidavertices; + + if ( this->select( tidavertices, vtx_name ) ) chain.back().addVertices( tidavertices ); + } + + if ( roiInfo ) delete roiInfo; } @@ -757,50 +744,16 @@ protected: /// now get the vertices if ( vtx_name!="" ) { - - m_provider->msg(MSG::VERBOSE) << "\tFetch xAOD::VertexContainer for chain " << chainConfig << " with key " << vtx_name << endmsg; - - std::pair< xAOD::VertexContainer::const_iterator, - xAOD::VertexContainer::const_iterator > vtx_itrpair = this->template getCollection<xAOD::VertexContainer>( roi_link, vtx_name ); - - if ( vtx_itrpair.first == vtx_itrpair.second ) { - m_provider->msg(MSG::WARNING) << "\tNo xAOD::Vertex for chain " << chainName << " for key " << vtx_name << endmsg; - } - else { - - m_provider->msg(MSG::INFO) << "\txAOD::VertexContainer found with size " << (vtx_itrpair.second - vtx_itrpair.first) - << "\t" << vtx_name << endmsg; - - xAOD::VertexContainer::const_iterator vtxitr = vtx_itrpair.first; - - for ( ; vtxitr!=vtx_itrpair.second ; vtxitr++ ) { - - /// leave this code commented so that we have a record of the change - as soon as we can - /// fix the missing track multiplicity from the vertex this will need to go back - // if ( ( (*vtxitr)->nTrackParticles()>0 && (*vtxitr)->vertexType()!=0 ) || vtx_name=="EFHistoPrmVtx" ) { - if ( (*vtxitr)->vertexType()!=0 || vtx_name=="EFHistoPrmVtx" ) { - - m_provider->msg(MSG::VERBOSE) << "\tvertex " << chainConfig << " " << (*vtxitr) << "\t name" << vtx_name << endmsg; - - chain.back().addVertex( TIDA::Vertex( (*vtxitr)->x(), - (*vtxitr)->y(), - (*vtxitr)->z(), - /// variances - (*vtxitr)->covariancePosition()(Trk::x,Trk::x), - (*vtxitr)->covariancePosition()(Trk::y,Trk::y), - (*vtxitr)->covariancePosition()(Trk::z,Trk::z), - (*vtxitr)->nTrackParticles(), - /// quality - (*vtxitr)->chiSquared(), - (*vtxitr)->numberDoF() ) ); - - } - } - } + std::vector<TIDA::Vertex> tidavertices; + + this->select( vertices, roi_link, vtx_name ); + + chain.back().addVertices( tidavertices ); } /// retrieve online vertices + #if 0 if ( dbg ) { std::cout << "\tTIDA analysis for chain: " << chainname << "\t key: " << key << "\t" << **roiptr << std::endl; diff --git a/Trigger/TrigAnalysis/TrigInDetAnalysisExample/src/AnalysisConfigMT_Ntuple.cxx b/Trigger/TrigAnalysis/TrigInDetAnalysisExample/src/AnalysisConfigMT_Ntuple.cxx index 149b90f237e2ad3de5dd5aaeb21250a1a97e5707..183061cf891c625d86067ee49aa894f95912d41a 100644 --- a/Trigger/TrigAnalysis/TrigInDetAnalysisExample/src/AnalysisConfigMT_Ntuple.cxx +++ b/Trigger/TrigAnalysis/TrigInDetAnalysisExample/src/AnalysisConfigMT_Ntuple.cxx @@ -102,9 +102,9 @@ void AnalysisConfigMT_Ntuple::loop() { std::vector<std::string> configuredChains = (*m_tdt)->getListOfTriggers("L2_.*, EF_.*, HLT_.*"); - // m_provider->msg(MSG::INFO) << "[91;1m" << configuredChains.size() << " Configured Chains" << "[m" << endmsg; + m_provider->msg(MSG::VERBOSE) << "[91;1m" << configuredChains.size() << " Configured Chains" << "[m" << endmsg; for ( unsigned i=0 ; i<configuredChains.size() ; i++ ) { - // m_provider->msg(MSG::INFO) << "[91;1m" << "Chain " << configuredChains[i] << " (ACN)[m" << endmsg; + // m_provider->msg(MSG::VERBOSE) << "[91;1m" << "Chain " << configuredChains[i] << " (ACN)[m" << endmsg; configuredHLTChains.insert( configuredChains[i] ); } @@ -528,6 +528,7 @@ void AnalysisConfigMT_Ntuple::loop() { m_provider->msg(MSG::INFO) << "xAOD Primary vertex container " << xaodVtxCollection->size() << " entries" << endmsg; xAOD::VertexContainer::const_iterator vtxitr = xaodVtxCollection->begin(); + for ( ; vtxitr != xaodVtxCollection->end(); vtxitr++ ) { /// useful debug information - leave in @@ -568,11 +569,13 @@ void AnalysisConfigMT_Ntuple::loop() { /// useful debug information - leave in // std::cout << "SUTT Nvertices " << vertices.size() << "\ttype 101 " << vertices_full.size() << std::endl; +#if 0 + /// don;t add them to the event - since now we store them in the Vertex chain ... for ( unsigned i=0 ; i<vertices.size() ; i++ ) { m_provider->msg(MSG::DEBUG) << "vertex " << i << " " << vertices[i] << endmsg; m_event->addVertex(vertices[i]); } - +#endif /// offline object counters @@ -628,12 +631,17 @@ void AnalysisConfigMT_Ntuple::loop() { /// get the chain, collection and TE names and track index - const std::string& chainname = m_chainNames[ichain].head(); - const std::string& collectionname = m_chainNames[ichain].tail(); + std::string chainname = m_chainNames[ichain].head(); + std::string collectionname = m_chainNames[ichain].tail(); + std::string vtx_name = m_chainNames[ichain].vtx(); + if ( chainname!="" ) continue; if ( collectionname=="" ) continue; + chainname = collectionname; + if ( vtx_name!="" ) chainname += ":" + vtx_name; + /// useful debug information - leave this here // const std::string& index = m_chainNames[ichain].extra(); @@ -668,12 +676,72 @@ void AnalysisConfigMT_Ntuple::loop() { m_provider->msg(MSG::WARNING) << "\tcollection " << collectionname << " not found" << endmsg; } + + /// now retrieve any verttices for the analysis + + std::vector<TIDA::Vertex> tidavertices; + + m_provider->msg(MSG::INFO) << "\tFetch xAOD::VertexContainer with key " << vtx_name << endmsg; + + if ( vtx_name!="" ) { + + m_provider->msg(MSG::INFO) << "\tFetch xAOD::VertexContainer with key " << vtx_name << endmsg; + + /// MT Vertex access + + const xAOD::VertexContainer* xaodVtxCollection = 0; + + if ( m_provider->evtStore()->retrieve( xaodVtxCollection, vtx_name ).isFailure() ) { + m_provider->msg(MSG::WARNING) << "xAOD vertex container not found with key " << vtx_name << endmsg; + } + + if ( xaodVtxCollection!=0 ) { + + m_provider->msg(MSG::INFO) << "\txAOD::VertexContainer found with size " << xaodVtxCollection->size() + << "\t" << vtx_name << endmsg; + + xAOD::VertexContainer::const_iterator vtxitr = xaodVtxCollection->begin(); + + for ( ; vtxitr!=xaodVtxCollection->end() ; vtxitr++ ) { + + /// leave this code commented so that we have a record of the change - as soon as we can + /// fix the missing track multiplicity from the vertex this will need to go back + // if ( ( (*vtxitr)->nTrackParticles()>0 && (*vtxitr)->vertexType()!=0 ) || vtx_name=="EFHistoPrmVtx" ) { + + // useful debug comment, left for debugging purposes ... + // std::cout << "SUTT xAOD::Vertex::type() " << (*vtxitr)->type() + // << "\tvtxtype " << (*vtxitr)->vertexType() + // << "\tntrax " << (*vtxitr)->nTrackParticles() + // << "\tz " << (*vtxitr)->z() << std::endl; + + if ( (*vtxitr)->vertexType()!=0 || vtx_name=="EFHistoPrmVtx" ) { + tidavertices.push_back( TIDA::Vertex( (*vtxitr)->x(), + (*vtxitr)->y(), + (*vtxitr)->z(), + /// variances + (*vtxitr)->covariancePosition()(Trk::x,Trk::x), + (*vtxitr)->covariancePosition()(Trk::y,Trk::y), + (*vtxitr)->covariancePosition()(Trk::z,Trk::z), + (*vtxitr)->nTrackParticles(), + /// quality + (*vtxitr)->chiSquared(), + (*vtxitr)->numberDoF() ) ); + } + } + + } + + } + + + if ( found ) { - m_event->addChain( collectionname ); + m_event->addChain( chainname ); m_event->back().addRoi(TIDARoiDescriptor(true)); + if ( vtx_name!="" ) m_event->back().back().addVertices( tidavertices ); m_event->back().back().addTracks(selectorTest.tracks()); - + if ( selectorTest.getBeamX()!=0 || selectorTest.getBeamY()!=0 || selectorTest.getBeamZ()!=0 ) { std::vector<double> beamline_; beamline_.push_back( selectorTest.getBeamX() ); diff --git a/Trigger/TrigAnalysis/TrigInDetAnalysisUser/Analysis/src/ConfAnalysis.cxx b/Trigger/TrigAnalysis/TrigInDetAnalysisUser/Analysis/src/ConfAnalysis.cxx index ed8eb1fd28b0600bbca5cb49727dd800955f1c16..b0855525ee2b106e6b7d0f082c17d2c895aba886 100644 --- a/Trigger/TrigAnalysis/TrigInDetAnalysisUser/Analysis/src/ConfAnalysis.cxx +++ b/Trigger/TrigAnalysis/TrigInDetAnalysisUser/Analysis/src/ConfAnalysis.cxx @@ -649,7 +649,7 @@ void ConfAnalysis::initialiseInternal() { // hit occupancies int NHits = 40; - int Ntracks = 1000; + int Ntracks = 10000; addHistogram( new TH1F( "nsct", "nsct", NHits, -0.5, float(NHits-0.5) ) ); addHistogram( new TH1F( "nsct_rec", "nsct_rec", NHits, -0.5, float(NHits-0.5) ) ); diff --git a/Trigger/TrigAnalysis/TrigInDetAnalysisUser/Analysis/src/comparitor.cxx b/Trigger/TrigAnalysis/TrigInDetAnalysisUser/Analysis/src/comparitor.cxx index 176d7de22728a327c66321cebe573599c5517844..03924a3b0dff113e2aeaea3b058be473a95be3f7 100644 --- a/Trigger/TrigAnalysis/TrigInDetAnalysisUser/Analysis/src/comparitor.cxx +++ b/Trigger/TrigAnalysis/TrigInDetAnalysisUser/Analysis/src/comparitor.cxx @@ -1781,11 +1781,23 @@ int main(int argc, char** argv) { #if 1 if ( contains(histo.name(),"ntracks") ) { - htest->Rebin(2); - htest->Sumw2(); - if ( !noreftmp ) { - href->Rebin(2); - href->Sumw2(); + + double xm = htest->GetMean(); + + if ( xm>=10 ) { + double lxm = std::log10(xm); + int newbins = int(0.5+xm/std::pow(10,int(lxm)))*pow(10,int(lxm)); + int nrebin = int( (newbins+5)/10 ); + + if ( nrebin>1 ) { + std::cout << "rebin: " << htest->GetName() << "\tbins: " << nrebin << std::endl; + htest->Rebin(nrebin); + htest->Sumw2(); + if ( !noreftmp ) { + href->Rebin(nrebin); + href->Sumw2(); + } + } } } #endif @@ -1853,16 +1865,21 @@ int main(int argc, char** argv) { std::cout << "actual chain: " << actual_chain << std::endl; - + if ( actual_chain.find("HLT_IDTrack_")!=std::string::npos ) actual_chain.erase( actual_chain.find("HLT_IDTrack_"), 12 ); if ( actual_chain.find("_idperf")!=std::string::npos ) actual_chain.erase( actual_chain.find("_idperf"), 7 ); if ( actual_chain.find("_bperf")!=std::string::npos ) actual_chain.erase( actual_chain.find("_bperf"), 6 ); if ( actual_chain.find("_boffperf")!=std::string::npos ) actual_chain.erase( actual_chain.find("_boffperf"), 9 ); + if ( actual_chain.find("_HLT_")!=std::string::npos ) actual_chain.replace( actual_chain.find("_HLT_"), 5, " " ); + if ( actual_chain.find("HLT_")!=std::string::npos ) actual_chain.erase( actual_chain.find("HLT_"), 4 ); if ( collection.find("_IDTrkNoCut")!=std::string::npos ) collection.erase( collection.find("_IDTrkNoCut"), 11 ); if ( collection.find("xAODCnv")!=std::string::npos ) collection.erase( collection.find("xAODCnv"), 7 ); + if ( collection.find("HLT_IDTrack_")!=std::string::npos ) collection.erase( collection.find("HLT_IDTrack_"), 12 ); if ( collection.find("HLT_IDTrack")!=std::string::npos ) collection.erase( collection.find("HLT_IDTrack"), 11 ); if ( collection.find("Tracking")!=std::string::npos ) collection.replace( collection.find("Tracking"), 8, "Trk" ); if ( collection.find("InDetTrigTrk_")!=std::string::npos ) collection.erase( collection.find("InDetTrigTrk_"), 13 ); if ( collection.find("HLT_xAODTracks_")!=std::string::npos ) collection.erase( collection.find("HLT_xAODTracks_"), 15 ); + if ( collection.find("_HLT_")!=std::string::npos ) collection.replace( collection.find("_HLT_"), 5, " " ); + if ( collection.find("HLT_")!=std::string::npos ) collection.erase( collection.find("HLT_"), 4 ); std::string c = actual_chain + " : " + collection; diff --git a/Trigger/TrigAnalysis/TrigInDetAnalysisUser/Analysis/src/rmain.cxx b/Trigger/TrigAnalysis/TrigInDetAnalysisUser/Analysis/src/rmain.cxx index a2fb73f028aa0c07f21d4d3faf0b3a61eafbe865..f32b4b4e31f4626684cf077fa1efe186ee5edb67 100644 --- a/Trigger/TrigAnalysis/TrigInDetAnalysisUser/Analysis/src/rmain.cxx +++ b/Trigger/TrigAnalysis/TrigInDetAnalysisUser/Analysis/src/rmain.cxx @@ -342,7 +342,6 @@ int usage(const std::string& name, int status) { // s << "\nSee " << PACKAGE_URL << " for more details\n"; s << "\nReport bugs to sutt@cern.ch"; s << std::endl; - return status; } @@ -781,7 +780,8 @@ int main(int argc, char** argv) else vtxind_rec = atoi_check( vertexSelection_rec ); } - + std::cout << "vertexSelection: " << vertexSelection << std::endl; + std::cout << "vertexSelection_rec: " << vertexSelection_rec << std::endl; #if 0 @@ -1390,7 +1390,10 @@ int main(int argc, char** argv) std::cout << "starting event loop " << time_str() << std::endl; - for ( unsigned ifile=0 ; run && ifile<filenames.size() && ( nfiles==0 || ifile<nfiles ) ; ifile++ ) { + size_t max_files = filenames.size(); + if ( nfiles!=0 && nfiles<max_files ) max_files = nfiles; + + for ( size_t ifile=0 ; run && ifile<max_files; ifile++ ) { bool newfile = true; @@ -1453,6 +1456,8 @@ int main(int argc, char** argv) // Nentries++; data->GetEntry(i); + + // if (i==0) { // std::cout << "TrkNtuple generated with: " << *releaseMetaData << std::endl;//Only necessary for first event // } @@ -1503,25 +1508,23 @@ int main(int argc, char** argv) hevent->Fill( event ); - - if ( filenames.size()<2 ) { - if ( (Nentries<10) || i%(Nentries/10)==0 || i%1000==0 || debugPrintout ) { + if ( (cNentries<10) || i%(cNentries/10)==0 || i%1000==0 || debugPrintout ) { std::cout << "run " << track_ev->run_number() << "\tevent " << track_ev->event_number() << "\tlb " << track_ev->lumi_block() << "\tchains " << track_ev->chains().size() << "\ttime " << track_ev->time_stamp(); - std::cout << "\t : processed " << i << " events so far (" << int((1000*i)/Nentries)*0.1 << "%)\t" << time_str() << std::endl; + std::cout << "\t : processed " << i << " events so far (" << int((1000*i)/cNentries)*0.1 << "%)\t" << time_str() << std::endl; // std::cerr << "\tprocessed " << i << " events so far \t" << time_str() << std::endl; } } - - if ( newfile ) { + else if ( newfile ) { int pfiles = filenames.size(); if ( nfiles>0 ) pfiles = nfiles; + std::cout << "file entries=" << data->GetEntries(); if ( data->GetEntries()<100 ) std::cout << " "; @@ -1566,7 +1569,7 @@ int main(int argc, char** argv) if ( truthMatch ) { for (unsigned int ic=0 ; ic<chains.size() ; ic++ ) { if ( chains[ic].name()=="Truth" ) { - truthTracks.selectTracks( chains[ic].rois()[0].tracks() ); + truthTracks.selectTracks( chains[ic][0].tracks() ); break; } } @@ -1575,9 +1578,9 @@ int main(int argc, char** argv) //// get the reference tracks for (unsigned int ic=0 ; ic<chains.size() ; ic++ ) { if ( chains[ic].name()==refChain ) { - offTracks.selectTracks( chains[ic].rois()[0].tracks() ); + offTracks.selectTracks( chains[ic][0].tracks() ); //extract beamline position values from rois - beamline_ref = chains[ic].rois()[0].user(); + beamline_ref = chains[ic][0].user(); // std::cout << "beamline: " << chains[ic].name() << " " << beamline_ref << std::endl; break; } @@ -1587,56 +1590,63 @@ int main(int argc, char** argv) /// select the reference offline vertices std::vector<TIDA::Vertex> vertices; - - const std::vector<TIDA::Vertex>& mv = track_ev->vertices(); - int selectvtx = -1; - double selection = 0; + // const std::vector<TIDA::Vertex>& mv = track_ev->vertices(); - // std::vector<TIDA::Vertex>& vertices = vertices; - - if ( bestPTVtx || bestPT2Vtx ) { - for ( unsigned iv=0 ; iv<mv.size() ; iv++ ) { - if ( mv[iv].Ntracks()==0 ) continue; - double selection_ = 0.0; - for (unsigned itr=0; itr<offTracks.tracks().size(); itr++){ + const TIDA::Chain* vtxchain = track_ev->chain("Vertex"); + + if ( vtxchain && vtxchain->size()>0 ) { + + const std::vector<TIDA::Vertex>& mv = vtxchain->at(0).vertices(); + + int selectvtx = -1; + double selection = 0; + + // std::vector<TIDA::Vertex>& vertices = vertices; + if ( debugPrintout ) std::cout << "vertices:\n" << mv << std::endl; + + if ( bestPTVtx || bestPT2Vtx ) { + for ( size_t iv=0 ; iv<mv.size() ; iv++ ) { + if ( mv[iv].Ntracks()==0 ) continue; + double selection_ = 0.0; + for (unsigned itr=0; itr<offTracks.tracks().size(); itr++){ TIDA::Track* tr = offTracks.tracks().at(itr); if( std::fabs(mv[iv].z()-tr->z0()) < 1.5 ) { if ( bestPTVtx ) selection_ += std::fabs(tr->pT()); else if ( bestPT2Vtx ) selection_ += std::fabs(tr->pT())*std::fabs(tr->pT()); } } - if( selection_>selection){ - selection = selection_; - selectvtx = iv; - } + if( selection_>selection){ + selection = selection_; + selectvtx = iv; + } + } + if ( selectvtx!=-1 ) vertices.push_back( mv[selectvtx] ); } - if ( selectvtx!=-1 ) vertices.push_back( mv[selectvtx] ); - } - else if ( vtxind>=0 ) { - if ( unsigned(vtxind)<mv.size() ) vertices.push_back( mv[vtxind] ); - } - else { - for ( unsigned iv=0 ; iv<mv.size() ; iv++ ) vertices.push_back( mv[iv] ); - } - - - // if ( vertices.size()>0 ) std::cout << "vertex " << vertices[0] << std::endl; - // else std::cout << "NO vertex !!!" << std::endl; - - /// always push back the vector - if required there will be only one vertex on it - filter_vertex.setVertex( vertices ); - - /// calculate number of "vertex tracks" - - NvtxCount = 0; - - for ( unsigned iv=0 ; iv<mv.size() ; iv++ ) { - int Ntracks = mv[iv].Ntracks(); - if ( Ntracks>NVtxTrackCut ) { /// do we really want this cut ??? - Nvtxtracks += Ntracks; - // vertices.push_back( mv[iv] ); - NvtxCount++; + else if ( vtxind>=0 ) { + if ( size_t(vtxind)<mv.size() ) vertices.push_back( mv[vtxind] ); + } + else { + for ( size_t iv=0 ; iv<mv.size() ; iv++ ) vertices.push_back( mv[iv] ); + } + + // if ( vertices.size()>0 ) std::cout << "vertex " << vertices[0] << std::endl; + // else std::cout << "NO vertex !!!" << std::endl; + + /// always push back the vector - if required there will be only one vertex on it + filter_vertex.setVertex( vertices ); + + /// calculate number of "vertex tracks" + + NvtxCount = 0; + + for ( unsigned iv=0 ; iv<mv.size() ; iv++ ) { + int Ntracks = mv[iv].Ntracks(); + if ( Ntracks>NVtxTrackCut ) { /// do we really want this cut ??? + Nvtxtracks += Ntracks; + // vertices.push_back( mv[iv] ); + NvtxCount++; + } } } @@ -1682,7 +1692,6 @@ int main(int argc, char** argv) if ( !foundReference ) continue; if ( debugPrintout ) { - std::cout << "vertices:\n" << mv << std::endl; std::cout << "reference chain:\n" << *refchain << std::endl; } diff --git a/Trigger/TrigAnalysis/TrigInDetAnalysisUtils/TrigInDetAnalysisUtils/T_AnalysisConfig.h b/Trigger/TrigAnalysis/TrigInDetAnalysisUtils/TrigInDetAnalysisUtils/T_AnalysisConfig.h index 69ec81e65114b3626acbd8e130f5e4ab9d6364b5..d4b82488aa9f2e6306ebd469f15daac4042c6466 100644 --- a/Trigger/TrigAnalysis/TrigInDetAnalysisUtils/TrigInDetAnalysisUtils/T_AnalysisConfig.h +++ b/Trigger/TrigAnalysis/TrigInDetAnalysisUtils/TrigInDetAnalysisUtils/T_AnalysisConfig.h @@ -327,8 +327,116 @@ protected: return itrpair; } + + + + + + + + + + + bool select( std::vector<TIDA::Vertex>& vertices, + xAOD::VertexContainer::const_iterator vtx_start, + xAOD::VertexContainer::const_iterator vtx_end ) { + + xAOD::VertexContainer::const_iterator vtxitr = vtx_start; + + for ( ; vtxitr!=vtx_end ; vtxitr++ ) { + if ( (*vtxitr)->vertexType()!=0 ) { + m_provider->msg(MSG::VERBOSE) << "\tvertex " << (*vtxitr)->z() << endmsg; + + vertices.push_back( TIDA::Vertex( (*vtxitr)->x(), + (*vtxitr)->y(), + (*vtxitr)->z(), + /// variances + (*vtxitr)->covariancePosition()(Trk::x,Trk::x), + (*vtxitr)->covariancePosition()(Trk::y,Trk::y), + (*vtxitr)->covariancePosition()(Trk::z,Trk::z), + (*vtxitr)->nTrackParticles(), + /// quality + (*vtxitr)->chiSquared(), + (*vtxitr)->numberDoF() ) ); + + } + } + + return true; + } + + + bool select( std::vector<TIDA::Vertex>& vertices, + const ElementLink<TrigRoiDescriptorCollection>& roi_link, + const std::string& key="" ) { + + m_provider->msg(MSG::VERBOSE) << "\tFetch xAOD::VertexContainer for key: " << key << endmsg; + + std::pair< xAOD::VertexContainer::const_iterator, + xAOD::VertexContainer::const_iterator > vtx_itrpair = this->template getCollection<xAOD::VertexContainer>( roi_link, key ); + + if ( vtx_itrpair.first == vtx_itrpair.second ) { + m_provider->msg(MSG::WARNING) << "\tNo xAOD::Vertex collection for key " << key << endmsg; + return false; + } + + m_provider->msg(MSG::INFO) << "\txAOD::VertexContainer found with size " << (vtx_itrpair.second - vtx_itrpair.first) + << "\t:" << key << endmsg; + + return select( vertices, vtx_itrpair.first, vtx_itrpair.second ); + } + + + + + bool select( std::vector<TIDA::Vertex>& vertices, const std::string& key="" ) { + + m_provider->msg(MSG::VERBOSE) << "fetching AOD vertex container" << endmsg; + + const xAOD::VertexContainer* xaodVtxCollection = 0; + + if ( m_provider->evtStore()->retrieve( xaodVtxCollection, key ).isFailure()) { + m_provider->msg(MSG::WARNING) << "xAOD vertex container not found with key " << key << endmsg; + return false; + } + + if ( xaodVtxCollection!=0 ) { + + m_provider->msg(MSG::VERBOSE) << "xAOD vertex container " << xaodVtxCollection->size() << " entries" << endmsg; + + return select( vertices, xaodVtxCollection->begin(), xaodVtxCollection->end() ); + +#if 0 + + xAOD::VertexContainer::const_iterator vtxitr = xaodVtxCollection->begin(); + + for ( ; vtxitr != xaodVtxCollection->end(); vtxitr++ ) { + if ( (*vtxitr)->nTrackParticles()>0 && (*vtxitr)->vertexType()!=0 ) { + vertices.push_back( TIDA::Vertex( (*vtxitr)->x(), + (*vtxitr)->y(), + (*vtxitr)->z(), + /// variances + (*vtxitr)->covariancePosition()(Trk::x,Trk::x), + (*vtxitr)->covariancePosition()(Trk::y,Trk::y), + (*vtxitr)->covariancePosition()(Trk::z,Trk::z), + (*vtxitr)->nTrackParticles(), + /// quality + (*vtxitr)->chiSquared(), + (*vtxitr)->numberDoF() ) ); + } + } + +#endif + + } + + return true; + } + + + template<class Collection> bool selectTracks( TrigTrackSelector* selector, // const TrigCompositeUtils::LinkInfo<TrigRoiDescriptorCollection> roi_link, diff --git a/Trigger/TrigConfiguration/TrigConfigSvc/python/TrigConfigSvcCfg.py b/Trigger/TrigConfiguration/TrigConfigSvc/python/TrigConfigSvcCfg.py index 35c9ac9e5b2e3c15e4269f13b577263e384dbbdc..78d2235659d61bff3f46c46b587aff97630f1119 100644 --- a/Trigger/TrigConfiguration/TrigConfigSvc/python/TrigConfigSvcCfg.py +++ b/Trigger/TrigConfiguration/TrigConfigSvc/python/TrigConfigSvcCfg.py @@ -12,65 +12,45 @@ def getHLTPrescaleFolderName(): # L1 Json file name -def getL1MenuFileName( flags=None ): - if flags is None: - from TriggerJobOpts.TriggerFlags import TriggerFlags as tf - l1MenuFileName = 'L1Menu_'+tf.triggerMenuSetup()+'_'+tf.menuVersion()+'.json' - else: - l1MenuFileName = 'L1Menu_'+flags.Trigger.triggerMenuSetup+'_'+flags.Trigger.menuVersion+'.json' +def getL1MenuFileName( flags ): + l1MenuFileName = 'L1Menu_'+flags.Trigger.triggerMenuSetup+'_'+flags.Trigger.menuVersion+'.json' l1MenuFileName = l1MenuFileName.replace(".xml",".json").replace("LVL1config", "L1Menu") l1MenuFileName = l1MenuFileName.replace("_newJO","") return l1MenuFileName # HLT Json file name -def getHLTMenuFileName( flags=None ): - if flags is None: - from TriggerJobOpts.TriggerFlags import TriggerFlags as tf - hltMenuFileName = 'HLTMenu_'+tf.triggerMenuSetup()+'_'+tf.menuVersion()+'.json' - else: - hltMenuFileName = 'HLTMenu_'+flags.Trigger.triggerMenuSetup+'_'+flags.Trigger.menuVersion+'.json' +def getHLTMenuFileName( flags ): + hltMenuFileName = 'HLTMenu_'+flags.Trigger.triggerMenuSetup+'_'+flags.Trigger.menuVersion+'.json' hltMenuFileName = hltMenuFileName.replace(".xml",".json").replace("HLTconfig", "HLTMenu").replace("HLTmenu", "HLTMenu") hltMenuFileName = hltMenuFileName.replace("_newJO","") return hltMenuFileName # L1 Prescales set json file name -def getL1PrescalesSetFileName( flags=None ): - if flags is None: - from TriggerJobOpts.TriggerFlags import TriggerFlags as tf - l1PrescalesSetFileName = 'L1PrescalesSet_'+tf.triggerMenuSetup()+'_'+tf.menuVersion()+'.json' - else: - l1PrescalesSetFileName = 'L1PrescalesSet_'+flags.Trigger.triggerMenuSetup+'_'+flags.Trigger.menuVersion+'.json' +def getL1PrescalesSetFileName( flags ): + l1PrescalesSetFileName = 'L1PrescalesSet_'+flags.Trigger.triggerMenuSetup+'_'+flags.Trigger.menuVersion+'.json' return l1PrescalesSetFileName # HLT Prescales set json file name -def getHLTPrescalesSetFileName( flags=None ): - if flags is None: - from TriggerJobOpts.TriggerFlags import TriggerFlags as tf - hltPrescalesSetFileName = 'HLTPrescalesSet_'+tf.triggerMenuSetup()+'_'+tf.menuVersion()+'.json' - else: - hltPrescalesSetFileName = 'HLTPrescalesSet_'+flags.Trigger.triggerMenuSetup+'_'+flags.Trigger.menuVersion+'.json' +def getHLTPrescalesSetFileName( flags ): + hltPrescalesSetFileName = 'HLTPrescalesSet_'+flags.Trigger.triggerMenuSetup+'_'+flags.Trigger.menuVersion+'.json' return hltPrescalesSetFileName # L1 Bunchgroups set json file name -def getBunchGroupSetFileName( flags=None ): - if flags is None: - from TriggerJobOpts.TriggerFlags import TriggerFlags as tf - bunchGroupSetFileName = 'BunchGroupSet_'+tf.triggerMenuSetup()+'_'+tf.menuVersion()+'.json' - else: - bunchGroupSetFileName = 'BunchGroupSet_'+flags.Trigger.triggerMenuSetup+'_'+flags.Trigger.menuVersion+'.json' +def getBunchGroupSetFileName( flags ): + bunchGroupSetFileName = 'BunchGroupSet_'+flags.Trigger.triggerMenuSetup+'_'+flags.Trigger.menuVersion+'.json' return bunchGroupSetFileName # HLT Job options json file name -def getHLTJobOptionsFileName( flags=None ): +def getHLTJobOptionsFileName( ): return 'HLTJobOptions.json' # Creates an L1 Prescale file from the menu # this is a temporary solution, in the final version the L1PrescalesSet file should come from the menu -def createL1PrescalesFileFromMenu( flags=None ): +def createL1PrescalesFileFromMenu( flags ): log = logging.getLogger('TrigConfigSvcCfg') menuFN = getL1MenuFileName( flags ) with open(menuFN,'r') as fh: @@ -94,7 +74,7 @@ def createL1PrescalesFileFromMenu( flags=None ): # Creates an HLT Prescale file from the menu # this is a temporary solution, in the final version the HLTPrescalesSet file should come from the menu -def createHLTPrescalesFileFromMenu( flags=None ): +def createHLTPrescalesFileFromMenu( flags ): log = logging.getLogger('TrigConfigSvcCfg') menuFN = getHLTMenuFileName( flags ) with open(menuFN,'r') as fh: @@ -118,15 +98,10 @@ def createHLTPrescalesFileFromMenu( flags=None ): log.info("Generated default HLT prescale set %s", outfile.name) -def getTrigConfigFromFlag( flags=None ): +def getTrigConfigFromFlag( flags ): log = logging.getLogger('TrigConfigSvcCfg') - if flags is None: # old-style TriggerFlags - from TriggerJobOpts.TriggerFlags import TriggerFlags as tf - tcflag = tf.triggerConfig() if tf.triggerConfig.statusOn else None - log.info("Parsing old-style trigger flags 'triggerConfig': %s", tcflag) - else: - tcflag = flags.Trigger.triggerConfig - log.info("Parsing new-style trigger flag 'triggerConfig': %s", tcflag) + tcflag = flags.Trigger.triggerConfig + log.info("Parsing new-style trigger flag 'triggerConfig': %s", tcflag) if tcflag is None: tcflag = "FILE" source, dbconn, keys = (tcflag+":::").split(":")[:3] @@ -152,16 +127,12 @@ def getTrigConfigFromFlag( flags=None ): # L1 menu generation @memoize -def generateL1Menu( flags=None ): +def generateL1Menu( flags ): log = logging.getLogger('TrigConfigSvcCfg') - from TriggerJobOpts.TriggerFlags import TriggerFlags fileName = getL1MenuFileName( flags ) - if flags: - TriggerFlags.triggerMenuSetup = flags.Trigger.triggerMenuSetup - menuName = TriggerFlags.triggerMenuSetup() if flags is None else flags.Trigger.triggerMenuSetup - log.info("Generating L1 menu %s", menuName) + log.info("Generating L1 menu %s", flags.Trigger.triggerMenuSetup) from TriggerMenuMT.L1.L1MenuConfig import L1MenuConfig - l1cfg = L1MenuConfig( menuName = menuName ) + l1cfg = L1MenuConfig( menuName = flags.Trigger.triggerMenuSetup) outfile = l1cfg.writeJSON(outputFile = fileName) if outfile is not None: log.info("Wrote L1 menu file %s", outfile) @@ -170,18 +141,18 @@ def generateL1Menu( flags=None ): # configuration of L1ConfigSvc @memoize -def getL1ConfigSvc( flags = None ): +def getL1ConfigSvc( flags ): log = logging.getLogger('TrigConfigSvcCfg') from AthenaCommon.Logging import log - from TriggerJobOpts.TriggerFlags import TriggerFlags # generate menu file - generatedFile = generateL1Menu( flags=flags ) + generatedFile = generateL1Menu( flags ) # configure config svc TrigConf__LVL1ConfigSvc = CompFactory.getComp("TrigConf::LVL1ConfigSvc") l1ConfigSvc = TrigConf__LVL1ConfigSvc("LVL1ConfigSvc") l1ConfigSvc.ConfigSource = "XML" + from TriggerJobOpts.TriggerFlags import TriggerFlags l1XMLFile = TriggerFlags.inputLVL1configFile() if flags is None else flags.Trigger.LVL1ConfigFile # check if file exists in this directory otherwise add the package to aid path resolution # also a '/' in the file name indicates that no package needs to be added @@ -208,7 +179,7 @@ def getL1ConfigSvc( flags = None ): # configuration of HLTConfigSvc @memoize -def getHLTConfigSvc( flags = None ): +def getHLTConfigSvc( flags ): log = logging.getLogger('TrigConfigSvcCfg') TrigConf__HLTConfigSvc = CompFactory.getComp("TrigConf::HLTConfigSvc") hltConfigSvc = TrigConf__HLTConfigSvc("HLTConfigSvc") diff --git a/Trigger/TrigMonitoring/TrigBjetMonitoring/python/TrigBjetMonitorAlgorithm.py b/Trigger/TrigMonitoring/TrigBjetMonitoring/python/TrigBjetMonitorAlgorithm.py index 9f46002882518f1323a101ff4d0ab00b98e1fe44..244c1569c3c73835de51b61f9d8c624ccc88b2ee 100644 --- a/Trigger/TrigMonitoring/TrigBjetMonitoring/python/TrigBjetMonitorAlgorithm.py +++ b/Trigger/TrigMonitoring/TrigBjetMonitoring/python/TrigBjetMonitorAlgorithm.py @@ -304,14 +304,85 @@ def TrigBjetMonConfig(inputFlags): # b-tagging quantities - HistName = 'wMV2c20_' + chain[2:] + HistName = 'IP3D_pu_tr_' + chain[2:] if chain[0:1] == "E" : - BjetMonGroup.defineHistogram(HistName, title='Distribution of MV2c20 discriminant;MV2c20;Events', + BjetMonGroup.defineHistogram(HistName, title='IP3D_pu probability distribution;IP3D_pu;Events', + path='Expert/'+chain[2:],xbins=200,xmin=0.0,xmax=1.0) + if chain[0:1] == "S" : + BjetMonGroup.defineHistogram(HistName, title='IP3D_pu probability distribution;IP3D_pu;Events', + path='Shifter/'+chain[2:],xbins=200,xmin=0.0,xmax=1.0) + + HistName = 'IP3D_pb_tr_' + chain[2:] + if chain[0:1] == "E" : + BjetMonGroup.defineHistogram(HistName, title='IP3D_pb probability distribution;IP3D_pb;Events', + path='Expert/'+chain[2:],xbins=200,xmin=0.0,xmax=1.0) + if chain[0:1] == "S" : + BjetMonGroup.defineHistogram(HistName, title='IP3D_pb probability distribution;IP3D_pb;Events', + path='Shifter/'+chain[2:],xbins=200,xmin=0.0,xmax=1.0) + + HistName = 'IP3D_pc_tr_' + chain[2:] + if chain[0:1] == "E" : + BjetMonGroup.defineHistogram(HistName, title='IP3D_pc probability distribution;IP3D_pc;Events', + path='Expert/'+chain[2:],xbins=200,xmin=0.0,xmax=1.0) + if chain[0:1] == "S" : + BjetMonGroup.defineHistogram(HistName, title='IP3D_pc probability distribution;IP3D_pc;Events', + path='Shifter/'+chain[2:],xbins=200,xmin=0.0,xmax=1.0) + + HistName = 'wIP3D_Rbu_tr_' + chain[2:] + if chain[0:1] == "E" : + BjetMonGroup.defineHistogram(HistName, title='LogLH IP3D_pb/IP3D_pu probability ratio distribution;LogLH IP3D_pb/IP3D_pu;Events', + path='Expert/'+chain[2:],xbins=200,xmin=-4.0,xmax=6.0) + if chain[0:1] == "S" : + BjetMonGroup.defineHistogram(HistName, title='LogLH IP3D_pb/IP3D_pu probability ratio distribution;LogLH IP3D_pb/IP3D_pu;Events', + path='Shifter/'+chain[2:],xbins=200,xmin=-4.0,xmax=6.0) + + HistName = 'wSV1_Rbu_tr_' + chain[2:] + if chain[0:1] == "E" : + BjetMonGroup.defineHistogram(HistName, title='LogLH SV1_pb/SV1_pu probability ratio distribution;LogLH SV1_pb/SV1_pu;Events', + path='Expert/'+chain[2:],xbins=200,xmin=-4.0,xmax=6.0) + if chain[0:1] == "S" : + BjetMonGroup.defineHistogram(HistName, title='LogLH SV1_pb/SV1_pu probability ratio distribution;LogLH SV1_pb/SV1_pu;Events', + path='Shifter/'+chain[2:],xbins=200,xmin=-4.0,xmax=6.0) + + HistName = 'wCOMB_Rbu_tr_' + chain[2:] + if chain[0:1] == "E" : + BjetMonGroup.defineHistogram(HistName, title='LogLH IP3D+SV1 probability ratio distribution;LogLH IP3D+SV1 probability ratio;Events', + path='Expert/'+chain[2:],xbins=200,xmin=-4.0,xmax=6.0) + if chain[0:1] == "S" : + BjetMonGroup.defineHistogram(HistName, title='LogLH IP3D+SV1 probability ratio distribution;LogLH IP3D+SV1 probability ratio;Events', + path='Shifter/'+chain[2:],xbins=200,xmin=-4.0,xmax=6.0) + + HistName = 'wMV2c10_tr_' + chain[2:] + if chain[0:1] == "E" : + BjetMonGroup.defineHistogram(HistName, title='Distribution of MV2c10 discriminant;MV2c10;Events', path='Expert/'+chain[2:],xbins=200,xmin=-1.0,xmax=1.0) - # print " ==> histogram ",HistName," is defined for Expert folder" if chain[0:1] == "S" : - BjetMonGroup.defineHistogram(HistName, title='Distribution of MV2c20 discriminant;MV2c20;Events', + BjetMonGroup.defineHistogram(HistName, title='Distribution of MV2c10 discriminant;MV2c10;Events', path='Shifter/'+chain[2:],xbins=200,xmin=-1.0,xmax=1.0) + + HistName = 'xMVtx_tr_' + chain[2:] + if chain[0:1] == "E" : + BjetMonGroup.defineHistogram(HistName, title='SV1 mass distribution;SV1 mass;Events', + path='Expert/'+chain[2:],xbins=50,xmin=0.0,xmax=10.0) + if chain[0:1] == "S" : + BjetMonGroup.defineHistogram(HistName, title='SV1 mass distribution;SV1 mass;Events', + path='Shifter/'+chain[2:],xbins=50,xmin=0.0,xmax=10.0) + + HistName = 'xEVtx_tr_' + chain[2:] + if chain[0:1] == "E" : + BjetMonGroup.defineHistogram(HistName, title='SV1 E-fraction distribution;SV1 E-fraction;Events', + path='Expert/'+chain[2:],xbins=50,xmin=0.0,xmax=1.0) + if chain[0:1] == "S" : + BjetMonGroup.defineHistogram(HistName, title='SV1 E-fraction distribution;SV1 E-fraction;Events', + path='Shifter/'+chain[2:],xbins=50,xmin=0.0,xmax=1.0) + + HistName = 'xNVtx_tr_' + chain[2:] + if chain[0:1] == "E" : + BjetMonGroup.defineHistogram(HistName, title='Distribution of number of 2-track SV1;Number of 2-track SV1;Events', + path='Expert/'+chain[2:],xbins=40,xmin=0.0,xmax=40.0) + if chain[0:1] == "S" : + BjetMonGroup.defineHistogram(HistName, title='Distribution of number of 2-track SV1;Number of 2-track SV1;Events', + path='Shifter/'+chain[2:],xbins=40,xmin=0.0,xmax=40.0) continue @@ -366,7 +437,7 @@ if __name__=='__main__': # file to be run w/ doRun2 = False # file = '/afs/cern.ch/user/e/ebergeas/work/public/triggermonitoring/nightly_2019-10-20T2130/AOD.pool.root' # file = '/afs/cern.ch/work/e/enagy/public/GenerateAOD/Gen_MT_240919/AOD.pool.root' - file = '/afs/cern.ch/work/e/enagy/public/ARTfiles/MCtest010720.AOD.pool.root' + file = '/afs/cern.ch/work/e/enagy/public/ARTfiles/MCtest310720.AOD.pool.root' # file to be run w/ doRun2 = True # file = '/afs/cern.ch/work/e/enagy/public/GenerateAOD/Gen_ST_240919/AOD.pool.root' # file = '/eos/atlas/atlascerngroupdisk/data-art/build-output/master/Athena/x86_64-centos7-gcc8-opt/2019-09-16T2129/TrigAnalysisTest/test_trigAna_q221_RDOtoAOD_mt1_build/AOD.pool.root' diff --git a/Trigger/TrigMonitoring/TrigBjetMonitoring/src/HLTBjetMonTool.cxx b/Trigger/TrigMonitoring/TrigBjetMonitoring/src/HLTBjetMonTool.cxx index 06de7c3a82a2f0c1dc8e981c309c989a85400392..3c2694a6e89569cf106305f2e0b3fc7524a0e6cc 100755 --- a/Trigger/TrigMonitoring/TrigBjetMonitoring/src/HLTBjetMonTool.cxx +++ b/Trigger/TrigMonitoring/TrigBjetMonitoring/src/HLTBjetMonTool.cxx @@ -128,6 +128,7 @@ StatusCode HLTBjetMonTool::init() { ATH_CHECK( m_offlineVertexContainerKey.initialize() ); ATH_CHECK( m_onlineVertexContainerKey.initialize() ); ATH_CHECK( m_onlineTrackContainerKey.initialize() ); + ATH_CHECK( m_onlineBTaggingContainerKey.initialize() ); return StatusCode::SUCCESS; } @@ -1083,6 +1084,8 @@ StatusCode HLTBjetMonTool::book(){ if(HistJet) hist2("jetEtaPhi"+HistExt,"HLT/BjetMon/"+HistDir)->Fill(jet->eta(),jet->phi()); // zPV associated to the jets in the same event: they are the same for every jet in the same event so only the first zPV should be plotted if (ijet == 0) { + + // Fetch and plot PV std::string vtxname = m_onlineVertexContainerKey.key(); if ( vtxname.find("HLT_")==0 ) vtxname.erase(0,4); auto vertexLinkInfo = TrigCompositeUtils::findLink<xAOD::VertexContainer>(jetLinkInfo.source, vtxname ); // CV 200120 & MS 290620 @@ -1090,7 +1093,70 @@ StatusCode HLTBjetMonTool::book(){ const xAOD::Vertex* vtx = *(vertexLinkInfo.link); ATH_MSG_DEBUG(" PVz_jet from jet link info: " << vtx->z()); // if(HistPV) hist("PVz_tr"+HistExt,"HLT/BjetMon/"+HistDir)->Fill(vtx->z()); - } + + // Fetch and plot BTagging information + + std::string btagname = m_onlineBTaggingContainerKey.key(); + if ( btagname.find("HLT_")==0 ) btagname.erase(0,4); + auto btaggingLinkInfo = TrigCompositeUtils::findLink<xAOD::BTaggingContainer>(jetLinkInfo.source, btagname ); + ATH_CHECK( btaggingLinkInfo.isValid() ) ; + const xAOD::BTagging* btag = *(btaggingLinkInfo.link); + + double wIP3D, wSV1, wCOMB, wMV2c10 = 0.; // discriminant variables + float svp_efrc, svp_mass = -1.; int svp_n2t = -1; // SV1 variables + btag->loglikelihoodratio("IP3D", wIP3D); + btag->loglikelihoodratio("SV1", wSV1); + double SV1_loglikelihoodratioLZ = btag->SV1_loglikelihoodratio(); + wCOMB = wIP3D+wSV1; + + wMV2c10 = btag->auxdata<double>("MV2c10_discriminant"); + + // Suggestion of LZ + btag->variable<float>("SV1", "masssvx", svp_mass); + btag->variable<float>("SV1", "efracsvx", svp_efrc); + btag->variable<int>("SV1", "N2Tpair", svp_n2t); + ATH_MSG_DEBUG(" - Before SV1 check - MVTX / EVTX / NVTX: " << svp_mass << " / " << svp_efrc << " / " << svp_n2t ) ; + if (HistBjet) hist("xNVtx_tr"+HistExt,"HLT/BjetMon/"+HistDir)->Fill(svp_n2t); + if ( svp_n2t > 0 ) { + if (HistBjet) hist("xMVtx_tr"+HistExt,"HLT/BjetMon/"+HistDir)->Fill( svp_mass * 1.e-3 ); + if (HistBjet) hist("xEVtx_tr"+HistExt,"HLT/BjetMon/"+HistDir)->Fill( svp_efrc ); + } // if svp_n2t + // end of suggestion of LZ + ATH_MSG_DEBUG(" - IP3Dpu / IP3Dpb / IP3Dpc: " << btag->IP3D_pu() << " / " << btag->IP3D_pb() << " / " << btag->IP3D_pc() ); + if (HistBjet) hist("IP3D_pu_tr"+HistExt,"HLT/BjetMon/"+HistDir)->Fill(btag->IP3D_pu()); + if (HistBjet) hist("IP3D_pb_tr"+HistExt,"HLT/BjetMon/"+HistDir)->Fill(btag->IP3D_pb()); + if (HistBjet) hist("IP3D_pc_tr"+HistExt,"HLT/BjetMon/"+HistDir)->Fill(btag->IP3D_pc()); + ATH_MSG_DEBUG(" - IP3D / SV1 / IP3D+SV1: " << wIP3D << " / " << wSV1 << " / " << wCOMB ); + ATH_MSG_DEBUG(" - SV1 LZ: " << SV1_loglikelihoodratioLZ ); + ATH_MSG_DEBUG(" - MV2c10 : " << wMV2c10 ); + if (HistBjet) hist("wIP3D_Rbu_tr"+HistExt,"HLT/BjetMon/"+HistDir)->Fill(wIP3D); + if (HistBjet) hist("wSV1_Rbu_tr"+HistExt,"HLT/BjetMon/"+HistDir)->Fill(wSV1); + if (HistBjet) hist("wCOMB_Rbu_tr"+HistExt,"HLT/BjetMon/"+HistDir)->Fill(wCOMB); + if (HistBjet) hist("wMV2c10_tr"+HistExt,"HLT/BjetMon/"+HistDir)->Fill(wMV2c10); + + // Get SV1 secondary vtx information, see: + // /PhysicsAnalysis/JetTagging/JetTagTools/src/MV2Tag.cxx#0486 and + // /PhysicsAnalysis/JetTagging/JetTagTools/src/GaiaNNTool.cxx#0349 + std::vector< ElementLink< xAOD::VertexContainer > > myVertices; + ATH_MSG_DEBUG(" SV1 info source name before calling VertexContainer: " << m_sv1_infosource ) ; + btag->variable<std::vector<ElementLink<xAOD::VertexContainer> > >(m_sv1_infosource, "vertices", myVertices); + ATH_MSG_DEBUG(" SV1 info source name after calling VertexContainer: " << m_sv1_infosource ) ; + if ( myVertices.size() > 0 && myVertices[0].isValid() ) { + ATH_MSG_DEBUG(" SV1 vertex size: " << myVertices.size() << " is it valid? " << myVertices[0].isValid() ) ; + btag->variable<float>(m_sv1_infosource, "masssvx", svp_mass); + btag->variable<float>(m_sv1_infosource, "efracsvx", svp_efrc); + btag->variable<int>(m_sv1_infosource, "N2Tpair", svp_n2t); + ATH_MSG_DEBUG(" - MVTX / EVTX / NVTX: " << svp_mass << " / " << svp_efrc << " / " << svp_n2t ) ; + if ( svp_n2t > 0 ) { + } // if svp_n2t + } else { + ATH_MSG_DEBUG(" No valid SV1 vertex found -- SV1 vertex size: " << myVertices.size() ); + if ( myVertices.size() > 0 ) ATH_MSG_DEBUG(" No valid SV1 vertex found -- myVertices[0].isValid(): " << myVertices[0].isValid() ) ; + } // if vertex valid + + + } // if (ijet == 0) + ijet++; // Tracks associated to triggered jets ( featurs = onlinejets ) courtesy of Tim Martin on 12/05/2020 diff --git a/Trigger/TrigMonitoring/TrigBjetMonitoring/src/HLTBjetMonTool.h b/Trigger/TrigMonitoring/TrigBjetMonitoring/src/HLTBjetMonTool.h index 532affe7b5dd9a1191c442f792758e5d660aa0d7..293af2637fb08d70bde621680504169698ba0dfe 100755 --- a/Trigger/TrigMonitoring/TrigBjetMonitoring/src/HLTBjetMonTool.h +++ b/Trigger/TrigMonitoring/TrigBjetMonitoring/src/HLTBjetMonTool.h @@ -72,6 +72,7 @@ class HLTBjetMonTool : public IHLTMonTool { SG::ReadHandleKey<xAOD::VertexContainer> m_offlineVertexContainerKey {this,"OfflineVertexContainerName","PrimaryVertices","Key of offline primary vertexes"}; SG::ReadHandleKey<xAOD::VertexContainer> m_onlineVertexContainerKey {this,"OnlineVertexContainerName","HLT_IDVertex_FS","Key of online bjet primary vertexes"}; // MS 290620 SG::ReadHandleKey<xAOD::TrackParticleContainer> m_onlineTrackContainerKey {this,"OnlineTrackContainerName","HLT_IDTrack_Bjet_IDTrig","Key of online tracks of bjets"}; + SG::ReadHandleKey<xAOD::BTaggingContainer> m_onlineBTaggingContainerKey {this,"OnlineBTaggingContainerName","HLT_BTagging","Key of online b-tagging object"}; ToolHandle<Trig::TrigDecisionTool> m_trigDec; //! diff --git a/Trigger/TrigMonitoring/TrigBjetMonitoring/src/TrigBjetMonitorAlgorithm.cxx b/Trigger/TrigMonitoring/TrigBjetMonitoring/src/TrigBjetMonitorAlgorithm.cxx index aed70bc5133586888ca19f45bc6b10d93241949f..f067a7784ee3a1ffc07d81fcfedfd2e5d57d4693 100644 --- a/Trigger/TrigMonitoring/TrigBjetMonitoring/src/TrigBjetMonitorAlgorithm.cxx +++ b/Trigger/TrigMonitoring/TrigBjetMonitoring/src/TrigBjetMonitorAlgorithm.cxx @@ -4,12 +4,19 @@ #include "TrigBjetMonitorAlgorithm.h" +#include "AthenaMonitoring/AthenaMonManager.h" +#include "AthenaMonitoring/ManagedMonitorToolTest.h" +#include "AthenaMonitoring/ManagedMonitorToolBase.h" //EN + #include "xAODTracking/TrackParticle.h" #include "xAODTracking/VertexContainer.h" + #include "xAODBTagging/BTaggingAuxContainer.h" #include "xAODBTagging/BTaggingContainer.h" #include "xAODBTagging/BTagging.h" +#include "EventPrimitives/EventPrimitivesHelpers.h" + #include "Particle/TrackParticleContainer.h" #include "GeoPrimitives/GeoPrimitives.h" @@ -48,6 +55,7 @@ StatusCode TrigBjetMonitorAlgorithm::initialize() { ATH_CHECK( m_offlineVertexContainerKey.initialize() ); ATH_CHECK( m_onlineVertexContainerKey.initialize() ); ATH_CHECK( m_onlineTrackContainerKey.initialize() ); + ATH_CHECK( m_onlineBTaggingContainerKey.initialize() ); return AthMonitorAlgorithm::initialize(); } @@ -370,9 +378,10 @@ StatusCode TrigBjetMonitorAlgorithm::fillHistograms( const EventContext& ctx ) c // zPV associated to the jets in the same event: they are the same for every jet in the same event so only the first zPV should be plotted if (ijet == 0) { + // Fetch and plot PV + std::string vtxname = m_onlineVertexContainerKey.key(); if ( vtxname.find("HLT_")==0 ) vtxname.erase(0,4); - auto vertexLinkInfo = TrigCompositeUtils::findLink<xAOD::VertexContainer>(jetLinkInfo.source, vtxname ); // CV 200120 & MS 290620 ATH_CHECK( vertexLinkInfo.isValid() ) ; // TM 200120 const xAOD::Vertex* vtx = *(vertexLinkInfo.link); @@ -394,7 +403,93 @@ StatusCode TrigBjetMonitorAlgorithm::fillHistograms( const EventContext& ctx ) c PVy_jet = vtx->y(); ATH_MSG_DEBUG(" PVy_jet: " << PVy_jet); fill("TrigBjetMonitor",PVy_jet); - } + + // Fetch and plot BTagging information + + std::string btagname = m_onlineBTaggingContainerKey.key(); + if ( btagname.find("HLT_")==0 ) btagname.erase(0,4); + auto btaggingLinkInfo = TrigCompositeUtils::findLink<xAOD::BTaggingContainer>(jetLinkInfo.source, btagname ); + ATH_CHECK( btaggingLinkInfo.isValid() ) ; + const xAOD::BTagging* btag = *(btaggingLinkInfo.link); + + // IP3D variables + NameH = "IP3D_pu_tr_"+trigName; + ATH_MSG_DEBUG( " NameH: " << NameH ); + auto IP3D_pu = Monitored::Scalar<float>(NameH,0.0); + IP3D_pu = btag->IP3D_pu(); + ATH_MSG_DEBUG(" IP3D_pu: " << IP3D_pu); + fill("TrigBjetMonitor",IP3D_pu); + + NameH = "IP3D_pb_tr_"+trigName; + ATH_MSG_DEBUG( " NameH: " << NameH ); + auto IP3D_pb = Monitored::Scalar<float>(NameH,0.0); + IP3D_pb = btag->IP3D_pb(); + ATH_MSG_DEBUG(" IP3D_pb: " << IP3D_pb); + fill("TrigBjetMonitor",IP3D_pb); + + NameH = "IP3D_pc_tr_"+trigName; + ATH_MSG_DEBUG( " NameH: " << NameH ); + auto IP3D_pc = Monitored::Scalar<float>(NameH,0.0); + IP3D_pc = btag->IP3D_pc(); + ATH_MSG_DEBUG(" IP3D_pc: " << IP3D_pc); + fill("TrigBjetMonitor",IP3D_pc); + + // LogLH variables + NameH = "wIP3D_Rbu_tr_"+trigName; + ATH_MSG_DEBUG( " NameH: " << NameH ); + auto wIP3D = Monitored::Scalar<double>(NameH,0.0); + btag->loglikelihoodratio("IP3D", wIP3D); + ATH_MSG_DEBUG(" wIP3D: " << wIP3D); + fill("TrigBjetMonitor",wIP3D); + + NameH = "wSV1_Rbu_tr_"+trigName; + ATH_MSG_DEBUG( " NameH: " << NameH ); + auto wSV1 = Monitored::Scalar<double>(NameH,0.0); + btag->loglikelihoodratio("SV1", wSV1); + ATH_MSG_DEBUG(" wSV1: " << wSV1); + fill("TrigBjetMonitor",wSV1); + + NameH = "wCOMB_Rbu_tr_"+trigName; + ATH_MSG_DEBUG( " NameH: " << NameH ); + auto wCOMB = Monitored::Scalar<double>(NameH,0.0); + wCOMB = wIP3D+wSV1; + ATH_MSG_DEBUG(" wCOMB: " << wCOMB); + fill("TrigBjetMonitor",wCOMB); + + // Discriminants + NameH = "wMV2c10_tr_"+trigName; + ATH_MSG_DEBUG( " NameH: " << NameH ); + auto wMV2c10 = Monitored::Scalar<double>(NameH,0.0); + wMV2c10 = btag->auxdata<double>("MV2c10_discriminant"); + ATH_MSG_DEBUG(" wMV2c10: " << wMV2c10); + fill("TrigBjetMonitor",wMV2c10); + + // SV1 variables (credit LZ) + NameH = "xNVtx_tr_"+trigName; + ATH_MSG_DEBUG( " NameH: " << NameH ); + auto svp_n2t = Monitored::Scalar<int>(NameH,0.0); + btag->variable<int>("SV1", "N2Tpair", svp_n2t); + ATH_MSG_DEBUG(" svp_n2t: " << svp_n2t); + fill("TrigBjetMonitor",svp_n2t); + + NameH = "xMVtx_tr_"+trigName; + ATH_MSG_DEBUG( " NameH: " << NameH ); + auto svp_mass = Monitored::Scalar<float>(NameH,0.0); + btag->variable<float>("SV1", "masssvx", svp_mass); + ATH_MSG_DEBUG(" svp_mass: " << svp_mass ); + svp_mass *= 1.e-3; + ATH_MSG_DEBUG(" svp_mass: " << svp_mass ); + fill("TrigBjetMonitor",svp_mass); + + NameH = "xEVtx_tr_"+trigName; + ATH_MSG_DEBUG( " NameH: " << NameH ); + auto svp_efrc = Monitored::Scalar<float>(NameH,0.0); + btag->variable<float>("SV1", "efracsvx", svp_efrc); + ATH_MSG_DEBUG(" svp_efrc: " << svp_efrc); + fill("TrigBjetMonitor",svp_efrc); + + } // if (ijet == 0) + ijet++; // Tracks associated to triggered jets ( featurs = onlinejets ) courtesy of Tim Martin on 12/05/2020 diff --git a/Trigger/TrigMonitoring/TrigBjetMonitoring/src/TrigBjetMonitorAlgorithm.h b/Trigger/TrigMonitoring/TrigBjetMonitoring/src/TrigBjetMonitorAlgorithm.h index 9a2f86dd9a72d0f17ec852f349f9785fa0d39dbf..fc1bf0e82bdbcc045046b422988e19827b376e1a 100644 --- a/Trigger/TrigMonitoring/TrigBjetMonitoring/src/TrigBjetMonitorAlgorithm.h +++ b/Trigger/TrigMonitoring/TrigBjetMonitoring/src/TrigBjetMonitorAlgorithm.h @@ -33,6 +33,7 @@ class TrigBjetMonitorAlgorithm : public AthMonitorAlgorithm { SG::ReadHandleKey<xAOD::VertexContainer> m_offlineVertexContainerKey {this,"OfflineVertexContainerName","PrimaryVertices","Key of offline primary vertexes"}; SG::ReadHandleKey<xAOD::VertexContainer> m_onlineVertexContainerKey {this,"OnlineVertexContainerName","HLT_IDVertex_FS","Key of online bjet primary vertexes"}; // MS 290620 SG::ReadHandleKey<xAOD::TrackParticleContainer> m_onlineTrackContainerKey {this,"OnlineTrackContainerName","HLT_IDTrack_Bjet_IDTrig","Key of online tracks of bjets"}; + SG::ReadHandleKey<xAOD::BTaggingContainer> m_onlineBTaggingContainerKey {this,"OnlineBTaggingContainerName","HLT_BTagging","Key of online b-tagging object"}; ToolHandle<Trig::TrigDecisionTool> m_trigDec; //! diff --git a/Trigger/TrigMonitoring/TrigBphysMonitoring/share/configureBphysTrackingServices.py b/Trigger/TrigMonitoring/TrigBphysMonitoring/share/configureBphysTrackingServices.py index 9c6cba88c8fa9f46651325f5aee1f63aa2b0258d..c580b2f522914ae49a899ae2d8a66e09b901d95a 100644 --- a/Trigger/TrigMonitoring/TrigBphysMonitoring/share/configureBphysTrackingServices.py +++ b/Trigger/TrigMonitoring/TrigBphysMonitoring/share/configureBphysTrackingServices.py @@ -43,11 +43,18 @@ CountDeadModulesAfterLastHit=False #rec.Commissioning=False from AthenaCommon.DetFlags import DetFlags +from InDetBoundaryCheckTool.InDetBoundaryCheckToolConf import InDet__InDetBoundaryCheckTool +InDetBoundaryCheck = InDet__InDetBoundaryCheckTool( + name="TrigBphysInDetBoundaryCheckTool", + UsePixel=DetFlags.haveRIO.pixel_on(), + UseSCT=DetFlags.haveRIO.SCT_on() +) +ToolSvc += InDetBoundaryCheck + from InDetTrackHoleSearch.InDetTrackHoleSearchConf import InDet__InDetTrackHoleSearchTool InDetHoleSearchTool = InDet__InDetTrackHoleSearchTool(name = "TrigBphysInDetHoleSearchTool", Extrapolator = InDetExtrapolator, - usePixel = DetFlags.haveRIO.pixel_on(), - useSCT = DetFlags.haveRIO.SCT_on(), + BoundaryCheckTool=InDetBoundaryCheck, #Commissioning = rec.Commissioning()) CountDeadModulesAfterLastHit = CountDeadModulesAfterLastHit) ToolSvc += InDetHoleSearchTool diff --git a/Trigger/TrigMonitoring/TrigIDtrkMonitoring/python/TrigIDtrkMonitoringConfig.py b/Trigger/TrigMonitoring/TrigIDtrkMonitoring/python/TrigIDtrkMonitoringConfig.py index b6e3d58fd04059c91ae1a71ef956910adf07979a..d431c4aa426518290ce2603501468edc5bdd8084 100644 --- a/Trigger/TrigMonitoring/TrigIDtrkMonitoring/python/TrigIDtrkMonitoringConfig.py +++ b/Trigger/TrigMonitoring/TrigIDtrkMonitoring/python/TrigIDtrkMonitoringConfig.py @@ -332,7 +332,7 @@ def TrigIDtrkMonitoringTool( legacy_monitoring=False ): if mt_chains: tidabjet.ntupleChainNames += [ "Offline", - ":key=HLT_IDTrack_FS_FTF", + ":HLT_IDTrack_FS_FTF:vtx=HLT_IDVertex_FS", "HLT_j.*.*boffperf.*:key=HLT_IDTrack_Bjet_FTF", "HLT_j.*.*boffperf.*:key=HLT_IDTrack_Bjet_IDTrig" ] diff --git a/Trigger/TrigMonitoring/TrigMuonMonitoringMT/python/EFMuonMonConfig.py b/Trigger/TrigMonitoring/TrigMuonMonitoringMT/python/EFMuonMonConfig.py new file mode 100644 index 0000000000000000000000000000000000000000..993633bb31c0da9481fa9b9d5697861076405f8b --- /dev/null +++ b/Trigger/TrigMonitoring/TrigMuonMonitoringMT/python/EFMuonMonConfig.py @@ -0,0 +1,235 @@ +# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration + +import ROOT + +def EFMuonMonConfig(helper): + + from AthenaConfiguration.ComponentFactory import CompFactory + # HLT_mu6_L1MU6 is test chain for small statistics, so it will be removed. + Chains = ['HLT_mu6_L1MU6', 'HLT_mu26_ivarmedium_L1MU20', 'HLT_mu50_L1MU20'] + + for chain in Chains: + + GroupName = 'EFMuon_'+chain + + monAlg = helper.addAlgorithm(CompFactory.EFMuonMonMT,'EFMuonMonMT_'+chain) + monAlg.MuonType = ROOT.xAOD.Muon_v1.MuonStandAlone + monAlg.MonitoredChains = [chain] + monAlg.Group = GroupName + + histGroup = helper.addGroup(monAlg, GroupName, 'HLT/MuonMon/EFMuon/'+chain) + + + # basic EDM variables + # EFSA + histGroup.defineHistogram(GroupName+'_EFSA_Pt;EFSA_Pt', + title='EFSA Pt '+chain+';p_{T} [GeV];Events', + type='TH1F', path='',xbins=210,xmin=-105.,xmax=105.) + + histGroup.defineHistogram(GroupName+'_EFSA_Eta;EFSA_Eta', + title='EFSA Eta '+chain+';#eta;Events', + type='TH1F', path='',xbins=108,xmin=-2.7,xmax=2.7) + + histGroup.defineHistogram(GroupName+'_EFSA_Phi;EFSA_Phi', + title='EFSA Phi '+chain+';#phi;Events', + type='TH1F', path='',xbins=96,xmin=-ROOT.TMath.Pi(),xmax=ROOT.TMath.Pi()) + + histGroup.defineHistogram(GroupName+'_EFSA_Eta,'+GroupName+'_EFSA_Phi;EFSA_Eta_vs_Phi', + title='EFSA Eta vs Phi '+chain+';#eta;#phi', + type='TH2F', path='',xbins=108,xmin=-2.7,xmax=2.7, ybins=96,ymin=-ROOT.TMath.Pi(),ymax=ROOT.TMath.Pi()) + + + # EFCB + histGroup.defineHistogram(GroupName+'_EFCB_Pt;EFCB_Pt', + title='EFCB Pt '+chain+';p_{T} [GeV];Events', + type='TH1F', path='',xbins=210,xmin=-105.,xmax=105.) + + histGroup.defineHistogram(GroupName+'_EFCB_Eta;EFCB_Eta', + title='EFCB Eta '+chain+';#eta;Events', + type='TH1F', path='',xbins=108,xmin=-2.7,xmax=2.7) + + histGroup.defineHistogram(GroupName+'_EFCB_Phi;EFCB_Phi', + title='EFCB Phi '+chain+';#phi;Events', + type='TH1F', path='',xbins=96,xmin=-ROOT.TMath.Pi(),xmax=ROOT.TMath.Pi()) + + histGroup.defineHistogram(GroupName+'_EFCB_Eta,'+GroupName+'_EFCB_Phi;EFCB_Eta_vs_Phi', + title='EFCB Eta vs Phi '+chain+';#eta;#phi', + type='TH2F', path='',xbins=108,xmin=-2.7,xmax=2.7, ybins=96,ymin=-ROOT.TMath.Pi(),ymax=ROOT.TMath.Pi()) + + + # OfflineSA + histGroup.defineHistogram(GroupName+'_OfflineSA_Pt;OfflineSA_Pt', + title='OfflineSA Pt '+chain+';p_{T} [GeV];Events', + type='TH1F', path='',xbins=210,xmin=-105.,xmax=105.) + + histGroup.defineHistogram(GroupName+'_OfflineSA_Eta;OfflineSA_Eta', + title='OfflineSA Eta '+chain+';#eta;Events', + type='TH1F', path='',xbins=108,xmin=-2.7,xmax=2.7) + + histGroup.defineHistogram(GroupName+'_OfflineSA_Phi;OfflineSA_Phi', + title='OfflineSA Phi '+chain+';#phi;Events', + type='TH1F', path='',xbins=96,xmin=-ROOT.TMath.Pi(),xmax=ROOT.TMath.Pi()) + + histGroup.defineHistogram(GroupName+'_OfflineSA_Eta,'+GroupName+'_OfflineSA_Phi;OfflineSA_Eta_vs_Phi', + title='OfflineSA Eta vs Phi '+chain+';#eta;#phi', + type='TH2F', path='',xbins=108,xmin=-2.7,xmax=2.7, ybins=96,ymin=-ROOT.TMath.Pi(),ymax=ROOT.TMath.Pi()) + + + # OfflineCB + histGroup.defineHistogram(GroupName+'_OfflineCB_Pt;OfflineCB_Pt', + title='OfflineCB Pt '+chain+';p_{T} [GeV];Events', + type='TH1F', path='',xbins=210,xmin=-105.,xmax=105.) + + histGroup.defineHistogram(GroupName+'_OfflineCB_Eta;OfflineCB_Eta', + title='OfflineCB Eta '+chain+';#eta;Events', + type='TH1F', path='',xbins=108,xmin=-2.7,xmax=2.7) + + histGroup.defineHistogram(GroupName+'_OfflineCB_Phi;OfflineCB_Phi', + title='OfflineCB Phi '+chain+';#phi;Events', + type='TH1F', path='',xbins=96,xmin=-ROOT.TMath.Pi(),xmax=ROOT.TMath.Pi()) + + histGroup.defineHistogram(GroupName+'_OfflineCB_Eta,'+GroupName+'_OfflineCB_Phi;OfflineCB_Eta_vs_Phi', + title='OfflineCB Eta vs Phi '+chain+';#eta;#phi', + type='TH2F', path='',xbins=108,xmin=-2.7,xmax=2.7, ybins=96,ymin=-ROOT.TMath.Pi(),ymax=ROOT.TMath.Pi()) + + + + # correlation histograms + # EFSA vs. OfflineSA muons + histGroup.defineHistogram(GroupName+'_OfflineSA_Pt,'+GroupName+'_MatchedEFSA_Pt;EFSA_OfflineSA_PtCor', + title='PtCor EFSA OfflineSA '+chain+';OfflineSA p_{T} [GeV];EFSA p_{T} [GeV]', + cutmask=GroupName+'_matchedEFSA', + type='TH2F', path='',xbins=210,xmin=-105.,xmax=105., ybins=210,ymin=-105.,ymax=105.) + + histGroup.defineHistogram(GroupName+'_OfflineSA_Phi,'+GroupName+'_MatchedEFSA_Phi;EFSA_OfflineSA_PhiCor', + title='PhiCor EFSA OfflineSA '+chain+';OfflineSA #phi;EFSA #phi', + cutmask=GroupName+'_matchedEFSA', + type='TH2F', path='',xbins=96,xmin=-ROOT.TMath.Pi(),xmax=ROOT.TMath.Pi(), ybins=96,ymin=-ROOT.TMath.Pi(),ymax=ROOT.TMath.Pi()) + + histGroup.defineHistogram(GroupName+'_OfflineSA_Eta,'+GroupName+'_MatchedEFSA_Eta;EFSA_OfflineSA_EtaCor', + title='EtaCor EFSA OfflineSA '+chain+';OfflineSA #eta;EFSA #eta', + cutmask=GroupName+'_matchedEFSA', + type='TH2F', path='',xbins=108,xmin=-2.7,xmax=2.7, ybins=108,ymin=-2.7,ymax=2.7) + + histGroup.defineHistogram(GroupName+'_SAdPt;EFSA_OfflineSA_dPt', + title='dPt EFSA OfflineSA '+chain+';dPt [GeV];Events', + cutmask=GroupName+'_matchedEFSA', + type='TH1F', path='',xbins=100,xmin=-10.,xmax=10.) + + histGroup.defineHistogram(GroupName+'_SAdEta;EFSA_OfflineSA_dEta', + title='dEta EFSA OfflineSA '+chain+';dEta;Events', + cutmask=GroupName+'_matchedEFSA', + type='TH1F', path='',xbins=200,xmin=-5.,xmax=5.) + + histGroup.defineHistogram(GroupName+'_SAdPhi;EFSA_OfflineSA_dPhi', + title='dPhi EFSA OfflineSA '+chain+';dPhi;Events', + cutmask=GroupName+'_matchedEFSA', + type='TH1F', path='',xbins=96,xmin=-ROOT.TMath.Pi(),xmax=ROOT.TMath.Pi()) + + histGroup.defineHistogram(GroupName+'_SAdR;EFSA_OfflineSA_dR', + title='dR EFSA OfflineSA '+chain+';dR;Events', + cutmask=GroupName+'_matchedEFSA', + type='TH1F', path='',xbins=110,xmin=0.,xmax=11.) + + histGroup.defineHistogram(GroupName+'_OfflineSA_Pt;OfflineSA_Pt_AwareEFSA', + title='OfflineSA Pt AwareEFSA '+chain+';OfflineSA p_{T} [GeV];Events', + cutmask=GroupName+'_matchedEFSA', + type='TH1F', path='',xbins=210,xmin=-105.,xmax=105.) + + histGroup.defineHistogram(GroupName+'_OfflineSA_Phi;OfflineSA_Phi_AwareEFSA', + title='OfflineSA Phi AwareEFSA '+chain+';OfflineSA #phi;Events', + cutmask=GroupName+'_matchedEFSA', + type='TH1F', path='',xbins=96,xmin=-ROOT.TMath.Pi(),xmax=ROOT.TMath.Pi()) + + histGroup.defineHistogram(GroupName+'_OfflineSA_Eta;OfflineSA_Eta_AwareEFSA', + title='OfflineSA Eta AwareEFSA '+chain+';OfflineSA #eta;Events', + cutmask=GroupName+'_matchedEFSA', + type='TH1F', path='',xbins=108,xmin=-2.7,xmax=2.7) + + + # OfflineSA (matched to EFSA) vs. OfflineSA (matched to L2SA) + histGroup.defineHistogram(GroupName+'_OfflineSA_Pt,'+GroupName+'_OfflineSAmatchedL2SA_Pt;OfflineSA_matchedEFSA_matchedL2SA_PtCor', + title='PtCor OfflineSA (matched to EFSA) vs. OfflineSA (matched to L2SA) '+chain+';OfflineSA matched to EFSA p_{T} [GeV];OfflineSA matched to L2SA p_{T} [GeV]', + cutmask=GroupName+'_matchedL2SA', + type='TH2F', path='',xbins=210,xmin=-105.,xmax=105., ybins=210,ymin=-105.,ymax=105.) + + histGroup.defineHistogram(GroupName+'_OfflineSA_Phi,'+GroupName+'_OfflineSAmatchedL2SA_Phi;OfflineSA_matchedEFSA_matchedL2SA_PhiCor', + title='PhiCor OfflineSA (matched to EFSA) vs. OfflineSA (matched to L2SA) '+chain+';OfflineSA matched to EFSA #phi;OfflineSA matched to L2SA #phi', + cutmask=GroupName+'_matchedL2SA', + type='TH2F', path='',xbins=96,xmin=-ROOT.TMath.Pi(),xmax=ROOT.TMath.Pi(), ybins=96,ymin=-ROOT.TMath.Pi(),ymax=ROOT.TMath.Pi()) + + histGroup.defineHistogram(GroupName+'_OfflineSA_Eta,'+GroupName+'_OfflineSAmatchedL2SA_Eta;OfflineSA_matchedEFSA_matchedL2SA_EtaCor', + title='EtaCor OfflineSA (matched to EFSA) vs. OfflineSA (matched to L2SA) '+chain+';OfflineSA matched to EFSA #eta;OfflineSA matched to L2SA #eta', + cutmask=GroupName+'_matchedL2SA', + type='TH2F', path='',xbins=108,xmin=-2.7,xmax=2.7, ybins=108,ymin=-2.7,ymax=2.7) + + + # EFCB vs. OfflineCB muons + histGroup.defineHistogram(GroupName+'_EFCB_Pt,'+GroupName+'_OfflineCB_Pt;EFCB_OfflineCB_PtCor', + title='PtCor EFCB OfflineCB '+chain+';OfflineCB p_{T} [GeV];EFCB p_{T} [GeV];', + cutmask=GroupName+'_matchedEFCB', + type='TH2F', path='',xbins=210,xmin=-105.,xmax=105., ybins=210,ymin=-105.,ymax=105.) + + histGroup.defineHistogram(GroupName+'_EFCB_Phi,'+GroupName+'_OfflineCB_Phi;EFCB_OfflineCB_PhiCor', + title='PhiCor EFCB OfflineCB '+chain+';OfflineCB #phi;EFCB #phi;', + cutmask=GroupName+'_matchedEFCB', + type='TH2F', path='',xbins=96,xmin=-ROOT.TMath.Pi(),xmax=ROOT.TMath.Pi(), ybins=96,ymin=-ROOT.TMath.Pi(),ymax=ROOT.TMath.Pi()) + + histGroup.defineHistogram(GroupName+'_EFCB_Eta,'+GroupName+'_OfflineCB_Eta;EFCB_OfflineCB_EtaCor', + title='EtaCor EFCB OfflineCB '+chain+';OfflineCB #eta;EFCB #eta;', + cutmask=GroupName+'_matchedEFCB', + type='TH2F', path='',xbins=108,xmin=-2.7,xmax=2.7, ybins=108,ymin=-2.7,ymax=2.7) + + histGroup.defineHistogram(GroupName+'_CBdPt;EFCB_OfflineCB_dPt', + title='dPt EFCB OfflineCB '+chain+';dPt [GeV];Events', + cutmask=GroupName+'_matchedEFCB', + type='TH1F', path='',xbins=100,xmin=-10.,xmax=10.) + + histGroup.defineHistogram(GroupName+'_CBdEta;EFCB_OfflineCB_dEta', + title='dEta EFCB OfflineCB '+chain+';dEta;Events', + cutmask=GroupName+'_matchedEFCB', + type='TH1F', path='',xbins=200,xmin=-5.,xmax=5.) + + histGroup.defineHistogram(GroupName+'_CBdPhi;EFCB_OfflineCB_dPhi', + title='dPhi EFCB OfflineCB '+chain+';dPhi;Events', + cutmask=GroupName+'_matchedEFCB', + type='TH1F', path='',xbins=96,xmin=-ROOT.TMath.Pi(),xmax=ROOT.TMath.Pi()) + + histGroup.defineHistogram(GroupName+'_CBdR;EFCB_OfflineCB_dR', + title='dR EFCB OfflineCB '+chain+';dR;Events', + cutmask=GroupName+'_matchedEFCB', + type='TH1F', path='',xbins=110,xmin=0.,xmax=11.) + + histGroup.defineHistogram(GroupName+'_OfflineCB_Pt;OfflineCB_Pt_AwareEFCB', + title='OfflineCB Pt AwareEFCB '+chain+';OfflineCB p_{T} [GeV];Events', + cutmask=GroupName+'_matchedEFCB', + type='TH1F', path='',xbins=210,xmin=-105.,xmax=105.) + + histGroup.defineHistogram(GroupName+'_OfflineCB_Phi;OfflineCB_Phi_AwareEFCB', + title='OfflineCB Phi AwareEFCB '+chain+';OfflineCB #phi;Events', + cutmask=GroupName+'_matchedEFCB', + type='TH1F', path='',xbins=96,xmin=-ROOT.TMath.Pi(),xmax=ROOT.TMath.Pi()) + + histGroup.defineHistogram(GroupName+'_OfflineCB_Eta;OfflineCB_Eta_AwareEFCB', + title='OfflineCB Eta AwareEFCB '+chain+';OfflineCB #eta;Events', + cutmask=GroupName+'_matchedEFCB', + type='TH1F', path='',xbins=108,xmin=-2.7,xmax=2.7) + + + # OfflineCB (matched to EFCB) vs. OfflineCB (matched to L2CB) + histGroup.defineHistogram(GroupName+'_OfflineCB_Pt,'+GroupName+'_OfflineCBmatchedL2CB_Pt;OfflineCB_matchedEFCB_matchedL2CB_PtCor', + title='PtCor OfflineCB (matched to EFCB) vs. OfflineCB (matched to L2CB) '+chain+';OfflineCB matched to EFCB p_{T} [GeV];OfflineCB matched to L2CB p_{T} [GeV]', + cutmask=GroupName+'_matchedL2CB', + type='TH2F', path='',xbins=210,xmin=-105.,xmax=105., ybins=210,ymin=-105.,ymax=105.) + + histGroup.defineHistogram(GroupName+'_OfflineCB_Phi,'+GroupName+'_OfflineCBmatchedL2CB_Phi;OfflineCB_matchedEFCB_matchedL2CB_PhiCor', + title='PhiCor OfflineCB (matched to EFCB) vs. OfflineCB (matched to L2CB) '+chain+';OfflineCB matched to EFCB #phi;OfflineCB matched to L2CB #phi', + cutmask=GroupName+'_matchedL2CB', + type='TH2F', path='',xbins=96,xmin=-ROOT.TMath.Pi(),xmax=ROOT.TMath.Pi(), ybins=96,ymin=-ROOT.TMath.Pi(),ymax=ROOT.TMath.Pi()) + + histGroup.defineHistogram(GroupName+'_OfflineCB_Eta,'+GroupName+'_OfflineCBmatchedL2CB_Eta;OfflineCB_matchedEFCB_matchedL2CB_EtaCor', + title='EtaCor OfflineCB (matched to EFCB) vs. OfflineCB (matched to L2CB) '+chain+';OfflineCB matched to EFCB #eta;OfflineCB matched to L2CB #eta', + cutmask=GroupName+'_matchedL2CB', + type='TH2F', path='',xbins=108,xmin=-2.7,xmax=2.7, ybins=108,ymin=-2.7,ymax=2.7) + + return diff --git a/Trigger/TrigMonitoring/TrigMuonMonitoringMT/python/L2MuonSAMonConfig.py b/Trigger/TrigMonitoring/TrigMuonMonitoringMT/python/L2MuonSAMonConfig.py index 5b60726c934a847a2fb5990c028cf6cc4250d9a0..849df16bc87738d9a7e6787594d1464c6567dd37 100644 --- a/Trigger/TrigMonitoring/TrigMuonMonitoringMT/python/L2MuonSAMonConfig.py +++ b/Trigger/TrigMonitoring/TrigMuonMonitoringMT/python/L2MuonSAMonConfig.py @@ -72,7 +72,7 @@ def L2MuonSAMonConfig(helper): # L1 RoI eta vs. phi in case mF failed histGroup.defineHistogram(GroupName+'_roiEta,'+GroupName+'_roiPhi;L2MuonSA_failed_L1_eta_vs_phi', title='L1 RoI Eta vs. Phi in case of L2MuonSA failure '+chain+';#eta;#phi', - cutmask=GroupName+'mf_failure', + cutmask=GroupName+'_mf_failure', type='TH2F', path='',xbins=108,xmin=-2.7,xmax=2.7, ybins=96,ymin=-ROOT.TMath.Pi(),ymax=ROOT.TMath.Pi()) diff --git a/Trigger/TrigMonitoring/TrigMuonMonitoringMT/python/TrigMuonMonitoringMTConfig.py b/Trigger/TrigMonitoring/TrigMuonMonitoringMT/python/TrigMuonMonitoringMTConfig.py index 2bdde7145b14d4f89b9fa9d9753b2c194e4a1919..b97ef6928ff8f0516307b11173a221a6faf949be 100644 --- a/Trigger/TrigMonitoring/TrigMuonMonitoringMT/python/TrigMuonMonitoringMTConfig.py +++ b/Trigger/TrigMonitoring/TrigMuonMonitoringMT/python/TrigMuonMonitoringMTConfig.py @@ -1,9 +1,10 @@ # Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration -from TrigMuonMonitoringMT.L2muCombMonConfig import L2muCombMonConfig -from TrigMuonMonitoringMT.L2MuonSAMonConfig import L2MuonSAMonConfig from TrigMuonMonitoringMT.L1MuonMonConfig import L1MuonMonConfig +from TrigMuonMonitoringMT.L2MuonSAMonConfig import L2MuonSAMonConfig +from TrigMuonMonitoringMT.L2muCombMonConfig import L2muCombMonConfig +from TrigMuonMonitoringMT.EFMuonMonConfig import EFMuonMonConfig from TrigMuonMonitoringMT.TrigMuonEfficiencyMonConfig import TrigMuonEfficiencyMonConfig @@ -15,6 +16,7 @@ def TrigMuonMonConfig(inputFlags): L1MuonMonConfig(helper) L2MuonSAMonConfig(helper) L2muCombMonConfig(helper) + EFMuonMonConfig(helper) TrigMuonEfficiencyMonConfig(helper) return helper.result() diff --git a/Trigger/TrigMonitoring/TrigMuonMonitoringMT/src/EFMuonMonMT.cxx b/Trigger/TrigMonitoring/TrigMuonMonitoringMT/src/EFMuonMonMT.cxx new file mode 100644 index 0000000000000000000000000000000000000000..3247ad55b4406926e57aeac03244bf55117da617 --- /dev/null +++ b/Trigger/TrigMonitoring/TrigMuonMonitoringMT/src/EFMuonMonMT.cxx @@ -0,0 +1,211 @@ +/* + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration +*/ + +#include "EFMuonMonMT.h" + +#include "xAODTrigMuon/TrigMuonDefs.h" +#include "MuonMatchingTool.h" + +EFMuonMonMT :: EFMuonMonMT(const std::string& name, ISvcLocator* pSvcLocator ) + : TrigMuonMonitorAlgorithm(name, pSvcLocator) +{} + +StatusCode EFMuonMonMT :: fillVariablesPerChain(const EventContext& , const std::string &chain) const { + + ATH_MSG_DEBUG ("Filling histograms for " << name() << "..."); + + // EFSA + std::vector< TrigCompositeUtils::LinkInfo<xAOD::MuonContainer> > featureContSA = getTrigDecisionTool()->features<xAOD::MuonContainer>( chain, TrigDefs::includeFailedDecisions, "HLT_Muons_"); + for (const TrigCompositeUtils::LinkInfo<xAOD::MuonContainer>& muSALinkInfo : featureContSA) { + ATH_CHECK( muSALinkInfo.isValid() ); + const ElementLink<xAOD::MuonContainer> muSAEL = muSALinkInfo.link; + if ( ! (*muSAEL)->trackParticle(xAOD::Muon::TrackParticleType::ExtrapolatedMuonSpectrometerTrackParticle) ) continue; + + // basic EDM variables + auto EFSAPt = Monitored::Scalar<float>(m_group+"_EFSA_Pt",-999.); + auto EFSAEta = Monitored::Scalar<float>(m_group+"_EFSA_Eta",-999.); + auto EFSAPhi = Monitored::Scalar<float>(m_group+"_EFSA_Phi",-999.); + + EFSAPt = (*muSAEL)->pt()/1e3 * (*muSAEL)->charge(); // convert to GeV + EFSAEta = (*muSAEL)->eta(); + EFSAPhi = (*muSAEL)->phi(); + + fill(m_group, EFSAPt, EFSAEta, EFSAPhi); + } + + + // EFCB + std::vector< TrigCompositeUtils::LinkInfo<xAOD::MuonContainer> > featureContCB = getTrigDecisionTool()->features<xAOD::MuonContainer>( chain, TrigDefs::includeFailedDecisions, "HLT_MuonsCB"); + for (const TrigCompositeUtils::LinkInfo<xAOD::MuonContainer>& muCBLinkInfo : featureContCB) { + ATH_CHECK( muCBLinkInfo.isValid() ); + const ElementLink<xAOD::MuonContainer> muCBEL = muCBLinkInfo.link; + if ( ! (*muCBEL)->trackParticle(xAOD::Muon::TrackParticleType::CombinedTrackParticle) ) continue; + + // basic EDM variables + auto EFCBPt = Monitored::Scalar<float>(m_group+"_EFCB_Pt",-999.); + auto EFCBEta = Monitored::Scalar<float>(m_group+"_EFCB_Eta",-999.); + auto EFCBPhi = Monitored::Scalar<float>(m_group+"_EFCB_Phi",-999.); + + EFCBPt = (*muCBEL)->pt()/1e3 * (*muCBEL)->charge(); // convert to GeV + EFCBEta = (*muCBEL)->eta(); + EFCBPhi = (*muCBEL)->phi(); + + fill(m_group, EFCBPt, EFCBEta, EFCBPhi); + } + + return StatusCode::SUCCESS; +} + + +StatusCode EFMuonMonMT :: fillVariablesPerOfflineMuonPerChain(const EventContext &ctx, const xAOD::Muon* mu, const std::string &chain) const { + + ATH_MSG_DEBUG ("Filling histograms for " << name() << "..."); + + const xAOD::TrackParticle* OfflineSATrack = mu->trackParticle(xAOD::Muon::TrackParticleType::ExtrapolatedMuonSpectrometerTrackParticle); + const xAOD::TrackParticle* OfflineCBTrack = mu->trackParticle(xAOD::Muon::TrackParticleType::CombinedTrackParticle); + + + // OfflineSA + if( OfflineSATrack ){ + auto OfflineSAPt = Monitored::Scalar<float>(m_group+"_OfflineSA_Pt",-999.); + auto OfflineSAEta = Monitored::Scalar<float>(m_group+"_OfflineSA_Eta",-999.); + auto OfflineSAPhi = Monitored::Scalar<float>(m_group+"_OfflineSA_Phi",-999.); + + auto matchedEFSA = Monitored::Scalar<bool>(m_group+"_matchedEFSA",false); + auto matchedL2SA = Monitored::Scalar<bool>(m_group+"_matchedL2SA",false); + + auto OfflineSAmatchedL2SAPt = Monitored::Scalar<float>(m_group+"_OfflineSAmatchedL2SA_Pt",-999.); + auto OfflineSAmatchedL2SAEta = Monitored::Scalar<float>(m_group+"_OfflineSAmatchedL2SA_Eta",-999.); + auto OfflineSAmatchedL2SAPhi = Monitored::Scalar<float>(m_group+"_OfflineSAmatchedL2SA_Phi",-999.); + + auto MatchedEFSAPt = Monitored::Scalar<float>(m_group+"_MatchedEFSA_Pt",-999.); + auto MatchedEFSAEta = Monitored::Scalar<float>(m_group+"_MatchedEFSA_Eta",-999.); + auto MatchedEFSAPhi = Monitored::Scalar<float>(m_group+"_MatchedEFSA_Phi",-999.); + + auto SAdR = Monitored::Scalar<float>(m_group+"_SAdR",1000.); + auto SAdPt = Monitored::Scalar<float>(m_group+"_SAdPt",-999.); + auto SAdEta = Monitored::Scalar<float>(m_group+"_SAdEta",-999.); + auto SAdPhi = Monitored::Scalar<float>(m_group+"_SAdPhi",-999.); + + // basic EDM variables + OfflineSAPt = OfflineSATrack->pt()/1e3 * OfflineSATrack->charge(); // convert to GeV + OfflineSAEta = OfflineSATrack->eta(); + OfflineSAPhi = OfflineSATrack->phi(); + + // correlation histograms EFSA vs. OfflineSA + // get the EFSA muon matched to offlineSA muon + const TrigCompositeUtils::LinkInfo<xAOD::MuonContainer> EFSAMuonLinkInfo = m_matchTool->matchEFSALinkInfo(mu, chain); + if( EFSAMuonLinkInfo.isValid() ){ + const ElementLink<xAOD::MuonContainer> EFSAMuon = EFSAMuonLinkInfo.link; + const xAOD::TrackParticle* EFSATrack = (*EFSAMuon)->trackParticle(xAOD::Muon::TrackParticleType::ExtrapolatedMuonSpectrometerTrackParticle); + if ( EFSATrack ){ + matchedEFSA = true; + + MatchedEFSAPt = EFSATrack->pt()/1e3 * EFSATrack->charge(); // convert to GeV + MatchedEFSAEta = EFSATrack->eta(); + MatchedEFSAPhi = EFSATrack->phi(); + + SAdR = xAOD::P4Helpers::deltaR(OfflineSATrack, EFSATrack, false); + SAdPt = std::abs(OfflineSAPt) - std::abs(MatchedEFSAPt); + SAdEta = OfflineSAEta - MatchedEFSAEta; + SAdPhi = OfflineSAPhi - MatchedEFSAPhi; + + + // correlation histograms offlineSA (matched to EFSA) vs. offlineSA (matched to L2SA) + // get L2SA feature + const TrigCompositeUtils::Decision* EFSAMuonDecision = EFSAMuonLinkInfo.source; + const TrigCompositeUtils::LinkInfo<xAOD::L2StandAloneMuonContainer> L2SALinkInfo = TrigCompositeUtils::findLink<xAOD::L2StandAloneMuonContainer>(EFSAMuonDecision, "feature"); + ATH_CHECK( L2SALinkInfo.isValid() ); + const ElementLink<xAOD::L2StandAloneMuonContainer> L2SAEL = L2SALinkInfo.link; + + // get offline muon matched to L2SA + const xAOD::Muon *OfflineSAmatchedL2SA = m_matchTool->matchL2SAtoOff(ctx, (*L2SAEL)); + if (OfflineSAmatchedL2SA){ + const xAOD::TrackParticle* OfflineSATrackmatchedL2SA = OfflineSAmatchedL2SA->trackParticle(xAOD::Muon::TrackParticleType::ExtrapolatedMuonSpectrometerTrackParticle); + if ( OfflineSATrackmatchedL2SA ){ + matchedL2SA = true; + OfflineSAmatchedL2SAPt = OfflineSATrackmatchedL2SA->pt()/1e3 * OfflineSATrackmatchedL2SA->charge(); // convert to GeV + OfflineSAmatchedL2SAEta = OfflineSATrackmatchedL2SA->eta(); + OfflineSAmatchedL2SAPhi = OfflineSATrackmatchedL2SA->phi(); + } + } + } + } + fill(m_group, OfflineSAPt, OfflineSAEta, OfflineSAPhi, OfflineSAmatchedL2SAPt, OfflineSAmatchedL2SAEta, OfflineSAmatchedL2SAPhi, + MatchedEFSAPt, MatchedEFSAEta, MatchedEFSAPhi, SAdPt, SAdEta, SAdPhi, SAdR, matchedEFSA, matchedL2SA); + } + + + // OfflineCB + if( OfflineCBTrack ){ + auto OfflineCBPt = Monitored::Scalar<float>(m_group+"_OfflineCB_Pt",-999.); + auto OfflineCBEta = Monitored::Scalar<float>(m_group+"_OfflineCB_Eta",-999.); + auto OfflineCBPhi = Monitored::Scalar<float>(m_group+"_OfflineCB_Phi",-999.); + + auto matchedEFCB = Monitored::Scalar<bool>(m_group+"_matchedEFCB",false); + auto matchedL2CB = Monitored::Scalar<bool>(m_group+"_matchedL2CB",false); + + auto OfflineCBmatchedL2CBPt = Monitored::Scalar<float>(m_group+"_OfflineCBmatchedL2CB_Pt",-999.); + auto OfflineCBmatchedL2CBEta = Monitored::Scalar<float>(m_group+"_OfflineCBmatchedL2CB_Eta",-999.); + auto OfflineCBmatchedL2CBPhi = Monitored::Scalar<float>(m_group+"_OfflineCBmatchedL2CB_Phi",-999.); + + auto MatchedEFCBPt = Monitored::Scalar<float>(m_group+"_MatchedEFCB_Pt",-999.); + auto MatchedEFCBEta = Monitored::Scalar<float>(m_group+"_MatchedEFCB_Eta",-999.); + auto MatchedEFCBPhi = Monitored::Scalar<float>(m_group+"_MatchedEFCB_Phi",-999.); + + auto CBdR = Monitored::Scalar<float>(m_group+"_CBdR",1000.); + auto CBdPt = Monitored::Scalar<float>(m_group+"_CBdPt",-999.); + auto CBdEta = Monitored::Scalar<float>(m_group+"_CBdEta",-999.); + auto CBdPhi = Monitored::Scalar<float>(m_group+"_CBdPhi",-999.); + + // basic EDM variables + OfflineCBPt = OfflineCBTrack->pt()/1e3 * OfflineCBTrack->charge(); // convert to GeV + OfflineCBEta = OfflineCBTrack->eta(); + OfflineCBPhi = OfflineCBTrack->phi(); + + // correlation histograms EFCB vs. OfflineCB + // get the closest EFCB muon + const TrigCompositeUtils::LinkInfo<xAOD::MuonContainer> EFCBMuonLinkInfo = m_matchTool->matchEFCBLinkInfo(mu, chain); + if( EFCBMuonLinkInfo.isValid() ){ + const ElementLink<xAOD::MuonContainer> EFCBMuon = EFCBMuonLinkInfo.link; + const xAOD::TrackParticle* EFCBTrack = (*EFCBMuon)->trackParticle(xAOD::Muon::TrackParticleType::CombinedTrackParticle); + if ( EFCBTrack ){ + matchedEFCB = true; + + MatchedEFCBPt = EFCBTrack->pt()/1e3 * EFCBTrack->charge(); // convert to GeV + MatchedEFCBEta = EFCBTrack->eta(); + MatchedEFCBPhi = EFCBTrack->phi(); + + CBdR = xAOD::P4Helpers::deltaR(OfflineCBTrack, EFCBTrack, false); + CBdPt = std::abs(OfflineCBPt) - std::abs(MatchedEFCBPt); + CBdEta = OfflineCBEta - MatchedEFCBEta; + CBdPhi = OfflineCBPhi - MatchedEFCBPhi; + + + // correlation histograms offlineCB (matched to EFCB) vs. offlineCB (matched to L2CB) + // get L2CB feature + const TrigCompositeUtils::Decision* EFCBMuonDecision = EFCBMuonLinkInfo.source; + const TrigCompositeUtils::LinkInfo<xAOD::L2CombinedMuonContainer> L2CBLinkInfo = TrigCompositeUtils::findLink<xAOD::L2CombinedMuonContainer>(EFCBMuonDecision, "feature"); + ATH_CHECK( L2CBLinkInfo.isValid() ); + const ElementLink<xAOD::L2CombinedMuonContainer> L2CBEL = L2CBLinkInfo.link; + + // get offline muon matched to L2CB + const xAOD::Muon *OfflineCBmatchedL2CB = m_matchTool->matchL2CBtoOff(ctx, (*L2CBEL)); + if (OfflineCBmatchedL2CB){ + const xAOD::TrackParticle* OfflineCBTrackmatchedL2CB = OfflineCBmatchedL2CB->trackParticle(xAOD::Muon::TrackParticleType::CombinedTrackParticle); + if ( OfflineCBTrackmatchedL2CB ){ + matchedL2CB = true; + OfflineCBmatchedL2CBPt = OfflineCBTrackmatchedL2CB->pt()/1e3 * OfflineCBTrackmatchedL2CB->charge(); // convert to GeV + OfflineCBmatchedL2CBEta = OfflineCBTrackmatchedL2CB->eta(); + OfflineCBmatchedL2CBPhi = OfflineCBTrackmatchedL2CB->phi(); + } + } + } + } + fill(m_group, OfflineCBPt, OfflineCBEta, OfflineCBPhi, OfflineCBmatchedL2CBPt, OfflineCBmatchedL2CBEta, OfflineCBmatchedL2CBPhi, + MatchedEFCBPt, MatchedEFCBEta, MatchedEFCBPhi, CBdPt, CBdEta, CBdPhi, CBdR, matchedEFCB, matchedL2CB); + } + + return StatusCode::SUCCESS; +} diff --git a/Trigger/TrigMonitoring/TrigMuonMonitoringMT/src/EFMuonMonMT.h b/Trigger/TrigMonitoring/TrigMuonMonitoringMT/src/EFMuonMonMT.h new file mode 100644 index 0000000000000000000000000000000000000000..24b80ad36ba7a93dc60488d36c1a2ca9d815a6fe --- /dev/null +++ b/Trigger/TrigMonitoring/TrigMuonMonitoringMT/src/EFMuonMonMT.h @@ -0,0 +1,25 @@ +/* + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration +*/ + +#ifndef TRIGMUONMONITORINGMT_EFMUONMONMT_H +#define TRIGMUONMONITORINGMT_EFMUONMONMT_H + +#include "TrigMuonMonitorAlgorithm.h" +#include "xAODMuon/MuonContainer.h" + +/* +This is a class for monitoring EFMuon. + */ +class EFMuonMonMT : public TrigMuonMonitorAlgorithm{ + + public: + EFMuonMonMT(const std::string& name, ISvcLocator* pSvcLocator ); + + protected: + virtual StatusCode fillVariablesPerChain(const EventContext &ctx, const std::string &chain) const override; + virtual StatusCode fillVariablesPerOfflineMuonPerChain(const EventContext &ctx, const xAOD::Muon* mu, const std::string &chain) const override; + +}; + +#endif //TRIGMUONMONITORINGMT_EFMUONMONMT_H diff --git a/Trigger/TrigMonitoring/TrigMuonMonitoringMT/src/L2MuonSAMonMT.cxx b/Trigger/TrigMonitoring/TrigMuonMonitoringMT/src/L2MuonSAMonMT.cxx index 191a7c9c9a3564f8482a8ea5c9e9962ef6d878dc..bbbb10f6010e68dd7c19d7010353ab99e3ef1608 100644 --- a/Trigger/TrigMonitoring/TrigMuonMonitoringMT/src/L2MuonSAMonMT.cxx +++ b/Trigger/TrigMonitoring/TrigMuonMonitoringMT/src/L2MuonSAMonMT.cxx @@ -44,7 +44,7 @@ StatusCode L2MuonSAMonMT :: fillVariablesPerChain(const EventContext &ctx, const roiPhi = (*muEL)->roiPhi(); ATH_MSG_DEBUG("saPt = " << saPt << ", saEta =" << saEta << ", saPhi = " << saPhi << ", saddr = " << saddr); - if(fabs(saPt) < ZERO_LIMIT) mf_failure = true; + if(std::abs(saPt) < ZERO_LIMIT) mf_failure = true; fill(m_group, roiEta, roiPhi, mf_failure); if( mf_failure ) continue; @@ -91,12 +91,12 @@ StatusCode L2MuonSAMonMT :: fillVariablesPerChain(const EventContext &ctx, const if(isBarrel){ if( nRPC > 0 ) isL1hitThere = true; float rpcFitMidSlope = (*muEL)->rpcFitMidSlope(); - if( fabs(rpcFitMidSlope) > ZERO_LIMIT ) isL1emuOkForTriggerPlane = true; + if( std::abs(rpcFitMidSlope) > ZERO_LIMIT ) isL1emuOkForTriggerPlane = true; } else { if( nTGCMidRho > 0 && nTGCMidPhi > 0 ) isL1hitThere = true; float TGCMid1Z = (*muEL)->tgcMid1Z(); - if( fabs(TGCMid1Z) > ZERO_LIMIT ) isL1emuOkForTriggerPlane = true; + if( std::abs(TGCMid1Z) > ZERO_LIMIT ) isL1emuOkForTriggerPlane = true; } @@ -127,15 +127,15 @@ StatusCode L2MuonSAMonMT :: fillVariablesPerChain(const EventContext &ctx, const auto mon_sp_r= Monitored::Collection(m_group+"_MDTpoints_r", sp_r); auto mon_sp_z= Monitored::Collection(m_group+"_MDTpoints_z", sp_z); - if( fabs((*muEL)->superPointR(inner)) > ZERO_LIMIT ) { + if( std::abs((*muEL)->superPointR(inner)) > ZERO_LIMIT ) { sp_r.push_back( sign * (*muEL)->superPointR(inner) ); sp_z.push_back( (*muEL)->superPointZ(inner) ); } - if( fabs((*muEL)->superPointR(middle)) > ZERO_LIMIT ) { + if( std::abs((*muEL)->superPointR(middle)) > ZERO_LIMIT ) { sp_r.push_back( sign * (*muEL)->superPointR(middle) ); sp_z.push_back( (*muEL)->superPointZ(middle) ); } - if( fabs((*muEL)->superPointR(outer)) > ZERO_LIMIT ) { + if( std::abs((*muEL)->superPointR(outer)) > ZERO_LIMIT ) { sp_r.push_back( sign * (*muEL)->superPointR(outer) ); sp_z.push_back( (*muEL)->superPointZ(outer) ); } @@ -210,7 +210,7 @@ StatusCode L2MuonSAMonMT :: fillVariablesPerChain(const EventContext &ctx, const // matching to offline - const xAOD::Muon* RecMuonCB = m_matchTool->matchL2SAtoOff(ctx, saEta, saPhi); + const xAOD::Muon* RecMuonCB = m_matchTool->matchL2SAtoOff(ctx, (*muEL)); if(RecMuonCB == nullptr) continue; std::vector<float> res_inn_OffMatch = res_inn; @@ -281,8 +281,8 @@ StatusCode L2MuonSAMonMT :: fillVariablesPerOfflineMuonPerChain(const EventConte // pt resolution, inverse pt resolution auto ptresol = Monitored::Scalar<float>(m_group+"_ptresol",-999.); auto invptresol = Monitored::Scalar<float>(m_group+"_invptresol",-999.); - if ( fabs(offPt) > ZERO_LIMIT && fabs(saPt) > ZERO_LIMIT ) { - ptresol = fabs(saPt)/fabs(offPt) - 1.; + if ( std::abs(offPt) > ZERO_LIMIT && std::abs(saPt) > ZERO_LIMIT ) { + ptresol = std::abs(saPt)/std::abs(offPt) - 1.; invptresol = (1./(offPt * offCharge) - 1./saPt) / (1./(offPt * offCharge)); } @@ -327,7 +327,7 @@ StatusCode L2MuonSAMonMT :: fillVariablesPerOfflineMuonPerChain(const EventConte // define region - if( fabs(offEta) < ETA_OF_BARREL ) { + if( std::abs(offEta) < ETA_OF_BARREL ) { if( offEta > 0. ) isBarrelA = true; else isBarrelC = true; } @@ -337,31 +337,31 @@ StatusCode L2MuonSAMonMT :: fillVariablesPerOfflineMuonPerChain(const EventConte } - if( fabs(offEta) < ETA_OF_BARREL ){ + if( std::abs(offEta) < ETA_OF_BARREL ){ isBarrel = true; if( offEta > 0. ) isBarrelA = true; else isBarrelC = true; } - else if ( fabs(offEta) < ETA_OF_ENDCAP1 ){ + else if ( std::abs(offEta) < ETA_OF_ENDCAP1 ){ isEndcap1 = true; if( offEta > 0. ) isEndcap1A = true; else isEndcap1C = true; } - else if ( fabs(offEta) < ETA_OF_ENDCAP2 ){ + else if ( std::abs(offEta) < ETA_OF_ENDCAP2 ){ isEndcap2 = true; if( offEta > 0. ) isEndcap2A = true; else isEndcap2C = true; } - else if ( fabs(offEta) < ETA_OF_ENDCAP3 ){ + else if ( std::abs(offEta) < ETA_OF_ENDCAP3 ){ isEndcap3 = true; if( offEta > 0. ) isEndcap3A = true; else isEndcap3C = true; } - if( fabs(offPt) > 4 ){ - if( fabs(offPt) < 6 ) pt4to6 = true; - else if( fabs(offPt) < 8 ) pt6to8 = true; + if( std::abs(offPt) > 4 ){ + if( std::abs(offPt) < 6 ) pt4to6 = true; + else if( std::abs(offPt) < 8 ) pt6to8 = true; else ptover8 = true; } diff --git a/Trigger/TrigMonitoring/TrigMuonMonitoringMT/src/L2MuonSAMonMT.h b/Trigger/TrigMonitoring/TrigMuonMonitoringMT/src/L2MuonSAMonMT.h index 48828390e2fb890b3a017333d12eddee4a3c6a1a..5edf8cc10ba8589a997ea9688245e8acd3255748 100644 --- a/Trigger/TrigMonitoring/TrigMuonMonitoringMT/src/L2MuonSAMonMT.h +++ b/Trigger/TrigMonitoring/TrigMuonMonitoringMT/src/L2MuonSAMonMT.h @@ -8,8 +8,6 @@ #include "TrigMuonMonitorAlgorithm.h" #include "xAODTrigMuon/L2StandAloneMuonContainer.h" -class MuonMatchingTool; - /* This is a class for monitoring L2MuonSA. */ diff --git a/Trigger/TrigMonitoring/TrigMuonMonitoringMT/src/L2muCombMonMT.cxx b/Trigger/TrigMonitoring/TrigMuonMonitoringMT/src/L2muCombMonMT.cxx index 815cc28e17a2cf3e60a2a7ecdc2ae654ba45c653..e897b343e88b01f436d1e0f0f132dbeffa25a427 100644 --- a/Trigger/TrigMonitoring/TrigMuonMonitoringMT/src/L2muCombMonMT.cxx +++ b/Trigger/TrigMonitoring/TrigMuonMonitoringMT/src/L2muCombMonMT.cxx @@ -64,7 +64,7 @@ StatusCode L2muCombMonMT :: fillVariablesPerChain(const EventContext &ctx, const bool error = false; if( samu ){ - if(fabs(saELPt - saPt) > ZERO_LIMIT){ + if(std::abs(saELPt - saPt) > ZERO_LIMIT){ vec_MF_error.push_back(1); error = true; } @@ -72,7 +72,7 @@ StatusCode L2muCombMonMT :: fillVariablesPerChain(const EventContext &ctx, const vec_MF_error.push_back(1); error = true; } - if(fabs(saELPt) < ZERO_LIMIT){ + if(std::abs(saELPt) < ZERO_LIMIT){ vec_MF_error.push_back(2); error = true; } @@ -89,13 +89,13 @@ StatusCode L2muCombMonMT :: fillVariablesPerChain(const EventContext &ctx, const auto L2CB_failure = Monitored::Scalar<bool>(m_group+"_L2CB_failure",false); bool off_cb_match = false; bool off_sa_match = false; - L2SA_success = (fabs(saPt) > ZERO_LIMIT)? true:false; - L2CB_success = (fabs(cbPt) > ZERO_LIMIT)? true:false; + L2SA_success = (std::abs(saPt) > ZERO_LIMIT)? true:false; + L2CB_success = (std::abs(cbPt) > ZERO_LIMIT)? true:false; // matching to offline - const xAOD::Muon* RecMuonCBmatchL2SA = m_matchTool->matchL2SAtoOff(ctx, saEta, saPhi); - const xAOD::Muon* RecMuonCBmatchL2CB = m_matchTool->matchL2CBtoOff(ctx, cbEta, cbPhi); + const xAOD::Muon* RecMuonCBmatchL2SA = m_matchTool->matchL2SAtoOff(ctx, (*saEL)); + const xAOD::Muon* RecMuonCBmatchL2CB = m_matchTool->matchL2CBtoOff(ctx, (*muEL)); if( RecMuonCBmatchL2SA && L2SA_success) off_sa_match = true; if( RecMuonCBmatchL2CB && L2CB_success) off_cb_match = true; @@ -119,8 +119,8 @@ StatusCode L2muCombMonMT :: fillVariablesPerChain(const EventContext &ctx, const auto dPhi_toSA = Monitored::Scalar<float>(m_group+"_dPhi_toSA",-999.); auto dR_toSA = Monitored::Scalar<float>(m_group+"_dR_toSA",-999.); - if( (*muEL)->muSATrackLink().isValid() && fabs(saPt) > ZERO_LIMIT ){ - ptratio_toSA = fabs(cbPt / saPt); + if( (*muEL)->muSATrackLink().isValid() && std::abs(saPt) > ZERO_LIMIT ){ + ptratio_toSA = std::abs(cbPt / saPt); dEta_toSA = cbEta - saEta; dPhi_toSA = xAOD::P4Helpers::deltaPhi(cbPhi, saPhi); dR_toSA = sqrt(dEta_toSA*dEta_toSA + dPhi_toSA*dPhi_toSA); @@ -147,7 +147,7 @@ StatusCode L2muCombMonMT :: fillVariablesPerChain(const EventContext &ctx, const } fill(m_group, trkPt); - if( fabs(trkPt) > ZERO_LIMIT) fill(m_group, trkEta, trkPhi, trkZ0, trkChi2); + if( std::abs(trkPt) > ZERO_LIMIT) fill(m_group, trkEta, trkPhi, trkZ0, trkChi2); // comparison L2muComb (IDTrack) vs L2MuonSA @@ -156,8 +156,8 @@ StatusCode L2muCombMonMT :: fillVariablesPerChain(const EventContext &ctx, const auto dPhi_TrktoSA = Monitored::Scalar<float>(m_group+"_dPhi_TrktoSA",-999.); auto dR_TrktoSA = Monitored::Scalar<float>(m_group+"_dR_TrktoSA",-999.); - if( (*muEL)->idTrackLink().isValid() && fabs(saPt) > ZERO_LIMIT ){ - ptratio_TrktoSA = fabs(cbPt / saPt); + if( (*muEL)->idTrackLink().isValid() && std::abs(saPt) > ZERO_LIMIT ){ + ptratio_TrktoSA = std::abs(cbPt / saPt); dEta_TrktoSA = cbEta - saEta; dPhi_TrktoSA = xAOD::P4Helpers::deltaPhi(cbPhi, saPhi); dR_TrktoSA = sqrt(dEta_TrktoSA*dEta_TrktoSA + dPhi_TrktoSA*dPhi_TrktoSA); @@ -201,7 +201,7 @@ StatusCode L2muCombMonMT :: fillVariablesPerOfflineMuonPerChain(const EventConte // pt resolution float cbPt = (*muEL)->pt()/1e3; - if ( fabs(offPt) > ZERO_LIMIT && fabs(cbPt) > ZERO_LIMIT ) ptresol = fabs(cbPt)/fabs(offPt) - 1.; + if ( std::abs(offPt) > ZERO_LIMIT && std::abs(cbPt) > ZERO_LIMIT ) ptresol = std::abs(cbPt)/std::abs(offPt) - 1.; fill(m_group, offEta, ptresol); diff --git a/Trigger/TrigMonitoring/TrigMuonMonitoringMT/src/L2muCombMonMT.h b/Trigger/TrigMonitoring/TrigMuonMonitoringMT/src/L2muCombMonMT.h index 155e6cb3f1132551ee6967adaa3708938b1f7e38..0e0f5a8629be87f97ce373c16c2e89f53123150c 100644 --- a/Trigger/TrigMonitoring/TrigMuonMonitoringMT/src/L2muCombMonMT.h +++ b/Trigger/TrigMonitoring/TrigMuonMonitoringMT/src/L2muCombMonMT.h @@ -2,14 +2,12 @@ Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ -#ifndef TRIGMUONMONITORINGMT_L2MUONCBMONMT_H -#define TRIGMUONMONITORINGMT_L2MUONCBMONMT_H +#ifndef TRIGMUONMONITORINGMT_L2MUCOMBMONMT_H +#define TRIGMUONMONITORINGMT_L2MUCOMBMONMT_H #include "TrigMuonMonitorAlgorithm.h" #include "xAODTrigMuon/L2CombinedMuonContainer.h" -class MuonMatchingTool; - /* This is a class for monitoring L2muComb. */ @@ -25,4 +23,4 @@ class L2muCombMonMT : public TrigMuonMonitorAlgorithm{ }; -#endif //TRIGMUONMONITORINGMT_L2MUONCBMONMT_H +#endif //TRIGMUONMONITORINGMT_L2MUCOMBMONMT_H diff --git a/Trigger/TrigMonitoring/TrigMuonMonitoringMT/src/MuonMatchingTool.cxx b/Trigger/TrigMonitoring/TrigMuonMonitoringMT/src/MuonMatchingTool.cxx index 677802dcda9f77d118aa8537b2994ccdb73745a9..d7c643c59e1c8f8753e556b7185b7b53b948a27f 100644 --- a/Trigger/TrigMonitoring/TrigMuonMonitoringMT/src/MuonMatchingTool.cxx +++ b/Trigger/TrigMonitoring/TrigMuonMonitoringMT/src/MuonMatchingTool.cxx @@ -38,23 +38,60 @@ std::tuple<bool, double,double> MuonMatchingTool :: trigPosForMatch<xAOD::L2Stan } -std::tuple<bool, double,double> MuonMatchingTool :: trigPosForMatchEFSA(const xAOD::Muon *trig){ - const xAOD::TrackParticle* mooreMuon = trig->trackParticle(xAOD::Muon::TrackParticleType::ExtrapolatedMuonSpectrometerTrackParticle); - return mooreMuon ? std::forward_as_tuple(true, mooreMuon->eta(), mooreMuon->phi()) : std::forward_as_tuple(false, 0., 0.); +std::tuple<bool, double,double> MuonMatchingTool :: PosForMatchSATrack(const xAOD::Muon *mu){ + const xAOD::TrackParticle* MuonTrack = mu->trackParticle(xAOD::Muon::TrackParticleType::ExtrapolatedMuonSpectrometerTrackParticle); + return MuonTrack ? std::forward_as_tuple(true, MuonTrack->eta(), MuonTrack->phi()) : std::forward_as_tuple(false, 0., 0.); +} + +std::tuple<bool, double,double> MuonMatchingTool :: PosForMatchCBTrack(const xAOD::Muon *mu){ + const xAOD::TrackParticle* MuonTrack = mu->trackParticle(xAOD::Muon::TrackParticleType::CombinedTrackParticle); + return MuonTrack ? std::forward_as_tuple(true, MuonTrack->eta(), MuonTrack->phi()) : std::forward_as_tuple(false, 0., 0.); } const xAOD::Muon* MuonMatchingTool :: matchEFSA( const xAOD::Muon *mu, std::string trig, bool &pass) const { ATH_MSG_DEBUG("MuonMonitoring::matchEFSA()"); - float reqdR = 0.03; - return match<xAOD::Muon>( mu, trig, reqdR, pass, &MuonMatchingTool::trigPosForMatchEFSA); + const xAOD::TrackParticle* MuonTrack = nullptr; + using Type = xAOD::Muon::TrackParticleType; + std::vector<Type> types { Type::ExtrapolatedMuonSpectrometerTrackParticle, + Type::MSOnlyExtrapolatedMuonSpectrometerTrackParticle, + Type::MuonSpectrometerTrackParticle}; + for (Type type : types){ + MuonTrack = mu->trackParticle(type); + if (MuonTrack) break; + } + return MuonTrack ? match<xAOD::Muon>( MuonTrack, trig, m_EFreqdR, pass, &MuonMatchingTool::PosForMatchSATrack) : nullptr; +} + +const TrigCompositeUtils::LinkInfo<xAOD::MuonContainer> MuonMatchingTool :: matchEFSALinkInfo( const xAOD::Muon *mu, std::string trig) const { + ATH_MSG_DEBUG("MuonMonitoring::matchEFSALinkInfo()"); + bool pass = false; + TrigCompositeUtils::LinkInfo<xAOD::MuonContainer> muonLinkInfo; + const xAOD::TrackParticle* MuonTrack = nullptr; + using Type = xAOD::Muon::TrackParticleType; + std::vector<Type> types { Type::ExtrapolatedMuonSpectrometerTrackParticle, + Type::MSOnlyExtrapolatedMuonSpectrometerTrackParticle, + Type::MuonSpectrometerTrackParticle}; + for (Type type : types){ + MuonTrack = mu->trackParticle(type); + if (MuonTrack) break; + } + return MuonTrack ? matchLinkInfo<xAOD::Muon>(MuonTrack, trig, m_EFreqdR, pass, &MuonMatchingTool::PosForMatchSATrack) : muonLinkInfo; } const xAOD::Muon* MuonMatchingTool :: matchEFCB( const xAOD::Muon *mu, std::string trig, bool &pass) const { ATH_MSG_DEBUG("MuonMonitoring::matchEFCB()"); - float reqdR = 0.03; - return match<xAOD::Muon>( mu, trig, reqdR, pass); + const xAOD::TrackParticle* MuonTrack = mu->trackParticle(xAOD::Muon::TrackParticleType::Primary); + return MuonTrack ? match<xAOD::Muon>( MuonTrack, trig, m_EFreqdR, pass, &MuonMatchingTool::PosForMatchCBTrack) : nullptr; +} + +const TrigCompositeUtils::LinkInfo<xAOD::MuonContainer> MuonMatchingTool :: matchEFCBLinkInfo( const xAOD::Muon *mu, std::string trig) const { + ATH_MSG_DEBUG("MuonMonitoring::matchEFCBLinkInfo()"); + bool pass = false; + TrigCompositeUtils::LinkInfo<xAOD::MuonContainer> muonLinkInfo; + const xAOD::TrackParticle* MuonTrack = mu->trackParticle(xAOD::Muon::TrackParticleType::Primary); + return MuonTrack ? matchLinkInfo<xAOD::Muon>(MuonTrack, trig, m_EFreqdR, pass, &MuonMatchingTool::PosForMatchCBTrack) : muonLinkInfo; } @@ -74,7 +111,7 @@ const xAOD::L2StandAloneMuon* MuonMatchingTool :: matchL2SA( const xAOD::Muon * const TrigCompositeUtils::LinkInfo<xAOD::L2StandAloneMuonContainer> MuonMatchingTool :: searchL2SALinkInfo( const xAOD::Muon *mu, std::string trig) const { ATH_MSG_DEBUG("MuonMonitoring::searchL2SALinkInfo()"); bool pass = false; - return searchLinkInfo<xAOD::L2StandAloneMuon>( mu, trig, 1000., pass); + return matchLinkInfo<xAOD::L2StandAloneMuon>( mu, trig, 1000., pass); } @@ -86,7 +123,7 @@ const xAOD::L2CombinedMuon* MuonMatchingTool :: matchL2CB( const xAOD::Muon *mu const TrigCompositeUtils::LinkInfo<xAOD::L2CombinedMuonContainer> MuonMatchingTool :: searchL2CBLinkInfo( const xAOD::Muon *mu, std::string trig) const { ATH_MSG_DEBUG("MuonMonitoring::searchL2CBLinkInfo()"); bool pass = false; - return searchLinkInfo<xAOD::L2CombinedMuon>( mu, trig, 1000., pass); + return matchLinkInfo<xAOD::L2CombinedMuon>( mu, trig, 1000., pass); } @@ -125,7 +162,7 @@ const xAOD::MuonRoI* MuonMatchingTool :: matchL1( const xAOD::Muon *mu, const E double dphi = xAOD::P4Helpers::deltaPhi(refPhi, roiPhi); double dR = sqrt(deta*deta + dphi*dphi); ATH_MSG_VERBOSE("L1 muon candidate eta=" << roiEta << " phi=" << roiPhi << " dR=" << dR); - if( dR<reqdR && roiThr>=L1ItemSTI(trig)){ + if( dR<reqdR && roiThr>=L1ItemStringToInt(trig)){ reqdR = dR; pass = true; closest = roi; @@ -137,40 +174,12 @@ const xAOD::MuonRoI* MuonMatchingTool :: matchL1( const xAOD::Muon *mu, const E } -const xAOD::Muon* MuonMatchingTool :: matchL2SAtoOff( const EventContext& ctx, float trigEta, float trigPhi) const { - return matchOff(ctx, trigEta, trigPhi, m_L2SAreqdR); +const xAOD::Muon* MuonMatchingTool :: matchL2SAtoOff( const EventContext& ctx, const xAOD::L2StandAloneMuon* samu) const { + return matchOff(ctx, samu, m_L2SAreqdR, &MuonMatchingTool::PosForMatchSATrack); } -const xAOD::Muon* MuonMatchingTool :: matchL2CBtoOff( const EventContext& ctx, float trigEta, float trigPhi) const { - return matchOff(ctx, trigEta, trigPhi, m_L2CBreqdR); -} - -const xAOD::Muon* MuonMatchingTool :: matchOff( const EventContext& ctx, float trigEta, float trigPhi, float DR_cut) const { - - const xAOD::Muon *muon = nullptr; - - SG::ReadHandle<xAOD::MuonContainer> muons(m_MuonContainerKey, ctx); - if (! muons.isValid() ) { - ATH_MSG_ERROR("evtStore() does not contain muon Collection with name "<< m_MuonContainerKey); - return muon; - } - - for(const auto &mu : *muons){ - float offEta = mu->eta(); - float offPhi = mu->phi(); - - float deta = offEta - trigEta; - float dphi = xAOD::P4Helpers::deltaPhi(offPhi, trigPhi); - double dR = sqrt(deta*deta + dphi*dphi); - - if(dR < DR_cut){ - DR_cut = dR; - muon = mu; - ATH_MSG_DEBUG("* Trigger muon eta=" << trigEta << " phi=" << trigPhi << " offEta=" << offEta << " offPhi=" << offPhi << " dR=" << dR); - } - } - - return muon; +const xAOD::Muon* MuonMatchingTool :: matchL2CBtoOff( const EventContext& ctx, const xAOD::L2CombinedMuon* cbmu) const { + return matchOff(ctx, cbmu, m_L2CBreqdR, &MuonMatchingTool::PosForMatchCBTrack); } diff --git a/Trigger/TrigMonitoring/TrigMuonMonitoringMT/src/MuonMatchingTool.h b/Trigger/TrigMonitoring/TrigMuonMonitoringMT/src/MuonMatchingTool.h index acc0b914d1c70b7a20e8532ceaecf7ef1e3860da..a46d29dbcd5fbb929d3f5bfedb1d70f143a9067a 100644 --- a/Trigger/TrigMonitoring/TrigMuonMonitoringMT/src/MuonMatchingTool.h +++ b/Trigger/TrigMonitoring/TrigMuonMonitoringMT/src/MuonMatchingTool.h @@ -32,19 +32,6 @@ class MuonMatchingTool : public AthAlgTool { virtual StatusCode initialize() override; - enum L1Items{ L1_MU4=1, L1_MU6, L1_MU10, L1_MU11, L1_MU15, L1_MU20, L1_MU21,ERROR}; - int L1ItemSTI(std::string l1item) const { - if( "L1_MU4"==l1item) return L1Items::L1_MU4; - if( "L1_MU6"==l1item) return L1Items::L1_MU6; - if( "L1_MU10"==l1item) return L1Items::L1_MU10; - if( "L1_MU11"==l1item) return L1Items::L1_MU11; - if( "L1_MU15"==l1item) return L1Items::L1_MU15; - if( "L1_MU20"==l1item) return L1Items::L1_MU20; - if( "L1_MU21"==l1item) return L1Items::L1_MU21; - return L1Items::ERROR; - } - - /** * @brief Function that searches for a Level 1 muon candidate and judges if it is matched to a given offline muon. * @param mu Offline muon around which Level 1 candidates are searched. @@ -107,6 +94,15 @@ class MuonMatchingTool : public AthAlgTool { */ const xAOD::Muon* matchEFSA(const xAOD::Muon *mu, std::string trigger, bool &pass) const; + /** + * @brief Function that searches for an EF standalone muon (EFSA) candidate and judges if it is matched to a given track particle. + * @param mu Offline muon around which EFSA candidates are searched. + * @param trigger Considered chain name, e.g. HLT_mu26_ivarmedium_L1MU20, etc. + * @return Pointer to the matched candidate. This is inValid link when there is no candidate found. + * Important: a valid pointer doesn't mean that it passed the hypothesis, users should check @c pass for the decision. + */ + const TrigCompositeUtils::LinkInfo<xAOD::MuonContainer> matchEFSALinkInfo( const xAOD::Muon *mu, std::string trig) const; + /** * @brief Function that searches for an EF combined muon (EFCB) candidate and judges if it is matched to a given offline muon. * @param mu Offline muon around which EFCB candidates are searched. @@ -117,33 +113,31 @@ class MuonMatchingTool : public AthAlgTool { */ const xAOD::Muon* matchEFCB(const xAOD::Muon *mu, std::string trigger, bool &pass) const; - /** - * @brief Function that searches for an offline muon within @c DR_cut from the given eta-phi (of a online muon) - * @param ctx Reference to the @c EventContext needed for accessing the @c Muons container. - * @param trigEta Eta of the given online muon - * @param trigPhi Phi of the given online muon - * @return Pointer to the matched offline muon. This is @c nullptr when there is no muon found. + * @brief Function that searches for an EF combined muon (EFCB) candidate and judges if it is matched to a given track particle. + * @param mu Offline muon around which EFCB candidates are searched. + * @param trigger Considered chain name, e.g. HLT_mu26_ivarmedium_L1MU20, etc. + * @return Pointer to the matched candidate. This is inValid link when there is no candidate found. + * Important: a valid pointer doesn't mean that it passed the hypothesis, users should check @c pass for the decision. */ - const xAOD::Muon* matchOff( const EventContext& ctx, float trigEta, float trigPhi, float DR_cut) const; + const TrigCompositeUtils::LinkInfo<xAOD::MuonContainer> matchEFCBLinkInfo( const xAOD::Muon *mu, std::string trig) const; + /** - * @brief Function that searches for an offline muon matched to L2SA muon from the given eta-phi (of a online muon) + * @brief Function that searches for an offline muon matched to L2SA muon * @param ctx Reference to the @c EventContext needed for accessing the @c Muons container. - * @param trigEta Eta of the given online muon - * @param trigPhi Phi of the given online muon + * @param samu the given online muon * @return Pointer to the matched offline muon. This is @c nullptr when there is no muon found. */ - const xAOD::Muon* matchL2SAtoOff( const EventContext& ctx, float trigEta, float trigPhi) const; + const xAOD::Muon* matchL2SAtoOff( const EventContext& ctx, const xAOD::L2StandAloneMuon* samu) const; /** - * @brief Function that searches for an offline muon matched to L2CB muon from the given eta-phi (of a online muon) + * @brief Function that searches for an offline muon matched to L2CB muon * @param ctx Reference to the @c EventContext needed for accessing the @c Muons container. - * @param trigEta Eta of the given online muon - * @param trigPhi Phi of the given online muon + * @param cbmu the given online muon * @return Pointer to the matched offline muon. This is @c nullptr when there is no muon found. */ - const xAOD::Muon* matchL2CBtoOff( const EventContext& ctx, float trigEta, float trigPhi) const; + const xAOD::Muon* matchL2CBtoOff( const EventContext& ctx, const xAOD::L2CombinedMuon* cbmu) const; bool isMatchedL2SA(const xAOD::L2StandAloneMuon*, const xAOD::Muon*) const; @@ -170,8 +164,21 @@ class MuonMatchingTool : public AthAlgTool { private: + enum L1Items{ L1_MU4=1, L1_MU6, L1_MU10, L1_MU11, L1_MU15, L1_MU20, L1_MU21,ERROR}; + int L1ItemStringToInt(std::string l1item) const { + if( "L1_MU4"==l1item) return L1Items::L1_MU4; + if( "L1_MU6"==l1item) return L1Items::L1_MU6; + if( "L1_MU10"==l1item) return L1Items::L1_MU10; + if( "L1_MU11"==l1item) return L1Items::L1_MU11; + if( "L1_MU15"==l1item) return L1Items::L1_MU15; + if( "L1_MU20"==l1item) return L1Items::L1_MU20; + if( "L1_MU21"==l1item) return L1Items::L1_MU21; + return L1Items::ERROR; + } + const float m_L2SAreqdR = 0.25; const float m_L2CBreqdR = 0.03; + const float m_EFreqdR = 0.03; // private methods /** @@ -184,7 +191,7 @@ class MuonMatchingTool : public AthAlgTool { * @see MuonMatchingTool.icc for the implementation and MuonMatchingTool.cxx for the instantiation. * @todo Consider improving the argument list. */ - template<class T, class OFFL> const TrigCompositeUtils::LinkInfo<DataVector<T> > searchLinkInfo(const OFFL *offl, std::string trigger, float reqdR, bool &pass, + template<class T, class OFFL> const TrigCompositeUtils::LinkInfo<DataVector<T> > matchLinkInfo(const OFFL *offl, std::string trigger, float reqdR, bool &pass, std::tuple<bool,double,double> (*trigPosForMatchFunc)(const T*) = &MuonMatchingTool::trigPosForMatch<T>) const; /** @@ -201,6 +208,23 @@ class MuonMatchingTool : public AthAlgTool { */ template<class T, class OFFL> const T* match(const OFFL *offl, std::string trigger, float reqdR, bool &pass, std::tuple<bool,double,double> (*trigPosForMatchFunc)(const T*) = &MuonMatchingTool::trigPosForMatch<T>) const; + + /** + * @brief Function that searches for an offline muon candidate matched to online muon of type T. + * @param trig Position of the online muon used for computing dR. + * @param reqdR Requirement of dR used for the matching. Note that reqdR is updated with the dR of the found candidate. + * @param offlinePosForMatchFunc Function pointer that implements cuts for the offline muon candidates. + * @param trigPosForMatchFunc Function pointer that implements cuts for the online muon candidates. + * @return Pointer to the matched candidate. This is @c nullptr when there is no candidate found. + * Important: a valid pointer doesn't mean that it passed the hypothesis, users should check @c pass for the decision. + * @see MuonMatchingTool.icc for the implementation and MuonMatchingTool.cxx for the instantiation. + * @todo Consider improving the argument list. + */ + template<class T> const xAOD::Muon* matchOff(const EventContext& ctx, const T* trig, float reqdR, + std::tuple<bool,double,double> (*offlinePosForMatchFunc)(const xAOD::Muon*), + std::tuple<bool,double,double> (*trigPosForMatchFunc)(const T*) = &MuonMatchingTool::trigPosForMatch<T>) const; + + const Amg::Vector3D offlineMuonAtPivot(const xAOD::Muon *mu) const; double FermiFunction(double x, double x0, double w) const; const Trk::TrackParameters* extTrackToTGC(const xAOD::TrackParticle *track) const; @@ -209,7 +233,8 @@ class MuonMatchingTool : public AthAlgTool { // static methods // Template methods that perform different matching schemes for T=xAOD::L2StandAloneMuon, xAOD::L2CombinedMuon and xAOD::Muon (EF). template<class T> static inline std::tuple<bool,double,double> trigPosForMatch(const T *trig); - static inline std::tuple<bool,double,double> trigPosForMatchEFSA(const xAOD::Muon *trig); + static inline std::tuple<bool,double,double> PosForMatchSATrack(const xAOD::Muon *mu); + static inline std::tuple<bool,double,double> PosForMatchCBTrack(const xAOD::Muon *mu); SG::ReadHandleKey<xAOD::MuonRoIContainer> m_MuonRoIContainerKey {this, "MuonRoIContainerName", "LVL1MuonRoIs", "Level 1 muon container"}; SG::ReadHandleKey<xAOD::MuonContainer> m_MuonContainerKey {this, "MuonContainerName", "Muons", "Offline muon container"}; diff --git a/Trigger/TrigMonitoring/TrigMuonMonitoringMT/src/MuonMatchingTool.icc b/Trigger/TrigMonitoring/TrigMuonMonitoringMT/src/MuonMatchingTool.icc index afd22dd3d0af65b518ef5be9c7d7524509a1bdcb..19d1383cd791e1758b53588f0d2c3d2703deef14 100644 --- a/Trigger/TrigMonitoring/TrigMuonMonitoringMT/src/MuonMatchingTool.icc +++ b/Trigger/TrigMonitoring/TrigMuonMonitoringMT/src/MuonMatchingTool.icc @@ -17,7 +17,7 @@ const T* MuonMatchingTool :: match(const OFFL* offl, std::string trig, float req using CONTAINER = DataVector<T>; const T* ptr = nullptr; - const TrigCompositeUtils::LinkInfo<CONTAINER> featureLinkInfo = searchLinkInfo<T>(offl, trig, reqdR, pass, trigPosForMatchFunc); + const TrigCompositeUtils::LinkInfo<CONTAINER> featureLinkInfo = matchLinkInfo<T>(offl, trig, reqdR, pass, trigPosForMatchFunc); if( featureLinkInfo.isValid() ){ const ElementLink<CONTAINER> link = featureLinkInfo.link; ptr = *link; @@ -29,10 +29,10 @@ const T* MuonMatchingTool :: match(const OFFL* offl, std::string trig, float req template<class T, class OFFL> -const TrigCompositeUtils::LinkInfo<DataVector<T> > MuonMatchingTool :: searchLinkInfo(const OFFL* offl, std::string trig, float reqdR, bool &pass, - std::tuple<bool,double,double> (*trigPosForMatchFunc)(const T*)) const { +const TrigCompositeUtils::LinkInfo<DataVector<T> > MuonMatchingTool :: matchLinkInfo(const OFFL* offl, std::string trig, float reqdR, bool &pass, + std::tuple<bool,double,double> (*trigPosForMatchFunc)(const T*)) const { - ATH_MSG_DEBUG("MuonMonitoring::searchLinkInfo<T>"); + ATH_MSG_DEBUG("MuonMonitoring::matchLinkInfo<T>"); using CONTAINER = DataVector<T>; @@ -63,3 +63,38 @@ const TrigCompositeUtils::LinkInfo<DataVector<T> > MuonMatchingTool :: searchLin return muonLinkInfo; } + + +template<class T> +const xAOD::Muon* MuonMatchingTool :: matchOff(const EventContext& ctx, const T* trig, float reqdR, + std::tuple<bool,double,double> (*offlinePosForMatchFunc)(const xAOD::Muon*), std::tuple<bool,double,double> (*trigPosForMatchFunc)(const T*)) const { + + ATH_MSG_DEBUG("MuonMonitoring::matchOff<T>"); + + const xAOD::Muon *muon = nullptr; + + SG::ReadHandle<xAOD::MuonContainer> muons(m_MuonContainerKey, ctx); + if (! muons.isValid() ) { + ATH_MSG_ERROR("evtStore() does not contain muon Collection with name "<< m_MuonContainerKey); + return muon; + } + + const auto [trigstatus, trigEta, trigPhi] = trigPosForMatchFunc(trig); + if(!trigstatus) return muon; + + for(const auto &mu : *muons){ + const auto [offstatus, offEta, offPhi] = offlinePosForMatchFunc(mu); + if(!offstatus) continue; + float deta = offEta - trigEta; + float dphi = xAOD::P4Helpers::deltaPhi(offPhi, trigPhi); + double dR = sqrt(deta*deta + dphi*dphi); + + if(dR < reqdR){ + reqdR = dR; + muon = mu; + ATH_MSG_DEBUG("* Trigger muon eta=" << trigEta << " phi=" << trigPhi << " offEta=" << offEta << " offPhi=" << offPhi << " dR=" << dR); + } + } + + return muon; +} diff --git a/Trigger/TrigMonitoring/TrigMuonMonitoringMT/src/components/TrigMuonMonintoringMT_entries.cxx b/Trigger/TrigMonitoring/TrigMuonMonitoringMT/src/components/TrigMuonMonintoringMT_entries.cxx index 661fcb42ca21bf04e631d531083c47345c93acd7..9d72abf92e1f114432d5a9bede845a76166eb63c 100644 --- a/Trigger/TrigMonitoring/TrigMuonMonitoringMT/src/components/TrigMuonMonintoringMT_entries.cxx +++ b/Trigger/TrigMonitoring/TrigMuonMonitoringMT/src/components/TrigMuonMonintoringMT_entries.cxx @@ -5,6 +5,7 @@ #include "../L1MuonMonMT.h" #include "../L2MuonSAMonMT.h" #include "../L2muCombMonMT.h" +#include "../EFMuonMonMT.h" #include "../TrigMuonEfficiencyMonMT.h" #include "../MuonMatchingTool.h" @@ -12,4 +13,5 @@ DECLARE_COMPONENT( TrigMuonEfficiencyMonMT ) DECLARE_COMPONENT( L1MuonMonMT ) DECLARE_COMPONENT( L2MuonSAMonMT ) DECLARE_COMPONENT( L2muCombMonMT ) +DECLARE_COMPONENT( EFMuonMonMT ) DECLARE_COMPONENT( MuonMatchingTool ) diff --git a/Trigger/TrigSteer/TrigCompositeUtils/TrigCompositeUtils/NavGraph.h b/Trigger/TrigSteer/TrigCompositeUtils/TrigCompositeUtils/NavGraph.h new file mode 100644 index 0000000000000000000000000000000000000000..6ddb00d9f992c06bc8aa6e4ba9aa33dff8162ed8 --- /dev/null +++ b/Trigger/TrigSteer/TrigCompositeUtils/TrigCompositeUtils/NavGraph.h @@ -0,0 +1,124 @@ +/* + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration +*/ + +#ifndef TrigCompositeUtils_NavGraph_h +#define TrigCompositeUtils_NavGraph_h + +#include <set> + +#include "AthContainers/AuxElement.h" +#include "xAODTrigger/TrigCompositeContainer.h" +#include "xAODTrigger/TrigCompositeAuxContainer.h" + + +namespace TrigCompositeUtils { + + /** + * @class NavGraphNode + * @brief Transient utility class to represent a node in a graph (m_decisionObject), and a set of edges (m_filteredSeeds) + * to other nodes which are parents of this node. + **/ + class NavGraphNode { + public: + + /** + * @brief Construct a NavGraphNode shadowing a node in the full xAOD navigation graph + * @param[in] me The Decision object node from the full xAOD navigation graph which this object is representing. + **/ + NavGraphNode(const Decision* me); + + /** + * @brief Form an edge in the graph from this node to another one. + * @param[in] to The "parent" or "seed" Decision object from the perspective of this Node's shadowed Decision object. + * @return True if a new edge was added. False if this was a duplicated call to add this edge. + **/ + bool linksTo(const NavGraphNode* to); + + /** + * @brief Return a const pointer to the Decision object node which this NavGraphNode is shadowing. + **/ + const Decision* node() const; + + /** + * @brief Return a set of const pointers to the Decision object nodes which this NavGraphNode seeds from. + * Note: NavGraph is used to represent a sub-graph of the full navigation graph, hence it is expected that + * the set of seeds returned from this function may be smaller than the set of seeds returned from the + * shadowed xAOD Decision Object. + **/ + const std::set<const NavGraphNode*>& seeds() const; + + private: + const Decision* m_decisionObject; //!< The Decision object node which I shadow + std::set<const NavGraphNode*> m_filteredSeeds; //!< My seeds (edges in the graph), filtered on per-chain requirements. + + }; + + /** + * @class NavGraph + * @brief Structure to hold a transient Directed Acyclic Graph (DAG) structure. + * NavGraph is populated from, and forms a sub-graph over the full Run 3 trigger navigation graph in a single event. + * Requirements on specific chains, and the specification of allowable graph entry-points are considered in the construction of the NavGraph sub-graph. + * Once one of these sub-graphs is fully populated to a given specification, it is searched by the feature-retrieval code to find features. + **/ + class NavGraph { + + public: + + /** + * @brief Construct an empty NavGraph + **/ + NavGraph(); + + /** + * @brief Add a new NavGraphNode which shadows the xAOD Decision object "node" from the full navigation graph + * @param[in] node The xAOD Decision object which the new node will shadow. Will not cause duplication if node has already been added. + * @param[in] comingFrom If not null, used to indicate which xAOD Decision object was the seed of "node". This is used to form an edge in the graph. + * Alternately, if comingFrom is null then "node" is taken as a final node (one of the locations from which the graph should be explored) and hence is added + * to the finalNodes set. + **/ + void addNode(const Decision* node, const Decision* comingFrom = nullptr); + + /** + * @brief Get all final nodes. + * @return Set of final nodes. These are the nodes which were added without any "comingFrom". + * To explore the NavGraph fully, one should explore recursively from each of the final nodes. + **/ + const std::set<NavGraphNode*>& finalNodes() const; + + /** + * @return Total number of unique nodes in the NavGraph. + **/ + size_t nodes() const; + + /** + * @return Total number of unique edges in the NavGraph. + **/ + size_t edges() const; + + /** + * @bried Helper function. Print the internal graph structure to the terminal. + * @param[in] log Athena messaging service reference. + * @param[in] msgLevel Athena messaging service verbosity level. + **/ + void printAllPaths(MsgStream& log, MSG::Level msgLevel = MSG::VERBOSE) const; + + private: + + /** + * @bried Internal helper function. Recursively print the graph structure from a single given starting node. + * @param[in] nav The node to recursively explore. + * @param[in] level The current depth of recursion. Used to pad output format. + * @param[in] log Athena messaging service reference. + * @param[in] msgLevel Athena messaging service verbosity level. + **/ + void recursivePrintNavPath(const NavGraphNode& nav, size_t level, MsgStream& log, MSG::Level msgLevel) const; + + std::map<const Decision*, NavGraphNode> m_nodes; //!< Map of nodes in the graph. Indexed on the underlying Decision object's transient pointer. + std::set<NavGraphNode*> m_finalNodes; //!< Entry points into the navigation graph. When iterating over the graph, start from all of these places. + size_t m_edges; //!< Statistics on the number of edges, connecting the nodes in the graph. + }; + +} + +#endif // TrigCompositeUtils_NavGraph_h diff --git a/Trigger/TrigSteer/TrigCompositeUtils/TrigCompositeUtils/TrigCompositeUtils.h b/Trigger/TrigSteer/TrigCompositeUtils/TrigCompositeUtils/TrigCompositeUtils.h index 1f62fa70f4aadd7dad301cbd3bb6f8baaaf0d750..d2b2e3e81aa00f9f93a6ab3683376b430edc1fed 100644 --- a/Trigger/TrigSteer/TrigCompositeUtils/TrigCompositeUtils/TrigCompositeUtils.h +++ b/Trigger/TrigSteer/TrigCompositeUtils/TrigCompositeUtils/TrigCompositeUtils.h @@ -17,6 +17,7 @@ #include "StoreGate/ReadHandleKey.h" #include "StoreGate/WriteHandle.h" #include "GaudiKernel/ThreadLocalContext.h" +#include "GaudiKernel/MsgStream.h" #include "AthContainers/AuxElement.h" #include "xAODTrigger/TrigCompositeContainer.h" @@ -25,6 +26,7 @@ #include "TrigDecisionInterface/Conditions.h" #include "HLTIdentifier.h" +#include "NavGraph.h" namespace TrigCompositeUtils { @@ -251,17 +253,20 @@ namespace TrigCompositeUtils { **/ std::vector<const Decision*> getRejectedDecisionNodes(StoreGateSvc* eventStore, const DecisionID id = 0); + + + /** - * @brief Search back in time from "start" and locate all linear paths back through Decision objects for a given chain. - * @param[in] start The Decision object to start the search from. Typically this will be one of the terminus objects from the HLTNav_Summary (regular or rerun). - * @param[out] linkVector Each entry in the outer vector represents a path through the graph. For each path, a vector of ElementLinks describing the path is returned. + * @brief Search back in time from "node" and locate all paths back through Decision objects for a given chain. + * @param[in] node The Decision object to start the search from. Typically this will be one of the terminus objects from the HLTNav_Summary. + * @param[inout] navPaths Holds a sub-graph of the full navigation graph, filtered by DecisionID. An already partially populated graph may be provided as input. * @param[in] id Optional DecisionID of a Chain to trace through the navigation. If omitted, no chain requirement will be applied. * @param[in] enforceDecisionOnStartNode If the check of DecisionID should be carried out on the start node. * enforceDecisionOnStartNode should be true if navigating for a trigger which passed (e.g. starting from HLTPassRaw) * enforceDecisionOnStartNode should be false if navigating for a trigger which failed but whose failing start node(s) were recovered via getRejectedDecisionNodes **/ - void recursiveGetDecisions(const Decision* start, - std::vector<ElementLinkVector<DecisionContainer>>& linkVector, + void recursiveGetDecisions(const Decision* node, + NavGraph& navGraph, const DecisionID id = 0, const bool enforceDecisionOnStartNode = true); @@ -269,12 +274,13 @@ namespace TrigCompositeUtils { /** * @brief Used by recursiveGetDecisions * @see recursiveGetDecisions + * @param comingFrom The parent node which has a link in the navigation to this "node" **/ - void recursiveGetDecisionsInternal(const Decision* start, - const size_t location, - std::vector<ElementLinkVector<DecisionContainer>>& linkVector, - const DecisionID id = 0, - const bool enforceDecisionOnNode = true); + void recursiveGetDecisionsInternal(const Decision* node, + const Decision* comingFrom, + NavGraph& navGraph, + const DecisionID id, + const bool enforceDecisionOnNode); /** * @brief Additional information returned by the TrigerDecisionTool's feature retrieval, contained within the LinkInfo. @@ -330,20 +336,37 @@ namespace TrigCompositeUtils { /** * @brief Extract features from the supplied linkVector (obtained through recursiveGetDecisions). - * @param[in] linkVector Vector of paths through the navigation which are to be considered. + * @param[in] navPaths Sub-graph of the trigger navigation which is to be considered. * @param[in] lastFeatureOfType True for TrigDefs::lastFeatureOfType. stops at the first feature (of the correct type) found per path through the navigation. * @param[in] featureName Optional name of feature link as saved online. The "feature" link is enforced, others may have been added. * @param[in] chains Optional set of Chain IDs which features are being requested for. Used to set the ActiveState of returned LinkInfo objects. * @return Typed vector of LinkInfo. Each LinkInfo wraps an ElementLink to a feature and a pointer to the feature's Decision object in the navigation. **/ template<class CONTAINER> - const std::vector< LinkInfo<CONTAINER> > getFeaturesOfType( - const std::vector<ElementLinkVector<DecisionContainer>>& linkVector, + const std::vector< LinkInfo<CONTAINER> > recursiveGetFeaturesOfType( + const NavGraph& navGraph, const std::string containerSGKey = "", const bool lastFeatureOfType = true, const std::string& navElementLinkKey = featureString(), const DecisionIDContainer chainIDs = DecisionIDContainer()); + /** + * @see recursiveGetFeaturesOfType + * @brief Internal implimentation called by recursiveGetFeaturesOfType, and by itself + * @param[inout] features The untimate return vector. New links are to be appended. + * @param[inout] fullyExploredFrom Cache of graph nodes which have been fully explored, and hence don't need exploring again should they show up. + * @param[in] navGraphNode The current node in the navGraph which is being explored. + **/ + template<class CONTAINER> + void recursiveGetFeaturesOfTypeInternal( + std::vector< LinkInfo<CONTAINER> >& features, + std::set<const NavGraphNode*>& fullyExploredFrom, + const NavGraphNode* navGraphNode, + const std::string containerSGKey, + const bool lastFeatureOfType, + const std::string& navElementLinkKey, + const DecisionIDContainer chainIDs); + /** * @brief Perform a recursive search for ElementLinks of type T and name 'linkName', starting from Decision object 'start' * For the case of multiple links, this function only returns the first one found. @see findLinks @@ -400,11 +423,6 @@ namespace TrigCompositeUtils { **/ std::string dump( const Decision* tc, std::function< std::string( const Decision* )> printerFnc ); - - - - - } #include "TrigCompositeUtils/TrigCompositeUtils.icc" diff --git a/Trigger/TrigSteer/TrigCompositeUtils/TrigCompositeUtils/TrigCompositeUtils.icc b/Trigger/TrigSteer/TrigCompositeUtils/TrigCompositeUtils/TrigCompositeUtils.icc index 87952570993f30e5c47f9f1477c7a0d01eb785a6..2996de9d0cc0d7ac90b85516e5c7d589fcc3d536 100644 --- a/Trigger/TrigSteer/TrigCompositeUtils/TrigCompositeUtils/TrigCompositeUtils.icc +++ b/Trigger/TrigSteer/TrigCompositeUtils/TrigCompositeUtils/TrigCompositeUtils.icc @@ -48,8 +48,6 @@ namespace TrigCompositeUtils { // We can keep a record of nodes which we have already explored, these we can safely skip over. if (visitedCache->count(start) == 1) { return; // Early exit - } else { - visitedCache->insert(start); } } ElementLinkVector<T> featureLinks; @@ -96,6 +94,10 @@ namespace TrigCompositeUtils { for (const auto& seed : getLinkToPrevious(start)) { findLinks<T>(*seed, linkName, links, behaviour); } + // Fully explored this node + if (visitedCache != nullptr) { + visitedCache->insert(start); + } } template<typename T> @@ -128,9 +130,10 @@ namespace TrigCompositeUtils { return LinkInfo<T>(); // invalid link } + template<class CONTAINER> void filterLinkVectorByContainerKey(const std::string& containerSGKey, ElementLinkVector<CONTAINER>& vector) { - if (containerSGKey == "") { + if (containerSGKey.empty()) { return; } auto it = std::remove_if(vector.begin(), vector.end(), [&](const ElementLink<CONTAINER>& el) { @@ -140,97 +143,138 @@ namespace TrigCompositeUtils { vector.erase(it, vector.end()); } + template<class CONTAINER> - const std::vector< LinkInfo<CONTAINER> > getFeaturesOfType( - const std::vector<ElementLinkVector<DecisionContainer>>& linkVector, + const std::vector< LinkInfo<CONTAINER> > recursiveGetFeaturesOfType( + const NavGraph& navGraph, const std::string containerSGKey, const bool lastFeatureOfType, const std::string& navElementLinkKey, const DecisionIDContainer chainIDs) { - std::vector< LinkInfo<CONTAINER> > features; - // For each unique path through the navigation for a given chain - for (const ElementLinkVector<DecisionContainer>& decisionPath : linkVector) { - // For each step along this path, starting at the terminus and working back towards L1 - for (const ElementLink<DecisionContainer>& decisionObjLink : decisionPath) { - const Decision* decisionObj = (*decisionObjLink); - ElementLinkVector<CONTAINER> featureLinks; - - // Look up what named links are available in the Decision Object - std::vector<std::string> availableLinkNames; - if (navElementLinkKey == "") { - const std::vector<std::string> getSingleLinkNames = decisionObj->getObjectNames<CONTAINER>(); - const std::vector<std::string> getCollectionLinkNames = decisionObj->getObjectCollectionNames<CONTAINER>(); - std::copy(getSingleLinkNames.begin(), getSingleLinkNames.end(), std::back_inserter(availableLinkNames)); - std::copy(getCollectionLinkNames.begin(), getCollectionLinkNames.end(), std::back_inserter(availableLinkNames)); - } else { // Just looking for an explicitly named feature - availableLinkNames.push_back( navElementLinkKey ); - } + std::vector< LinkInfo<CONTAINER> > features; // The return vector + std::set<const NavGraphNode*> fullyExploredFrom; // Lets us navigate more efficiently - // Fetch the named links that we're interested in - for (const std::string& featureNameToGet : availableLinkNames) { - // This try block protects against ExcCLIDMismatch throws from - // features which do not derive from IParticle, when an IParticle interface is requested. - try { - // Slices may have added link collections. These links may have been to objects in different containers. - if (decisionObj->hasObjectCollectionLinks(featureNameToGet, ClassID_traits< CONTAINER >::ID())) { - ElementLinkVector<CONTAINER> collectionLinks = decisionObj->objectCollectionLinks<CONTAINER>( featureNameToGet ); - filterLinkVectorByContainerKey<CONTAINER>(containerSGKey, collectionLinks); - std::copy(collectionLinks.begin(), collectionLinks.end(), std::back_inserter(featureLinks)); - } - } catch (SG::ExcCLIDMismatch&) { - // This is in place to catch the exception caused by non-IParticle features when an IParticle interface is requested. - // We're fine to catch this silently and cary on looking at the next Decision object in the graph - } - try { - // Slices may have added single links. Note: the framework-specified "feature" link is always a single link. - if (decisionObj->hasObjectLink(featureNameToGet, ClassID_traits< CONTAINER >::ID())) { - ElementLinkVector<CONTAINER> singleEntryVector; // Filtering function operates on a vector - singleEntryVector.push_back( decisionObj->objectLink<CONTAINER>( featureNameToGet ) ); - filterLinkVectorByContainerKey<CONTAINER>(containerSGKey, singleEntryVector); - std::copy(singleEntryVector.begin(), singleEntryVector.end(), std::back_inserter(featureLinks)); - } - } catch (SG::ExcCLIDMismatch&) { - // Silently. As above. - } - } + // For each starting point through the navigation for a given chain-group + for (const NavGraphNode* finalNode : navGraph.finalNodes()) { + recursiveGetFeaturesOfTypeInternal<CONTAINER>(features, + fullyExploredFrom, + finalNode, + containerSGKey, + lastFeatureOfType, + navElementLinkKey, + chainIDs); + } - // Check if the Decsision object is active for a specific set of Chains-of-interest (as supplied by the TDT) - ActiveState state = ActiveState::UNSET; - if (chainIDs.size() > 0) { - // If we were given a list of chains to consider then we start assuming none passed this decisionObj - state = ActiveState::INACTIVE; - for (DecisionID id : chainIDs) { - if (std::count(decisionObj->decisions().begin(), decisionObj->decisions().end(), id) == 1) { - state = ActiveState::ACTIVE; - break; - } - } - } + return features; + } - // Copy the fetched links into the return vector - for (const ElementLink<CONTAINER>& featureLink : featureLinks) { - typename std::vector<LinkInfo<CONTAINER>>::iterator vecIt = std::find_if(features.begin(), features.end(), [&](const auto& li) { return li.link == featureLink; } ); - if (vecIt == features.end()) { - // Link did not already exist - add it to the output - features.emplace_back( decisionObj, featureLink, state ); - } else { - // Link already existed - if the link's state in the return vector is INACTIVE but is ACTIVE here, - // then we need to change it to ACTIVE as this denotes one-or-more of the requested chains were active for the object. - if (vecIt->state == ActiveState::INACTIVE) { - vecIt->state = ActiveState::ACTIVE; - } - } + + template<class CONTAINER> + void recursiveGetFeaturesOfTypeInternal( + std::vector< LinkInfo<CONTAINER> >& features, + std::set<const NavGraphNode*>& fullyExploredFrom, + const NavGraphNode* navGraphNode, + const std::string containerSGKey, + const bool lastFeatureOfType, + const std::string& navElementLinkKey, + const DecisionIDContainer chainIDs) { + + if (fullyExploredFrom.count(navGraphNode) == 1) { + return; // Already explored down from here + } + + const Decision* decisionObj = navGraphNode->node(); + ElementLinkVector<CONTAINER> featureLinks; + + // Look up what named links are available in the Decision Object + std::vector<std::string> availableLinkNames; + if (navElementLinkKey == "") { + const std::vector<std::string> getSingleLinkNames = decisionObj->getObjectNames<CONTAINER>(); + const std::vector<std::string> getCollectionLinkNames = decisionObj->getObjectCollectionNames<CONTAINER>(); + std::copy(getSingleLinkNames.begin(), getSingleLinkNames.end(), std::back_inserter(availableLinkNames)); + std::copy(getCollectionLinkNames.begin(), getCollectionLinkNames.end(), std::back_inserter(availableLinkNames)); + } else { // Just looking for an explicitly named feature + availableLinkNames.push_back( navElementLinkKey ); + } + + // Fetch the named links that we're interested in + for (const std::string& featureNameToGet : availableLinkNames) { + // This try block protects against ExcCLIDMismatch throws from + // features which do not derive from IParticle, when an IParticle interface is requested. + try { + // Slices may have added link collections. These links may have been to objects in different containers. + if (decisionObj->hasObjectCollectionLinks(featureNameToGet, ClassID_traits< CONTAINER >::ID())) { + ElementLinkVector<CONTAINER> collectionLinks = decisionObj->objectCollectionLinks<CONTAINER>( featureNameToGet ); + filterLinkVectorByContainerKey<CONTAINER>(containerSGKey, collectionLinks); + std::copy(collectionLinks.begin(), collectionLinks.end(), std::back_inserter(featureLinks)); + } + } catch (SG::ExcCLIDMismatch&) { + // This is in place to catch the exception caused by non-IParticle features when an IParticle interface is requested. + // We're fine to catch this silently and cary on looking at the next Decision object in the graph + } + try { + // Slices may have added single links. Note: the framework-specified "feature" link is always a single link. + if (decisionObj->hasObjectLink(featureNameToGet, ClassID_traits< CONTAINER >::ID())) { + ElementLinkVector<CONTAINER> singleEntryVector; // Filtering function operates on a vector + singleEntryVector.push_back( decisionObj->objectLink<CONTAINER>( featureNameToGet ) ); + filterLinkVectorByContainerKey<CONTAINER>(containerSGKey, singleEntryVector); + std::copy(singleEntryVector.begin(), singleEntryVector.end(), std::back_inserter(featureLinks)); } + } catch (SG::ExcCLIDMismatch&) { + // Silently. As above. + } + } - // Stop processing this path through the navigation if the lastFeatureOfType flag is set - if (featureLinks.size() && lastFeatureOfType) { + // Check if the Decsision object is active for a specific set of Chains-of-interest (as supplied by the TDT) + ActiveState state = ActiveState::UNSET; + if (chainIDs.size() > 0) { + // If we were given a list of chains to consider then we start assuming none passed this decisionObj + state = ActiveState::INACTIVE; + for (DecisionID id : chainIDs) { + if (std::count(decisionObj->decisions().begin(), decisionObj->decisions().end(), id) == 1) { + state = ActiveState::ACTIVE; break; } + } + } - } // for (decisionLink : decisionPath) - } // for (decisionPath : linkVector) - return features; + // Copy the fetched links into the return vector + for (const ElementLink<CONTAINER>& featureLink : featureLinks) { + typename std::vector<LinkInfo<CONTAINER>>::iterator vecIt = std::find_if(features.begin(), features.end(), [&](const auto& li) { return li.link == featureLink; } ); + if (vecIt == features.end()) { + // Link did not already exist - add it to the output + features.emplace_back( decisionObj, featureLink, state ); + } else { + // Link already existed - if the link's state in the return vector is INACTIVE but is ACTIVE here, + // then we need to change it to ACTIVE as this denotes one-or-more of the requested chains were active for the object. + if (vecIt->state == ActiveState::INACTIVE) { + vecIt->state = ActiveState::ACTIVE; + } + } + } + + // Stop processing this path through the navigation if the lastFeatureOfType flag is set + if (featureLinks.size() && lastFeatureOfType) { + return; + } + + // Recurse to decisionObj's seeds + for (const NavGraphNode* seedNavNode : navGraphNode->seeds()) { + recursiveGetFeaturesOfTypeInternal<CONTAINER>(features, + fullyExploredFrom, + seedNavNode, + containerSGKey, + lastFeatureOfType, + navElementLinkKey, + chainIDs); + } + + // If we encounter this node again in the future, we don't need to explore it again as it's now fully explored. + fullyExploredFrom.insert( navGraphNode ); + + return; } + } diff --git a/Trigger/TrigSteer/TrigCompositeUtils/share/TrigTraversal_test.ref b/Trigger/TrigSteer/TrigCompositeUtils/share/TrigTraversal_test.ref index 63640a78da22ac8c89ca98c306a93cb6f6550a2d..b3b56bddf23b14d62ff6b1c71fbbd0e96ba6c10a 100644 --- a/Trigger/TrigSteer/TrigCompositeUtils/share/TrigTraversal_test.ref +++ b/Trigger/TrigSteer/TrigCompositeUtils/share/TrigTraversal_test.ref @@ -1,131 +1,304 @@ ApplicationMgr SUCCESS ==================================================================================================================================== - Welcome to ApplicationMgr (GaudiCoreSvc v32r0) - running on lxplus713.cern.ch on Thu Aug 8 12:51:31 2019 + Welcome to ApplicationMgr (GaudiCoreSvc v33r1) + running on pc-tbed-pub-21.cern.ch on Mon Aug 3 16:45:27 2020 ==================================================================================================================================== ApplicationMgr INFO Application Manager Configured successfully 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 -ClassIDSvc INFO getRegistryEntries: read 8743 CLIDRegistry entries for module ALL -Context: s: 0 e: 0 -Current context: s: 0 e: 0 +ClassIDSvc INFO getRegistryEntries: read 5171 CLIDRegistry entries for module ALL ClassIDSvc INFO getRegistryEntries: read 372 CLIDRegistry entries for module ALL -1 paths for HLT_mufast_chain - Path 0[HLTPassRaw -> MU_H_1__MU1 F(pt:20) -> MU_IM_1__MU1 -> MU_F_1__MU1 -> MU1] -2 paths for HLT_mu_chain - Path 0[HLTPassRaw -> MU_H_1__MU1 F(pt:20) -> MU_IM_1__MU1 -> MU_F_1__MU1 -> MU1] - Path 1[HLTPassRaw -> MU_H_2__MU1 F(pt:21) -> MU_IM_2__MU1 -> MU_F_2__MU1 -> MU_H_1__MU1 F(pt:20) -> MU_IM_1__MU1 -> MU_F_1__MU1 -> MU1] -2 paths for HLT_mu_em_chain - Path 0[HLTPassRaw -> MUEM_CH_2__MU1 -> MUEM_H_2__MU1 F(pt:21) -> MUEM_IM_2__MU1 -> MUEM_F_2__MU1 -> MUEM_CH_1__MU1 -> MUEM_H_1__MU1 F(pt:20) -> MUEM_IM_1__MU1 -> MUEM_F_1__MU1 -> MU1] - Path 1[HLTPassRaw -> MUEM_CH_2__EM0 -> MUEM_H_2__EM0 F(pt:31) -> MUEM_IM_2__EM0 -> MUEM_F_2__EM0 -> MUEM_CH_1__EM0 -> MUEM_H_1__EM0 F(pt:30) -> MUEM_IM_1__EM0 -> MUEM_F_1__EM0 -> EM0] -1 paths for HLT_em_chain - Path 0[HLTPassRaw -> EM_H_2__EM0 F(pt:31) -> EM_IM_2__EM0 -> EM_F_2__EM0 -> EM_H_1__EM0 F(pt:30) -> EM_IM_1__EM0 -> EM_F_1__EM0 -> EM0] -5 paths for All - Path 0[HLTPassRaw -> MU_H_1__MU1 F(pt:20) -> MU_IM_1__MU1 -> MU_F_1__MU1 -> MU1] - Path 1[HLTPassRaw -> MU_H_2__MU1 F(pt:21) -> MU_IM_2__MU1 -> MU_F_2__MU1 -> MU_H_1__MU1 F(pt:20) -> MU_IM_1__MU1 -> MU_F_1__MU1 -> MU1] - Path 2[HLTPassRaw -> MUEM_CH_2__MU1 -> MUEM_H_2__MU1 F(pt:21) -> MUEM_IM_2__MU1 -> MUEM_F_2__MU1 -> MUEM_CH_1__MU1 -> MUEM_H_1__MU1 F(pt:20) -> MUEM_IM_1__MU1 -> MUEM_F_1__MU1 -> MU1] - Path 3[HLTPassRaw -> EM_H_2__EM0 F(pt:31) -> EM_IM_2__EM0 -> EM_F_2__EM0 -> EM_H_1__EM0 F(pt:30) -> EM_IM_1__EM0 -> EM_F_1__EM0 -> EM0] - Path 4[HLTPassRaw -> MUEM_CH_2__EM0 -> MUEM_H_2__EM0 F(pt:31) -> MUEM_IM_2__EM0 -> MUEM_F_2__EM0 -> MUEM_CH_1__EM0 -> MUEM_H_1__EM0 F(pt:30) -> MUEM_IM_1__EM0 -> MUEM_F_1__EM0 -> EM0] -[All passing features] HLT_mufast_chain features size:1 +TrigTraversal INFO HLT_mufast_chain +TrigTraversal INFO |-> HLTNav_MyDecisionContainer #3 (HLTPassRaw) +TrigTraversal INFO |-> HLTNav_MyDecisionContainer #13 (MU_H_1__MU1) +TrigTraversal INFO |-> HLTNav_MyDecisionContainer #12 (MU_IM_1__MU1) +TrigTraversal INFO |-> HLTNav_MyDecisionContainer #11 (MU_F_1__MU1) +TrigTraversal INFO |-> HLTNav_MyDecisionContainer #1 (MU1) +TrigTraversal INFO HLT_mu_chain +TrigTraversal INFO |-> HLTNav_MyDecisionContainer #3 (HLTPassRaw) +TrigTraversal INFO |-> HLTNav_MyDecisionContainer #13 (MU_H_1__MU1) +TrigTraversal INFO |-> HLTNav_MyDecisionContainer #12 (MU_IM_1__MU1) +TrigTraversal INFO |-> HLTNav_MyDecisionContainer #11 (MU_F_1__MU1) +TrigTraversal INFO |-> HLTNav_MyDecisionContainer #1 (MU1) +TrigTraversal INFO |-> HLTNav_MyDecisionContainer #16 (MU_H_2__MU1) +TrigTraversal INFO |-> HLTNav_MyDecisionContainer #15 (MU_IM_2__MU1) +TrigTraversal INFO |-> HLTNav_MyDecisionContainer #14 (MU_F_2__MU1) +TrigTraversal INFO |-> HLTNav_MyDecisionContainer #13 (MU_H_1__MU1) +TrigTraversal INFO |-> HLTNav_MyDecisionContainer #12 (MU_IM_1__MU1) +TrigTraversal INFO |-> HLTNav_MyDecisionContainer #11 (MU_F_1__MU1) +TrigTraversal INFO |-> HLTNav_MyDecisionContainer #1 (MU1) +TrigTraversal INFO HLT_mu_em_chain +TrigTraversal INFO |-> HLTNav_MyDecisionContainer #3 (HLTPassRaw) +TrigTraversal INFO |-> HLTNav_MyDecisionContainer #24 (MUEM_CH_2__MU1) +TrigTraversal INFO |-> HLTNav_MyDecisionContainer #23 (MUEM_H_2__MU1) +TrigTraversal INFO |-> HLTNav_MyDecisionContainer #22 (MUEM_IM_2__MU1) +TrigTraversal INFO |-> HLTNav_MyDecisionContainer #21 (MUEM_F_2__MU1) +TrigTraversal INFO |-> HLTNav_MyDecisionContainer #20 (MUEM_CH_1__MU1) +TrigTraversal INFO |-> HLTNav_MyDecisionContainer #19 (MUEM_H_1__MU1) +TrigTraversal INFO |-> HLTNav_MyDecisionContainer #18 (MUEM_IM_1__MU1) +TrigTraversal INFO |-> HLTNav_MyDecisionContainer #17 (MUEM_F_1__MU1) +TrigTraversal INFO |-> HLTNav_MyDecisionContainer #1 (MU1) +TrigTraversal INFO |-> HLTNav_MyDecisionContainer #38 (MUEM_CH_2__EM0) +TrigTraversal INFO |-> HLTNav_MyDecisionContainer #37 (MUEM_H_2__EM0) +TrigTraversal INFO |-> HLTNav_MyDecisionContainer #36 (MUEM_IM_2__EM0) +TrigTraversal INFO |-> HLTNav_MyDecisionContainer #35 (MUEM_F_2__EM0) +TrigTraversal INFO |-> HLTNav_MyDecisionContainer #34 (MUEM_CH_1__EM0) +TrigTraversal INFO |-> HLTNav_MyDecisionContainer #33 (MUEM_H_1__EM0) +TrigTraversal INFO |-> HLTNav_MyDecisionContainer #32 (MUEM_IM_1__EM0) +TrigTraversal INFO |-> HLTNav_MyDecisionContainer #31 (MUEM_F_1__EM0) +TrigTraversal INFO |-> HLTNav_MyDecisionContainer #2 (EM0) +TrigTraversal INFO HLT_em_chain +TrigTraversal INFO |-> HLTNav_MyDecisionContainer #3 (HLTPassRaw) +TrigTraversal INFO |-> HLTNav_MyDecisionContainer #30 (EM_H_2__EM0) +TrigTraversal INFO |-> HLTNav_MyDecisionContainer #29 (EM_IM_2__EM0) +TrigTraversal INFO |-> HLTNav_MyDecisionContainer #28 (EM_F_2__EM0) +TrigTraversal INFO |-> HLTNav_MyDecisionContainer #27 (EM_H_1__EM0) +TrigTraversal INFO |-> HLTNav_MyDecisionContainer #26 (EM_IM_1__EM0) +TrigTraversal INFO |-> HLTNav_MyDecisionContainer #25 (EM_F_1__EM0) +TrigTraversal INFO |-> HLTNav_MyDecisionContainer #2 (EM0) +TrigTraversal INFO All +TrigTraversal INFO |-> HLTNav_MyDecisionContainer #3 (HLTPassRaw) +TrigTraversal INFO |-> HLTNav_MyDecisionContainer #13 (MU_H_1__MU1) +TrigTraversal INFO |-> HLTNav_MyDecisionContainer #12 (MU_IM_1__MU1) +TrigTraversal INFO |-> HLTNav_MyDecisionContainer #11 (MU_F_1__MU1) +TrigTraversal INFO |-> HLTNav_MyDecisionContainer #1 (MU1) +TrigTraversal INFO |-> HLTNav_MyDecisionContainer #16 (MU_H_2__MU1) +TrigTraversal INFO |-> HLTNav_MyDecisionContainer #15 (MU_IM_2__MU1) +TrigTraversal INFO |-> HLTNav_MyDecisionContainer #14 (MU_F_2__MU1) +TrigTraversal INFO |-> HLTNav_MyDecisionContainer #13 (MU_H_1__MU1) +TrigTraversal INFO |-> HLTNav_MyDecisionContainer #12 (MU_IM_1__MU1) +TrigTraversal INFO |-> HLTNav_MyDecisionContainer #11 (MU_F_1__MU1) +TrigTraversal INFO |-> HLTNav_MyDecisionContainer #1 (MU1) +TrigTraversal INFO |-> HLTNav_MyDecisionContainer #24 (MUEM_CH_2__MU1) +TrigTraversal INFO |-> HLTNav_MyDecisionContainer #23 (MUEM_H_2__MU1) +TrigTraversal INFO |-> HLTNav_MyDecisionContainer #22 (MUEM_IM_2__MU1) +TrigTraversal INFO |-> HLTNav_MyDecisionContainer #21 (MUEM_F_2__MU1) +TrigTraversal INFO |-> HLTNav_MyDecisionContainer #20 (MUEM_CH_1__MU1) +TrigTraversal INFO |-> HLTNav_MyDecisionContainer #19 (MUEM_H_1__MU1) +TrigTraversal INFO |-> HLTNav_MyDecisionContainer #18 (MUEM_IM_1__MU1) +TrigTraversal INFO |-> HLTNav_MyDecisionContainer #17 (MUEM_F_1__MU1) +TrigTraversal INFO |-> HLTNav_MyDecisionContainer #1 (MU1) +TrigTraversal INFO |-> HLTNav_MyDecisionContainer #30 (EM_H_2__EM0) +TrigTraversal INFO |-> HLTNav_MyDecisionContainer #29 (EM_IM_2__EM0) +TrigTraversal INFO |-> HLTNav_MyDecisionContainer #28 (EM_F_2__EM0) +TrigTraversal INFO |-> HLTNav_MyDecisionContainer #27 (EM_H_1__EM0) +TrigTraversal INFO |-> HLTNav_MyDecisionContainer #26 (EM_IM_1__EM0) +TrigTraversal INFO |-> HLTNav_MyDecisionContainer #25 (EM_F_1__EM0) +TrigTraversal INFO |-> HLTNav_MyDecisionContainer #2 (EM0) +TrigTraversal INFO |-> HLTNav_MyDecisionContainer #38 (MUEM_CH_2__EM0) +TrigTraversal INFO |-> HLTNav_MyDecisionContainer #37 (MUEM_H_2__EM0) +TrigTraversal INFO |-> HLTNav_MyDecisionContainer #36 (MUEM_IM_2__EM0) +TrigTraversal INFO |-> HLTNav_MyDecisionContainer #35 (MUEM_F_2__EM0) +TrigTraversal INFO |-> HLTNav_MyDecisionContainer #34 (MUEM_CH_1__EM0) +TrigTraversal INFO |-> HLTNav_MyDecisionContainer #33 (MUEM_H_1__EM0) +TrigTraversal INFO |-> HLTNav_MyDecisionContainer #32 (MUEM_IM_1__EM0) +TrigTraversal INFO |-> HLTNav_MyDecisionContainer #31 (MUEM_F_1__EM0) +TrigTraversal INFO |-> HLTNav_MyDecisionContainer #2 (EM0) +TrigTraversal INFO [All passing features] HLT_mufast_chain features size:1 Feature 0 pt:20, state:ACTIVE -[All passing features] HLT_mu_chain features size:2 + +TrigTraversal INFO [All passing features] HLT_mu_chain features size:2 Feature 0 pt:20, state:ACTIVE Feature 1 pt:21, state:ACTIVE -[All passing features] HLT_mu_em_chain features size:4 + +TrigTraversal INFO [All passing features] HLT_mu_em_chain features size:4 Feature 0 pt:21, state:ACTIVE Feature 1 pt:20, state:ACTIVE Feature 2 pt:31, state:ACTIVE Feature 3 pt:30, state:ACTIVE -[All passing features] HLT_em_chain features size:2 + +TrigTraversal INFO [All passing features] HLT_em_chain features size:2 Feature 0 pt:31, state:ACTIVE Feature 1 pt:30, state:ACTIVE -[All passing features] All chains features size:4 + +TrigTraversal INFO [All passing features] All chains features size:4 Feature 0 pt:20, state:ACTIVE Feature 1 pt:21, state:ACTIVE Feature 2 pt:31, state:ACTIVE Feature 3 pt:30, state:ACTIVE -[Final passing feature] HLT_mufast_chain features size:1 + +TrigTraversal INFO [Final passing feature] HLT_mufast_chain features size:1 Feature 0 pt:20, state:ACTIVE -[Final passing feature] HLT_mu_chain features size:2 + +TrigTraversal INFO [Final passing feature] HLT_mu_chain features size:2 Feature 0 pt:20, state:ACTIVE Feature 1 pt:21, state:ACTIVE -[Final passing feature] HLT_mu_em_chain features size:2 + +TrigTraversal INFO [Final passing feature] HLT_mu_em_chain features size:2 Feature 0 pt:21, state:ACTIVE Feature 1 pt:31, state:ACTIVE -[Final passing feature] HLT_em_chain features size:1 + +TrigTraversal INFO [Final passing feature] HLT_em_chain features size:1 Feature 0 pt:31, state:ACTIVE -[Final passing feature] All chains features size:3 + +TrigTraversal INFO [Final passing feature] All chains features size:3 Feature 0 pt:20, state:ACTIVE Feature 1 pt:21, state:ACTIVE Feature 2 pt:31, state:ACTIVE + ---------- Now Include Failing Features -2 paths for HLT_mufast_chain - Path 0[HLTPassRaw -> MU_H_1__MU1 F(pt:20) -> MU_IM_1__MU1 -> MU_F_1__MU1 -> MU1] - Path 1[MU_H_1__MU0 F(pt:5) -> MU_IM_1__MU0 -> MU_F_1__MU0 -> MU0] -3 paths for HLT_mu_chain - Path 0[HLTPassRaw -> MU_H_1__MU1 F(pt:20) -> MU_IM_1__MU1 -> MU_F_1__MU1 -> MU1] - Path 1[HLTPassRaw -> MU_H_2__MU1 F(pt:21) -> MU_IM_2__MU1 -> MU_F_2__MU1 -> MU_H_1__MU1 F(pt:20) -> MU_IM_1__MU1 -> MU_F_1__MU1 -> MU1] - Path 2[MU_H_1__MU0 F(pt:5) -> MU_IM_1__MU0 -> MU_F_1__MU0 -> MU0] -3 paths for HLT_mu_em_chain - Path 0[HLTPassRaw -> MUEM_CH_2__MU1 -> MUEM_H_2__MU1 F(pt:21) -> MUEM_IM_2__MU1 -> MUEM_F_2__MU1 -> MUEM_CH_1__MU1 -> MUEM_H_1__MU1 F(pt:20) -> MUEM_IM_1__MU1 -> MUEM_F_1__MU1 -> MU1] - Path 1[HLTPassRaw -> MUEM_CH_2__EM0 -> MUEM_H_2__EM0 F(pt:31) -> MUEM_IM_2__EM0 -> MUEM_F_2__EM0 -> MUEM_CH_1__EM0 -> MUEM_H_1__EM0 F(pt:30) -> MUEM_IM_1__EM0 -> MUEM_F_1__EM0 -> EM0] - Path 2[MUEM_H_1__MU0 F(pt:5) -> MUEM_IM_1__MU0 -> MUEM_F_1__MU0 -> MU0] -1 paths for HLT_em_chain - Path 0[HLTPassRaw -> EM_H_2__EM0 F(pt:31) -> EM_IM_2__EM0 -> EM_F_2__EM0 -> EM_H_1__EM0 F(pt:30) -> EM_IM_1__EM0 -> EM_F_1__EM0 -> EM0] -7 paths for All - Path 0[HLTPassRaw -> MU_H_1__MU1 F(pt:20) -> MU_IM_1__MU1 -> MU_F_1__MU1 -> MU1] - Path 1[HLTPassRaw -> MU_H_2__MU1 F(pt:21) -> MU_IM_2__MU1 -> MU_F_2__MU1 -> MU_H_1__MU1 F(pt:20) -> MU_IM_1__MU1 -> MU_F_1__MU1 -> MU1] - Path 2[HLTPassRaw -> MUEM_CH_2__MU1 -> MUEM_H_2__MU1 F(pt:21) -> MUEM_IM_2__MU1 -> MUEM_F_2__MU1 -> MUEM_CH_1__MU1 -> MUEM_H_1__MU1 F(pt:20) -> MUEM_IM_1__MU1 -> MUEM_F_1__MU1 -> MU1] - Path 3[HLTPassRaw -> EM_H_2__EM0 F(pt:31) -> EM_IM_2__EM0 -> EM_F_2__EM0 -> EM_H_1__EM0 F(pt:30) -> EM_IM_1__EM0 -> EM_F_1__EM0 -> EM0] - Path 4[HLTPassRaw -> MUEM_CH_2__EM0 -> MUEM_H_2__EM0 F(pt:31) -> MUEM_IM_2__EM0 -> MUEM_F_2__EM0 -> MUEM_CH_1__EM0 -> MUEM_H_1__EM0 F(pt:30) -> MUEM_IM_1__EM0 -> MUEM_F_1__EM0 -> EM0] - Path 5[MU_H_1__MU0 F(pt:5) -> MU_IM_1__MU0 -> MU_F_1__MU0 -> MU0] - Path 6[MUEM_H_1__MU0 F(pt:5) -> MUEM_IM_1__MU0 -> MUEM_F_1__MU0 -> MU0] -[All passing/failing features] HLT_mufast_chain features size:2 +TrigTraversal INFO HLT_mufast_chain +TrigTraversal INFO |-> HLTNav_MyDecisionContainer #3 (HLTPassRaw) +TrigTraversal INFO |-> HLTNav_MyDecisionContainer #13 (MU_H_1__MU1) +TrigTraversal INFO |-> HLTNav_MyDecisionContainer #12 (MU_IM_1__MU1) +TrigTraversal INFO |-> HLTNav_MyDecisionContainer #11 (MU_F_1__MU1) +TrigTraversal INFO |-> HLTNav_MyDecisionContainer #1 (MU1) +TrigTraversal INFO |-> HLTNav_MyDecisionContainer #6 (MU_H_1__MU0) +TrigTraversal INFO |-> HLTNav_MyDecisionContainer #5 (MU_IM_1__MU0) +TrigTraversal INFO |-> HLTNav_MyDecisionContainer #4 (MU_F_1__MU0) +TrigTraversal INFO |-> HLTNav_MyDecisionContainer #0 (MU0) +TrigTraversal INFO HLT_mu_chain +TrigTraversal INFO |-> HLTNav_MyDecisionContainer #3 (HLTPassRaw) +TrigTraversal INFO |-> HLTNav_MyDecisionContainer #13 (MU_H_1__MU1) +TrigTraversal INFO |-> HLTNav_MyDecisionContainer #12 (MU_IM_1__MU1) +TrigTraversal INFO |-> HLTNav_MyDecisionContainer #11 (MU_F_1__MU1) +TrigTraversal INFO |-> HLTNav_MyDecisionContainer #1 (MU1) +TrigTraversal INFO |-> HLTNav_MyDecisionContainer #16 (MU_H_2__MU1) +TrigTraversal INFO |-> HLTNav_MyDecisionContainer #15 (MU_IM_2__MU1) +TrigTraversal INFO |-> HLTNav_MyDecisionContainer #14 (MU_F_2__MU1) +TrigTraversal INFO |-> HLTNav_MyDecisionContainer #13 (MU_H_1__MU1) +TrigTraversal INFO |-> HLTNav_MyDecisionContainer #12 (MU_IM_1__MU1) +TrigTraversal INFO |-> HLTNav_MyDecisionContainer #11 (MU_F_1__MU1) +TrigTraversal INFO |-> HLTNav_MyDecisionContainer #1 (MU1) +TrigTraversal INFO |-> HLTNav_MyDecisionContainer #6 (MU_H_1__MU0) +TrigTraversal INFO |-> HLTNav_MyDecisionContainer #5 (MU_IM_1__MU0) +TrigTraversal INFO |-> HLTNav_MyDecisionContainer #4 (MU_F_1__MU0) +TrigTraversal INFO |-> HLTNav_MyDecisionContainer #0 (MU0) +TrigTraversal INFO HLT_mu_em_chain +TrigTraversal INFO |-> HLTNav_MyDecisionContainer #3 (HLTPassRaw) +TrigTraversal INFO |-> HLTNav_MyDecisionContainer #24 (MUEM_CH_2__MU1) +TrigTraversal INFO |-> HLTNav_MyDecisionContainer #23 (MUEM_H_2__MU1) +TrigTraversal INFO |-> HLTNav_MyDecisionContainer #22 (MUEM_IM_2__MU1) +TrigTraversal INFO |-> HLTNav_MyDecisionContainer #21 (MUEM_F_2__MU1) +TrigTraversal INFO |-> HLTNav_MyDecisionContainer #20 (MUEM_CH_1__MU1) +TrigTraversal INFO |-> HLTNav_MyDecisionContainer #19 (MUEM_H_1__MU1) +TrigTraversal INFO |-> HLTNav_MyDecisionContainer #18 (MUEM_IM_1__MU1) +TrigTraversal INFO |-> HLTNav_MyDecisionContainer #17 (MUEM_F_1__MU1) +TrigTraversal INFO |-> HLTNav_MyDecisionContainer #1 (MU1) +TrigTraversal INFO |-> HLTNav_MyDecisionContainer #38 (MUEM_CH_2__EM0) +TrigTraversal INFO |-> HLTNav_MyDecisionContainer #37 (MUEM_H_2__EM0) +TrigTraversal INFO |-> HLTNav_MyDecisionContainer #36 (MUEM_IM_2__EM0) +TrigTraversal INFO |-> HLTNav_MyDecisionContainer #35 (MUEM_F_2__EM0) +TrigTraversal INFO |-> HLTNav_MyDecisionContainer #34 (MUEM_CH_1__EM0) +TrigTraversal INFO |-> HLTNav_MyDecisionContainer #33 (MUEM_H_1__EM0) +TrigTraversal INFO |-> HLTNav_MyDecisionContainer #32 (MUEM_IM_1__EM0) +TrigTraversal INFO |-> HLTNav_MyDecisionContainer #31 (MUEM_F_1__EM0) +TrigTraversal INFO |-> HLTNav_MyDecisionContainer #2 (EM0) +TrigTraversal INFO |-> HLTNav_MyDecisionContainer #9 (MUEM_H_1__MU0) +TrigTraversal INFO |-> HLTNav_MyDecisionContainer #8 (MUEM_IM_1__MU0) +TrigTraversal INFO |-> HLTNav_MyDecisionContainer #7 (MUEM_F_1__MU0) +TrigTraversal INFO |-> HLTNav_MyDecisionContainer #0 (MU0) +TrigTraversal INFO HLT_em_chain +TrigTraversal INFO |-> HLTNav_MyDecisionContainer #3 (HLTPassRaw) +TrigTraversal INFO |-> HLTNav_MyDecisionContainer #30 (EM_H_2__EM0) +TrigTraversal INFO |-> HLTNav_MyDecisionContainer #29 (EM_IM_2__EM0) +TrigTraversal INFO |-> HLTNav_MyDecisionContainer #28 (EM_F_2__EM0) +TrigTraversal INFO |-> HLTNav_MyDecisionContainer #27 (EM_H_1__EM0) +TrigTraversal INFO |-> HLTNav_MyDecisionContainer #26 (EM_IM_1__EM0) +TrigTraversal INFO |-> HLTNav_MyDecisionContainer #25 (EM_F_1__EM0) +TrigTraversal INFO |-> HLTNav_MyDecisionContainer #2 (EM0) +TrigTraversal INFO All +TrigTraversal INFO |-> HLTNav_MyDecisionContainer #3 (HLTPassRaw) +TrigTraversal INFO |-> HLTNav_MyDecisionContainer #13 (MU_H_1__MU1) +TrigTraversal INFO |-> HLTNav_MyDecisionContainer #12 (MU_IM_1__MU1) +TrigTraversal INFO |-> HLTNav_MyDecisionContainer #11 (MU_F_1__MU1) +TrigTraversal INFO |-> HLTNav_MyDecisionContainer #1 (MU1) +TrigTraversal INFO |-> HLTNav_MyDecisionContainer #16 (MU_H_2__MU1) +TrigTraversal INFO |-> HLTNav_MyDecisionContainer #15 (MU_IM_2__MU1) +TrigTraversal INFO |-> HLTNav_MyDecisionContainer #14 (MU_F_2__MU1) +TrigTraversal INFO |-> HLTNav_MyDecisionContainer #13 (MU_H_1__MU1) +TrigTraversal INFO |-> HLTNav_MyDecisionContainer #12 (MU_IM_1__MU1) +TrigTraversal INFO |-> HLTNav_MyDecisionContainer #11 (MU_F_1__MU1) +TrigTraversal INFO |-> HLTNav_MyDecisionContainer #1 (MU1) +TrigTraversal INFO |-> HLTNav_MyDecisionContainer #24 (MUEM_CH_2__MU1) +TrigTraversal INFO |-> HLTNav_MyDecisionContainer #23 (MUEM_H_2__MU1) +TrigTraversal INFO |-> HLTNav_MyDecisionContainer #22 (MUEM_IM_2__MU1) +TrigTraversal INFO |-> HLTNav_MyDecisionContainer #21 (MUEM_F_2__MU1) +TrigTraversal INFO |-> HLTNav_MyDecisionContainer #20 (MUEM_CH_1__MU1) +TrigTraversal INFO |-> HLTNav_MyDecisionContainer #19 (MUEM_H_1__MU1) +TrigTraversal INFO |-> HLTNav_MyDecisionContainer #18 (MUEM_IM_1__MU1) +TrigTraversal INFO |-> HLTNav_MyDecisionContainer #17 (MUEM_F_1__MU1) +TrigTraversal INFO |-> HLTNav_MyDecisionContainer #1 (MU1) +TrigTraversal INFO |-> HLTNav_MyDecisionContainer #30 (EM_H_2__EM0) +TrigTraversal INFO |-> HLTNav_MyDecisionContainer #29 (EM_IM_2__EM0) +TrigTraversal INFO |-> HLTNav_MyDecisionContainer #28 (EM_F_2__EM0) +TrigTraversal INFO |-> HLTNav_MyDecisionContainer #27 (EM_H_1__EM0) +TrigTraversal INFO |-> HLTNav_MyDecisionContainer #26 (EM_IM_1__EM0) +TrigTraversal INFO |-> HLTNav_MyDecisionContainer #25 (EM_F_1__EM0) +TrigTraversal INFO |-> HLTNav_MyDecisionContainer #2 (EM0) +TrigTraversal INFO |-> HLTNav_MyDecisionContainer #38 (MUEM_CH_2__EM0) +TrigTraversal INFO |-> HLTNav_MyDecisionContainer #37 (MUEM_H_2__EM0) +TrigTraversal INFO |-> HLTNav_MyDecisionContainer #36 (MUEM_IM_2__EM0) +TrigTraversal INFO |-> HLTNav_MyDecisionContainer #35 (MUEM_F_2__EM0) +TrigTraversal INFO |-> HLTNav_MyDecisionContainer #34 (MUEM_CH_1__EM0) +TrigTraversal INFO |-> HLTNav_MyDecisionContainer #33 (MUEM_H_1__EM0) +TrigTraversal INFO |-> HLTNav_MyDecisionContainer #32 (MUEM_IM_1__EM0) +TrigTraversal INFO |-> HLTNav_MyDecisionContainer #31 (MUEM_F_1__EM0) +TrigTraversal INFO |-> HLTNav_MyDecisionContainer #2 (EM0) +TrigTraversal INFO |-> HLTNav_MyDecisionContainer #6 (MU_H_1__MU0) +TrigTraversal INFO |-> HLTNav_MyDecisionContainer #5 (MU_IM_1__MU0) +TrigTraversal INFO |-> HLTNav_MyDecisionContainer #4 (MU_F_1__MU0) +TrigTraversal INFO |-> HLTNav_MyDecisionContainer #0 (MU0) +TrigTraversal INFO |-> HLTNav_MyDecisionContainer #9 (MUEM_H_1__MU0) +TrigTraversal INFO |-> HLTNav_MyDecisionContainer #8 (MUEM_IM_1__MU0) +TrigTraversal INFO |-> HLTNav_MyDecisionContainer #7 (MUEM_F_1__MU0) +TrigTraversal INFO |-> HLTNav_MyDecisionContainer #0 (MU0) +TrigTraversal INFO [All passing/failing features] HLT_mufast_chain features size:2 Feature 0 pt:20, state:ACTIVE Feature 1 pt:5, state:INACTIVE -[All passing/failing features] HLT_mu_chain features size:3 + +TrigTraversal INFO [All passing/failing features] HLT_mu_chain features size:3 Feature 0 pt:20, state:ACTIVE Feature 1 pt:21, state:ACTIVE Feature 2 pt:5, state:INACTIVE -[All passing/failing features] HLT_mu_em_chain features size:5 + +TrigTraversal INFO [All passing/failing features] HLT_mu_em_chain features size:5 Feature 0 pt:21, state:ACTIVE Feature 1 pt:20, state:ACTIVE Feature 2 pt:31, state:ACTIVE Feature 3 pt:30, state:ACTIVE Feature 4 pt:5, state:INACTIVE -[All passing/failing features] HLT_em_chain features size:2 + +TrigTraversal INFO [All passing/failing features] HLT_em_chain features size:2 Feature 0 pt:31, state:ACTIVE Feature 1 pt:30, state:ACTIVE -[All passing/failing features] All chains features size:5 + +TrigTraversal INFO [All passing/failing features] All chains features size:5 Feature 0 pt:20, state:ACTIVE Feature 1 pt:21, state:ACTIVE Feature 2 pt:31, state:ACTIVE Feature 3 pt:30, state:ACTIVE Feature 4 pt:5, state:ACTIVE -[Final passing/failing feature] HLT_mufast_chain features size:2 + +TrigTraversal INFO [Final passing/failing feature] HLT_mufast_chain features size:2 Feature 0 pt:20, state:ACTIVE Feature 1 pt:5, state:INACTIVE -[Final passing/failing feature] HLT_mu_chain features size:3 + +TrigTraversal INFO [Final passing/failing feature] HLT_mu_chain features size:3 Feature 0 pt:20, state:ACTIVE Feature 1 pt:21, state:ACTIVE Feature 2 pt:5, state:INACTIVE -[Final passing/failing feature] HLT_mu_em_chain features size:3 + +TrigTraversal INFO [Final passing/failing feature] HLT_mu_em_chain features size:3 Feature 0 pt:21, state:ACTIVE Feature 1 pt:31, state:ACTIVE Feature 2 pt:5, state:INACTIVE -[Final passing/failing feature] HLT_em_chain features size:1 + +TrigTraversal INFO [Final passing/failing feature] HLT_em_chain features size:1 Feature 0 pt:31, state:ACTIVE -[Final passing/failing feature] All chains features size:4 + +TrigTraversal INFO [Final passing/failing feature] All chains features size:4 Feature 0 pt:20, state:ACTIVE Feature 1 pt:21, state:ACTIVE Feature 2 pt:31, state:ACTIVE Feature 3 pt:5, state:ACTIVE + ---------- Check Explicit Type -[Explicit Final Muon Features] HLT_mu_em_chain features size:2 +TrigTraversal INFO [Explicit Final Muon Features] HLT_mu_em_chain features size:2 Feature 0 pt:21, state:UNSET Feature 1 pt:5, state:UNSET -[Explicit Final Electron Features] HLT_mu_em_chain features size:1 + +TrigTraversal INFO [Explicit Final Electron Features] HLT_mu_em_chain features size:1 Feature 0 pt:31, state:UNSET diff --git a/Trigger/TrigSteer/TrigCompositeUtils/src/NavGraph.cxx b/Trigger/TrigSteer/TrigCompositeUtils/src/NavGraph.cxx new file mode 100644 index 0000000000000000000000000000000000000000..cd7e5476855cef6b2ac5736fddc2b2ffd60bdaa7 --- /dev/null +++ b/Trigger/TrigSteer/TrigCompositeUtils/src/NavGraph.cxx @@ -0,0 +1,89 @@ +/* + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration +*/ + +#include "TrigCompositeUtils/TrigCompositeUtils.h" +#include "TrigCompositeUtils/NavGraph.h" + +namespace TrigCompositeUtils { + + NavGraphNode::NavGraphNode(const Decision* me) : m_decisionObject(me){ + } + + + bool NavGraphNode::linksTo(const NavGraphNode* to) { + return (m_filteredSeeds.insert(to)).second; // Return TRUE if a new edge is added + } + + + const Decision* NavGraphNode::node() const { + return m_decisionObject; + } + + + const std::set<const NavGraphNode*>& NavGraphNode::seeds() const { + return m_filteredSeeds; + } + + + // ################################################# + + + NavGraph::NavGraph() : m_nodes(), m_finalNodes(), m_edges(0) { + } + + + void NavGraph::addNode(const Decision* node, const Decision* comingFrom) { + auto nodePairIt = m_nodes.insert( std::make_pair(node, NavGraphNode(node)) ); + NavGraphNode& nodeObj = nodePairIt.first->second; + + if (comingFrom == nullptr) { // Not coming from anywhere - hence a final node. + m_finalNodes.insert( &nodeObj ); + } else { + auto comingFromPairIt = m_nodes.insert( std::make_pair(comingFrom, NavGraphNode(comingFrom)) ); + NavGraphNode& comingFromNodeObj = comingFromPairIt.first->second; + const bool newEdge = comingFromNodeObj.linksTo( &nodeObj ); + if (newEdge) { + ++m_edges; + } + } + } + + + const std::set<NavGraphNode*>& NavGraph::finalNodes() const { + return m_finalNodes; + } + + + size_t NavGraph::nodes() const { + return m_nodes.size(); + } + + + size_t NavGraph::edges() const { + return m_edges; + } + + + void NavGraph::printAllPaths(MsgStream& log, MSG::Level msgLevel) const { + for (const NavGraphNode* finalNode : finalNodes()) { + recursivePrintNavPath(*finalNode, 0, log, msgLevel); + } + } + + + void NavGraph::recursivePrintNavPath(const NavGraphNode& nav, size_t level, MsgStream& log, MSG::Level msgLevel) const { + const Decision* node = nav.node(); + const ElementLink<DecisionContainer> nodeEL = decisionToElementLink( node ); + std::stringstream ss; + for (size_t i = 0; i < level; ++i) { + ss << " "; + } + ss << "|-> " << nodeEL.dataID() << " #" << nodeEL.index() << " (" << node->name() << ")"; + log << msgLevel << ss.str() << endmsg; + for (const NavGraphNode* seed : nav.seeds()) { + recursivePrintNavPath(*seed, level + 1, log, msgLevel); + } + } + +} \ No newline at end of file diff --git a/Trigger/TrigSteer/TrigCompositeUtils/src/TrigCompositeUtils.cxx b/Trigger/TrigSteer/TrigCompositeUtils/src/TrigCompositeUtils.cxx index 312d1997ef11d547b98b4c8ee8c1817fe0635c07..e570baed73678d23205a1ce4a02e79790798221a 100644 --- a/Trigger/TrigSteer/TrigCompositeUtils/src/TrigCompositeUtils.cxx +++ b/Trigger/TrigSteer/TrigCompositeUtils/src/TrigCompositeUtils.cxx @@ -1,6 +1,7 @@ /* Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ + #include "StoreGate/WriteHandle.h" #include "StoreGate/ReadHandle.h" #include "AthContainers/AuxElement.h" @@ -275,94 +276,46 @@ namespace TrigCompositeUtils { return output; } - void recursiveGetDecisionsInternal(const Decision* start, - const size_t location, - std::vector<ElementLinkVector<DecisionContainer>>& linkVector, + void recursiveGetDecisionsInternal(const Decision* node, + const Decision* comingFrom, + NavGraph& navGraph, const DecisionID id, const bool enforceDecisionOnNode) { // Does this Decision satisfy the chain requirement? DecisionIDContainer idSet = {id}; - if (enforceDecisionOnNode && id != 0 && !isAnyIDPassing(start, idSet)) { + if (enforceDecisionOnNode && id != 0 && !isAnyIDPassing(node, idSet)) { return; // Stop propagating down this leg. It does not concern the chain with DecisionID = id } - // This Decision object is part of this linear path through the Navigation - const DecisionContainer* container = dynamic_cast<const DecisionContainer*>( start->container() ); - ElementLink<DecisionContainer> startLink = ElementLink<DecisionContainer>(*container, start->index()); - linkVector.at(location).push_back( startLink ); + // This Decision object is part of this path through the Navigation + navGraph.addNode(node, comingFrom); // Continue to the path(s) by looking at this Decision object's seed(s) - if ( hasLinkToPrevious(start) ) { - const ElementLinkVector<DecisionContainer> seedsVector = getLinkToPrevious(start); - - // If there is more than one seed then we need to fork. - // Each fork implies copying the (linear) vector of links up to this point. - // As this forking may have happened more than once before, we need to remember which seed - // corresponds to which fork. Done here via a map. - std::unordered_map<size_t,size_t> mapSeedToLinkVector; - for (size_t seed = 0; seed < seedsVector.size(); ++seed) { - if (seed == 0) { - mapSeedToLinkVector.insert( std::make_pair(seed, location) ); - } else { - linkVector.push_back( linkVector.at(location) ); - mapSeedToLinkVector.insert( std::make_pair(seed, linkVector.size() - 1) ); - } - } - + if ( hasLinkToPrevious(node) ) { // Do the recursion - for (size_t seed = 0; seed < seedsVector.size(); ++seed) { - const Decision* seedDecision = *(seedsVector.at(seed)); // Dereference ElementLink - size_t linkVectorLocation = mapSeedToLinkVector.find(seed)->second; + for ( ElementLink<DecisionContainer> seed : getLinkToPrevious(node)) { + const Decision* seedDecision = *(seed); // Dereference ElementLink // Sending true as final parameter for enforceDecisionOnStartNode as we are recursing away from the supplied start node - recursiveGetDecisionsInternal(seedDecision, linkVectorLocation, linkVector, id, true); + recursiveGetDecisionsInternal(seedDecision, node, navGraph, id, /*enforceDecisionOnNode*/ true); } } return; } void recursiveGetDecisions(const Decision* start, - std::vector<ElementLinkVector<DecisionContainer>>& linkVector, + NavGraph& navGraph, const DecisionID id, const bool enforceDecisionOnStartNode) { - // Note: we do not require linkVector to be an empty vector. We can append to it. - linkVector.push_back( ElementLinkVector<DecisionContainer>() ); // Our starting point - const size_t startingElement = linkVector.size() - 1; - recursiveGetDecisionsInternal(start, startingElement, linkVector, id, enforceDecisionOnStartNode); - // Writing finished. - // Now - remove defunct branches. These are zero length entries or entries which did not propagate all the way up to the root nodes - // (this occurs when the decision ID was not valid along a prospective branch) - std::vector<ElementLinkVector<DecisionContainer>>::iterator vecIt = linkVector.begin(); - std::advance(vecIt, startingElement); - // vecIt is an iterator which now corresponds to the first element added by this call to recursiveGetDecisions - for (; vecIt != linkVector.end();) { - bool shouldRemove = false; - if (vecIt->size() == 0) { - // No Decision ELs were added to the inner ElementLinkVector. - shouldRemove = true; - } else { - ElementLink<DecisionContainer> finalDecision = vecIt->back(); - DecisionIDContainer idSet = {id}; - if (hasLinkToPrevious(*finalDecision)) { - // If the back Decision is not L1 (hence has links), then it's not from the top of the graph. And the path should be removed. - shouldRemove = true; - } else if (id != 0 && !isAnyIDPassing(*finalDecision, idSet)) { - // The final hop to this L1 node was not valid for the chain in question - shouldRemove = true; - } - } - if (shouldRemove) { - vecIt = linkVector.erase(vecIt); - } else { - ++vecIt; - } - } + // Note: we do not require navGraph to be an empty graph. We can extend it. + recursiveGetDecisionsInternal(start, /*comingFrom*/nullptr, navGraph, id, enforceDecisionOnStartNode); + return; } - std::string dump( const Decision* tc, std::function< std::string( const Decision* )> printerFnc ) { + std::string dump( const Decision* tc, std::function< std::string( const Decision* )> printerFnc ) { std::string ret; ret += printerFnc( tc ); if ( hasLinkToPrevious(tc) ) { diff --git a/Trigger/TrigSteer/TrigCompositeUtils/test/TrigTraversal_test.cxx b/Trigger/TrigSteer/TrigCompositeUtils/test/TrigTraversal_test.cxx index 59c63f8cb65851aa806f3a457aff3a0732e0ecf6..7ae89a7d3f021351bf8af542d667142d981278de 100644 --- a/Trigger/TrigSteer/TrigCompositeUtils/test/TrigTraversal_test.cxx +++ b/Trigger/TrigSteer/TrigCompositeUtils/test/TrigTraversal_test.cxx @@ -22,10 +22,8 @@ #include "xAODMuon/MuonContainer.h" #include "xAODMuon/MuonAuxContainer.h" -void printPaths(const std::vector<ElementLinkVector<TrigCompositeUtils::DecisionContainer>>& paths, const std::string& name); - template<class CONTAINER> -void printFeatures(const std::vector< TrigCompositeUtils::LinkInfo<CONTAINER> >& featureContainer, const std::string& name); +void printFeatures(const std::vector< TrigCompositeUtils::LinkInfo<CONTAINER> >& featureContainer, const std::string& name, MsgStream& log); /// @brief Test to check traversal functions of a graph of interconnect TrigComposite objects /// @@ -41,20 +39,22 @@ int main ATLAS_NOT_THREAD_SAFE () { // initialize Gaudi, SG ISvcLocator* pSvcLoc; Athena_test::initGaudi(pSvcLoc); - StoreGateSvc* pSG(0); + StoreGateSvc* pSG(nullptr); assert( pSvcLoc->service("StoreGateSvc", pSG, true).isSuccess() ); + MsgStream log(nullptr, "TrigTraversal"); + // Create a context IProxyDict* xdict = &*pSG; xdict = pSG->hiveProxyDict(); EventContext ctx(0,0); ctx.setExtension( Atlas::ExtendedEventContext(xdict) ); Gaudi::Hive::setCurrentContext (ctx); - std::cout << "Context: " << ctx << std::endl; + log << "Context: " << ctx << endmsg; // check current context const EventContext& ctx1 = Gaudi::Hive::currentContext(); - std::cout << "Current context: " << ctx1 << std::endl; + log << "Current context: " << ctx1 << endmsg; SG::WriteHandleKey<DecisionContainer> decisionContainerKey("HLTNav_MyDecisionContainer"); SG::WriteHandleKey<xAOD::ElectronContainer> electronContainerKey("MyElectronContainer"); @@ -374,47 +374,53 @@ int main ATLAS_NOT_THREAD_SAFE () { // Test the graph - std::vector<ElementLinkVector<DecisionContainer>> paths_HLT_mufast_chain; - std::vector<ElementLinkVector<DecisionContainer>> paths_HLT_mu_chain; - std::vector<ElementLinkVector<DecisionContainer>> paths_HLT_mu_em_chain; - std::vector<ElementLinkVector<DecisionContainer>> paths_HLT_em_chain; - std::vector<ElementLinkVector<DecisionContainer>> paths_HLT_all; - - recursiveGetDecisions(END, paths_HLT_mufast_chain, HLT_mufast_chain, true); - recursiveGetDecisions(END, paths_HLT_mu_chain, HLT_mu_chain, true); - recursiveGetDecisions(END, paths_HLT_mu_em_chain, HLT_mu_em_chain, true); - recursiveGetDecisions(END, paths_HLT_em_chain, HLT_em_chain, true); - recursiveGetDecisions(END, paths_HLT_all, 0, true); - - printPaths(paths_HLT_mufast_chain, "HLT_mufast_chain"); - printPaths(paths_HLT_mu_chain, "HLT_mu_chain"); - printPaths(paths_HLT_mu_em_chain, "HLT_mu_em_chain"); - printPaths(paths_HLT_em_chain, "HLT_em_chain"); - printPaths(paths_HLT_all, "All"); - - std::vector< LinkInfo<xAOD::IParticleContainer> > features_pass_all_HLT_mufast_chain = getFeaturesOfType<xAOD::IParticleContainer>(paths_HLT_mufast_chain, "", false, featureString(), mufast_IDcont); - std::vector< LinkInfo<xAOD::IParticleContainer> > features_pass_all_HLT_mu_chain = getFeaturesOfType<xAOD::IParticleContainer>(paths_HLT_mu_chain, "", false, featureString(), mu_IDcont); - std::vector< LinkInfo<xAOD::IParticleContainer> > features_pass_all_HLT_mu_em_chain = getFeaturesOfType<xAOD::IParticleContainer>(paths_HLT_mu_em_chain, "", false, featureString(), mu_em_IDcont); - std::vector< LinkInfo<xAOD::IParticleContainer> > features_pass_all_HLT_em_chain = getFeaturesOfType<xAOD::IParticleContainer>(paths_HLT_em_chain, "", false, featureString(), em_IDcont); - std::vector< LinkInfo<xAOD::IParticleContainer> > features_pass_all_HLT_all = getFeaturesOfType<xAOD::IParticleContainer>(paths_HLT_all, "", false, featureString(), all_IDcont); - - printFeatures(features_pass_all_HLT_mufast_chain, "[All passing features] HLT_mufast_chain"); - printFeatures(features_pass_all_HLT_mu_chain, "[All passing features] HLT_mu_chain"); - printFeatures(features_pass_all_HLT_mu_em_chain, "[All passing features] HLT_mu_em_chain"); - printFeatures(features_pass_all_HLT_em_chain, "[All passing features] HLT_em_chain"); - printFeatures(features_pass_all_HLT_all, "[All passing features] All chains"); - - std::vector< LinkInfo<xAOD::IParticleContainer> > features_pass_final_HLT_mufast_chain = getFeaturesOfType<xAOD::IParticleContainer>(paths_HLT_mufast_chain, "", true, featureString(), mufast_IDcont); - std::vector< LinkInfo<xAOD::IParticleContainer> > features_pass_final_HLT_mu_chain = getFeaturesOfType<xAOD::IParticleContainer>(paths_HLT_mu_chain, "", true, featureString(), mu_IDcont); - std::vector< LinkInfo<xAOD::IParticleContainer> > features_pass_final_HLT_mu_em_chain = getFeaturesOfType<xAOD::IParticleContainer>(paths_HLT_mu_em_chain, "", true, featureString(), mu_em_IDcont); - std::vector< LinkInfo<xAOD::IParticleContainer> > features_pass_final_HLT_em_chain = getFeaturesOfType<xAOD::IParticleContainer>(paths_HLT_em_chain, "", true, featureString(), em_IDcont); - std::vector< LinkInfo<xAOD::IParticleContainer> > features_pass_final_HLT_all = getFeaturesOfType<xAOD::IParticleContainer>(paths_HLT_all, "", true, featureString(), all_IDcont); - - printFeatures(features_pass_final_HLT_mufast_chain, "[Final passing feature] HLT_mufast_chain"); - printFeatures(features_pass_final_HLT_mu_chain, "[Final passing feature] HLT_mu_chain"); - printFeatures(features_pass_final_HLT_mu_em_chain, "[Final passing feature] HLT_mu_em_chain"); - printFeatures(features_pass_final_HLT_em_chain, "[Final passing feature] HLT_em_chain"); - printFeatures(features_pass_final_HLT_all, "[Final passing feature] All chains"); + NavGraph graph_HLT_mufast_chain; + NavGraph graph_HLT_mu_chain; + NavGraph graph_HLT_mu_em_chain; + NavGraph graph_HLT_em_chain; + NavGraph graph_HLT_all; + + recursiveGetDecisions(END, graph_HLT_mufast_chain, HLT_mufast_chain, true); + recursiveGetDecisions(END, graph_HLT_mu_chain, HLT_mu_chain, true); + recursiveGetDecisions(END, graph_HLT_mu_em_chain, HLT_mu_em_chain, true); + recursiveGetDecisions(END, graph_HLT_em_chain, HLT_em_chain, true); + recursiveGetDecisions(END, graph_HLT_all, 0, true); + + + log << MSG::INFO << "HLT_mufast_chain" << endmsg; + graph_HLT_mufast_chain.printAllPaths(log, MSG::INFO); + log << MSG::INFO << "HLT_mu_chain" << endmsg; + graph_HLT_mu_chain.printAllPaths(log, MSG::INFO); + log << MSG::INFO << "HLT_mu_em_chain" << endmsg; + graph_HLT_mu_em_chain.printAllPaths(log, MSG::INFO); + log << MSG::INFO << "HLT_em_chain" << endmsg; + graph_HLT_em_chain.printAllPaths(log, MSG::INFO); + log << MSG::INFO << "All" << endmsg; + graph_HLT_all.printAllPaths(log, MSG::INFO); + + std::vector< LinkInfo<xAOD::IParticleContainer> > features_pass_all_HLT_mufast_chain = recursiveGetFeaturesOfType<xAOD::IParticleContainer>(graph_HLT_mufast_chain, "", false, featureString(), mufast_IDcont); + std::vector< LinkInfo<xAOD::IParticleContainer> > features_pass_all_HLT_mu_chain = recursiveGetFeaturesOfType<xAOD::IParticleContainer>(graph_HLT_mu_chain, "", false, featureString(), mu_IDcont); + std::vector< LinkInfo<xAOD::IParticleContainer> > features_pass_all_HLT_mu_em_chain = recursiveGetFeaturesOfType<xAOD::IParticleContainer>(graph_HLT_mu_em_chain, "", false, featureString(), mu_em_IDcont); + std::vector< LinkInfo<xAOD::IParticleContainer> > features_pass_all_HLT_em_chain = recursiveGetFeaturesOfType<xAOD::IParticleContainer>(graph_HLT_em_chain, "", false, featureString(), em_IDcont); + std::vector< LinkInfo<xAOD::IParticleContainer> > features_pass_all_HLT_all = recursiveGetFeaturesOfType<xAOD::IParticleContainer>(graph_HLT_all, "", false, featureString(), all_IDcont); + + printFeatures(features_pass_all_HLT_mufast_chain, "[All passing features] HLT_mufast_chain", log); + printFeatures(features_pass_all_HLT_mu_chain, "[All passing features] HLT_mu_chain", log); + printFeatures(features_pass_all_HLT_mu_em_chain, "[All passing features] HLT_mu_em_chain", log); + printFeatures(features_pass_all_HLT_em_chain, "[All passing features] HLT_em_chain", log); + printFeatures(features_pass_all_HLT_all, "[All passing features] All chains", log); + + std::vector< LinkInfo<xAOD::IParticleContainer> > features_pass_final_HLT_mufast_chain = recursiveGetFeaturesOfType<xAOD::IParticleContainer>(graph_HLT_mufast_chain, "", true, featureString(), mufast_IDcont); + std::vector< LinkInfo<xAOD::IParticleContainer> > features_pass_final_HLT_mu_chain = recursiveGetFeaturesOfType<xAOD::IParticleContainer>(graph_HLT_mu_chain, "", true, featureString(), mu_IDcont); + std::vector< LinkInfo<xAOD::IParticleContainer> > features_pass_final_HLT_mu_em_chain = recursiveGetFeaturesOfType<xAOD::IParticleContainer>(graph_HLT_mu_em_chain, "", true, featureString(), mu_em_IDcont); + std::vector< LinkInfo<xAOD::IParticleContainer> > features_pass_final_HLT_em_chain = recursiveGetFeaturesOfType<xAOD::IParticleContainer>(graph_HLT_em_chain, "", true, featureString(), em_IDcont); + std::vector< LinkInfo<xAOD::IParticleContainer> > features_pass_final_HLT_all = recursiveGetFeaturesOfType<xAOD::IParticleContainer>(graph_HLT_all, "", true, featureString(), all_IDcont); + + printFeatures(features_pass_final_HLT_mufast_chain, "[Final passing feature] HLT_mufast_chain", log); + printFeatures(features_pass_final_HLT_mu_chain, "[Final passing feature] HLT_mu_chain", log); + printFeatures(features_pass_final_HLT_mu_em_chain, "[Final passing feature] HLT_mu_em_chain", log); + printFeatures(features_pass_final_HLT_em_chain, "[Final passing feature] HLT_em_chain", log); + printFeatures(features_pass_final_HLT_all, "[Final passing feature] All chains", log); std::cout << " ---------- Now Include Failing Features " << std::endl; @@ -425,64 +431,69 @@ int main ATLAS_NOT_THREAD_SAFE () { std::vector<const Decision*> extraStart_HLT_all = getRejectedDecisionNodes(pSG, 0); for (const Decision* d : extraStart_HLT_mufast_chain) { - recursiveGetDecisions(d, paths_HLT_mufast_chain, HLT_mufast_chain, false); + recursiveGetDecisions(d, graph_HLT_mufast_chain, HLT_mufast_chain, false); } for (const Decision* d : extraStart_HLT_mu_chain) { - recursiveGetDecisions(d, paths_HLT_mu_chain, HLT_mu_chain, false); + recursiveGetDecisions(d, graph_HLT_mu_chain, HLT_mu_chain, false); } for (const Decision* d : extraStart_HLT_mu_em_chain) { - recursiveGetDecisions(d, paths_HLT_mu_em_chain, HLT_mu_em_chain, false); + recursiveGetDecisions(d, graph_HLT_mu_em_chain, HLT_mu_em_chain, false); } for (const Decision* d : extraStart_HLT_em_chain) { - recursiveGetDecisions(d, paths_HLT_em_chain, HLT_em_chain, false); + recursiveGetDecisions(d, graph_HLT_em_chain, HLT_em_chain, false); } for (const Decision* d : extraStart_HLT_all) { - recursiveGetDecisions(d, paths_HLT_all, 0, false); + recursiveGetDecisions(d, graph_HLT_all, 0, false); } - printPaths(paths_HLT_mufast_chain, "HLT_mufast_chain"); - printPaths(paths_HLT_mu_chain, "HLT_mu_chain"); - printPaths(paths_HLT_mu_em_chain, "HLT_mu_em_chain"); - printPaths(paths_HLT_em_chain, "HLT_em_chain"); - printPaths(paths_HLT_all, "All"); - - std::vector< LinkInfo<xAOD::IParticleContainer> > features_passfail_all_HLT_mufast_chain = getFeaturesOfType<xAOD::IParticleContainer>(paths_HLT_mufast_chain, "", false, featureString(), mufast_IDcont); - std::vector< LinkInfo<xAOD::IParticleContainer> > features_passfail_all_HLT_mu_chain = getFeaturesOfType<xAOD::IParticleContainer>(paths_HLT_mu_chain, "", false, featureString(), mu_IDcont); - std::vector< LinkInfo<xAOD::IParticleContainer> > features_passfail_all_HLT_mu_em_chain = getFeaturesOfType<xAOD::IParticleContainer>(paths_HLT_mu_em_chain, "", false, featureString(), mu_em_IDcont); - std::vector< LinkInfo<xAOD::IParticleContainer> > features_passfail_all_HLT_em_chain = getFeaturesOfType<xAOD::IParticleContainer>(paths_HLT_em_chain, "", false, featureString(), em_IDcont); - std::vector< LinkInfo<xAOD::IParticleContainer> > features_passfail_all_HLT_all = getFeaturesOfType<xAOD::IParticleContainer>(paths_HLT_all, "", false, featureString(), all_IDcont); - - printFeatures(features_passfail_all_HLT_mufast_chain, "[All passing/failing features] HLT_mufast_chain"); - printFeatures(features_passfail_all_HLT_mu_chain, "[All passing/failing features] HLT_mu_chain"); - printFeatures(features_passfail_all_HLT_mu_em_chain, "[All passing/failing features] HLT_mu_em_chain"); - printFeatures(features_passfail_all_HLT_em_chain, "[All passing/failing features] HLT_em_chain"); - printFeatures(features_passfail_all_HLT_all, "[All passing/failing features] All chains"); - - std::vector< LinkInfo<xAOD::IParticleContainer> > features_passfail_final_HLT_mufast_chain = getFeaturesOfType<xAOD::IParticleContainer>(paths_HLT_mufast_chain, "", true, featureString(), mufast_IDcont); - std::vector< LinkInfo<xAOD::IParticleContainer> > features_passfail_final_HLT_mu_chain = getFeaturesOfType<xAOD::IParticleContainer>(paths_HLT_mu_chain, "", true, featureString(), mu_IDcont); - std::vector< LinkInfo<xAOD::IParticleContainer> > features_passfail_final_HLT_mu_em_chain = getFeaturesOfType<xAOD::IParticleContainer>(paths_HLT_mu_em_chain, "", true, featureString(), mu_em_IDcont); - std::vector< LinkInfo<xAOD::IParticleContainer> > features_passfail_final_HLT_em_chain = getFeaturesOfType<xAOD::IParticleContainer>(paths_HLT_em_chain, "", true, featureString(), em_IDcont); - std::vector< LinkInfo<xAOD::IParticleContainer> > features_passfail_final_HLT_all = getFeaturesOfType<xAOD::IParticleContainer>(paths_HLT_all, "", true, featureString(), all_IDcont); - - printFeatures(features_passfail_final_HLT_mufast_chain, "[Final passing/failing feature] HLT_mufast_chain"); - printFeatures(features_passfail_final_HLT_mu_chain, "[Final passing/failing feature] HLT_mu_chain"); - printFeatures(features_passfail_final_HLT_mu_em_chain, "[Final passing/failing feature] HLT_mu_em_chain"); - printFeatures(features_passfail_final_HLT_em_chain, "[Final passing/failing feature] HLT_em_chain"); - printFeatures(features_passfail_final_HLT_all, "[Final passing/failing feature] All chains"); + log << MSG::INFO << "HLT_mufast_chain" << endmsg; + graph_HLT_mufast_chain.printAllPaths(log, MSG::INFO); + log << MSG::INFO << "HLT_mu_chain" << endmsg; + graph_HLT_mu_chain.printAllPaths(log, MSG::INFO); + log << MSG::INFO << "HLT_mu_em_chain" << endmsg; + graph_HLT_mu_em_chain.printAllPaths(log, MSG::INFO); + log << MSG::INFO << "HLT_em_chain" << endmsg; + graph_HLT_em_chain.printAllPaths(log, MSG::INFO); + log << MSG::INFO << "All" << endmsg; + graph_HLT_all.printAllPaths(log, MSG::INFO); + + std::vector< LinkInfo<xAOD::IParticleContainer> > features_passfail_all_HLT_mufast_chain = recursiveGetFeaturesOfType<xAOD::IParticleContainer>(graph_HLT_mufast_chain, "", false, featureString(), mufast_IDcont); + std::vector< LinkInfo<xAOD::IParticleContainer> > features_passfail_all_HLT_mu_chain = recursiveGetFeaturesOfType<xAOD::IParticleContainer>(graph_HLT_mu_chain, "", false, featureString(), mu_IDcont); + std::vector< LinkInfo<xAOD::IParticleContainer> > features_passfail_all_HLT_mu_em_chain = recursiveGetFeaturesOfType<xAOD::IParticleContainer>(graph_HLT_mu_em_chain, "", false, featureString(), mu_em_IDcont); + std::vector< LinkInfo<xAOD::IParticleContainer> > features_passfail_all_HLT_em_chain = recursiveGetFeaturesOfType<xAOD::IParticleContainer>(graph_HLT_em_chain, "", false, featureString(), em_IDcont); + std::vector< LinkInfo<xAOD::IParticleContainer> > features_passfail_all_HLT_all = recursiveGetFeaturesOfType<xAOD::IParticleContainer>(graph_HLT_all, "", false, featureString(), all_IDcont); + + printFeatures(features_passfail_all_HLT_mufast_chain, "[All passing/failing features] HLT_mufast_chain", log); + printFeatures(features_passfail_all_HLT_mu_chain, "[All passing/failing features] HLT_mu_chain", log); + printFeatures(features_passfail_all_HLT_mu_em_chain, "[All passing/failing features] HLT_mu_em_chain", log); + printFeatures(features_passfail_all_HLT_em_chain, "[All passing/failing features] HLT_em_chain", log); + printFeatures(features_passfail_all_HLT_all, "[All passing/failing features] All chains", log); + + std::vector< LinkInfo<xAOD::IParticleContainer> > features_passfail_final_HLT_mufast_chain = recursiveGetFeaturesOfType<xAOD::IParticleContainer>(graph_HLT_mufast_chain, "", true, featureString(), mufast_IDcont); + std::vector< LinkInfo<xAOD::IParticleContainer> > features_passfail_final_HLT_mu_chain = recursiveGetFeaturesOfType<xAOD::IParticleContainer>(graph_HLT_mu_chain, "", true, featureString(), mu_IDcont); + std::vector< LinkInfo<xAOD::IParticleContainer> > features_passfail_final_HLT_mu_em_chain = recursiveGetFeaturesOfType<xAOD::IParticleContainer>(graph_HLT_mu_em_chain, "", true, featureString(), mu_em_IDcont); + std::vector< LinkInfo<xAOD::IParticleContainer> > features_passfail_final_HLT_em_chain = recursiveGetFeaturesOfType<xAOD::IParticleContainer>(graph_HLT_em_chain, "", true, featureString(), em_IDcont); + std::vector< LinkInfo<xAOD::IParticleContainer> > features_passfail_final_HLT_all = recursiveGetFeaturesOfType<xAOD::IParticleContainer>(graph_HLT_all, "", true, featureString(), all_IDcont); + + printFeatures(features_passfail_final_HLT_mufast_chain, "[Final passing/failing feature] HLT_mufast_chain", log); + printFeatures(features_passfail_final_HLT_mu_chain, "[Final passing/failing feature] HLT_mu_chain", log); + printFeatures(features_passfail_final_HLT_mu_em_chain, "[Final passing/failing feature] HLT_mu_em_chain", log); + printFeatures(features_passfail_final_HLT_em_chain, "[Final passing/failing feature] HLT_em_chain", log); + printFeatures(features_passfail_final_HLT_all, "[Final passing/failing feature] All chains", log); std::cout << " ---------- Check Explicit Type " << std::endl; // Check typed retrieval too // Note we are *not* passing the set of interested chains here so expect the state to be unset - std::vector< LinkInfo<xAOD::MuonContainer> > features_final_mu = getFeaturesOfType<xAOD::MuonContainer>(paths_HLT_mu_em_chain); - std::vector< LinkInfo<xAOD::ElectronContainer> > features_final_em = getFeaturesOfType<xAOD::ElectronContainer>(paths_HLT_mu_em_chain); - printFeatures(features_final_mu, "[Explicit Final Muon Features] HLT_mu_em_chain"); - printFeatures(features_final_em, "[Explicit Final Electron Features] HLT_mu_em_chain"); + std::vector< LinkInfo<xAOD::MuonContainer> > features_final_mu = recursiveGetFeaturesOfType<xAOD::MuonContainer>(graph_HLT_mu_em_chain); + std::vector< LinkInfo<xAOD::ElectronContainer> > features_final_em = recursiveGetFeaturesOfType<xAOD::ElectronContainer>(graph_HLT_mu_em_chain); + printFeatures(features_final_mu, "[Explicit Final Muon Features] HLT_mu_em_chain", log); + printFeatures(features_final_em, "[Explicit Final Electron Features] HLT_mu_em_chain", log); // Check filtering on the collection name. Note sub-string matching, omitting the "My". - std::vector< LinkInfo<xAOD::ElectronContainer> > features_final_em_correctContainer = getFeaturesOfType<xAOD::ElectronContainer>(paths_HLT_mu_em_chain, "ElectronContainer"); - std::vector< LinkInfo<xAOD::ElectronContainer> > features_final_em_incorrectContainer = getFeaturesOfType<xAOD::ElectronContainer>(paths_HLT_mu_em_chain, "WrongContainerName"); + std::vector< LinkInfo<xAOD::ElectronContainer> > features_final_em_correctContainer = recursiveGetFeaturesOfType<xAOD::ElectronContainer>(graph_HLT_mu_em_chain, "ElectronContainer"); + std::vector< LinkInfo<xAOD::ElectronContainer> > features_final_em_incorrectContainer = recursiveGetFeaturesOfType<xAOD::ElectronContainer>(graph_HLT_mu_em_chain, "WrongContainerName"); VALUE ( features_final_em_correctContainer.size() ) EXPECTED ( features_final_em.size() ); VALUE ( features_final_em_incorrectContainer.size() ) EXPECTED ( 0 ); @@ -495,9 +506,10 @@ int main ATLAS_NOT_THREAD_SAFE () { } template<class CONTAINER> -void printFeatures(const std::vector< TrigCompositeUtils::LinkInfo<CONTAINER> >& featureContainer, const std::string& name) { +void printFeatures(const std::vector< TrigCompositeUtils::LinkInfo<CONTAINER> >& featureContainer, const std::string& name, MsgStream& log) { using namespace TrigCompositeUtils; - std::cout << name << " features size:" << featureContainer.size() << std::endl; + std::stringstream ss; + ss << name << " features size:" << featureContainer.size() << std::endl; size_t count = 0; for (const TrigCompositeUtils::LinkInfo<CONTAINER>& featureLinkInfo : featureContainer) { std::string stateStr; @@ -506,27 +518,7 @@ void printFeatures(const std::vector< TrigCompositeUtils::LinkInfo<CONTAINER> >& case ActiveState::INACTIVE: stateStr = "INACTIVE"; break; case ActiveState::UNSET: default: stateStr = "UNSET"; break; } - std::cout << " Feature " << count++ << " pt:" << (*featureLinkInfo.link)->pt() << ", state:" << stateStr << std::endl; + ss << " Feature " << count++ << " pt:" << (*featureLinkInfo.link)->pt() << ", state:" << stateStr << std::endl; } + log << MSG::INFO << ss.str() << endmsg; } - -void printPaths(const std::vector<ElementLinkVector<TrigCompositeUtils::DecisionContainer>>& paths, const std::string& name) { - using namespace TrigCompositeUtils; - std::cout << paths.size() << " paths for " << name << std::endl; - size_t count = 0; - for (const ElementLinkVector<DecisionContainer>& path : paths) { - std::cout << " Path " << count++ << "["; - bool first = true; - for (const ElementLink<DecisionContainer>& link : path) { - if (!first) std::cout << " -> "; - first = false; - std::cout << (*link)->name(); - if ((*link)->hasObjectLink(featureString())) { - ElementLink<xAOD::IParticleContainer> feature = (*link)->objectLink<xAOD::IParticleContainer>(featureString()); - std::cout << " F(pt:" << (*feature)->pt() << ")"; - } - } - std::cout << "]" << std::endl; - } -} - diff --git a/Trigger/TrigSteer/ViewAlgs/CMakeLists.txt b/Trigger/TrigSteer/ViewAlgs/CMakeLists.txt index e2c5914873f06c873857f4a19622594caad103ac..4eb103c076f769bf34c2dc944b5f856ba2c713ae 100644 --- a/Trigger/TrigSteer/ViewAlgs/CMakeLists.txt +++ b/Trigger/TrigSteer/ViewAlgs/CMakeLists.txt @@ -5,10 +5,11 @@ atlas_subdir( ViewAlgs ) # Component(s) in the package: atlas_add_library( ViewAlgsLib + src/*.cxx PUBLIC_HEADERS ViewAlgs INTERFACE - LINK_LIBRARIES AthContainers AthLinks GaudiKernel TrigCompositeUtilsLib xAODTrigger ) + LINK_LIBRARIES AthContainers AthLinks GaudiKernel DecisionHandlingLib MuonCombinedEvent xAODJet xAODMuon TrigCompositeUtilsLib xAODTrigger ) atlas_add_component( ViewAlgs - src/*.cxx src/components/*.cxx - LINK_LIBRARIES AthViews AthenaBaseComps CxxUtils DecisionHandlingLib MuonCombinedEvent StoreGateLib TrigSteeringEvent ViewAlgsLib xAODJet xAODMuon ) + src/components/*.cxx + LINK_LIBRARIES AthViews AthenaBaseComps CxxUtils DecisionHandlingLib MuonCombinedEvent StoreGateLib TrigSteeringEvent ViewAlgsLib xAODJet xAODMuon ViewAlgsLib ) diff --git a/Trigger/TrigSteer/ViewAlgs/ViewAlgs/IDCCacheCreatorBase.h b/Trigger/TrigSteer/ViewAlgs/ViewAlgs/IDCCacheCreatorBase.h new file mode 100644 index 0000000000000000000000000000000000000000..9398575b4398471868072c932fc229d817f65f68 --- /dev/null +++ b/Trigger/TrigSteer/ViewAlgs/ViewAlgs/IDCCacheCreatorBase.h @@ -0,0 +1,58 @@ +/* + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration +*/ + +#pragma once + +#include "AthenaBaseComps/AthReentrantAlgorithm.h" +#include <atomic> +#include "EventContainers/IdentifiableValueCache.h" +#include "EventContainers/IdentifiableCache.h" + +class IDCCacheCreatorBase : public AthReentrantAlgorithm { + public: + /// Constructor + IDCCacheCreatorBase(const std::string &name,ISvcLocator *pSvcLocator); + /// Destructor + virtual ~IDCCacheCreatorBase()=default; +protected: + template<bool checkKey = true, typename T> + StatusCode createContainer(const SG::WriteHandleKey<T>& , long unsigned int , const EventContext& ) const; + template<bool checkKey = true, typename T, typename X> + StatusCode createValueContainer(const SG::WriteHandleKey<T>& , long unsigned int , const EventContext&, const X& defaultValue ) const; + mutable std::atomic_bool m_disableWarningCheck; + bool isInsideView(const EventContext&) const; + StatusCode checkInsideViewOnce(const EventContext&) const; +}; + + +template<bool checkKey = true, typename T> +StatusCode IDCCacheCreatorBase::createContainer(const SG::WriteHandleKey<T>& containerKey, long unsigned int size, const EventContext& ctx) const{ + static_assert(std::is_base_of<EventContainers::IdentifiableCacheBase, T>::value, "Expects a IdentifiableCache Class" ); + if constexpr (checkKey){ + if(containerKey.key().empty()){ + ATH_MSG_DEBUG( "Creation of container "<< containerKey.key() << " is disabled (no name specified)"); + return StatusCode::SUCCESS; + } + } + SG::WriteHandle<T> ContainerCacheKey(containerKey, ctx); + ATH_CHECK( ContainerCacheKey.recordNonConst ( std::make_unique<T>(IdentifierHash(size), nullptr) )); + ATH_MSG_DEBUG( "Container "<< containerKey.key() << " created to hold " << size ); + return StatusCode::SUCCESS; +} + +template<bool checkKey = true, typename T, typename X> +StatusCode IDCCacheCreatorBase::createValueContainer(const SG::WriteHandleKey<T>& containerKey, long unsigned int size, const EventContext& ctx, const X& defaultValue) const{ + static_assert(std::is_base_of<IdentifiableValueCache<X>, T>::value, "Expects a IdentifiableValueCache Class" ); + if constexpr (checkKey){ + if(containerKey.key().empty()){ + ATH_MSG_DEBUG( "Creation of container "<< containerKey.key() << " is disabled (no name specified)"); + return StatusCode::SUCCESS; + } + } + SG::WriteHandle<T> ContainerCacheKey(containerKey, ctx); + ATH_CHECK( ContainerCacheKey.recordNonConst ( std::make_unique<T>(size, defaultValue) )); + ATH_MSG_DEBUG( "ValueContainer "<< containerKey.key() << " created to hold " << size ); + return StatusCode::SUCCESS; +} + diff --git a/Trigger/TrigSteer/ViewAlgs/src/IDCCacheCreatorBase.cxx b/Trigger/TrigSteer/ViewAlgs/src/IDCCacheCreatorBase.cxx new file mode 100644 index 0000000000000000000000000000000000000000..b9bb754905f061e70e26a58b0169a523e5535b14 --- /dev/null +++ b/Trigger/TrigSteer/ViewAlgs/src/IDCCacheCreatorBase.cxx @@ -0,0 +1,28 @@ + +#include "ViewAlgs/IDCCacheCreatorBase.h" +#include "AthViews/View.h" + +bool IDCCacheCreatorBase::isInsideView(const EventContext& context) const +{ + const IProxyDict* proxy = Atlas::getExtendedEventContext(context).proxy(); + const SG::View* view = dynamic_cast<const SG::View*>(proxy); + return view != nullptr; +} + +IDCCacheCreatorBase::IDCCacheCreatorBase(const std::string &name,ISvcLocator *pSvcLocator) : +AthReentrantAlgorithm(name,pSvcLocator), +m_disableWarningCheck(false) +{ + +} + +StatusCode IDCCacheCreatorBase::checkInsideViewOnce(const EventContext& ctx) const +{ + if(!m_disableWarningCheck && !m_disableWarningCheck.exchange(true)){ //Only check once + if(isInsideView(ctx)){ + ATH_MSG_ERROR("CacheCreator is running inside a view, this is probably a misconfiguration"); + return StatusCode::FAILURE; + } + } + return StatusCode::SUCCESS; +} \ No newline at end of file diff --git a/Trigger/TrigTools/TrigInDetConfig/python/TrigInDetPriVtxConfig.py b/Trigger/TrigTools/TrigInDetConfig/python/TrigInDetPriVtxConfig.py index 85b8bec6df85deca48f5387b073d5bce3ea0430c..b4a71aa9f30ad93e6840dee6ca629acaf20f023f 100644 --- a/Trigger/TrigTools/TrigInDetConfig/python/TrigInDetPriVtxConfig.py +++ b/Trigger/TrigTools/TrigInDetConfig/python/TrigInDetPriVtxConfig.py @@ -68,7 +68,7 @@ def impactEstimator_builder( signature, extrapolator ) : -def trackSelectorTool_builder( signature, trackSummaryTool, extrapolator ) : +def trackSelectorTool_builder( signature, trackSummaryTool, extrapolator, cuts ) : from AthenaCommon.AppMgr import ToolSvc @@ -77,26 +77,24 @@ def trackSelectorTool_builder( signature, trackSummaryTool, extrapolator ) : from InDetTrackSelectionTool.InDetTrackSelectionToolConf import InDet__InDetTrackSelectionTool trackSelectorTool = InDet__InDetTrackSelectionTool( name = "InDetTrigDetailedTrackSelectionTool" + signature, - Extrapolator = extrapolator ) - -# these changes need to go in next ... -# TrackSummaryTool = trackSummaryTool, -# CutLevel = configuredTrigVtxCuts.TrackCutLevel(), -# # maybe have all these cuts passed in just by passing in the configuredVtsCuts object -# minPt = configuredTrigVtxCuts.minPT(), -# maxD0 = configuredTrigVtxCuts.IPd0Max(), -# maxZ0 = configuredTrigVtxCuts.z0Max(), -# maxZ0SinTheta = configuredTrigVtxCuts.IPz0Max(), -# maxSigmaD0 = configuredTrigVtxCuts.sigIPd0Max(), -# maxSigmaZ0SinTheta = configuredTrigVtxCuts.sigIPz0Max(), -# maxChiSqperNdf = configuredTrigVtxCuts.fitChi2OnNdfMax(), # Seems not to be implemented? -# maxAbsEta = configuredTrigVtxCuts.etaMax(), -# minNInnermostLayerHits = configuredTrigVtxCuts.nHitInnermostLayer(), -# minNPixelHits = configuredTrigVtxCuts.nHitPix(), -# maxNPixelHoles = configuredTrigVtxCuts.nHolesPix(), -# minNSctHits = configuredTrigVtxCuts.nHitSct(), -# minNTrtHits = configuredTrigVtxCuts.nHitTrt(), -# minNSiHits = configuredTrigVtxCuts.nHitSi() ) + Extrapolator = extrapolator, + TrackSummaryTool = trackSummaryTool, + CutLevel = cuts.TrackCutLevel(), + # maybe have all these cuts passed in just by passing in the configuredVtsCuts object + minPt = cuts.minPT(), + maxD0 = cuts.IPd0Max(), + maxZ0 = cuts.z0Max(), + maxZ0SinTheta = cuts.IPz0Max(), + maxSigmaD0 = cuts.sigIPd0Max(), + maxSigmaZ0SinTheta = cuts.sigIPz0Max(), + maxChiSqperNdf = cuts.fitChi2OnNdfMax(), # Seems not to be implemented? + maxAbsEta = cuts.etaMax(), + minNInnermostLayerHits = cuts.nHitInnermostLayer(), + minNPixelHits = cuts.nHitPix(), + maxNPixelHoles = cuts.nHolesPix(), + minNSctHits = cuts.nHitSct(), + minNTrtHits = cuts.nHitTrt(), + minNSiHits = cuts.nHitSi() ) ToolSvc += trackSelectorTool @@ -147,12 +145,10 @@ def vertexFinderTool_builder( signature ) : trackSummaryTool = TrackingCommon.getInDetTrackSummaryTool() extrapolator = TrackingCommon.getInDetExtrapolator() - # NB: not yet ready to go in, but we have the code here in readiness ... # get the selection cuts use to select the actual tracks in the tool ... - # from InDetTrigRecExample.TrigInDetConfiguredVtxCuts import ConfiguredTrigVertexingCuts - # configuredTrigVtxCuts = ConfiguredTrigVertexingCuts() - # configuredTrigVtxCuts.printInfo() - + from InDetTrigRecExample.TrigInDetConfiguredVtxCuts import ConfiguredTrigVtxCuts + vtxcuts = ConfiguredTrigVtxCuts() + vtxcuts.printInfo() # now create the five sub tools needed ... @@ -160,7 +156,7 @@ def vertexFinderTool_builder( signature ) : linearTrackFactory = linearTrackFactory_builder( signature, extrapolator ) vertexFitterTool = vertexFitterTool_builder( signature, linearTrackFactory, extrapolator ) impactEstimator = impactEstimator_builder( signature, extrapolator ) - trackSelectorTool = trackSelectorTool_builder( signature, trackSummaryTool, extrapolator ) + trackSelectorTool = trackSelectorTool_builder( signature, trackSummaryTool, extrapolator, vtxcuts ) trackDensitySeedFinder = trackDensitySeedFinder_builder( signature ) # now create the actual vertex finder tool ... @@ -177,14 +173,13 @@ def vertexFinderTool_builder( signature ) : SeedFinder = trackDensitySeedFinder, ImpactPoint3dEstimator = impactEstimator, LinearizedTrackFactory = linearTrackFactory, - useBeamConstraint = False, + useBeamConstraint = True, significanceCutSeeding = 12, maximumChi2cutForSeeding = 49, maxVertices = 200, - createSplitVertices = False ) -# these too should go in next ... -# doMaxTracksCut = configuredTrigVtxCuts.doMaxTracksCut(), -# MaxTracks = configuredTrigVtxCuts.MaxTracks() ) + createSplitVertices = False, + doMaxTracksCut = vtxcuts.doMaxTracksCut(), + MaxTracks = vtxcuts.MaxTracks() ) # InDetAdaptiveMultiPriVxFinderTool job options for later diff --git a/Trigger/TrigTools/TrigInDetToolInterfaces/TrigInDetToolInterfaces/ITrigPrimaryVertexFitter.h b/Trigger/TrigTools/TrigInDetToolInterfaces/TrigInDetToolInterfaces/ITrigPrimaryVertexFitter.h index 10232700af46c709029a36bcd5095bc159ccb121..f234b6a2c2f42b9c9ad8b0730ed9a23a67014739 100644 --- a/Trigger/TrigTools/TrigInDetToolInterfaces/TrigInDetToolInterfaces/ITrigPrimaryVertexFitter.h +++ b/Trigger/TrigTools/TrigInDetToolInterfaces/TrigInDetToolInterfaces/ITrigPrimaryVertexFitter.h @@ -10,7 +10,6 @@ #include "TrkTrack/TrackCollection.h" class TrigVertex; -class TrigInDetTrackCollection; static const InterfaceID IID_ITrigPrimaryVertexFitter("ITrigPrimaryVertexFitter",1,0); @@ -21,10 +20,8 @@ class ITrigPrimaryVertexFitter: virtual public IAlgTool static const InterfaceID& interfaceID() { return IID_ITrigPrimaryVertexFitter; } - virtual TrigVertex* fit(const TrigInDetTrackCollection*, double z=0.0) = 0; - virtual TrigVertex* fit(const TrigInDetTrackCollection*, std::vector<double>&, double z=0.0) = 0; - virtual TrigVertex* fit(const TrackCollection*, TrackCollection&, double z=0.0) = 0; - virtual TrigVertex* fit(const TrackCollection*, std::vector<double>&, double z=0.0) = 0; + virtual TrigVertex* fit(const TrackCollection*, TrackCollection&, double z=0.0) const = 0; + virtual TrigVertex* fit(const TrackCollection*, std::vector<double>&, double z=0.0) const = 0; }; #endif diff --git a/Trigger/TrigTools/TrigVertexFitter/src/TrigPrimaryVertexFitter.cxx b/Trigger/TrigTools/TrigVertexFitter/src/TrigPrimaryVertexFitter.cxx index 54263f408b25cd79f6e040331f0c0cf4da2fa5ab..49c6af79bbcde507ccaf3ccce5f9330db6800a84 100644 --- a/Trigger/TrigTools/TrigVertexFitter/src/TrigPrimaryVertexFitter.cxx +++ b/Trigger/TrigTools/TrigVertexFitter/src/TrigPrimaryVertexFitter.cxx @@ -17,8 +17,6 @@ #include <iostream> #include <algorithm> -#include "TrigInDetEvent/TrigInDetTrack.h" -#include "TrigInDetEvent/TrigInDetTrackCollection.h" #include "TrigTimeAlgs/TrigTimerSvc.h" #include "TrigInDetEvent/TrigL2Vertex.h" #include "TrigInDetEvent/TrigVertex.h" @@ -54,18 +52,6 @@ StatusCode TrigPrimaryVertexFitter::initialize() ATH_MSG_INFO( "Number of iterations is set to " << m_numIter ); ATH_MSG_INFO( "Accuracy of starting z-position is " << m_zVariance<<" mm" ); ATH_MSG_INFO( "Track lists created ? " << std::boolalpha<<m_createTrackLists ); - ServiceHandle<ITrigTimerSvc> timerSvc ("TrigTimerSvc", name()); - if( timerSvc.retrieve().isFailure() ) - { - ATH_MSG_INFO( "Unable to locate Service TrigTimerSvc " ); - m_timers = false; - } - else m_timers = true; - if(m_timers) - { - m_timer[0] = timerSvc->addItem("PrimaryVertexFit"); - } - ATH_MSG_INFO( "TrigPrimaryVertexFitter constructed " ); return StatusCode::SUCCESS; } @@ -80,112 +66,8 @@ TrigPrimaryVertexFitter::~TrigPrimaryVertexFitter() } -TrigVertex* TrigPrimaryVertexFitter::fit(const TrigInDetTrackCollection* tc, double z0) -{ - - TrigVertex* pVertex=NULL; - - double chi2; - int ndof; - - if(m_timers) m_timer[0]->start(); - - bool goodSet=checkTracks(tc); - - if(!goodSet) - { - ATH_MSG_WARNING( "Bad track set - vertex cannot be fit" ); - return NULL; - } - - std::vector<TrigPrimaryVertexTrack*> tracks; - tracks.clear(); - int idx=1; - for(TrigInDetTrackCollection::const_iterator ptIt=tc->begin();ptIt!=tc->end();++ptIt) - { - TrigPrimaryVertexTrack* pT= new TrigPrimaryVertexTrack(*ptIt); - if(pT!=NULL) { - pT->setIndex(idx++); - tracks.push_back(pT); - } - } - - TrigL2Vertex* pV = new TrigL2Vertex(); - - pV->getParametersVector()[0]=0.0; - pV->getParametersVector()[1]=0.0; - pV->getParametersVector()[2]=z0; - bool fitFailed=false; - chi2=0.0;ndof=-3; - for(int nIter=0;nIter<m_numIter;nIter++) - { - memset(&pV->m_Gk[0][0],0,sizeof(pV->m_Gk)); - pV->m_Gk[0][0]=m_xyVariance*m_xyVariance; - pV->m_Gk[1][1]=m_xyVariance*m_xyVariance; - pV->m_Gk[2][2]=m_zVariance*m_zVariance; - chi2=0.0;ndof=-3; - fitFailed=false; - - for(std::vector<TrigPrimaryVertexTrack*>::iterator it=tracks.begin();it!=tracks.end();++it) - { - if(!(*it)->isActive()) - (*it)->activate(); - - double dchi2=(*it)->getChi2Distance(pV); - ATH_MSG_VERBOSE("Track "<<(*it)->getIndex()<<" dchi2="<<dchi2 ); - if(std::isnan(dchi2)||(dchi2<0.0)||(dchi2>m_maxChi2Increase)) - { - fitFailed=true; - break; - } - if(dchi2<m_chi2cut) - { - chi2+=dchi2;ndof+=2; - (*it)->updateVertex(pV); - } - else - { - (*it)->mask(); - ATH_MSG_DEBUG("Skipping track "<<(*it)->getIndex()<<"due to large dchi2="<<dchi2 ); - } - } - if(fitFailed) break; - } - - - if(!fitFailed && (ndof>0)) - { - ATH_MSG_DEBUG("Primary vertex fit OK, chi2 = "<<chi2<<" NDOF = "<<ndof ); - ATH_MSG_DEBUG("x= "<<pV->getParametersVector()[0]<< - " y= "<<pV->getParametersVector()[1]<<" z= "<<pV->getParametersVector()[2] ); - double cv[6]; - cv[0]=pV->m_Gk[0][0];cv[1]=pV->m_Gk[0][1];cv[2]=pV->m_Gk[1][1]; - cv[3]=pV->m_Gk[0][2];cv[4]=pV->m_Gk[1][2];cv[5]=pV->m_Gk[2][2]; - TrackInVertexList* pTL = NULL; - if(m_createTrackLists) { - - pTL = new TrackInVertexList; - for(std::vector<TrigPrimaryVertexTrack*>::iterator it=tracks.begin();it!=tracks.end();++it) { - if ((*it)->isActive()) - pTL->push_back((*it)->getTrigTrack()); - } - } - pVertex = new TrigVertex(pV->getParametersVector()[0], - pV->getParametersVector()[1], - pV->getParametersVector()[2],cv,chi2,ndof,pTL); - } - delete pV; - for(std::vector<TrigPrimaryVertexTrack*>::iterator it=tracks.begin();it!=tracks.end();++it) - { - delete (*it); - } - if(m_timers) m_timer[0]->stop(); - - return pVertex; -} - //TrigVertex has associated TrigInDetTracks, but we want Trk::Tracks -TrigVertex* TrigPrimaryVertexFitter::fit(const TrackCollection* tc, TrackCollection& output_tc, double z0) +TrigVertex* TrigPrimaryVertexFitter::fit(const TrackCollection* tc, TrackCollection& output_tc, double z0) const { TrigVertex* pVertex=NULL; @@ -193,8 +75,6 @@ TrigVertex* TrigPrimaryVertexFitter::fit(const TrackCollection* tc, TrackCollect double chi2; int ndof; - if(m_timers) m_timer[0]->start(); - std::vector<TrigPrimaryVertexTrack*> tracks; tracks.clear(); int idx=1; @@ -276,8 +156,6 @@ TrigVertex* TrigPrimaryVertexFitter::fit(const TrackCollection* tc, TrackCollect { delete (*it); } - if(m_timers) m_timer[0]->stop(); - return pVertex; } @@ -289,7 +167,7 @@ struct TrigPrimaryTrackSortPredicate } }; -TrigVertex* TrigPrimaryVertexFitter::fit(const TrigInDetTrackCollection* tc, std::vector<double>& Chi2V, double z0) +TrigVertex* TrigPrimaryVertexFitter::fit(const TrackCollection* tc, std::vector<double>& Chi2V, double z0) const { TrigVertex* pVertex=NULL; @@ -297,149 +175,6 @@ TrigVertex* TrigPrimaryVertexFitter::fit(const TrigInDetTrackCollection* tc, std double chi2; int ndof; - if(m_timers) m_timer[0]->start(); - - bool goodSet=checkTracks(tc); - - if(!goodSet) - { - ATH_MSG_WARNING( "Bad track set - vertex cannot be fit" ); - return NULL; - } - - std::vector<TrigPrimaryVertexTrack*> tracks; - tracks.clear(); - Chi2V.clear(); - int idx=1; - for(TrigInDetTrackCollection::const_iterator ptIt=tc->begin();ptIt!=tc->end();++ptIt) - { - TrigPrimaryVertexTrack* pT= new TrigPrimaryVertexTrack(*ptIt); - if(pT!=NULL) - { - pT->setIndex(idx++); - tracks.push_back(pT); - Chi2V.push_back(-100.0); - } - } - - TrigL2Vertex* pV = new TrigL2Vertex(); - - // 1. preliminary fit - - pV->getParametersVector()[0]=0.0; - pV->getParametersVector()[1]=0.0; - pV->getParametersVector()[2]=z0; - - memset(&pV->m_Gk[0][0],0,sizeof(pV->m_Gk)); - pV->m_Gk[0][0]=m_xyVariance*m_xyVariance; - pV->m_Gk[1][1]=m_xyVariance*m_xyVariance; - pV->m_Gk[2][2]=m_zVariance*m_zVariance; - - bool fitFailed=false; - for(std::vector<TrigPrimaryVertexTrack*>::iterator it=tracks.begin();it!=tracks.end();++it) - { - double dchi2=(*it)->getChi2Distance(pV); - if(std::isnan(dchi2)||(dchi2<0.0)||(dchi2>m_maxChi2Increase)) - { - fitFailed=true; - break; - } - if(dchi2<m_chi2cut_loose) (*it)->updateVertex(pV); - } - if(fitFailed) - { - delete pV; - for(std::vector<TrigPrimaryVertexTrack*>::iterator it=tracks.begin(); - it!=tracks.end();++it) delete (*it); - return pVertex; - } - - // 2. calculation of "smoothed" chi2s - - memset(&pV->m_Gk[0][0],0,sizeof(pV->m_Gk)); - - for(std::vector<TrigPrimaryVertexTrack*>::iterator it=tracks.begin();it!=tracks.end();++it) - { - double dchi2=(*it)->getChi2Distance(pV); - ATH_MSG_DEBUG("Track "<<(*it)->getIndex()<<" dchi2="<<dchi2 ); - } - - // 3. sort tracks in accordance with their chi2s - - std::sort(tracks.begin(),tracks.end(),TrigPrimaryTrackSortPredicate()); - - // 4. Final track fit - - pV->getParametersVector()[0]=0.0; - pV->getParametersVector()[1]=0.0; - pV->getParametersVector()[2]=z0; - fitFailed=false; - chi2=0.0;ndof=-3; - for(int nIter=0;nIter<m_numIter;nIter++) - { - memset(&pV->m_Gk[0][0],0,sizeof(pV->m_Gk)); - pV->m_Gk[0][0]=100.0; - pV->m_Gk[1][1]=100.0; - pV->m_Gk[2][2]=m_zVariance*m_zVariance; - chi2=0.0;ndof=-3; - fitFailed=false; - - for(std::vector<TrigPrimaryVertexTrack*>::iterator it=tracks.begin();it!=tracks.end();++it) - { - double dchi2=(*it)->getChi2Distance(pV); - Chi2V[(*it)->getIndex()-1]=dchi2; - ATH_MSG_VERBOSE("Track "<<(*it)->getIndex()<<" dchi2="<<dchi2 ); - if(std::isnan(dchi2)||(dchi2<0.0)||(dchi2>m_maxChi2Increase)) - { - fitFailed=true; - break; - } - if(dchi2<m_chi2cut) - { - chi2+=dchi2;ndof+=2; - (*it)->updateVertex(pV); - } - else - { - ATH_MSG_DEBUG("Skipping track "<<(*it)->getIndex()<<"due to large dchi2="<<dchi2 ); - } - } - if(fitFailed) break; - } - for(std::vector<TrigPrimaryVertexTrack*>::iterator it=tracks.begin();it!=tracks.end();++it) - { - delete (*it); - } - - if(!fitFailed && (ndof>0)) - { - ATH_MSG_DEBUG("Primary vertex fit OK, chi2 = "<<chi2<<" NDOF = "<<ndof ); - ATH_MSG_DEBUG("x= "<<pV->getParametersVector()[0]<< - " y= "<<pV->getParametersVector()[1]<<" z= "<<pV->getParametersVector()[2] ); - double cv[6]; - cv[0]=pV->m_Gk[0][0];cv[1]=pV->m_Gk[0][1];cv[2]=pV->m_Gk[1][1]; - cv[3]=pV->m_Gk[0][2];cv[4]=pV->m_Gk[1][2];cv[5]=pV->m_Gk[2][2]; - pVertex = new TrigVertex(pV->getParametersVector()[0], - pV->getParametersVector()[1], - pV->getParametersVector()[2],cv,chi2,ndof,NULL); - } - delete pV; - - if(m_timers) m_timer[0]->stop(); - - return pVertex; -} - -TrigVertex* TrigPrimaryVertexFitter::fit(const TrackCollection* tc, std::vector<double>& Chi2V, double z0) -{ - - TrigVertex* pVertex=NULL; - - double chi2; - int ndof; - - if(m_timers) m_timer[0]->start(); - std::vector<TrigPrimaryVertexTrack*> tracks; tracks.clear(); Chi2V.clear(); @@ -558,33 +293,6 @@ TrigVertex* TrigPrimaryVertexFitter::fit(const TrackCollection* tc, std::vector< } delete pV; - if(m_timers) m_timer[0]->stop(); - return pVertex; } -bool TrigPrimaryVertexFitter::checkTracks(const TrigInDetTrackCollection* tc) -{ - bool rc=true; - - if(tc->size()<2) - { - ATH_MSG_WARNING( "Track set contains less than 2 tracks" ); - return false; - } - for(TrigInDetTrackCollection::const_iterator ptIt=tc->begin();ptIt!=tc->end();++ptIt) - { - const TrigInDetTrackFitPar* p=(*ptIt)->param(); - if(p==NULL) - { - ATH_MSG_WARNING( "TrigInDetTrack has no parameters" ); - rc=false;break; - } - if(p->cov()==NULL) - { - ATH_MSG_WARNING( "TrigInDetTrack covariance is not set" ); - rc=false;break; - } - } - return rc; -} diff --git a/Trigger/TrigTools/TrigVertexFitter/src/TrigPrimaryVertexFitter.h b/Trigger/TrigTools/TrigVertexFitter/src/TrigPrimaryVertexFitter.h index 889547677090298cdd37d5363414b45c6913ebd6..f2fb8ee9a99ebc02f084c090168dcf161a9ae723 100644 --- a/Trigger/TrigTools/TrigVertexFitter/src/TrigPrimaryVertexFitter.h +++ b/Trigger/TrigTools/TrigVertexFitter/src/TrigPrimaryVertexFitter.h @@ -18,13 +18,9 @@ class TrigPrimaryVertexFitter: public AthAlgTool, virtual public ITrigPrimaryVer virtual StatusCode initialize(); virtual StatusCode finalize(); - virtual TrigVertex* fit(const TrigInDetTrackCollection*, double z=0.0); - virtual TrigVertex* fit(const TrigInDetTrackCollection*, std::vector<double>&, double z=0.0); - - virtual TrigVertex* fit(const TrackCollection*, TrackCollection&, double z=0.0); - virtual TrigVertex* fit(const TrackCollection*, std::vector<double>&, double z=0.0); + virtual TrigVertex* fit(const TrackCollection*, TrackCollection&, double z=0.0) const; + virtual TrigVertex* fit(const TrackCollection*, std::vector<double>&, double z=0.0) const; private: - bool checkTracks(const TrigInDetTrackCollection*); int m_numIter; double m_zVariance,m_maxChi2Increase, m_chi2cut, m_chi2cut_loose; bool m_createTrackLists; diff --git a/Trigger/TrigValidation/TrigAnalysisTest/share/ref_RDOtoRDOTrig_mt1_build.ref b/Trigger/TrigValidation/TrigAnalysisTest/share/ref_RDOtoRDOTrig_mt1_build.ref index 4ceb03769136600fd83b4e79e1c9de55a96170fc..14ae6a3342a95da54f9115f65b628ff761ce9f12 100644 --- a/Trigger/TrigValidation/TrigAnalysisTest/share/ref_RDOtoRDOTrig_mt1_build.ref +++ b/Trigger/TrigValidation/TrigAnalysisTest/share/ref_RDOtoRDOTrig_mt1_build.ref @@ -250,41 +250,41 @@ TrigSignatureMoniMT INFO HLT_j45_ftf_L1J15 #8684 TrigSignatureMoniMT INFO -- #868405538 Events 20 20 0 0 0 0 0 0 0 0 0 0 19 - 19 TrigSignatureMoniMT INFO -- #868405538 Features 0 0 0 0 0 0 0 0 0 0 50 - TrigSignatureMoniMT INFO HLT_j45_ftf_csskpf_nojcalib_L1J20 #3533281867 -TrigSignatureMoniMT INFO -- #3533281867 Events 19 19 0 0 0 0 0 0 0 0 0 0 15 - 15 -TrigSignatureMoniMT INFO -- #3533281867 Features 0 0 0 0 0 0 0 0 0 0 25 - +TrigSignatureMoniMT INFO -- #3533281867 Events 19 19 0 0 0 0 0 0 0 0 0 0 16 - 16 +TrigSignatureMoniMT INFO -- #3533281867 Features 0 0 0 0 0 0 0 0 0 0 30 - TrigSignatureMoniMT INFO HLT_j45_ftf_pf_L1J20 #1335156103 -TrigSignatureMoniMT INFO -- #1335156103 Events 19 19 0 0 0 0 0 0 0 0 0 0 16 - 16 -TrigSignatureMoniMT INFO -- #1335156103 Features 0 0 0 0 0 0 0 0 0 0 31 - +TrigSignatureMoniMT INFO -- #1335156103 Events 19 19 0 0 0 0 0 0 0 0 0 0 18 - 18 +TrigSignatureMoniMT INFO -- #1335156103 Features 0 0 0 0 0 0 0 0 0 0 39 - TrigSignatureMoniMT INFO HLT_j45_ftf_pf_nojcalib_L1J20 #3658890913 -TrigSignatureMoniMT INFO -- #3658890913 Events 19 19 0 0 0 0 0 0 0 0 0 0 15 - 15 -TrigSignatureMoniMT INFO -- #3658890913 Features 0 0 0 0 0 0 0 0 0 0 29 - +TrigSignatureMoniMT INFO -- #3658890913 Events 19 19 0 0 0 0 0 0 0 0 0 0 17 - 17 +TrigSignatureMoniMT INFO -- #3658890913 Features 0 0 0 0 0 0 0 0 0 0 37 - TrigSignatureMoniMT INFO HLT_j45_ftf_subjesgscIS_011jvt_L1J15 #2857031468 -TrigSignatureMoniMT INFO -- #2857031468 Events 20 20 0 0 0 0 0 0 0 0 0 0 12 - 12 -TrigSignatureMoniMT INFO -- #2857031468 Features 0 0 0 0 0 0 0 0 0 0 20 - +TrigSignatureMoniMT INFO -- #2857031468 Events 20 20 0 0 0 0 0 0 0 0 0 0 16 - 16 +TrigSignatureMoniMT INFO -- #2857031468 Features 0 0 0 0 0 0 0 0 0 0 33 - TrigSignatureMoniMT INFO HLT_j45_ftf_subjesgscIS_015jvt_L1J15 #2938374624 -TrigSignatureMoniMT INFO -- #2938374624 Events 20 20 0 0 0 0 0 0 0 0 0 0 12 - 12 -TrigSignatureMoniMT INFO -- #2938374624 Features 0 0 0 0 0 0 0 0 0 0 19 - +TrigSignatureMoniMT INFO -- #2938374624 Events 20 20 0 0 0 0 0 0 0 0 0 0 16 - 16 +TrigSignatureMoniMT INFO -- #2938374624 Features 0 0 0 0 0 0 0 0 0 0 33 - TrigSignatureMoniMT INFO HLT_j45_ftf_subjesgscIS_059jvt_L1J15 #1593009344 -TrigSignatureMoniMT INFO -- #1593009344 Events 20 20 0 0 0 0 0 0 0 0 0 0 12 - 12 -TrigSignatureMoniMT INFO -- #1593009344 Features 0 0 0 0 0 0 0 0 0 0 19 - +TrigSignatureMoniMT INFO -- #1593009344 Events 20 20 0 0 0 0 0 0 0 0 0 0 16 - 16 +TrigSignatureMoniMT INFO -- #1593009344 Features 0 0 0 0 0 0 0 0 0 0 33 - TrigSignatureMoniMT INFO HLT_j45_ftf_subjesgscIS_L1J15 #3341539267 TrigSignatureMoniMT INFO -- #3341539267 Events 20 20 0 0 0 0 0 0 0 0 0 0 19 - 19 -TrigSignatureMoniMT INFO -- #3341539267 Features 0 0 0 0 0 0 0 0 0 0 51 - +TrigSignatureMoniMT INFO -- #3341539267 Features 0 0 0 0 0 0 0 0 0 0 50 - TrigSignatureMoniMT INFO HLT_j45_ftf_subjesgscIS_bmv2c1070_split_L1J20 #991419339 -TrigSignatureMoniMT INFO -- #991419339 Events 19 19 0 0 0 0 0 0 0 0 0 0 19 4 4 -TrigSignatureMoniMT INFO -- #991419339 Features 0 0 0 0 0 0 0 0 0 0 50 8 +TrigSignatureMoniMT INFO -- #991419339 Events 19 19 0 0 0 0 0 0 0 0 0 0 19 11 11 +TrigSignatureMoniMT INFO -- #991419339 Features 0 0 0 0 0 0 0 0 0 0 49 21 TrigSignatureMoniMT INFO HLT_j45_ftf_subjesgscIS_boffperf_split_L1J20 #1961149049 TrigSignatureMoniMT INFO -- #1961149049 Events 19 19 0 0 0 0 0 0 0 0 0 0 19 19 19 -TrigSignatureMoniMT INFO -- #1961149049 Features 0 0 0 0 0 0 0 0 0 0 50 50 +TrigSignatureMoniMT INFO -- #1961149049 Features 0 0 0 0 0 0 0 0 0 0 49 49 TrigSignatureMoniMT INFO HLT_j45_ftf_subjesgscIS_pf_L1J20 #761060030 -TrigSignatureMoniMT INFO -- #761060030 Events 19 19 0 0 0 0 0 0 0 0 0 0 16 - 16 -TrigSignatureMoniMT INFO -- #761060030 Features 0 0 0 0 0 0 0 0 0 0 31 - +TrigSignatureMoniMT INFO -- #761060030 Events 19 19 0 0 0 0 0 0 0 0 0 0 18 - 18 +TrigSignatureMoniMT INFO -- #761060030 Features 0 0 0 0 0 0 0 0 0 0 39 - TrigSignatureMoniMT INFO HLT_j45_ftf_subresjesgscIS_L1J15 #1509925407 -TrigSignatureMoniMT INFO -- #1509925407 Events 20 20 0 0 0 0 0 0 0 0 0 0 18 - 18 -TrigSignatureMoniMT INFO -- #1509925407 Features 0 0 0 0 0 0 0 0 0 0 44 - +TrigSignatureMoniMT INFO -- #1509925407 Events 20 20 0 0 0 0 0 0 0 0 0 0 19 - 19 +TrigSignatureMoniMT INFO -- #1509925407 Features 0 0 0 0 0 0 0 0 0 0 45 - TrigSignatureMoniMT INFO HLT_j45_ftf_subresjesgscIS_pf_L1J20 #4012311417 -TrigSignatureMoniMT INFO -- #4012311417 Events 19 19 0 0 0 0 0 0 0 0 0 0 16 - 16 -TrigSignatureMoniMT INFO -- #4012311417 Features 0 0 0 0 0 0 0 0 0 0 31 - +TrigSignatureMoniMT INFO -- #4012311417 Events 19 19 0 0 0 0 0 0 0 0 0 0 18 - 18 +TrigSignatureMoniMT INFO -- #4012311417 Features 0 0 0 0 0 0 0 0 0 0 39 - TrigSignatureMoniMT INFO HLT_j45_nojcalib_L1J20 #2042444294 TrigSignatureMoniMT INFO -- #2042444294 Events 19 19 0 0 0 0 0 0 0 0 0 0 17 - 17 TrigSignatureMoniMT INFO -- #2042444294 Features 0 0 0 0 0 0 0 0 0 0 39 - @@ -325,8 +325,8 @@ TrigSignatureMoniMT INFO HLT_j85_ftf_L1J20 #8770 TrigSignatureMoniMT INFO -- #877042532 Events 19 19 0 0 0 0 0 0 0 0 0 0 13 - 13 TrigSignatureMoniMT INFO -- #877042532 Features 0 0 0 0 0 0 0 0 0 0 21 - TrigSignatureMoniMT INFO HLT_j85_ftf_pf_L1J20 #1538535401 -TrigSignatureMoniMT INFO -- #1538535401 Events 19 19 0 0 0 0 0 0 0 0 0 0 8 - 8 -TrigSignatureMoniMT INFO -- #1538535401 Features 0 0 0 0 0 0 0 0 0 0 13 - +TrigSignatureMoniMT INFO -- #1538535401 Events 19 19 0 0 0 0 0 0 0 0 0 0 11 - 11 +TrigSignatureMoniMT INFO -- #1538535401 Features 0 0 0 0 0 0 0 0 0 0 16 - TrigSignatureMoniMT INFO HLT_mb_sptrk_L1RD0_FILLED #4097312640 TrigSignatureMoniMT INFO -- #4097312640 Events 20 20 20 20 - - - - - - - - - - 20 TrigSignatureMoniMT INFO -- #4097312640 Features 20 20 - - - - - - - - - - @@ -724,14 +724,14 @@ TrigSignatureMoniMT INFO HLT_xe100_mht_L1XE50 #5 TrigSignatureMoniMT INFO -- #532175988 Events 10 10 0 0 0 0 0 0 0 0 0 0 6 - 6 TrigSignatureMoniMT INFO -- #532175988 Features 0 0 0 0 0 0 0 0 0 0 6 - TrigSignatureMoniMT INFO HLT_xe100_pfsum_L1XE50 #1890237897 -TrigSignatureMoniMT INFO -- #1890237897 Events 10 10 0 0 0 0 0 0 0 0 0 0 2 - 2 -TrigSignatureMoniMT INFO -- #1890237897 Features 0 0 0 0 0 0 0 0 0 0 2 - +TrigSignatureMoniMT INFO -- #1890237897 Events 10 10 0 0 0 0 0 0 0 0 0 0 4 - 4 +TrigSignatureMoniMT INFO -- #1890237897 Features 0 0 0 0 0 0 0 0 0 0 4 - TrigSignatureMoniMT INFO HLT_xe100_tcpufit_L1XE50 #2803198799 TrigSignatureMoniMT INFO -- #2803198799 Events 10 10 0 0 0 0 0 0 0 0 0 0 6 - 6 TrigSignatureMoniMT INFO -- #2803198799 Features 0 0 0 0 0 0 0 0 0 0 6 - TrigSignatureMoniMT INFO HLT_xe100_trkmht_L1XE50 #1055916731 -TrigSignatureMoniMT INFO -- #1055916731 Events 10 10 0 0 0 0 0 0 0 0 0 0 4 - 4 -TrigSignatureMoniMT INFO -- #1055916731 Features 0 0 0 0 0 0 0 0 0 0 4 - +TrigSignatureMoniMT INFO -- #1055916731 Events 10 10 0 0 0 0 0 0 0 0 0 0 7 - 7 +TrigSignatureMoniMT INFO -- #1055916731 Features 0 0 0 0 0 0 0 0 0 0 7 - TrigSignatureMoniMT INFO HLT_xe110_mht_L1XE50 #3030733259 TrigSignatureMoniMT INFO -- #3030733259 Events 10 10 0 0 0 0 0 0 0 0 0 0 6 - 6 TrigSignatureMoniMT INFO -- #3030733259 Features 0 0 0 0 0 0 0 0 0 0 6 - @@ -751,8 +751,8 @@ TrigSignatureMoniMT INFO HLT_xe30_mht_L1XE10 #36 TrigSignatureMoniMT INFO -- #3626903018 Events 19 19 0 0 0 0 0 0 0 0 0 0 19 - 19 TrigSignatureMoniMT INFO -- #3626903018 Features 0 0 0 0 0 0 0 0 0 0 19 - TrigSignatureMoniMT INFO HLT_xe30_pfsum_L1XE10 #998713382 -TrigSignatureMoniMT INFO -- #998713382 Events 19 19 0 0 0 0 0 0 0 0 0 0 14 - 14 -TrigSignatureMoniMT INFO -- #998713382 Features 0 0 0 0 0 0 0 0 0 0 14 - +TrigSignatureMoniMT INFO -- #998713382 Events 19 19 0 0 0 0 0 0 0 0 0 0 16 - 16 +TrigSignatureMoniMT INFO -- #998713382 Features 0 0 0 0 0 0 0 0 0 0 16 - TrigSignatureMoniMT INFO HLT_xe30_tcpufit_L1XE10 #1583719916 TrigSignatureMoniMT INFO -- #1583719916 Events 19 19 0 0 0 0 0 0 0 0 0 0 14 - 14 TrigSignatureMoniMT INFO -- #1583719916 Features 0 0 0 0 0 0 0 0 0 0 14 - diff --git a/Trigger/TrigValidation/TrigInDetValidation/python/TrigInDetArtSteps.py b/Trigger/TrigValidation/TrigInDetValidation/python/TrigInDetArtSteps.py index ca007442f22cb7a44199a2d12a8f4b6188882598..4de9eb21354d6619e694f43608026e1df85d0919 100644 --- a/Trigger/TrigValidation/TrigInDetValidation/python/TrigInDetArtSteps.py +++ b/Trigger/TrigValidation/TrigInDetValidation/python/TrigInDetArtSteps.py @@ -9,12 +9,79 @@ The main common check steps are defined in the TrigValSteering.CheckSteps module import os +from TrigValTools.TrigValSteering.ExecStep import ExecStep from TrigAnalysisTest.TrigAnalysisSteps import AthenaCheckerStep from TrigValTools.TrigValSteering.Step import Step from TrigValTools.TrigValSteering.CheckSteps import RefComparisonStep ################################################## -# Additional exec (athena) steps +# Exec (athena) steps for Reco_tf +################################################## + +class TrigInDetReco(ExecStep): + def __init__(self, name='TrigInDetReco'): + ExecStep.__init__(self, name) +## super(TrigInDetReco, self).__init__(name) + self.type = 'Reco_tf' + self.max_events=-1 + self.required = True + self.threads = 1 # TODO: change to 4 + self.concurrent_events = 1 # TODO: change to 4 + self.perfmon = False + self.timeout = 18*3600 + self.slices = [] + self.preexec_trig = ' ' + self.preexec_reco = ';'.join([ + 'from RecExConfig.RecFlags import rec', + 'rec.doForwardDet=False', + 'rec.doEgamma=False', + 'rec.doMuonCombined=False', + 'rec.doJetMissingETTag=False', + 'rec.doTau=False' + ]) + self.preexec_aod = ';'.join([ + self.preexec_reco, + '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)' + ]) + self.preexec_all = ';'.join([ + 'from TriggerJobOpts.TriggerFlags import TriggerFlags', + 'TriggerFlags.AODEDMSet.set_Value_and_Lock(\\\"AODFULL\\\")', + ]) + self.args = '--outputAODFile=AOD.pool.root --steering="doRDO_TRIG" ' + + + def configure(self, test): + chains = '[' + flags = '' + for i in self.slices: + if (i=='muon') : + chains += "'HLT_mu6_idperf_L1MU6'," + chains += "'HLT_mu24_idperf_L1MU20'," + flags += 'doMuonSlice=True;' + if (i=='electron') : + chains += "'HLT_e5_etcut_L1EM3'," ## need an idperf chain once one is in the menu + flags += 'doEgammaSlice=True;' + if (i=='tau') : + chains += "'HLT_tau25_idperf_tracktwo_L1TAU12IM'," + flags += 'doTauSlice=True;' + if (i=='bjet') : + chains += "'HLT_j45_ftf_subjesgscIS_boffperf_split_L1J20'," + flags += 'doBjetSlice=true;' + + chains += ']' + self.preexec_trig = 'doEmptyMenu=True;'+flags+'selectChains='+chains + + self.args += ' --preExec "RDOtoRDOTrigger:{:s};" "all:{:s};" "RAWtoESD:{:s};" "ESDtoAOD:{:s};"'.format( + self.preexec_trig, self.preexec_all, self.preexec_reco, self.preexec_aod) + super(TrigInDetReco, self).configure(test) + + +################################################## +# Additional exec (athena) steps - AOD to TrkNtuple ################################################## class TrigInDetAna(AthenaCheckerStep): diff --git a/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_all_ttbar_pu80.py b/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_all_ttbar_pu80.py index 3745db15c4ee8dc671b62cbc13a2f4d010386961..9ad0519a0374370a348ad9eb75f99484ede60fca 100755 --- a/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_all_ttbar_pu80.py +++ b/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_all_ttbar_pu80.py @@ -24,8 +24,8 @@ # art-output: *.dat -from TrigValTools.TrigValSteering import Test, ExecStep, CheckSteps -from TrigInDetValidation.TrigInDetArtSteps import TrigInDetAna, TrigInDetdictStep, TrigInDetCompStep, TrigInDetCpuCostStep +from TrigValTools.TrigValSteering import Test, CheckSteps +from TrigInDetValidation.TrigInDetArtSteps import TrigInDetReco, TrigInDetAna, TrigInDetdictStep, TrigInDetCompStep, TrigInDetCpuCostStep import sys,getopt @@ -51,61 +51,15 @@ for opt,arg in opts: postproc=True -chains = [ - 'HLT_mu6_idperf_L1MU6', - 'HLT_mu24_idperf_L1MU20', - 'HLT_e5_etcut_L1EM3', ## need an idperf chain once one is in the menu - 'HLT_tau25_idperf_tracktwo_L1TAU12IM', - 'HLT_j45_ftf_subjesgscIS_boffperf_split_L1J20' -] - -preexec_trig = ';'.join([ - 'doEmptyMenu=True', - 'doMuonSlice=True', - 'doEgammaSlice=True', - 'doTauSlice=True', - 'doBjetSlice=True', - 'selectChains='+str(chains) -]) - - -preexec_reco = ';'.join([ - 'from RecExConfig.RecFlags import rec', - 'rec.doForwardDet=False', - 'rec.doEgamma=False', - 'rec.doMuonCombined=False', - 'rec.doJetMissingETTag=False', - 'rec.doTau=False' -]) - -preexec_aod = ';'.join([ - preexec_reco, - '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)' -]) - - - -preexec_all = ';'.join([ - 'from TriggerJobOpts.TriggerFlags import TriggerFlags', - 'TriggerFlags.AODEDMSet.set_Value_and_Lock(\\\"AODFULL\\\")', -]) - -rdo2aod = ExecStep.ExecStep() -rdo2aod.type = 'Reco_tf' -rdo2aod.max_events = 1000 # TODO: 2000 events +rdo2aod = TrigInDetReco() +rdo2aod.slices = ['muon','electron','tau','bjet'] +rdo2aod.max_events = 2000 rdo2aod.threads = 1 # TODO: change to 4 rdo2aod.concurrent_events = 1 # TODO: change to 4 rdo2aod.perfmon = False rdo2aod.timeout = 18*3600 -rdo2aod.args = '--outputAODFile=AOD.pool.root --steering="doRDO_TRIG" ' rdo2aod.input = 'ttbar_pu80' -rdo2aod.args += ' --preExec "RDOtoRDOTrigger:{:s};" "all:{:s};" "RAWtoESD:{:s};" "ESDtoAOD:{:s};"'.format( - preexec_trig, preexec_all, preexec_reco, preexec_aod) test = Test.Test() test.art_type = 'grid' diff --git a/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_all_ttbar_pu80_mt.py b/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_all_ttbar_pu80_mt.py index dbf9b1d6b19b22dd1f42e101f016bdcb4d721c1c..b67f68f0561fb368cb66a5a8b28569011fa52e0f 100755 --- a/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_all_ttbar_pu80_mt.py +++ b/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_all_ttbar_pu80_mt.py @@ -26,8 +26,8 @@ # art-output: *.dat -from TrigValTools.TrigValSteering import Test, ExecStep, CheckSteps -from TrigInDetValidation.TrigInDetArtSteps import TrigInDetAna, TrigInDetdictStep, TrigInDetCompStep, TrigInDetCpuCostStep +from TrigValTools.TrigValSteering import Test, CheckSteps +from TrigInDetValidation.TrigInDetArtSteps import TrigInDetReco, TrigInDetAna, TrigInDetdictStep, TrigInDetCompStep, TrigInDetCpuCostStep import sys,getopt @@ -45,60 +45,16 @@ for opt,arg in opts: -chains = [ - 'HLT_mu6_idperf_L1MU6', - 'HLT_mu24_idperf_L1MU20', - 'HLT_e5_etcut_L1EM3', ## need an idperf chain once one is in the menu - 'HLT_tau25_idperf_tracktwo_L1TAU12IM', - 'HLT_j45_ftf_subjesgscIS_boffperf_split_L1J20' -] - -preexec_trig = ';'.join([ - 'doEmptyMenu=True', - 'doMuonSlice=True', - 'doEgammaSlice=True', - 'doTauSlice=True', - 'doBjetSlice=True', - 'selectChains='+str(chains) -]) - - -preexec_reco = ';'.join([ - 'from RecExConfig.RecFlags import rec', - 'rec.doForwardDet=False', - 'rec.doEgamma=False', - 'rec.doMuonCombined=False', - 'rec.doJetMissingETTag=False', - 'rec.doTau=False' -]) - -preexec_aod = ';'.join([ - preexec_reco, - '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)' -]) - - - -preexec_all = ';'.join([ - 'from TriggerJobOpts.TriggerFlags import TriggerFlags', - 'TriggerFlags.AODEDMSet.set_Value_and_Lock(\\\"AODFULL\\\")', -]) - -rdo2aod = ExecStep.ExecStep() -rdo2aod.type = 'Reco_tf' + +rdo2aod = TrigInDetReco() +rdo2aod.slices = ['muon','electron','tau','bjet'] rdo2aod.max_events = 1000 # TODO: 2000 events rdo2aod.threads = 1 # TODO: change to 4 rdo2aod.concurrent_events = 4 rdo2aod.perfmon = False -rdo2aod.args = '--outputAODFile=AOD.pool.root --steering="doRDO_TRIG" ' -rdo2aod.input = 'ttbar_pu80' ## This isn't the same sample as the grid test but for not lets use it. +rdo2aod.timeout = 18*3600 +rdo2aod.input = 'ttbar_pu80' -rdo2aod.args += ' --preExec "RDOtoRDOTrigger:{:s};" "all:{:s};" "RAWtoESD:{:s};" "ESDtoAOD:{:s};"'.format( - preexec_trig, preexec_all, preexec_reco, preexec_aod) test = Test.Test() test.art_type = 'grid' diff --git a/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_bjet_pu40.py b/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_bjet_pu40.py index f7dfc28ec536dae2ca32de47755857892a46b7f4..242cc7286c548101b74a1fee679b8d4354347c13 100755 --- a/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_bjet_pu40.py +++ b/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_bjet_pu40.py @@ -24,8 +24,8 @@ # art-output: *.dat -from TrigValTools.TrigValSteering import Test, ExecStep, CheckSteps -from TrigInDetValidation.TrigInDetArtSteps import TrigInDetAna, TrigInDetdictStep, TrigInDetCompStep, TrigInDetCpuCostStep +from TrigValTools.TrigValSteering import Test, CheckSteps +from TrigInDetValidation.TrigInDetArtSteps import TrigInDetReco, TrigInDetAna, TrigInDetdictStep, TrigInDetCompStep, TrigInDetCpuCostStep import sys,getopt @@ -51,54 +51,16 @@ for opt,arg in opts: postproc=True -chains = [ - 'HLT_j45_ftf_subjesgscIS_boffperf_split_L1J20' -] -preexec_trig = ';'.join([ - 'doEmptyMenu=True', - 'doBjetSlice=True', - 'selectChains='+str(chains) -]) - - -preexec_reco = ';'.join([ - 'from RecExConfig.RecFlags import rec', - 'rec.doForwardDet=False', - 'rec.doEgamma=False', - 'rec.doMuonCombined=False', - 'rec.doJetMissingETTag=False', - 'rec.doTau=False' -]) - -preexec_aod = ';'.join([ - preexec_reco, - '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)' -]) - - - -preexec_all = ';'.join([ - 'from TriggerJobOpts.TriggerFlags import TriggerFlags', - 'TriggerFlags.AODEDMSet.set_Value_and_Lock(\\\"AODFULL\\\")', -]) - -rdo2aod = ExecStep.ExecStep() -rdo2aod.type = 'Reco_tf' -rdo2aod.max_events = 1000 # TODO: 2000 events -rdo2aod.threads = 1 # TODO: change to 4 -rdo2aod.concurrent_events = 1 # TODO: change to 4 +rdo2aod = TrigInDetReco() +rdo2aod.slices = ['bjet'] +rdo2aod.max_events = 2000 +rdo2aod.threads = 1 +rdo2aod.concurrent_events = 1 rdo2aod.perfmon = False rdo2aod.timeout = 18*3600 -rdo2aod.args = '--outputAODFile=AOD.pool.root --steering="doRDO_TRIG" ' rdo2aod.input = 'ttbar' -rdo2aod.args += ' --preExec "RDOtoRDOTrigger:{:s};" "all:{:s};" "RAWtoESD:{:s};" "ESDtoAOD:{:s};"'.format( - preexec_trig, preexec_all, preexec_reco, preexec_aod) test = Test.Test() test.art_type = 'grid' diff --git a/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_bjet_test_pu40.py b/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_bjet_test_pu40.py deleted file mode 100755 index fa70d6ec4291a7f638eec5e4e5199172044c7ebb..0000000000000000000000000000000000000000 --- a/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_bjet_test_pu40.py +++ /dev/null @@ -1,136 +0,0 @@ -#!/usr/bin/env python - -# art-description: art job for all_ttbar_pu80_grid -# art-type: grid -# art-include: master/Athena -# art-input-nfiles: 3 -# art-athena-mt: 4 -# art-output: *.txt -# art-output: *.log -# art-output: log.* -# art-output: *.out -# art-output: *.err -# art-output: *.log.tar.gz -# art-output: *.new -# art-output: *.json -# art-output: *.root -# art-output: *.check* -# art-output: HLT* -# art-output: times* -# art-output: cost-perCall -# art-output: cost-perEvent -# art-output: cost-perCall-chain -# art-output: cost-perEvent-chain -# art-output: *.dat - - -from TrigValTools.TrigValSteering import Test, ExecStep, CheckSteps -from TrigInDetValidation.TrigInDetArtSteps import TrigInDetAna, TrigInDetdictStep, TrigInDetCompStep, TrigInDetCpuCostStep - - -import sys,getopt - -try: - opts, args = getopt.getopt(sys.argv[1:],"lxp",["local"]) -except getopt.GetoptError: - print("Usage: ") - print("-l(--local) run locally with input file from art eos grid-input") - print("-x don't run athena or post post-processing, only plotting") - print("-p run post-processing, even if -x is set") - - -local=False -exclude=False -postproc=False -for opt,arg in opts: - if opt in ("-l", "--local"): - local=True - if opt=="-x": - exclude=True - if opt=="-p": - postproc=True - - -chains = [ - 'HLT_j45_ftf_subjesgscIS_boffperf_split_L1J20' -] - -preexec_trig = ';'.join([ - 'doEmptyMenu=True', - 'doBjetSlice=True', - 'selectChains='+str(chains), - 'from TrigBjetHypo.TrigSuperRoiBuilderAllTEConfig import getSuperRoiBuilderAllTEInstance as super; super.EtaHalfWidth = 0.2; super.PhiHalfWidth = 0.2' -]) - - -preexec_reco = ';'.join([ - 'from RecExConfig.RecFlags import rec', - 'rec.doForwardDet=False', - 'rec.doEgamma=False', - 'rec.doMuonCombined=False', - 'rec.doJetMissingETTag=False', - 'rec.doTau=False' -]) - -preexec_aod = ';'.join([ - preexec_reco, - '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)' -]) - - - -preexec_all = ';'.join([ - 'from TriggerJobOpts.TriggerFlags import TriggerFlags', - 'TriggerFlags.AODEDMSet.set_Value_and_Lock(\\\"AODFULL\\\")', -]) - -rdo2aod = ExecStep.ExecStep() -rdo2aod.type = 'Reco_tf' -rdo2aod.max_events = 1000 # TODO: 2000 events -rdo2aod.threads = 1 # TODO: change to 4 -rdo2aod.concurrent_events = 1 # TODO: change to 4 -rdo2aod.perfmon = False -rdo2aod.timeout = 18*3600 -rdo2aod.args = '--outputAODFile=AOD.pool.root --steering="doRDO_TRIG" ' -rdo2aod.input = 'ttbar' - -rdo2aod.args += ' --preExec "RDOtoRDOTrigger:{:s};" "all:{:s};" "RAWtoESD:{:s};" "ESDtoAOD:{:s};"'.format( - preexec_trig, preexec_all, preexec_reco, preexec_aod) - -test = Test.Test() -test.art_type = 'grid' -if (not exclude): - test.exec_steps = [rdo2aod] - test.exec_steps.append(TrigInDetAna()) # Run analysis to produce TrkNtuple - test.check_steps = CheckSteps.default_check_steps(test) - -# Run Tidardict -if ((not exclude) or postproc ): - rdict = TrigInDetdictStep() - rdict.args='TIDAdata-run3.dat -f data-hists.root -b Test_bin.dat ' - test.check_steps.append(rdict) - - -# Now the comparitor steps -comp1=TrigInDetCompStep('CompareStep1') -comp1.chains='HLT_j45_ftf_subjesgscIS_boffperf_split_L1J20:HLT_IDTrack_Bjet_FTF HLT_j45_ftf_subjesgscIS_boffperf_split_L1J20:HLT_IDTrack_Bjet_IDTrig' -comp1.output_dir = 'HLTEF-plots-bjet' -test.check_steps.append(comp1) - - - -cpucost=TrigInDetCpuCostStep('CpuCostStep1') -test.check_steps.append(cpucost) - -cpucost2=TrigInDetCpuCostStep('CpuCostStep2') -cpucost2.args += ' -p FastTrack' -cpucost2.output_dir = 'times-FTF' -test.check_steps.append(cpucost2) - - -import sys -sys.exit(test.run()) diff --git a/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_mu_zmumu_pu40.py b/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_mu_zmumu_pu40.py index 0ca7281291a1187ffb173beca3ef6d00bc823223..7edca3a8bc43bd1748f4830df01720e3ac1e7028 100755 --- a/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_mu_zmumu_pu40.py +++ b/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_mu_zmumu_pu40.py @@ -25,8 +25,8 @@ # art-output: *.dat -from TrigValTools.TrigValSteering import Test, ExecStep, CheckSteps -from TrigInDetValidation.TrigInDetArtSteps import TrigInDetAna, TrigInDetdictStep, TrigInDetCompStep, TrigInDetCpuCostStep +from TrigValTools.TrigValSteering import Test, CheckSteps +from TrigInDetValidation.TrigInDetArtSteps import TrigInDetReco, TrigInDetAna, TrigInDetdictStep, TrigInDetCompStep, TrigInDetCpuCostStep import sys,getopt @@ -51,60 +51,19 @@ for opt,arg in opts: postproc=True - - -chains = [ - 'HLT_mu6_idperf_L1MU6', - 'HLT_mu24_idperf_L1MU20' -] - -preexec_trig = ';'.join([ - 'doEmptyMenu=True', - 'doMuonSlice=True', - 'selectChains='+str(chains) -]) - - -preexec_reco = ';'.join([ - 'from RecExConfig.RecFlags import rec', - 'rec.doForwardDet=False', - 'rec.doEgamma=False', - 'rec.doMuonCombined=False', - 'rec.doJetMissingETTag=False', - 'rec.doTau=False' -]) - -preexec_aod = ';'.join([ - preexec_reco, - '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)' -]) - - - -preexec_all = ';'.join([ - 'from TriggerJobOpts.TriggerFlags import TriggerFlags', - 'TriggerFlags.AODEDMSet.set_Value_and_Lock(\\\"AODFULL\\\")', -]) - -rdo2aod = ExecStep.ExecStep() -rdo2aod.type = 'Reco_tf' +rdo2aod = TrigInDetReco() +rdo2aod.slices = ['muon'] rdo2aod.max_events = 2000 # TODO: 2000 events rdo2aod.threads = 1 # TODO: change to 4 rdo2aod.concurrent_events = 1 # TODO: change to 4 rdo2aod.perfmon = False -rdo2aod.args = '--outputAODFile=AOD.pool.root --steering="doRDO_TRIG" ' +rdo2aod.timeout = 18*3600 if local: rdo2aod.input = 'Zmumu_pu40' else: rdo2aod.input = '' rdo2aod.args += '--inputRDOFile=$ArtInFile ' -rdo2aod.args += ' --preExec "RDOtoRDOTrigger:{:s};" "all:{:s};" "RAWtoESD:{:s};" "ESDtoAOD:{:s};"'.format( - preexec_trig, preexec_all, preexec_reco, preexec_aod) test = Test.Test() test.art_type = 'grid' diff --git a/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_mu_zmumu_pu40_build.py b/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_mu_zmumu_pu40_build.py index 04186e37888ff54d0de8cc233c8a4c2e6ae9d86f..7b125971874dbaf40fc9daae3d7c4099b8cb9de6 100755 --- a/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_mu_zmumu_pu40_build.py +++ b/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_mu_zmumu_pu40_build.py @@ -23,53 +23,17 @@ for opt,arg in opts: postproc=True -from TrigValTools.TrigValSteering import Test, ExecStep, CheckSteps -from TrigInDetValidation.TrigInDetArtSteps import TrigInDetAna, TrigInDetdictStep, TrigInDetCompStep, TrigInDetCpuCostStep +from TrigValTools.TrigValSteering import Test, CheckSteps +from TrigInDetValidation.TrigInDetArtSteps import TrigInDetReco, TrigInDetAna, TrigInDetdictStep, TrigInDetCompStep, TrigInDetCpuCostStep -chains = [ - 'HLT_mu6_idperf_L1MU6', - 'HLT_mu24_idperf_L1MU20' -] - -preexec_trig = ';'.join([ - 'doEmptyMenu=True', - 'doMuonSlice=True', - 'selectChains='+str(chains) -]) - -preexec_reco = ';'.join([ - 'from RecExConfig.RecFlags import rec', - 'rec.doForwardDet=False', - 'rec.doEgamma=False', - 'rec.doMuonCombined=False', - 'rec.doJetMissingETTag=False', - 'rec.doTau=False' -]) - -preexec_aod = ';'.join([ - preexec_reco, - '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)' -]) - -preexec_all = ';'.join([ - 'from TriggerJobOpts.TriggerFlags import TriggerFlags', - 'TriggerFlags.AODEDMSet.set_Value_and_Lock(\\\"AODFULL\\\")', -]) - -rdo2aod = ExecStep.ExecStep() -rdo2aod.type = 'Reco_tf' -rdo2aod.input = 'Zmumu_pu40' -rdo2aod.max_events = 10 # TODO: 2000 events +rdo2aod = TrigInDetReco() +rdo2aod.slices = ['muon'] +rdo2aod.max_events = 2000 # TODO: 2000 events rdo2aod.threads = 1 # TODO: change to 4 rdo2aod.concurrent_events = 1 # TODO: change to 4 rdo2aod.perfmon = False -rdo2aod.args = '--outputAODFile=AOD.pool.root --steering="doRDO_TRIG"' -rdo2aod.args += ' --preExec "RDOtoRDOTrigger:{:s};" "all:{:s};" "RAWtoESD:{:s};" "ESDtoAOD:{:s};"'.format( - preexec_trig, preexec_all, preexec_reco, preexec_aod) +rdo2aod.input = 'Zmumu_pu40' + test = Test.Test() test.art_type = 'build' diff --git a/Trigger/TrigValidation/TrigValTools/bin/trigvalsteering-unit-tester.py b/Trigger/TrigValidation/TrigValTools/bin/trigvalsteering-unit-tester.py index 6e49a502e02594cdaa3799db56ce91a53c2c3a53..aefe7bd74d275c3fc32687751bc2122c145c2ba5 100755 --- a/Trigger/TrigValidation/TrigValTools/bin/trigvalsteering-unit-tester.py +++ b/Trigger/TrigValidation/TrigValTools/bin/trigvalsteering-unit-tester.py @@ -52,18 +52,28 @@ def main(): log_file = '{:s}.unitTest.log'.format(test) cmd += ' >{:s} 2>&1'.format(log_file) ret_code = subprocess.call(cmd, shell=True) + failed = False status_str = 'OK' if ret_code != 0: + failed = True status_str = 'FAILED WITH CODE {:d}'.format(ret_code) errors = grep_errors(log_file) if len(errors) > 0: + failed = True status_str = 'ERROR IN LOG {:s}:'.format(log_file) + log.info('---- %s ---- %s', test, status_str) - if status_str != 'OK': + if failed: n_failed += 1 - log.info('---- %s ---- %s', test, status_str) - for msg in errors: - print(msg) + if len(errors) > 0: + for msg in errors: + print(msg) + else: + log.error('Test failed but no ERROR messages found, printing full log below') + with open(log_file) as f: + for msg in f: + print(msg) + return n_failed diff --git a/Trigger/TrigValidation/TrigValTools/python/TrigValSteering/CheckSteps.py b/Trigger/TrigValidation/TrigValTools/python/TrigValSteering/CheckSteps.py index 62710f0657c12fb0901c6b6d5acbf7230dcb1aeb..460afdbca8cae9b36fe2691ef2f4ec9ef96d9f6f 100644 --- a/Trigger/TrigValidation/TrigValTools/python/TrigValSteering/CheckSteps.py +++ b/Trigger/TrigValidation/TrigValTools/python/TrigValSteering/CheckSteps.py @@ -6,7 +6,6 @@ Definitions of post-exec check steps in Trigger ART tests ''' -import sys import os import re import subprocess @@ -23,10 +22,17 @@ class RefComparisonStep(Step): def __init__(self, name): super(RefComparisonStep, self).__init__(name) self.reference = None + self.ref_test_name = None self.input_file = None self.explicit_reference = False # True if reference doesn't exist at configuration time def configure(self, test): + if self.reference and self.ref_test_name: + self.misconfig_abort('Both options "reference" and "ref_test_name" used. Use at most one of them.') + + if not self.ref_test_name: + self.ref_test_name = test.name + if self.reference is not None: # Do nothing if the reference will be produced later if self.explicit_reference: @@ -47,10 +53,7 @@ class RefComparisonStep(Step): return super(RefComparisonStep, self).configure(test) if self.input_file is None: - self.log.error('Cannot configure %s because input_file not specified', - self.name) - self.report_result(1, 'TestConfig') - sys.exit(1) + self.misconfig_abort('input_file not specified') branch = os.environ.get('AtlasBuildBranch') # Available after asetup if branch is None: @@ -61,7 +64,7 @@ class RefComparisonStep(Step): branch = 'UNKNOWN_BRANCH' sub_path = '{}/ref/{}/test_{}/'.format( - test.package_name, branch, test.name) + test.package_name, branch, self.ref_test_name) ref_eos = art_input_eos + sub_path + self.input_file ref_cvmfs = art_input_cvmfs + sub_path + self.input_file if os.path.isfile(ref_eos): @@ -123,10 +126,9 @@ class LogMergeStep(Step): self.log_files.append(step.name) # Protect against infinite loop if self.merged_name in self.log_files: - self.log.error('%s output log name %s is same as one of the input log names.'\ - ' This will lead to infinite loop, aborting.', self.name, self.merged_name) - self.report_result(1, 'TestConfig') - sys.exit(1) + self.misconfig_abort( + 'output log name %s is same as one of the input log names.' + ' This will lead to infinite loop, aborting.', self.merged_name) super(LogMergeStep, self).configure(test) def process_extra_regex(self): diff --git a/Trigger/TrigValidation/TrigValTools/python/TrigValSteering/ExecStep.py b/Trigger/TrigValidation/TrigValTools/python/TrigValSteering/ExecStep.py index d935df5bd430ff699130211c297762c9639773d6..b0edece9041c32f4a4dd4e7c322b9070f1bb5e73 100644 --- a/Trigger/TrigValidation/TrigValTools/python/TrigValSteering/ExecStep.py +++ b/Trigger/TrigValidation/TrigValTools/python/TrigValSteering/ExecStep.py @@ -6,7 +6,6 @@ Definitions of exec steps (main job) in Trigger ART tests ''' -import sys import os from TrigValTools.TrigValSteering.Step import Step @@ -71,10 +70,7 @@ class ExecStep(Step): self.log.debug('Configuring type for step %s', self.name) # Check if type or executable is specified if self.type is None and self.executable is None: - self.log.error('Cannot configure a step without specified type ' - 'or executable') - self.report_result(1, 'TestConfig') - sys.exit(1) + self.misconfig_abort('Cannot configure a step without specified type or executable') # Configure executable from type known_types = ['athena', 'athenaHLT', 'Reco_tf', 'Trig_reco_tf'] @@ -87,9 +83,7 @@ class ExecStep(Step): elif self.type == 'other' or self.type is None: self.type = 'other' else: - self.log.error('Cannot determine type of step %s', self.name) - self.report_result(1, 'TestConfig') - sys.exit(1) + self.misconfig_abort('Cannot determine type of this step') # Ensure no log duplication for transforms if self.executable.endswith('_tf.py'): @@ -100,12 +94,9 @@ class ExecStep(Step): def configure_input(self): self.log.debug('Configuring input for step %s', self.name) if self.input is None: - self.log.error( - 'Input not provided for step %s. To configure ' - 'a step without input, use an empty string', - self.name) - self.report_result(1, 'TestConfig') - sys.exit(1) + self.misconfig_abort( + 'Input not provided for this step. To configure' + 'a step without input, use an empty string') # Step with no input if len(self.input) == 0: @@ -115,18 +106,14 @@ class ExecStep(Step): if is_input_defined(self.input): self.input_object = get_input(self.input) if self.input_object is None: - self.log.error('Failed to load input with keyword %s', self.input) - self.report_result(1, 'TestConfig') - sys.exit(1) + self.misconfig_abort('Failed to load input with keyword %s', self.input) return # Try to interpret explicit paths input_paths = self.input.split(',') for path in input_paths: if not os.path.isfile(path): - self.log.error('The provided input does not exist: %s', self.input) - self.report_result(1, 'TestConfig') - sys.exit(1) + self.misconfig_abort('The provided input does not exist: %s', self.input) self.log.debug('Using explicit input: %s', self.input) def configure_job_options(self): @@ -143,21 +130,14 @@ class ExecStep(Step): if self.job_options is None: return else: - self.log.error('Transform %s does not accept job options', - self.type) - self.report_result(1, 'TestConfig') - sys.exit(1) + self.misconfig_abort('Transform %s does not accept job options', self.type) elif self.job_options is None or len(self.job_options) == 0: - self.log.error('Job options not provided for step %s', self.name) - self.report_result(1, 'TestConfig') - sys.exit(1) + self.misconfig_abort('Job options not provided for this step') # Check if job options exist if check_job_options(self.job_options): self.log.debug('Job options file exists: %s', self.job_options) else: - self.log.error('Failed to find job options file %s for step %s', self.job_options, self.name) - self.report_result(1, 'TestConfig') - sys.exit(1) + self.misconfig_abort('Failed to find job options file %s', self.job_options) def configure_args(self, test): self.log.debug('Configuring args for step %s', self.name) @@ -256,12 +236,10 @@ class ExecStep(Step): self.args += ' --file={}'.format(input_str) elif self.type.endswith('_tf'): if self.input_object is None: - self.log.error( + self.misconfig_abort( 'Cannot build inputXYZFile string for transform ' ' from explicit input path. Use input=\'\' and ' 'specify the input explicitly in args') - self.report_result(1, 'TestConfig') - sys.exit(1) if self.type == 'Trig_reco_tf' and '--prodSysBSRDO True' in self.args: self.args += ' --inputBS_RDOFile={}'.format(input_str) else: diff --git a/Trigger/TrigValidation/TrigValTools/python/TrigValSteering/Step.py b/Trigger/TrigValidation/TrigValTools/python/TrigValSteering/Step.py index e606b339c97b2d836718b784114348be0eae3e69..d8348957484ac6c7f5c69325d78ba842e9bab711 100644 --- a/Trigger/TrigValidation/TrigValTools/python/TrigValSteering/Step.py +++ b/Trigger/TrigValidation/TrigValTools/python/TrigValSteering/Step.py @@ -60,9 +60,7 @@ class Step(object): if self.result is not None: result = self.result else: - self.log.error('report_result was called but result is None') - self.report_result(1, 'TestConfig') - sys.exit(1) + self.misconfig_abort('report_result was called but result is None') if name is None: if self.name is not None: @@ -72,6 +70,15 @@ class Step(object): art_result(result, name) + def misconfig_abort(self, error_msg, *args, **kwargs): + ''' + Print an error message (arguments passed to logging.error), + report non-zero art-result and exit the process with non-zero code + ''' + self.log.error('Misconfiguration in %s: '+error_msg, self.name, *args, **kwargs) + self.report_result(1, 'TestConfig') + sys.exit(1) + def __trace_and_kill(self, pid, signal, backtrace_list): ''' Produce a backtrace for a process and its children, then call diff --git a/Trigger/TrigValidation/TriggerTest/share/ref_data_v1Dev_build.ref b/Trigger/TrigValidation/TriggerTest/share/ref_data_v1Dev_build.ref index eaabbf36b5a0c2e595247af7e89ef07311962ed7..127d6bc21d33f5b464c754d0adb7d5c742607376 100644 --- a/Trigger/TrigValidation/TriggerTest/share/ref_data_v1Dev_build.ref +++ b/Trigger/TrigValidation/TriggerTest/share/ref_data_v1Dev_build.ref @@ -253,38 +253,38 @@ TrigSignatureMoniMT INFO HLT_j45_ftf_csskpf_nojc TrigSignatureMoniMT INFO -- #3533281867 Events 20 20 0 0 0 0 0 0 0 0 0 0 3 - 3 TrigSignatureMoniMT INFO -- #3533281867 Features 0 0 0 0 0 0 0 0 0 0 3 - TrigSignatureMoniMT INFO HLT_j45_ftf_pf_L1J20 #1335156103 -TrigSignatureMoniMT INFO -- #1335156103 Events 20 20 0 0 0 0 0 0 0 0 0 0 5 - 5 -TrigSignatureMoniMT INFO -- #1335156103 Features 0 0 0 0 0 0 0 0 0 0 5 - +TrigSignatureMoniMT INFO -- #1335156103 Events 20 20 0 0 0 0 0 0 0 0 0 0 3 - 3 +TrigSignatureMoniMT INFO -- #1335156103 Features 0 0 0 0 0 0 0 0 0 0 3 - TrigSignatureMoniMT INFO HLT_j45_ftf_pf_nojcalib_L1J20 #3658890913 TrigSignatureMoniMT INFO -- #3658890913 Events 20 20 0 0 0 0 0 0 0 0 0 0 3 - 3 TrigSignatureMoniMT INFO -- #3658890913 Features 0 0 0 0 0 0 0 0 0 0 3 - TrigSignatureMoniMT INFO HLT_j45_ftf_subjesgscIS_011jvt_L1J15 #2857031468 -TrigSignatureMoniMT INFO -- #2857031468 Events 20 20 0 0 0 0 0 0 0 0 0 0 5 - 5 -TrigSignatureMoniMT INFO -- #2857031468 Features 0 0 0 0 0 0 0 0 0 0 5 - +TrigSignatureMoniMT INFO -- #2857031468 Events 20 20 0 0 0 0 0 0 0 0 0 0 4 - 4 +TrigSignatureMoniMT INFO -- #2857031468 Features 0 0 0 0 0 0 0 0 0 0 4 - TrigSignatureMoniMT INFO HLT_j45_ftf_subjesgscIS_015jvt_L1J15 #2938374624 -TrigSignatureMoniMT INFO -- #2938374624 Events 20 20 0 0 0 0 0 0 0 0 0 0 5 - 5 -TrigSignatureMoniMT INFO -- #2938374624 Features 0 0 0 0 0 0 0 0 0 0 5 - +TrigSignatureMoniMT INFO -- #2938374624 Events 20 20 0 0 0 0 0 0 0 0 0 0 4 - 4 +TrigSignatureMoniMT INFO -- #2938374624 Features 0 0 0 0 0 0 0 0 0 0 4 - TrigSignatureMoniMT INFO HLT_j45_ftf_subjesgscIS_059jvt_L1J15 #1593009344 -TrigSignatureMoniMT INFO -- #1593009344 Events 20 20 0 0 0 0 0 0 0 0 0 0 5 - 5 -TrigSignatureMoniMT INFO -- #1593009344 Features 0 0 0 0 0 0 0 0 0 0 5 - +TrigSignatureMoniMT INFO -- #1593009344 Events 20 20 0 0 0 0 0 0 0 0 0 0 4 - 4 +TrigSignatureMoniMT INFO -- #1593009344 Features 0 0 0 0 0 0 0 0 0 0 4 - TrigSignatureMoniMT INFO HLT_j45_ftf_subjesgscIS_L1J15 #3341539267 -TrigSignatureMoniMT INFO -- #3341539267 Events 20 20 0 0 0 0 0 0 0 0 0 0 6 - 6 -TrigSignatureMoniMT INFO -- #3341539267 Features 0 0 0 0 0 0 0 0 0 0 6 - +TrigSignatureMoniMT INFO -- #3341539267 Events 20 20 0 0 0 0 0 0 0 0 0 0 7 - 7 +TrigSignatureMoniMT INFO -- #3341539267 Features 0 0 0 0 0 0 0 0 0 0 7 - TrigSignatureMoniMT INFO HLT_j45_ftf_subjesgscIS_bmv2c1070_split_L1J20 #991419339 -TrigSignatureMoniMT INFO -- #991419339 Events 20 20 0 0 0 0 0 0 0 0 0 0 5 2 2 -TrigSignatureMoniMT INFO -- #991419339 Features 0 0 0 0 0 0 0 0 0 0 5 2 +TrigSignatureMoniMT INFO -- #991419339 Events 20 20 0 0 0 0 0 0 0 0 0 0 5 1 1 +TrigSignatureMoniMT INFO -- #991419339 Features 0 0 0 0 0 0 0 0 0 0 5 1 TrigSignatureMoniMT INFO HLT_j45_ftf_subjesgscIS_boffperf_split_L1J20 #1961149049 TrigSignatureMoniMT INFO -- #1961149049 Events 20 20 0 0 0 0 0 0 0 0 0 0 5 5 5 TrigSignatureMoniMT INFO -- #1961149049 Features 0 0 0 0 0 0 0 0 0 0 5 5 TrigSignatureMoniMT INFO HLT_j45_ftf_subjesgscIS_pf_L1J20 #761060030 -TrigSignatureMoniMT INFO -- #761060030 Events 20 20 0 0 0 0 0 0 0 0 0 0 5 - 5 -TrigSignatureMoniMT INFO -- #761060030 Features 0 0 0 0 0 0 0 0 0 0 5 - +TrigSignatureMoniMT INFO -- #761060030 Events 20 20 0 0 0 0 0 0 0 0 0 0 3 - 3 +TrigSignatureMoniMT INFO -- #761060030 Features 0 0 0 0 0 0 0 0 0 0 3 - TrigSignatureMoniMT INFO HLT_j45_ftf_subresjesgscIS_L1J15 #1509925407 -TrigSignatureMoniMT INFO -- #1509925407 Events 20 20 0 0 0 0 0 0 0 0 0 0 6 - 6 +TrigSignatureMoniMT INFO -- #1509925407 Events 20 20 0 0 0 0 0 0 0 0 0 0 7 - 7 TrigSignatureMoniMT INFO -- #1509925407 Features 0 0 0 0 0 0 0 0 0 0 7 - TrigSignatureMoniMT INFO HLT_j45_ftf_subresjesgscIS_pf_L1J20 #4012311417 -TrigSignatureMoniMT INFO -- #4012311417 Events 20 20 0 0 0 0 0 0 0 0 0 0 5 - 5 -TrigSignatureMoniMT INFO -- #4012311417 Features 0 0 0 0 0 0 0 0 0 0 5 - +TrigSignatureMoniMT INFO -- #4012311417 Events 20 20 0 0 0 0 0 0 0 0 0 0 3 - 3 +TrigSignatureMoniMT INFO -- #4012311417 Features 0 0 0 0 0 0 0 0 0 0 3 - TrigSignatureMoniMT INFO HLT_j45_nojcalib_L1J20 #2042444294 TrigSignatureMoniMT INFO -- #2042444294 Events 20 20 0 0 0 0 0 0 0 0 0 0 3 - 3 TrigSignatureMoniMT INFO -- #2042444294 Features 0 0 0 0 0 0 0 0 0 0 3 - @@ -724,8 +724,8 @@ TrigSignatureMoniMT INFO HLT_xe100_mht_L1XE50 #5 TrigSignatureMoniMT INFO -- #532175988 Events 20 20 0 0 0 0 0 0 0 0 0 0 2 - 2 TrigSignatureMoniMT INFO -- #532175988 Features 0 0 0 0 0 0 0 0 0 0 2 - TrigSignatureMoniMT INFO HLT_xe100_pfsum_L1XE50 #1890237897 -TrigSignatureMoniMT INFO -- #1890237897 Events 20 20 0 0 0 0 0 0 0 0 0 0 0 - 0 -TrigSignatureMoniMT INFO -- #1890237897 Features 0 0 0 0 0 0 0 0 0 0 0 - +TrigSignatureMoniMT INFO -- #1890237897 Events 20 20 0 0 0 0 0 0 0 0 0 0 1 - 1 +TrigSignatureMoniMT INFO -- #1890237897 Features 0 0 0 0 0 0 0 0 0 0 1 - TrigSignatureMoniMT INFO HLT_xe100_tcpufit_L1XE50 #2803198799 TrigSignatureMoniMT INFO -- #2803198799 Events 20 20 0 0 0 0 0 0 0 0 0 0 0 - 0 TrigSignatureMoniMT INFO -- #2803198799 Features 0 0 0 0 0 0 0 0 0 0 0 - @@ -751,14 +751,14 @@ TrigSignatureMoniMT INFO HLT_xe30_mht_L1XE10 #36 TrigSignatureMoniMT INFO -- #3626903018 Events 20 20 0 0 0 0 0 0 0 0 0 0 16 - 16 TrigSignatureMoniMT INFO -- #3626903018 Features 0 0 0 0 0 0 0 0 0 0 16 - TrigSignatureMoniMT INFO HLT_xe30_pfsum_L1XE10 #998713382 -TrigSignatureMoniMT INFO -- #998713382 Events 20 20 0 0 0 0 0 0 0 0 0 0 3 - 3 -TrigSignatureMoniMT INFO -- #998713382 Features 0 0 0 0 0 0 0 0 0 0 3 - +TrigSignatureMoniMT INFO -- #998713382 Events 20 20 0 0 0 0 0 0 0 0 0 0 5 - 5 +TrigSignatureMoniMT INFO -- #998713382 Features 0 0 0 0 0 0 0 0 0 0 5 - TrigSignatureMoniMT INFO HLT_xe30_tcpufit_L1XE10 #1583719916 TrigSignatureMoniMT INFO -- #1583719916 Events 20 20 0 0 0 0 0 0 0 0 0 0 6 - 6 TrigSignatureMoniMT INFO -- #1583719916 Features 0 0 0 0 0 0 0 0 0 0 6 - TrigSignatureMoniMT INFO HLT_xe30_trkmht_L1XE10 #2468872349 -TrigSignatureMoniMT INFO -- #2468872349 Events 20 20 0 0 0 0 0 0 0 0 0 0 5 - 5 -TrigSignatureMoniMT INFO -- #2468872349 Features 0 0 0 0 0 0 0 0 0 0 5 - +TrigSignatureMoniMT INFO -- #2468872349 Events 20 20 0 0 0 0 0 0 0 0 0 0 4 - 4 +TrigSignatureMoniMT INFO -- #2468872349 Features 0 0 0 0 0 0 0 0 0 0 4 - TrigSignatureMoniMT INFO HLT_xe65_cell_L1XE50 #531141817 TrigSignatureMoniMT INFO -- #531141817 Events 20 20 0 0 0 0 0 0 0 0 0 0 0 - 0 TrigSignatureMoniMT INFO -- #531141817 Features 0 0 0 0 0 0 0 0 0 0 0 - diff --git a/Trigger/TrigValidation/TriggerTest/test/test_trig_data_v1Dev_MT_build.py b/Trigger/TrigValidation/TriggerTest/test/test_trig_data_v1Dev_MT_build.py index ca120bbcdcce0f50ee4a3af92e834e5471eb4831..6eb24083fd91c9ff7a5acd4562bd188dec87cb2c 100755 --- a/Trigger/TrigValidation/TriggerTest/test/test_trig_data_v1Dev_MT_build.py +++ b/Trigger/TrigValidation/TriggerTest/test/test_trig_data_v1Dev_MT_build.py @@ -36,5 +36,8 @@ refcomp.reference = 'TriggerTest/ref_data_v1Dev_build.ref' refcomp.required = True # Final exit code depends on this step CheckSteps.add_step_after_type(test.check_steps, CheckSteps.LogMergeStep, refcomp) +# Use RootComp reference from test_trig_data_v1Dev_build +test.get_step('RootComp').ref_test_name = 'trig_data_v1Dev_build' + import sys sys.exit(test.run()) diff --git a/Trigger/TrigValidation/TriggerTest/test/test_trig_data_v1Dev_reverseViews_build.py b/Trigger/TrigValidation/TriggerTest/test/test_trig_data_v1Dev_reverseViews_build.py index 5742c5c1662849d3ec7c3bf5a0ae02a1b3c43cfd..5cb1502620d6ceb44966eb6c0301d3951d0af49e 100755 --- a/Trigger/TrigValidation/TriggerTest/test/test_trig_data_v1Dev_reverseViews_build.py +++ b/Trigger/TrigValidation/TriggerTest/test/test_trig_data_v1Dev_reverseViews_build.py @@ -36,5 +36,8 @@ refcomp.reference = 'TriggerTest/ref_data_v1Dev_build.ref' refcomp.required = True # Final exit code depends on this step CheckSteps.add_step_after_type(test.check_steps, CheckSteps.LogMergeStep, refcomp) +# Use RootComp reference from test_trig_data_v1Dev_build +test.get_step('RootComp').ref_test_name = 'trig_data_v1Dev_build' + import sys sys.exit(test.run()) diff --git a/Trigger/TrigValidation/TriggerTest/test/test_trig_mc_v1Dev_MT_build.py b/Trigger/TrigValidation/TriggerTest/test/test_trig_mc_v1Dev_MT_build.py index 4ba4e1c25419b62a99e66e2f259f4b155b5a36c6..83a3b311e8eadf9231c51c1220918959aab87c6e 100755 --- a/Trigger/TrigValidation/TriggerTest/test/test_trig_mc_v1Dev_MT_build.py +++ b/Trigger/TrigValidation/TriggerTest/test/test_trig_mc_v1Dev_MT_build.py @@ -28,5 +28,8 @@ test.art_type = 'build' test.exec_steps = [ex] test.check_steps = CheckSteps.default_check_steps(test) +# Use RootComp reference from test_trig_mc_v1Dev_build +test.get_step('RootComp').ref_test_name = 'trig_mc_v1Dev_build' + import sys sys.exit(test.run()) diff --git a/Trigger/TriggerCommon/TrigEDMConfig/python/TriggerEDMRun3.py b/Trigger/TriggerCommon/TrigEDMConfig/python/TriggerEDMRun3.py index 45852ae263f8c3bf8a7672904c74d9eee4ef9ff4..e3109c8979fe88a3eb762c062215cbc42a7b6661 100644 --- a/Trigger/TriggerCommon/TrigEDMConfig/python/TriggerEDMRun3.py +++ b/Trigger/TriggerCommon/TrigEDMConfig/python/TriggerEDMRun3.py @@ -137,6 +137,9 @@ TriggerHLTListRun3 = [ ('xAOD::CaloClusterContainer#HLT_TopoCaloClustersLCFS', 'BS ESD AODFULL', 'Jet', 'alias:CaloClusterContainerShallowCopy'), # special argument indicating that this collection has a different Aux ('xAOD::ShallowAuxContainer#HLT_TopoCaloClustersLCFSAux.calE.calEta.calPhi', 'BS ESD AODFULL', 'Jet'), + # fullscan Jet Roi + ('TrigRoiDescriptorCollection#HLT_FSJETRoI', 'BS ESD AODFULL', 'Jet'), + # Not sure we need these two... ('xAOD::CaloClusterContainer#HLT_TopoCaloClustersRoI', 'BS ESD AODFULL', 'Egamma', 'inViews:precisionCaloViews'), ('xAOD::CaloClusterTrigAuxContainer#HLT_TopoCaloClustersRoIAux.nCells', 'BS ESD AODFULL', 'Egamma'), diff --git a/Trigger/TriggerCommon/TriggerJobOpts/share/runHLT_standalone.py b/Trigger/TriggerCommon/TriggerJobOpts/share/runHLT_standalone.py index 9c3191559b6606cd7d86ec02eda3b684f0b84633..3ed34972062c6abf612d15e3e35965683891c856 100644 --- a/Trigger/TriggerCommon/TriggerJobOpts/share/runHLT_standalone.py +++ b/Trigger/TriggerCommon/TriggerJobOpts/share/runHLT_standalone.py @@ -431,7 +431,7 @@ elif globalflags.InputFormat.is_bytestream() and not ConfigFlags.Trigger.Online. # --------------------------------------------------------------- # Trigger config # --------------------------------------------------------------- -TriggerFlags.triggerMenuSetup = opt.setMenu +ConfigFlags.Trigger.triggerMenuSetup = TriggerFlags.triggerMenuSetup = opt.setMenu TriggerFlags.readLVL1configFromXML = True TriggerFlags.outputLVL1configFile = None @@ -506,14 +506,14 @@ svcMgr.MessageSvc.infoLimit=10000 from TrigConfigSvc.TrigConfigSvcCfg import getHLTConfigSvc -svcMgr += conf2toConfigurable( getHLTConfigSvc() ) +svcMgr += conf2toConfigurable( getHLTConfigSvc(ConfigFlags) ) if not opt.createHLTMenuExternally: # the generation of the prescale set file from the menu (with all prescales set to 1) # is not really needed. If no file is provided all chains are either enabled or disabled, # depending on the property L1Decoder.PrescalingTool.KeepUnknownChains being True or False from TrigConfigSvc.TrigConfigSvcCfg import createHLTPrescalesFileFromMenu - createHLTPrescalesFileFromMenu() + createHLTPrescalesFileFromMenu(ConfigFlags) @@ -617,6 +617,12 @@ if opt.reverseViews or opt.filterViews: #------------------------------------------------------------- include("TriggerTest/disableChronoStatSvcPrintout.py") +#------------------------------------------------------------- +# Disable spurious warnings from HepMcParticleLink, ATR-21838 +#------------------------------------------------------------- +if ConfigFlags.Input.isMC: + svcMgr.MessageSvc.setError += ['HepMcParticleLink'] + #------------------------------------------------------------- # Enable xAOD::EventInfo decorations for pileup values #------------------------------------------------------------- diff --git a/Trigger/TriggerCommon/TriggerMenu/python/menu/GenerateMenu.py b/Trigger/TriggerCommon/TriggerMenu/python/menu/GenerateMenu.py index 517210f27fb7111047e77939a4c50c255faa1287..5e230b529a1c380e921e82078ea766437a807702 100755 --- a/Trigger/TriggerCommon/TriggerMenu/python/menu/GenerateMenu.py +++ b/Trigger/TriggerCommon/TriggerMenu/python/menu/GenerateMenu.py @@ -961,7 +961,7 @@ class GenerateMenu: # print all chain counters if log.isEnabledFor(logging.DEBUG): - for name, chains in self.triggerPythonConfig.allChains.iteritems(): + for name, chains in self.triggerPythonConfig.allChains.items(): for c in chains: log.debug('Registered chain %04d %s', int(c.chain_counter), c.chain_name) diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/CalibCosmicMon/BeamspotChainConfiguration.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/CalibCosmicMon/BeamspotChainConfiguration.py index 416d23ad7d36d25f14ee9a3a8e482a22ec431a58..a85e4eb3a139154550a6444c9cb1b8c546d75cdf 100644 --- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/CalibCosmicMon/BeamspotChainConfiguration.py +++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/CalibCosmicMon/BeamspotChainConfiguration.py @@ -38,7 +38,7 @@ def allTE_trkfast( signature="FS" ): viewAlgs, viewVerify = makeInDetAlgs( whichSignature=signature, rois=inputMakerAlg.InViewRoIs ) vertexAlg = T2VertexBeamSpot_activeAllTE( "vertex_"+signature ) - vertexAlg.TrackCollections = ["TrigFastTrackFinder_Tracks_"+signature] + vertexAlg.TrackCollection = "TrigFastTrackFinder_Tracks_"+signature viewVerify.DataObjects += [( 'TrigRoiDescriptorCollection' , 'StoreGateSvc+beamspotViewRoI_'+signature ), ( 'xAOD::EventInfo' , 'StoreGateSvc+EventInfo' ), diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/CommonSequences/CaloSequenceSetup.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/CommonSequences/CaloSequenceSetup.py index 0b47542aaf456a1b0ed8f083cf4be66579afb1d2..abf095945895292f15dea693d496380d28e639da 100644 --- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/CommonSequences/CaloSequenceSetup.py +++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/CommonSequences/CaloSequenceSetup.py @@ -49,7 +49,7 @@ def fastCaloMenuSequence(name, doRinger): HypoToolGen = TrigEgammaFastCaloHypoToolFromDict ) -def cellRecoSequence(flags, name="HLTCaloCellMakerFS", RoIs="FSJETRoI", outputName="CaloCellsFS"): +def cellRecoSequence(flags, name="HLTCaloCellMakerFS", RoIs="HLT_FSJETRoI", outputName="CaloCellsFS"): """ Produce the full scan cell collection """ if not RoIs: from L1Decoder.L1DecoderConfig import mapThresholdToL1RoICollection @@ -65,7 +65,7 @@ def cellRecoSequence(flags, name="HLTCaloCellMakerFS", RoIs="FSJETRoI", outputNa return parOR(name+"RecoSequence", [alg]), alg.CellsName def caloClusterRecoSequence( - flags, name="HLTCaloClusterMakerFS", RoIs="FSJETRoI", + flags, name="HLTCaloClusterMakerFS", RoIs="HLT_FSJETRoI", outputName="HLT_TopoCaloClustersFS"): """ Create the EM-level fullscan clusters """ cell_sequence, cells_name = RecoFragmentsPool.retrieve(cellRecoSequence, flags=None, RoIs=RoIs) @@ -79,7 +79,7 @@ def caloClusterRecoSequence( return parOR(name+"RecoSequence", [cell_sequence, alg]), alg.CaloClusters def LCCaloClusterRecoSequence( - flags, name="HLTCaloClusterCalibratorLCFS", RoIs="FSJETRoI", + flags, name="HLTCaloClusterCalibratorLCFS", RoIs="HLT_FSJETRoI", outputName="HLT_TopoCaloClustersLCFS"): """ Create the LC calibrated fullscan clusters diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Jet/JetRecoSequences.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Jet/JetRecoSequences.py index dd8227c24b0d3499db66fec55509f5eded8610ad..3810184c44cfa502bbf4ca5fc52a3d99dde83213 100644 --- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Jet/JetRecoSequences.py +++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Jet/JetRecoSequences.py @@ -34,7 +34,7 @@ def jetAthSequence(dummyFlags, **jetRecoDict): # Dummy flag arg needed so that each reco sequence is held separately # in the RecoFragmentsPool -- only the kwargs are used to distinguish # different sequences. New convention is just to pass "None" for flags -def jetRecoSequence( dummyFlags, dataSource, RoIs = 'FSJETRoI', **jetRecoDict): +def jetRecoSequence( dummyFlags, dataSource, RoIs = 'HLT_FSJETRoI', **jetRecoDict): jetDefString = jetRecoDictToString(jetRecoDict) recoSeq = parOR( "JetRecSeq_"+jetDefString, []) diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Jet/JetTrackingConfig.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Jet/JetTrackingConfig.py index 97789cf114ee819440148b76cdcfb02ce60e326c..e1ea95fc9a18559d9a7a51d53fe39404b13730cd 100644 --- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Jet/JetTrackingConfig.py +++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Jet/JetTrackingConfig.py @@ -17,7 +17,7 @@ def JetTrackingSequence(dummyFlags,trkopt,RoIs): if trkopt=="ftf": from TrigInDetConfig.InDetSetup import makeInDetAlgsNoView # Guess FS rather than making it jet-specific? - viewAlgs = makeInDetAlgsNoView( "JetFS", "FS", rois=RoIs ) + viewAlgs = makeInDetAlgsNoView( "JetFS", "FS", rois=recordable(RoIs) ) jetTrkSeq += viewAlgs tracksname = recordable("HLT_IDTrack_FS_FTF") verticesname = recordable("HLT_IDVertex_FS") diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Jet/generateJet.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Jet/generateJet.py index 613bde8fab3bd9e5366404f090eb765951c2d438..b0e94aaf085eaf346cd908794234372daefde058 100644 --- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Jet/generateJet.py +++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Jet/generateJet.py @@ -10,11 +10,11 @@ log = logging.getLogger( 'TriggerMenuMT.HLTMenuConfig.Jet.generateJet' ) def HLTCaloCellMakerCfg( cellsname, cdaSvc ): result = ComponentAccumulator() verifier = CompFactory.AthViews.ViewDataVerifier( name = 'VDVFSCaloJet', - DataObjects = [('TrigRoiDescriptorCollection', 'StoreGateSvc+FSJETRoI'), + DataObjects = [('TrigRoiDescriptorCollection', 'StoreGateSvc+HLT_FSJETRoI'), ('CaloBCIDAverage', 'StoreGateSvc+CaloBCIDAverage') ]) result.addEventAlgo( verifier ) cellmaker = CompFactory.HLTCaloCellMaker("HLTCaloCellMaker_FS") - cellmaker.RoIs = "FSJETRoI" + cellmaker.RoIs = "HLT_FSJETRoI" cellmaker.TrigDataAccessMT = cdaSvc cellmaker.CellsName = cellsname diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/HLTMenuJSON.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/HLTMenuJSON.py index dba04e5537aaec87019e30822a24a9e3c41c1558..3ec6987198d595e9bef54649e388d4ab08f986d4 100644 --- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/HLTMenuJSON.py +++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/HLTMenuJSON.py @@ -128,7 +128,7 @@ def __generateJSON( chainDicts, chainConfigs, HLTAllSteps, menuName, fileName ): def generateJSON(): __log.info("Generating HLT Menu JSON in the rec-ex-common job") - from TriggerJobOpts.TriggerFlags import TriggerFlags + from AthenaConfiguration.AllConfigFlags import ConfigFlags from TriggerMenuMT.HLTMenuConfig.Menu.TriggerConfigHLT import TriggerConfigHLT from AthenaCommon.AlgSequence import AlgSequence from AthenaCommon.CFElements import findSubSequence @@ -136,8 +136,8 @@ def generateJSON(): return __generateJSON( TriggerConfigHLT.dictsList(), TriggerConfigHLT.configsList(), findSubSequence(AlgSequence(), "HLTAllSteps"), - TriggerFlags.triggerMenuSetup(), - getHLTMenuFileName() ) + ConfigFlags.Trigger.triggerMenuSetup, + getHLTMenuFileName(ConfigFlags) ) def generateJSON_newJO( chainDicts, chainConfigs, HLTAllSteps ): __log.info("Generating HLT Menu JSON in the new JO") diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Muon/MuonSetup.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Muon/MuonSetup.py index a2fe1fa9b5495dc481205e008c4ade4cadbf3540..a6b7e1f092c43a86047d92246079953c4d52d746 100644 --- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Muon/MuonSetup.py +++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Muon/MuonSetup.py @@ -731,10 +731,10 @@ def muEFCBRecoSequence( RoIs, name ): from AthenaCommon.AppMgr import ToolSvc from InDetTrigRecExample.InDetTrigConditionsAccess import SCT_ConditionsSetup from SCT_ConditionsTools.SCT_ConditionsToolsConf import SCT_ConditionsSummaryTool - ToolSvc.AtlasHoleSearchTool.SctSummaryTool = SCT_ConditionsSummaryTool(SCT_ConditionsSetup.instanceName('InDetSCT_ConditionsSummaryToolWithoutFlagged')) + ToolSvc.AtlasHoleSearchTool.BoundaryCheckTool.SctSummaryTool = SCT_ConditionsSummaryTool(SCT_ConditionsSetup.instanceName('InDetSCT_ConditionsSummaryToolWithoutFlagged')) from InDetTrigRecExample.InDetTrigConfigRecLoadTools import InDetTrigSCTConditionsSummaryTool - ToolSvc.CombinedMuonIDHoleSearch.SctSummaryTool = InDetTrigSCTConditionsSummaryTool + ToolSvc.CombinedMuonIDHoleSearch.BoundaryCheckTool.SctSummaryTool = InDetTrigSCTConditionsSummaryTool #MS ID combination candidatesName = "MuonCandidates" @@ -821,7 +821,7 @@ def muEFInsideOutRecoSequence(RoIs, name): from AthenaCommon.AppMgr import ToolSvc from InDetTrigRecExample.InDetTrigConditionsAccess import SCT_ConditionsSetup from SCT_ConditionsTools.SCT_ConditionsToolsConf import SCT_ConditionsSummaryTool - ToolSvc.CombinedMuonIDHoleSearch.SctSummaryTool = SCT_ConditionsSummaryTool(SCT_ConditionsSetup.instanceName('InDetSCT_ConditionsSummaryToolWithoutFlagged')) + ToolSvc.CombinedMuonIDHoleSearch.BoundaryCheckTool.SctSummaryTool = SCT_ConditionsSummaryTool(SCT_ConditionsSetup.instanceName('InDetSCT_ConditionsSummaryToolWithoutFlagged')) efAlgs.append(theIndetCandidateAlg) diff --git a/graphics/JiveXML/share/DataTypes_All.py b/graphics/JiveXML/share/DataTypes_All.py index cbf7f862bc56cf6282b17cb02f22eae26c9d526d..68a1ee5be4fb8f82d2fd8263927cf45f8c6a54df 100755 --- a/graphics/JiveXML/share/DataTypes_All.py +++ b/graphics/JiveXML/share/DataTypes_All.py @@ -1,3 +1,4 @@ +from __future__ import print_function #================================================================= #Run the Full Reconstruction -> XML converter #================================================================= @@ -12,4 +13,4 @@ include ("AnalysisJiveXML/AnalysisJiveXML_DataTypes.py") include ("TruthJiveXML/TruthJiveXML_DataTypes.py") include ("xAODJiveXML/xAODJiveXML_DataTypes.py") -print theEventData2XML +print(theEventData2XML) diff --git a/graphics/JiveXML/share/JiveXML_fromAOD.py b/graphics/JiveXML/share/JiveXML_fromAOD.py index 8809257d548c84f4e62d19d0da47c3bbed69f8b7..f601c050491b06ed3b9919f26a5ded89ff60ba0a 100755 --- a/graphics/JiveXML/share/JiveXML_fromAOD.py +++ b/graphics/JiveXML/share/JiveXML_fromAOD.py @@ -1,11 +1,12 @@ -print "=== JiveXML_fromAOD.py: " -print "=== Producing XML output for Atlantis event display" -print "=== 25 events processed by default." -print "=== Make sure you have a file AOD.pool.root connected with " -print "=== symbolic link in this directory, e.g." -print "=== ln -sf myAOD_runNumber.pool.root AOD.pool.root " -print "=== Make sure you have matching geometry, check with: " -print "=== os.system('dumpVersionTags.py AOD.pool.root | grep \"GeoAtlas \"') " +from __future__ import print_function +print("=== JiveXML_fromAOD.py: ") +print("=== Producing XML output for Atlantis event display") +print("=== 25 events processed by default.") +print("=== Make sure you have a file AOD.pool.root connected with ") +print("=== symbolic link in this directory, e.g.") +print("=== ln -sf myAOD_runNumber.pool.root AOD.pool.root ") +print("=== Make sure you have matching geometry, check with: ") +print("=== os.system('dumpVersionTags.py AOD.pool.root | grep \"GeoAtlas \"') ") import os import sys from RecExConfig.RecFlags import rec @@ -14,13 +15,13 @@ from AthenaCommon.AthenaCommonFlags import athenaCommonFlags from AthenaCommon.GlobalFlags import globalflags if os.path.isfile("AOD.pool.root"): athenaCommonFlags.PoolAODInput.set_Value_and_Lock(['AOD.pool.root']) - print "=== AOD file found ! " + print("=== AOD file found ! ") #### EDIT geometry version here if necessary: #globalflags.DetDescrVersion.set_Value_and_Lock('ATLAS-GEONF-08-00-00') #### EDIT number of events here, default 25: athenaCommonFlags.EvtMax.set_Value_and_Lock(25) include ("JiveXML/JiveXML_jobOptions_AODRecEx.py") else: - print "=== AOD.pool.root not found. Exiting." + print("=== AOD.pool.root not found. Exiting.") sys.exit(0)