diff --git a/Control/AthenaKernel/AthenaKernel/AthenaKernelDict.h b/Control/AthenaKernel/AthenaKernel/AthenaKernelDict.h index c78eeae9f98faaca0d2495c0494749c2e2f6c064..59ff7329823b44bdbcc129e4bb27f71e7c3d623e 100644 --- a/Control/AthenaKernel/AthenaKernel/AthenaKernelDict.h +++ b/Control/AthenaKernel/AthenaKernel/AthenaKernelDict.h @@ -27,6 +27,7 @@ #include "AthenaKernel/tools/AthenaPackageInfo.h" #include "AthenaKernel/DataBucketBase.h" #include "AthenaKernel/ThinningDecisionBase.h" +#include "AthenaKernel/CondCont.h" #include "GaudiKernel/MsgStream.h" diff --git a/Control/AthenaKernel/AthenaKernel/CondCont.h b/Control/AthenaKernel/AthenaKernel/CondCont.h index 4ad8039cc20e107871bc73caa4706a76de9a0c6c..0585ac969b7e6991c5e203ac6888b9c12abcc3e5 100644 --- a/Control/AthenaKernel/AthenaKernel/CondCont.h +++ b/Control/AthenaKernel/AthenaKernel/CondCont.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ /** * @file AthenaKernel/CondCont.h @@ -918,6 +918,17 @@ public: EventIDRange const** r = nullptr) const; + /** + * @brief Look up a conditions object for a given time. + * @param t IOV time to find. + * + * Returns the found object, or nullptr. + * + * This variant may be more convenient to call from python. + */ + const T* find (const EventIDBase& t) const; + + protected: /** * @brief Internal constructor. @@ -1227,6 +1238,17 @@ public: EventIDRange const** r = nullptr) const; + /** + * @brief Look up a conditions object for a given time. + * @param t IOV time to find. + * + * Returns the found object, or nullptr. + * + * This variant may be more convenient to call from python. + */ + const T* find (const EventIDBase& t) const; + + protected: /** * @brief Internal Constructor. diff --git a/Control/AthenaKernel/AthenaKernel/CondCont.icc b/Control/AthenaKernel/AthenaKernel/CondCont.icc index 68745f2b5b2aa658a9602fc2a15a7288f66cb464..76f4cdcf021a3286dc0e290db616b8dec45ac8c1 100644 --- a/Control/AthenaKernel/AthenaKernel/CondCont.icc +++ b/Control/AthenaKernel/AthenaKernel/CondCont.icc @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ /** * @file AthenaKernel/CondCont.icc @@ -283,6 +283,28 @@ bool CondCont<T>::find (const EventIDBase& t, /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ +/** + * @brief Look up a conditions object for a given time. + * @param t IOV time to find. + * + * Returns the found object, or nullptr. + * + * This variant may be more convenient to call from python. + */ +template <typename T> +const T* CondCont<T>::find (const EventIDBase& t) const +{ + const T* obj = nullptr; + if (this->find (t, obj)) { + return obj; + } + return nullptr; +} + + +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + + /** * @brief Do pointer conversion for the payload type. * @param clid CLID for the desired pointer type. @@ -448,6 +470,27 @@ bool CondContMixed<T>::find (const EventIDBase& t, /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ +/** + * @brief Look up a conditions object for a given time. + * @param t IOV time to find. + * + * Returns the found object, or nullptr. + * + * This variant may be more convenient to call from python. + */ +template <typename T> +const T* CondContMixed<T>::find (const EventIDBase& t) const +{ + const T* obj = nullptr; + if (this->find (t, obj)) { + return obj; + } + return nullptr; +} + +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + + /** * @brief Constructor. * @param rcusvc RCU service instance. diff --git a/Control/AthenaKernel/AthenaKernel/selection.xml b/Control/AthenaKernel/AthenaKernel/selection.xml index 3de968ea10570f56bfbdbba0633d48247a5b09b5..de4026969fcd33d98752b8859d72351e619423e2 100644 --- a/Control/AthenaKernel/AthenaKernel/selection.xml +++ b/Control/AthenaKernel/AthenaKernel/selection.xml @@ -28,4 +28,8 @@ <class name="SG::ThinningDecisionBase"/> + <class name="CondContBase"/> + <class name="CondContSingleBase"/> + <class name="CondContMixedBase"/> + </lcgdict> diff --git a/Control/AthenaKernel/share/CondCont_test.ref b/Control/AthenaKernel/share/CondCont_test.ref index 71832b0c5472d20d9df502917c5b11586da94551..3f1909bcca877f4e7068e182d7a5929b98894339 100644 --- a/Control/AthenaKernel/share/CondCont_test.ref +++ b/Control/AthenaKernel/share/CondCont_test.ref @@ -18,6 +18,7 @@ UNKNOWN_CLASS:c... ERROR CondContMixedBase::insertMixed: Run+lbn part of new ra UNKNOWN_CLASS:c... ERROR CondContMixedBase::findMixed: No valid timestamp in key used with mixed container. UNKNOWN_CLASS:c... ERROR CondContBase::findBase: Non-Run/LBN key used in Run/LBN container. UNKNOWN_CLASS:c... ERROR CondContMixedBase::findMixed: No valid timestamp in key used with mixed container. +UNKNOWN_CLASS:c... ERROR CondContMixedBase::findMixed: No valid timestamp in key used with mixed container. UNKNOWN_CLASS:c... ERROR CondContBase::findBase: Non-Run/LBN key used in Run/LBN container. UNKNOWN_CLASS:c... ERROR CondContMixedBase::erase: erase() is not implemented for mixed containers. UNKNOWN_CLASS:c... ERROR CondContMixedBase::extendLastRange: extendLastRange() is not implemented for mixed containers. diff --git a/Control/AthenaKernel/test/CondCont_test.cxx b/Control/AthenaKernel/test/CondCont_test.cxx index d349a96bb82b6563c5cf43f5c519a42d3ae775e6..4ff0fea9694329eeb9e31585ff9bc4f75fcbe2bb 100644 --- a/Control/AthenaKernel/test/CondCont_test.cxx +++ b/Control/AthenaKernel/test/CondCont_test.cxx @@ -257,6 +257,7 @@ void checkit (const CondCont<T>& cc_rl, const T* t = nullptr; assert (cc_rl.find (runlbn (10, 17), t)); assert (t == ptrs[0]); + assert (cc_rl.find (runlbn (10, 17)) == t); t = nullptr; assert (cc_rl.find (runlbn (100, 200), t)); @@ -271,6 +272,7 @@ void checkit (const CondCont<T>& cc_rl, assert (!cc_rl.find (runlbn (15, 17), t)); assert (!cc_ts.find (timestamp (999), t)); + assert (cc_rl.find (runlbn (15, 17)) == nullptr); assert (cc_rl.range (runlbn (100, 200), r)); assert (r == r2); @@ -535,10 +537,12 @@ void test4 (TestRCUSvc& rcusvc) const B* obj = nullptr; assert (!cc.find (runlbn(1, 10), obj, &range)); assert (!cc.find (timestamp(110), obj, &range)); + assert (cc.find (runlbn(1, 10)) == nullptr); assert (cc.find (mixed(1, 12, 3), obj, &range)); assert (obj->m_x == 2); assert (*range == EventIDRange (mixed(1, 10, 2), mixed(1, 20, 4.5))); + assert (cc.find (mixed(1, 12, 3)) == obj); assert (cc.find (mixed(1, 35, 25), obj, &range)); assert (obj->m_x == 3); diff --git a/Control/CxxUtils/CxxUtils/ones.h b/Control/CxxUtils/CxxUtils/ones.h index 57a23f878c606e42c25067273ef678573a2af433..41e40e3dd8769585b55d3b514a88248d5436575d 100644 --- a/Control/CxxUtils/CxxUtils/ones.h +++ b/Control/CxxUtils/CxxUtils/ones.h @@ -1,10 +1,7 @@ // This file's extension implies that it's C, but it's really -*- C++ -*-. - /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ - -// $Id$ /** * @file CxxUtils/ones.h * @author scott snyder <snyder@bnl.gov> @@ -29,6 +26,7 @@ T ones (unsigned int n) { if (n >= sizeof(T) * 8) return ~static_cast<T>(0); + // cppcheck-suppress shiftTooManyBits return (static_cast<T>(1) << n) - 1; } diff --git a/Control/CxxUtils/test/phihelper_test.cxx b/Control/CxxUtils/test/phihelper_test.cxx index 648b652be544987b417e55d587d8cfe474550983..1227ff72d6ec9e5b931cc07aada4ac7e8f9b2943 100644 --- a/Control/CxxUtils/test/phihelper_test.cxx +++ b/Control/CxxUtils/test/phihelper_test.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 */ /** * @file CxxUtils/test/phihelper_test.cxx @@ -64,6 +64,7 @@ BOOST_AUTO_TEST_CASE_TEMPLATE(test_wrap, T, test_types) BOOST_TEST(wrapToPi<T>(-40.1 * PI) == wrapToPi<T>(-10.1 * PI)); } +// cppcheck-suppress unknownMacro BOOST_TEST_DECORATOR(TOLERANCE) BOOST_AUTO_TEST_CASE_TEMPLATE(test_delta, T, test_types) { diff --git a/Control/IOVSvc/src/IOVSvc.cxx b/Control/IOVSvc/src/IOVSvc.cxx index 68b837086f3a8209dd550422135d326a58d4a8b8..08e41e5bc94420afe714dd5764a2be00aa51d5ad 100755 --- a/Control/IOVSvc/src/IOVSvc.cxx +++ b/Control/IOVSvc/src/IOVSvc.cxx @@ -847,6 +847,16 @@ IOVSvc::createCondObj(CondContBase* ccb, const DataObjID& id, dobj = 0; } + // Some data objects may be reference counted by the address. + // CondCont will take ownership of the object, but doesn't + // do refcounting. We'll have gotten a reference via the Storable_cast + // above, so it should be ok ... unless CondCont deletes + // the new object immediately instead of inserting. + // In that case, when we delete the address, it will + // follow an invalid pointer. So be sure to delete + // the address before the object is added to CondCont. + ioa.release(); + // DataObject *d2 = static_cast<DataObject*>(v); ATH_MSG_DEBUG( " SG::Storable_cast to obj: " << v ); diff --git a/Control/SGComps/src/ProxyProviderSvc.cxx b/Control/SGComps/src/ProxyProviderSvc.cxx index 2b2b938530e8c4d35a30dd8eee44b95f95dbc673..06a4b847fab8b0d08f892b5b054bc99d37d4be2c 100644 --- a/Control/SGComps/src/ProxyProviderSvc.cxx +++ b/Control/SGComps/src/ProxyProviderSvc.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 <algorithm> @@ -261,7 +261,7 @@ ProxyProviderSvc::retrieveProxy(const CLID& id, const std::string& key, const EventContext& ctx = contextFromStore (store); SG::TransientAddress pTAd (id, key); pAPiterator iProvider(m_providers.begin()), iEnd(m_providers.end()); - for (; iProvider != iEnd; iProvider++) { + for (; iProvider != iEnd; ++iProvider) { if ( ((*iProvider)->updateAddress(store.storeID(),&pTAd,ctx)).isSuccess() ) { pTAd.setProvider(*iProvider, store.storeID()); diff --git a/Control/SGComps/src/SGFolder.h b/Control/SGComps/src/SGFolder.h index 4bd4d02dc08c73ae0626fecfd463e78a2999ffdc..011fdc7a76a9db2bca4c760ea43b9bcba285e84b 100644 --- a/Control/SGComps/src/SGFolder.h +++ b/Control/SGComps/src/SGFolder.h @@ -1,7 +1,7 @@ // -*- c++ -*- /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ #ifndef SGCOMPS_FOLDER_H @@ -46,8 +46,8 @@ namespace SG { public: /// \name structors //@{ - Folder(const std::string& name, - const std::string& type, + Folder(const std::string& type, + const std::string& name, const IInterface* parent); virtual ~Folder() override; //@} diff --git a/Control/SGTools/SGTools/exceptions.h b/Control/SGTools/SGTools/exceptions.h index 2de48a5cab1753d3793d107addd977c2d71a3eb2..e949c2383e3d8554ee24c7dcded4819f118fc6c3 100644 --- a/Control/SGTools/SGTools/exceptions.h +++ b/Control/SGTools/SGTools/exceptions.h @@ -1,7 +1,7 @@ // This file's extension implies that it's C, but it's really -*- C++ -*-. /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ // $Id$ @@ -64,6 +64,7 @@ private: * @param id CLID of the DataProxy. * @param tid Type to which we're trying to convert the object. */ +[[noreturn]] void throwExcBadDataProxyCast (CLID id, const std::type_info& tid); diff --git a/Control/StoreGate/StoreGate/DataHandle.h b/Control/StoreGate/StoreGate/DataHandle.h index a3c3a93c65330822cdab0ba620069af4475bcba1..ddd4b87fb1d2839fb0426f42927facf2d31bbe48 100644 --- a/Control/StoreGate/StoreGate/DataHandle.h +++ b/Control/StoreGate/StoreGate/DataHandle.h @@ -19,17 +19,6 @@ #include "CxxUtils/checker_macros.h" #include <iterator> -template <typename DATA> -class DataHandle; - -template <class DATA> -bool operator== (const DataHandle<DATA>& h1, - const DataHandle<DATA>& h2); - -template <class DATA> -bool operator!= (const DataHandle<DATA>& h1, - const DataHandle<DATA>& h2); - /** @class DataHandle * @brief an iterator over instances of a given type in StoreGateSvc. It d-casts * and caches locally the pointed-at object, to speed-up subsequent accesses. @@ -131,11 +120,19 @@ public: virtual CLID clid() const override { return ClassID_traits<DATA>::ID(); } friend - bool operator==<>(const DataHandle<DATA>& h1, - const DataHandle<DATA>& h2); + bool operator== ATLAS_NOT_THREAD_SAFE (const DataHandle<DATA>& h1, + const DataHandle<DATA>& h2) + { + return h1.m_proxy == h2.m_proxy; + } + friend - bool operator!=<>(const DataHandle<DATA>& h1, - const DataHandle<DATA>& h2); + bool operator!= ATLAS_NOT_THREAD_SAFE (const DataHandle<DATA>& h1, + const DataHandle<DATA>& h2) + { + return h1.m_proxy != h2.m_proxy; + } + private: // OK since DataHandle should only be used locally, not shared between threads. @@ -146,22 +143,6 @@ private: }; -/// \name Comparison ops (compare proxies) -//@{ -template <class DATA> -bool operator== ATLAS_NOT_THREAD_SAFE (const DataHandle<DATA>& h1, - const DataHandle<DATA>& h2) -{ - return (h1.m_proxy == h2.m_proxy); -} -template <class DATA> -bool operator!= ATLAS_NOT_THREAD_SAFE (const DataHandle<DATA>& h1, - const DataHandle<DATA>& h2) -{ - return (h1.m_proxy != h2.m_proxy); -} -//@} - #include "StoreGate/DataHandle.icc" /* FIXME LEGACY - No dependency on ActiveStoreSvc here, but a number of Muon AtlasEvent packages are diff --git a/Control/StoreGate/StoreGate/StoreGate.h b/Control/StoreGate/StoreGate/StoreGate.h index 52e83e85cfa5c756ce01ee6dbb50264b29bf5683..d0999a5db85b67723cb1e7774c1c74f696d86304 100644 --- a/Control/StoreGate/StoreGate/StoreGate.h +++ b/Control/StoreGate/StoreGate/StoreGate.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 STOREGATE_STOREGATE_H @@ -28,11 +28,11 @@ public: static ActiveStoreSvc* activeStoreSvc(); /** multipleton: get a store by name * @param sgID name of the StoreGateSvc ptr to be returned */ - static StoreGateSvc* pointer(std::string sgID); + static StoreGateSvc* pointer(const std::string& sgID); /** multipleton: get a store by name * @param sgID name of the StoreGateSvc ptr to be returned * @throws std::runtime_error if not found*/ - static StoreGateSvc& instance(std::string sgID); + static StoreGateSvc& instance(const std::string& sgID); friend class NullType; //remove compiler warning diff --git a/Control/StoreGate/StoreGate/tools/SGImplSvc.h b/Control/StoreGate/StoreGate/tools/SGImplSvc.h index eef4075a2ae3aad74ab94d617c13157db16338a5..7b4034c2ab5548be3a99b3cdf5a324ce2ce529bb 100644 --- a/Control/StoreGate/StoreGate/tools/SGImplSvc.h +++ b/Control/StoreGate/StoreGate/tools/SGImplSvc.h @@ -247,14 +247,14 @@ public: //@{ /// register a callback function(2) with an already registered function(1) - StatusCode regFcn (const CallBackID c1, - const CallBackID c2, + StatusCode regFcn (const CallBackID& c1, + const CallBackID& c2, const IOVSvcCallBackFcn& fcn, bool trigger = false); /// register a callback function(2) with an already registered AlgTool StatusCode regFcn (const std::string& toolName, - const CallBackID c2, + const CallBackID& c2, const IOVSvcCallBackFcn& fcn, bool trigger = false); @@ -652,7 +652,7 @@ private: IResetable* ir, SG::DataProxy *&dp); bool bindHandleToProxyAndRegister (const CLID& id, const std::string& key, IResetable* ir, SG::DataProxy *&dp, - const CallBackID c, + const CallBackID& c, const IOVSvcCallBackFcn& fcn, bool trigger); diff --git a/Control/StoreGate/src/SGImplSvc.cxx b/Control/StoreGate/src/SGImplSvc.cxx index 555427a54532885e3d409b48adbae8e80760d16b..502702c18f911116616eac11a4dabdfb8c3c7d7f 100644 --- a/Control/StoreGate/src/SGImplSvc.cxx +++ b/Control/StoreGate/src/SGImplSvc.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 <algorithm> @@ -559,8 +559,8 @@ bool SGImplSvc::isSymLinked(const CLID& linkID, DataProxy* dp) StatusCode -SGImplSvc::regFcn( const CallBackID c1, - const CallBackID c2, +SGImplSvc::regFcn( const CallBackID& c1, + const CallBackID& c2, const IOVSvcCallBackFcn& fcn, bool trigger) { @@ -571,7 +571,7 @@ SGImplSvc::regFcn( const CallBackID c1, StatusCode SGImplSvc::regFcn( const std::string& toolName, - const CallBackID c2, + const CallBackID& c2, const IOVSvcCallBackFcn& fcn, bool trigger) { @@ -1449,7 +1449,7 @@ bool SGImplSvc::bindHandleToProxyAndRegister (const CLID& id, const std::string& bool SGImplSvc::bindHandleToProxyAndRegister (const CLID& id, const std::string& key, IResetable* ir, SG::DataProxy *&dp, - const CallBackID c, + const CallBackID& c, const IOVSvcCallBackFcn& fcn, bool trigger) { diff --git a/Control/StoreGate/src/StoreGate.cxx b/Control/StoreGate/src/StoreGate.cxx index 4d0a1ff90c684b19c4c33efbd0f43980866f9f12..7d3bccb215702adc027ae0d3a404656c4d5688a3 100644 --- a/Control/StoreGate/src/StoreGate.cxx +++ b/Control/StoreGate/src/StoreGate.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 "StoreGate/StoreGate.h" @@ -88,13 +88,13 @@ StoreGate::activeStoreSvc() { } StoreGateSvc* -StoreGate::pointer(std::string sgID) { +StoreGate::pointer(const std::string& sgID) { return getStore(sgID); } StoreGateSvc& -StoreGate::instance(std::string sgID) { +StoreGate::instance(const std::string& sgID) { StoreGateSvc* ptr(pointer(sgID)); if (0 == ptr) { throw std::runtime_error("Could not locate required StoreGate instance"); diff --git a/Control/StoreGate/test/DataHandle_test.cxx b/Control/StoreGate/test/DataHandle_test.cxx index 2df9fdbab49c74533ec101c7dcebc9b0417d70bb..e87aabcc07e26243d362721b344b84e94ef735c2 100644 --- a/Control/StoreGate/test/DataHandle_test.cxx +++ b/Control/StoreGate/test/DataHandle_test.cxx @@ -142,6 +142,7 @@ namespace Athena_test { ++dh; assert (vp[0]->refCount() == 2); + // cppcheck-suppress postfixOperator dh2++; assert (vp[0]->refCount() == 1); @@ -152,6 +153,7 @@ namespace Athena_test { assert (vp[0]->refCount() == 2); for (int i=1; i < 4; i++) assert (vp[i]->refCount() == 0); + // cppcheck-suppress postfixOperator dh3++; assert (vp[0]->refCount() == 1); assert (vp[1]->refCount() == 1); diff --git a/Database/AthenaPOOL/AthenaPoolCnvSvc/src/AthenaPoolCnvSvc.cxx b/Database/AthenaPOOL/AthenaPoolCnvSvc/src/AthenaPoolCnvSvc.cxx index 28f099b8dcf5e6266066ed5647e7a21950dfb7bb..43aa3e70f5fdce131a8ce895101661eb0c5920a0 100644 --- a/Database/AthenaPOOL/AthenaPoolCnvSvc/src/AthenaPoolCnvSvc.cxx +++ b/Database/AthenaPOOL/AthenaPoolCnvSvc/src/AthenaPoolCnvSvc.cxx @@ -30,6 +30,7 @@ #include "AuxDiscoverySvc.h" +#include "boost/algorithm/string.hpp" #include <algorithm> //______________________________________________________________________________ @@ -86,7 +87,7 @@ StatusCode AthenaPoolCnvSvc::initialize() { } // Extracting MaxFileSizes for global default and map by Database name. for (std::vector<std::string>::const_iterator iter = m_maxFileSizes.value().begin(), - last = m_maxFileSizes.value().end(); iter != last; iter++) { + last = m_maxFileSizes.value().end(); iter != last; ++iter) { if (iter->find('=') != std::string::npos) { long long maxFileSize = atoll(iter->substr(iter->find('=') + 1).c_str()); if (maxFileSize > 15000000000LL) { @@ -605,7 +606,7 @@ StatusCode AthenaPoolCnvSvc::commitOutput(const std::string& outputConnectionSpe ATH_MSG_ERROR("commitOutput FAILED to cleanup converters."); return(StatusCode::FAILURE); } - for (std::map<void*, RootType>::iterator iter = commitCache.begin(), last = commitCache.end(); iter != last; iter++) { + for (std::map<void*, RootType>::iterator iter = commitCache.begin(), last = commitCache.end(); iter != last; ++iter) { iter->second.Destruct(iter->first); } // Check FileSize @@ -963,15 +964,15 @@ StatusCode AthenaPoolCnvSvc::convertAddress(const IOpaqueAddress* pAddress, //__________________________________________________________________________ StatusCode AthenaPoolCnvSvc::decodeOutputSpec(std::string& fileSpec, int& outputTech) const { - if (fileSpec.find("oracle") == 0 || fileSpec.find("mysql") == 0) { + if (boost::starts_with (fileSpec, "oracle") || boost::starts_with (fileSpec, "mysql")) { outputTech = pool::POOL_RDBMS_StorageType.type(); - } else if (fileSpec.find("ROOTKEY:") == 0) { + } else if (boost::starts_with (fileSpec, "ROOTKEY:")) { outputTech = pool::ROOTKEY_StorageType.type(); fileSpec.erase(0, 8); - } else if (fileSpec.find("ROOTTREE:") == 0) { + } else if (boost::starts_with (fileSpec, "ROOTTREE:")) { outputTech = pool::ROOTTREE_StorageType.type(); fileSpec.erase(0, 9); - } else if (fileSpec.find("ROOTTREEINDEX:") == 0) { + } else if (boost::starts_with (fileSpec, "ROOTTREEINDEX:")) { outputTech = pool::ROOTTREEINDEX_StorageType.type(); fileSpec.erase(0, 14); } else if (outputTech == 0) { @@ -1178,7 +1179,7 @@ void AthenaPoolCnvSvc::extractPoolAttributes(const StringArrayProperty& property std::vector<std::string> opt; std::string attributeName, containerName, databaseName, valueString; for (std::vector<std::string>::const_iterator iter = property.value().begin(), - last = property.value().end(); iter != last; iter++) { + last = property.value().end(); iter != last; ++iter) { opt.clear(); attributeName.clear(); containerName.clear(); @@ -1295,7 +1296,7 @@ StatusCode AthenaPoolCnvSvc::processPoolAttributes(std::vector<std::vector<std:: if (iter->empty()) { iter = attr.erase(iter); } else { - iter++; + ++iter; } } return(retError ? StatusCode::FAILURE : StatusCode::SUCCESS); diff --git a/HLT/Trigger/TrigControl/TrigPSC/src/Psc.cxx b/HLT/Trigger/TrigControl/TrigPSC/src/Psc.cxx index cd0625d453e6be6625c977eacfbd253358844f19..0d06488d73591f3cf37ca5300414d593a408a2c9 100644 --- a/HLT/Trigger/TrigControl/TrigPSC/src/Psc.cxx +++ b/HLT/Trigger/TrigControl/TrigPSC/src/Psc.cxx @@ -44,6 +44,8 @@ #include <boost/property_tree/xml_parser.hpp> +#include "CxxUtils/checker_macros.h" + using namespace boost::property_tree; namespace @@ -523,7 +525,20 @@ bool psc::Psc::prepareForRun (const ptree& args) } // bind args to prepareForRun - auto prep = [&args](ITrigEventLoopMgr* mgr){return mgr->prepareForRun(args);}; + auto prep = [&args](ITrigEventLoopMgr* mgr) { + // FIXME: ITrigEventLookMgr::prepareForRun is declared NOT_THREAD_SAFE. + // Probably this method shoud also be NOT_THREAD_SAFE, but that's + // awkward because it implements a tdaq interface from hltinterface. + StatusCode ret ATLAS_THREAD_SAFE = mgr->prepareForRun (args); + + // This dance is needed to prevent RV optimization. + // Otherwise, the optimizer loses the ATLAS_THREAD_SAFE attribute + // on RET before the thread-safety checker gets to see the code. + if (ret.isSuccess()) { + return StatusCode (StatusCode::SUCCESS); + } + return ret; + }; if(!callOnEventLoopMgr<ITrigEventLoopMgr>(prep, "prepareForRun").isSuccess()) { ERS_PSC_ERROR("Error preparing the EventLoopMgr"); diff --git a/InnerDetector/InDetConditions/PixelConditionsAlgorithms/src/PixeldEdxAlg.cxx b/InnerDetector/InDetConditions/PixelConditionsAlgorithms/src/PixeldEdxAlg.cxx index def223c797bef3e3e6e6e8808d155e34f14aa7f5..986f74861234fccab0be13b14b69ba6014c1c730 100644 --- a/InnerDetector/InDetConditions/PixelConditionsAlgorithms/src/PixeldEdxAlg.cxx +++ b/InnerDetector/InDetConditions/PixelConditionsAlgorithms/src/PixeldEdxAlg.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 "PixeldEdxAlg.h" @@ -22,7 +22,7 @@ StatusCode PixeldEdxAlg::initialize() { ATH_CHECK(m_condSvc.retrieve()); - ATH_CHECK(m_readKey.initialize()); + ATH_CHECK(m_readKey.initialize(m_readfromcool)); ATH_CHECK(m_writeKey.initialize()); if (m_readfromcool) { if (m_condSvc->regHandle(this,m_writeKey).isFailure()) { diff --git a/InnerDetector/InDetConditions/SCT_ConditionsAlgorithms/share/testReadout.py b/InnerDetector/InDetConditions/SCT_ConditionsAlgorithms/share/testReadout.py index 4da660eb533574b7101b778d547eb9161c15d1c5..b317d7d79635fcdfc2f641d2c2b2dbf6885b89c8 100644 --- a/InnerDetector/InDetConditions/SCT_ConditionsAlgorithms/share/testReadout.py +++ b/InnerDetector/InDetConditions/SCT_ConditionsAlgorithms/share/testReadout.py @@ -88,6 +88,7 @@ conddb.addFolderSplitMC("SCT", "/SCT/DAQ/Config/MUR", "/SCT/DAQ/Config/MUR") from SCT_ConditionsAlgorithms.SCT_ConditionsAlgorithmsConf import SCT_ReadoutTestAlg SCT_ReadoutTestAlg = SCT_ReadoutTestAlg() +SCT_ReadoutTestAlg.SCT_ReadoutTool.SCT_CablingTool = '' # Module type and link status #SCT_ReadoutTestAlg.ModuleId = 143704064 # Endcap (default is barrel) diff --git a/InnerDetector/InDetConditions/SCT_ConditionsAlgorithms/share/testTdaqEnabled.py b/InnerDetector/InDetConditions/SCT_ConditionsAlgorithms/share/testTdaqEnabled.py index 044eafd34f340ae001c69bf371ce5828c658b620..ae84c18198a0b6c6286eb9ff4078b46a3ee8e48d 100644 --- a/InnerDetector/InDetConditions/SCT_ConditionsAlgorithms/share/testTdaqEnabled.py +++ b/InnerDetector/InDetConditions/SCT_ConditionsAlgorithms/share/testTdaqEnabled.py @@ -85,6 +85,12 @@ condSeq = AthSequencer("AthCondSeq") from xAODEventInfoCnv.xAODEventInfoCreator import xAODMaker__EventInfoCnvAlg condSeq+=xAODMaker__EventInfoCnvAlg(OutputLevel=2) +condAlgName = "SCT_CablingCondAlgFromCoraCool" +if not hasattr(condSeq, condAlgName): + from AthenaCommon.CfgGetter import getAlgorithm + SCT_CablingCondAlgFromCoraCool = getAlgorithm(condAlgName) + condSeq += SCT_CablingCondAlgFromCoraCool + from SCT_ConditionsTools.SCT_TdaqEnabledToolSetup import SCT_TdaqEnabledToolSetup sct_TdaqEnabledToolSetup = SCT_TdaqEnabledToolSetup() sct_TdaqEnabledToolSetup.setup() diff --git a/InnerDetector/InDetConditions/SCT_ConditionsAlgorithms/src/SCT_DCSConditionsStatCondAlg.cxx b/InnerDetector/InDetConditions/SCT_ConditionsAlgorithms/src/SCT_DCSConditionsStatCondAlg.cxx index 90576ddc47c00ec795074c6db6ed859be699a67a..0d61c20abd1678a77e60c2f9c7686c691082d06e 100644 --- a/InnerDetector/InDetConditions/SCT_ConditionsAlgorithms/src/SCT_DCSConditionsStatCondAlg.cxx +++ b/InnerDetector/InDetConditions/SCT_ConditionsAlgorithms/src/SCT_DCSConditionsStatCondAlg.cxx @@ -82,6 +82,8 @@ StatusCode SCT_DCSConditionsStatCondAlg::execute(const EventContext& ctx) const std::unique_ptr<SCT_DCSStatCondData> writeCdoState{std::make_unique<SCT_DCSStatCondData>()}; // Read state info + // Meaning of state word is found at + // https://twiki.cern.ch/twiki/bin/view/Atlas/SctDCSSoftware#Decoding_Status_words std::string paramState{"STATE"}; CondAttrListCollection::const_iterator attrListState{readCdoState->begin()}; CondAttrListCollection::const_iterator endState{readCdoState->end()}; @@ -92,11 +94,17 @@ StatusCode SCT_DCSConditionsStatCondAlg::execute(const EventContext& ctx) const const CondAttrListCollection::AttributeList &payload{attrListState->second}; if (payload.exists(paramState) and not payload[paramState].isNull()) { unsigned int val{payload[paramState].data<unsigned int>()}; - unsigned int hvstate{val bitand 240}; - unsigned int lvstate{val bitand 15}; - if ( ( (m_chanstatCut=="NORM") and not ((hvstate==16 or hvstate==48) and (lvstate==1 or lvstate==3)) ) - or ( (m_chanstatCut=="NSTBY") and not ((hvstate==16 or hvstate==48 or hvstate==32) and (lvstate==1 or lvstate==3 or lvstate==2)) ) - or ( (m_chanstatCut=="LOOSE") and not ((hvstate==16 or hvstate==48 or hvstate==32 or hvstate==128) and (lvstate==1 or lvstate==3 or lvstate==2 or lvstate==8)) )) { + unsigned int hvstate{(val >> 4) & 0xF}; + unsigned int lvstate{ val & 0xF}; + if ( ((m_chanstatCut=="NORM") + and not ((hvstate==ON or hvstate==MANUAL) + and (lvstate==ON or lvstate==MANUAL))) + or ((m_chanstatCut=="NSTBY") + and not ((hvstate==ON or hvstate==MANUAL or hvstate==STANDBY) + and (lvstate==ON or lvstate==MANUAL or lvstate==STANDBY))) + or ((m_chanstatCut=="LOOSE") + and not ((hvstate==ON or hvstate==MANUAL or hvstate==STANDBY or hvstate==RAMPING) + and (lvstate==ON or lvstate==MANUAL or lvstate==STANDBY or lvstate==RAMPING)))) { writeCdoState->fill(channelNumber, paramState); } else { writeCdoState->remove(channelNumber, paramState); diff --git a/InnerDetector/InDetConditions/SCT_ConditionsAlgorithms/src/SCT_DCSConditionsStatCondAlg.h b/InnerDetector/InDetConditions/SCT_ConditionsAlgorithms/src/SCT_DCSConditionsStatCondAlg.h index 9b06603159dee2cea6ddbb2f7a285e2e83dc57cc..1f36dc56b9becc80c811ab0c426c7b0f1f18d7f4 100644 --- a/InnerDetector/InDetConditions/SCT_ConditionsAlgorithms/src/SCT_DCSConditionsStatCondAlg.h +++ b/InnerDetector/InDetConditions/SCT_ConditionsAlgorithms/src/SCT_DCSConditionsStatCondAlg.h @@ -1,7 +1,7 @@ // -*- C++ -*- /* - Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ #ifndef SCT_DCSCONDITIONSSTATCONDALG @@ -30,6 +30,25 @@ class SCT_DCSConditionsStatCondAlg : public AthReentrantAlgorithm virtual bool isClonable() const override { return true; } private: + // Meaning of state word is found at + // https://twiki.cern.ch/twiki/bin/view/Atlas/SctDCSSoftware#Decoding_Status_words + enum StateWord {OFF=0x0, + ON=0x1, + STANDBY=0x2, + MANUAL=0x3, + MASK_OFF=0x4, + MASK_ON=0x5, + HARD_RESET=0x6, + DISABLED=0x7, + RAMPING=0x8, + INTERLOCKED=0x9, + TRIP_HW=0xA, + TRIP_SW=0xB, + LVCARD_LATCH=0xC, + NO_MATCH=0xD, + UNKNOWN=0xE, + ANY=0xF}; + SG::ReadCondHandleKey<CondAttrListCollection> m_readKeyHV{this, "ReadKeyHV", "/SCT/DCS/HV", "Key of input (raw) HV conditions folder"}; SG::ReadCondHandleKey<CondAttrListCollection> m_readKeyState{this, "ReadKeyState", "/SCT/DCS/CHANSTAT", "Key of input (raw) State conditions folder"}; SG::WriteCondHandleKey<SCT_DCSStatCondData> m_writeKeyState{this, "WriteKeyState", "SCT_DCSStatCondData", "Key of output (derived) State conditions data"}; diff --git a/InnerDetector/InDetDetDescr/InDetGeoModelUtils/InDetGeoModelUtils/IInDetServMatBuilderTool.h b/InnerDetector/InDetDetDescr/InDetGeoModelUtils/InDetGeoModelUtils/IInDetServMatBuilderTool.h index 5cd2eeb8e3d64c66744d99f1ef4954d0586626da..d3ac8a4d069d5612b64f503b7faca2b8b0fa5aa1 100644 --- a/InnerDetector/InDetDetDescr/InDetGeoModelUtils/InDetGeoModelUtils/IInDetServMatBuilderTool.h +++ b/InnerDetector/InDetDetDescr/InDetGeoModelUtils/InDetGeoModelUtils/IInDetServMatBuilderTool.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ /////////////////////////////////////////////////////////////////// @@ -24,7 +24,7 @@ class IInDetServMatBuilderTool : virtual public IAlgTool { public: static const InterfaceID& interfaceID( ) ; - virtual const std::vector<const InDetDD::ServiceVolume *> & getServices() = 0; + virtual const std::vector<const InDetDD::ServiceVolume *> & getServices() const = 0; }; inline const InterfaceID& IInDetServMatBuilderTool::interfaceID() diff --git a/InnerDetector/InDetDetDescr/InDetServMatGeoModel/CMakeLists.txt b/InnerDetector/InDetDetDescr/InDetServMatGeoModel/CMakeLists.txt index 2f42a3c03c2b2b44473be9411013013e38ba89c0..f8de9f5d402145029c0b46012d6371d2001c638e 100644 --- a/InnerDetector/InDetDetDescr/InDetServMatGeoModel/CMakeLists.txt +++ b/InnerDetector/InDetDetDescr/InDetServMatGeoModel/CMakeLists.txt @@ -9,6 +9,7 @@ atlas_subdir( InDetServMatGeoModel ) atlas_depends_on_subdirs( PUBLIC Control/AthenaBaseComps Control/AthenaKernel + Control/CxxUtils Database/RDBAccessSvc DetectorDescription/GeoPrimitives DetectorDescription/GeoModel/GeoModelUtilities @@ -31,7 +32,7 @@ atlas_add_component( InDetServMatGeoModel src/*.cxx src/components/*.cxx INCLUDE_DIRS ${CORAL_INCLUDE_DIRS} - LINK_LIBRARIES ${CORAL_LIBRARIES} ${GEOMODELCORE_LIBRARIES} AthenaBaseComps AthenaKernel GeoModelUtilities GaudiKernel InDetGeoModelUtils SGTools StoreGateLib SGtests GeometryDBSvcLib ) + LINK_LIBRARIES ${CORAL_LIBRARIES} ${GEOMODELCORE_LIBRARIES} AthenaBaseComps AthenaKernel CxxUtils GeoModelUtilities GaudiKernel InDetGeoModelUtils SGTools StoreGateLib SGtests GeometryDBSvcLib ) # Install files from the package: atlas_install_headers( InDetServMatGeoModel ) diff --git a/InnerDetector/InDetDetDescr/InDetServMatGeoModel/InDetServMatGeoModel/ComputeStaveServices.h b/InnerDetector/InDetDetDescr/InDetServMatGeoModel/InDetServMatGeoModel/ComputeStaveServices.h index 4868d8df5ddd12d8d7760f23ccdd6438110a0878..7ef824a5c21b997d18526ffed52fd7ab002ad92c 100644 --- a/InnerDetector/InDetDetDescr/InDetServMatGeoModel/InDetServMatGeoModel/ComputeStaveServices.h +++ b/InnerDetector/InDetDetDescr/InDetServMatGeoModel/InDetServMatGeoModel/ComputeStaveServices.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 ComputeStaveServices_H @@ -7,6 +7,7 @@ #include "InDetServMatGeoModel/StaveServices.h" #include "AthenaKernel/MsgStreamMember.h" +#include "CxxUtils/checker_macros.h" class ComputeStaveServices { public: @@ -21,7 +22,7 @@ public: private: // the message stream (same for all derived classes) MsgStream& msg (MSG::Level lvl) const { return m_msg << lvl; } - mutable Athena::MsgStreamMember m_msg; + mutable Athena::MsgStreamMember m_msg ATLAS_THREAD_SAFE; }; diff --git a/InnerDetector/InDetDetDescr/InDetServMatGeoModel/InDetServMatGeoModel/EndPlateFactoryFS.h b/InnerDetector/InDetDetDescr/InDetServMatGeoModel/InDetServMatGeoModel/EndPlateFactoryFS.h index 5dcd212f8a150b0a3c9c33bf7fb08d5816fda675..62323975ae37ee873ee55a4f8f84f1cea35185f3 100755 --- a/InnerDetector/InDetDetDescr/InDetServMatGeoModel/InDetServMatGeoModel/EndPlateFactoryFS.h +++ b/InnerDetector/InDetDetDescr/InDetServMatGeoModel/InDetServMatGeoModel/EndPlateFactoryFS.h @@ -1,11 +1,12 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ #ifndef INDETSERVMATGEOMODEL_ENDPLATEFACTORYFS_H #define INDETSERVMATGEOMODEL_ENDPLATEFACTORYFS_H #include "AthenaKernel/MsgStreamMember.h" +#include "CxxUtils/checker_macros.h" #include "GaudiKernel/ServiceHandle.h" class StoreGateSvc; @@ -39,7 +40,7 @@ class EndPlateFactoryFS { // private data StoreGateSvc *m_detStore; ServiceHandle<IRDBAccessSvc> m_rdbAccess; - mutable Athena::MsgStreamMember m_msg; + mutable Athena::MsgStreamMember m_msg ATLAS_THREAD_SAFE; }; #endif diff --git a/InnerDetector/InDetDetDescr/InDetServMatGeoModel/InDetServMatGeoModel/HRoute.h b/InnerDetector/InDetDetDescr/InDetServMatGeoModel/InDetServMatGeoModel/HRoute.h index 3ac1effba67781a18d68ed6dda11459347a307ae..75d2646365f0ea1793760e095109abe7a777e8df 100644 --- a/InnerDetector/InDetDetDescr/InDetServMatGeoModel/InDetServMatGeoModel/HRoute.h +++ b/InnerDetector/InDetDetDescr/InDetServMatGeoModel/InDetServMatGeoModel/HRoute.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 HRoute_H @@ -29,7 +29,7 @@ public: virtual double exit() const {return zExit();} - virtual Route* nextRoute() const {return m_next;} + virtual Route* nextRoute() {return m_next;} const VolumeContainer& volumes() const {return m_volumes;} diff --git a/InnerDetector/InDetDetDescr/InDetServMatGeoModel/InDetServMatGeoModel/InDetServMatAthenaComps.h b/InnerDetector/InDetDetDescr/InDetServMatGeoModel/InDetServMatGeoModel/InDetServMatAthenaComps.h index 28076e6b370cb0e931e8e590c26caa4f9d76bdd5..5b4da5326f1c3f2314c082d9b25cdfb9e5ce9729 100644 --- a/InnerDetector/InDetDetDescr/InDetServMatGeoModel/InDetServMatGeoModel/InDetServMatAthenaComps.h +++ b/InnerDetector/InDetDetDescr/InDetServMatGeoModel/InDetServMatGeoModel/InDetServMatAthenaComps.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 InDetServMatGeoModel_InDetServMatAthenaComps_H @@ -18,7 +18,7 @@ public: //Add Builder Tool void setBuilderTool(IInDetServMatBuilderTool * builderTool); - IInDetServMatBuilderTool *builderTool() const; + const IInDetServMatBuilderTool *builderTool() const; private: diff --git a/InnerDetector/InDetDetDescr/InDetServMatGeoModel/InDetServMatGeoModel/InDetServMatBuilderToolSLHC.h b/InnerDetector/InDetDetDescr/InDetServMatGeoModel/InDetServMatGeoModel/InDetServMatBuilderToolSLHC.h index 1e961306b3a17ae7a3fb4c9c6e577c4e37a561d8..3ee2ecd54af7d7f37d08291900e27ed1e59f0a0b 100644 --- a/InnerDetector/InDetDetDescr/InDetServMatGeoModel/InDetServMatGeoModel/InDetServMatBuilderToolSLHC.h +++ b/InnerDetector/InDetDetDescr/InDetServMatGeoModel/InDetServMatGeoModel/InDetServMatBuilderToolSLHC.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 InDetServMatBuilderToolSLHC_H @@ -62,7 +62,7 @@ public: virtual StatusCode finalize(); /// Get the services - virtual const std::vector<const InDetDD::ServiceVolume *> & getServices(); + virtual const std::vector<const InDetDD::ServiceVolume *> & getServices() const; /// General service adding method. void addService(InDetDD::ServiceVolume * param); diff --git a/InnerDetector/InDetDetDescr/InDetServMatGeoModel/InDetServMatGeoModel/InDetServMatFactoryDC2.h b/InnerDetector/InDetDetDescr/InDetServMatGeoModel/InDetServMatGeoModel/InDetServMatFactoryDC2.h index a75d268b25e50ada7fa747c66b87cd457bc91943..0d243aed661c6208ab04c8fb00e84c1845b431f4 100755 --- a/InnerDetector/InDetDetDescr/InDetServMatGeoModel/InDetServMatGeoModel/InDetServMatFactoryDC2.h +++ b/InnerDetector/InDetDetDescr/InDetServMatGeoModel/InDetServMatGeoModel/InDetServMatFactoryDC2.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 INDETSERVMATGEOMODEL_INDETSERVMATFACTORYDC2_H @@ -7,12 +7,13 @@ #include "AthenaKernel/MsgStreamMember.h" -#include "GaudiKernel/ServiceHandle.h" +#include "CxxUtils/checker_macros.h" #include "GeoModelKernel/GeoVDetectorFactory.h" //the following needed because the return type of getDetectorManager() is not //the same as the method return type as specified in the baseclass #include "InDetServMatGeoModel/InDetServMatManager.h" +#include "GaudiKernel/ServiceHandle.h" class StoreGateSvc; class IRDBAccessSvc; @@ -45,7 +46,7 @@ class InDetServMatFactoryDC2 : public GeoVDetectorFactory { StoreGateSvc *m_detStore; ServiceHandle<IRDBAccessSvc> m_rdbAccess; InDetDD::InDetServMatManager *m_manager; - mutable Athena::MsgStreamMember m_msg; + mutable Athena::MsgStreamMember m_msg ATLAS_THREAD_SAFE; }; #endif // INDETSERVMATGEOMODEL_INDETSERVMATFACTORYDC2_H diff --git a/InnerDetector/InDetDetDescr/InDetServMatGeoModel/InDetServMatGeoModel/InDetServMatFactoryFS.h b/InnerDetector/InDetDetDescr/InDetServMatGeoModel/InDetServMatGeoModel/InDetServMatFactoryFS.h index 73ef0ddd0469037ecba4941ed5e68fcf0f4fbd35..a2342a598d723a2fe497ab2aab0ae79d55299c6c 100755 --- a/InnerDetector/InDetDetDescr/InDetServMatGeoModel/InDetServMatGeoModel/InDetServMatFactoryFS.h +++ b/InnerDetector/InDetDetDescr/InDetServMatGeoModel/InDetServMatGeoModel/InDetServMatFactoryFS.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 INDETSERVMATGEOMODEL_INDETSERVMATFACTORYFS_H @@ -7,10 +7,12 @@ #include "AthenaKernel/MsgStreamMember.h" -#include "GaudiKernel/ServiceHandle.h" +#include "CxxUtils/checker_macros.h" #include "GeoModelKernel/GeoVDetectorFactory.h" #include "InDetServMatGeoModel/InDetServMatManager.h" +#include "GaudiKernel/ServiceHandle.h" + class StoreGateSvc; class IRDBAccessSvc; @@ -43,9 +45,7 @@ class InDetServMatFactoryFS : public GeoVDetectorFactory { StoreGateSvc *m_detStore; ServiceHandle<IRDBAccessSvc> m_rdbAccess; InDetDD::InDetServMatManager *m_manager; - mutable Athena::MsgStreamMember m_msg; + mutable Athena::MsgStreamMember m_msg ATLAS_THREAD_SAFE; }; #endif - - diff --git a/InnerDetector/InDetDetDescr/InDetServMatGeoModel/InDetServMatGeoModel/InDetServMatGeometryManager.h b/InnerDetector/InDetDetDescr/InDetServMatGeoModel/InDetServMatGeoModel/InDetServMatGeometryManager.h index 0492c528c4602f16d79b8a1b27815b910ccc9109..100f00b8847a7380e37a3ef6f5f45ae6847f4e6a 100644 --- a/InnerDetector/InDetDetDescr/InDetServMatGeoModel/InDetServMatGeoModel/InDetServMatGeometryManager.h +++ b/InnerDetector/InDetDetDescr/InDetServMatGeoModel/InDetServMatGeoModel/InDetServMatGeometryManager.h @@ -28,7 +28,7 @@ public: const IGeometryDBSvc * db() const {return m_athenaComps->geomDB();} // Access to material manager - InDetMaterialManager * matMgr() const {return m_matMgr;} + InDetMaterialManager * matMgr() {return m_matMgr;} // Access to message stream diff --git a/InnerDetector/InDetDetDescr/InDetServMatGeoModel/InDetServMatGeoModel/PixelServMatFactoryDC2.h b/InnerDetector/InDetDetDescr/InDetServMatGeoModel/InDetServMatGeoModel/PixelServMatFactoryDC2.h index e7128af38533b53dd3b910211da9fb503fddc02d..03de32713da33d3feaf9b593b0f2feb190a4d3e1 100755 --- a/InnerDetector/InDetDetDescr/InDetServMatGeoModel/InDetServMatGeoModel/PixelServMatFactoryDC2.h +++ b/InnerDetector/InDetDetDescr/InDetServMatGeoModel/InDetServMatGeoModel/PixelServMatFactoryDC2.h @@ -1,11 +1,12 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ #ifndef INDETSERVMATGEOMODEL_PIXELSERVMATFACTORYDC2_H #define INDETSERVMATGEOMODEL_PIXELSERVMATFACTORYDC2_H #include "AthenaKernel/MsgStreamMember.h" +#include "CxxUtils/checker_macros.h" #include "GaudiKernel/ServiceHandle.h" class StoreGateSvc; @@ -37,7 +38,7 @@ class PixelServMatFactoryDC2 { // private data StoreGateSvc *m_detStore; ServiceHandle<IRDBAccessSvc> m_rdbAccess; - mutable Athena::MsgStreamMember m_msg; + mutable Athena::MsgStreamMember m_msg ATLAS_THREAD_SAFE; }; #endif // INDETSERVMATGEOMODEL_PIXELSERVMATFACTORYDC2_H diff --git a/InnerDetector/InDetDetDescr/InDetServMatGeoModel/InDetServMatGeoModel/PixelServMatFactoryFS.h b/InnerDetector/InDetDetDescr/InDetServMatGeoModel/InDetServMatGeoModel/PixelServMatFactoryFS.h index 79f91d19cdcaba1a0fa03f3dba5bb8636b6bd877..dc8abbbc8c4560909e408064eab645bfcd83cb8c 100755 --- a/InnerDetector/InDetDetDescr/InDetServMatGeoModel/InDetServMatGeoModel/PixelServMatFactoryFS.h +++ b/InnerDetector/InDetDetDescr/InDetServMatGeoModel/InDetServMatGeoModel/PixelServMatFactoryFS.h @@ -6,6 +6,7 @@ #define INDETSERVMATGEOMODEL_PIXELSERVMATFACTORYFS_H #include "AthenaKernel/MsgStreamMember.h" +#include "CxxUtils/checker_macros.h" #include "GaudiKernel/ServiceHandle.h" class StoreGateSvc; @@ -40,7 +41,7 @@ class PixelServMatFactoryFS { StoreGateSvc *m_detStore; ServiceHandle<IRDBAccessSvc> m_rdbAccess; std::unique_ptr<InDetMaterialManager> m_materialManager; - mutable Athena::MsgStreamMember m_msg; + mutable Athena::MsgStreamMember m_msg ATLAS_THREAD_SAFE; }; diff --git a/InnerDetector/InDetDetDescr/InDetServMatGeoModel/InDetServMatGeoModel/Route.h b/InnerDetector/InDetDetDescr/InDetServMatGeoModel/InDetServMatGeoModel/Route.h index 4477275fbe9041cd13e3f29b7a39e57eaf3b80e4..cfc92db7cadad94d1b2b4bcc4a1aa64cf288dffc 100644 --- a/InnerDetector/InDetDetDescr/InDetServMatGeoModel/InDetServMatGeoModel/Route.h +++ b/InnerDetector/InDetDetDescr/InDetServMatGeoModel/InDetServMatGeoModel/Route.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 Route_H @@ -33,7 +33,7 @@ public: //virtual int direction() = 0; - virtual Route* nextRoute() const = 0; + virtual Route* nextRoute() = 0; virtual const VolumeContainer& volumes() const = 0; diff --git a/InnerDetector/InDetDetDescr/InDetServMatGeoModel/InDetServMatGeoModel/SCT_ServMatFactoryDC2.h b/InnerDetector/InDetDetDescr/InDetServMatGeoModel/InDetServMatGeoModel/SCT_ServMatFactoryDC2.h index beb1a0949c8150d764b5fde7104bba6a206e5349..abbdab708e9c6ca2e285fcc3c2bafbce19537875 100755 --- a/InnerDetector/InDetDetDescr/InDetServMatGeoModel/InDetServMatGeoModel/SCT_ServMatFactoryDC2.h +++ b/InnerDetector/InDetDetDescr/InDetServMatGeoModel/InDetServMatGeoModel/SCT_ServMatFactoryDC2.h @@ -1,11 +1,12 @@ /* - 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 INDETSERVMATGEOMODEL_SCT_SERVMATFACTORYDC2_H #define INDETSERVMATGEOMODEL_SCT_SERVMATFACTORYDC2_H #include "AthenaKernel/MsgStreamMember.h" +#include "CxxUtils/checker_macros.h" #include "GaudiKernel/ServiceHandle.h" class StoreGateSvc; @@ -57,7 +58,7 @@ class SCT_ServMatFactoryDC2 { StoreGateSvc *m_detStore; ServiceHandle<IRDBAccessSvc> m_rdbAccess; const StoredMaterialManager *m_materialManager; - mutable Athena::MsgStreamMember m_msg; + mutable Athena::MsgStreamMember m_msg ATLAS_THREAD_SAFE; }; #endif // INDETSERVMATGEOMODEL_SCT_SERVMATFACTORYDC2_H diff --git a/InnerDetector/InDetDetDescr/InDetServMatGeoModel/InDetServMatGeoModel/SCT_ServMatFactoryFS.h b/InnerDetector/InDetDetDescr/InDetServMatGeoModel/InDetServMatGeoModel/SCT_ServMatFactoryFS.h index 3a4c3a0a493d2e9f0132650afaca78f53f4c070a..f5f519f807769be7ad64bfe26c65a36e57c0089b 100755 --- a/InnerDetector/InDetDetDescr/InDetServMatGeoModel/InDetServMatGeoModel/SCT_ServMatFactoryFS.h +++ b/InnerDetector/InDetDetDescr/InDetServMatGeoModel/InDetServMatGeoModel/SCT_ServMatFactoryFS.h @@ -6,6 +6,7 @@ #define INDETSERVMATGEOMODEL_SCT_SERVMATFACTORYFS_H #include "AthenaKernel/MsgStreamMember.h" +#include "CxxUtils/checker_macros.h" #include "GaudiKernel/ServiceHandle.h" class StoreGateSvc; @@ -42,7 +43,7 @@ class SCT_ServMatFactoryFS { StoreGateSvc *m_detStore; ServiceHandle<IRDBAccessSvc> m_rdbAccess; std::unique_ptr<InDetMaterialManager> m_materialManager; - mutable Athena::MsgStreamMember m_msg; + mutable Athena::MsgStreamMember m_msg ATLAS_THREAD_SAFE; }; diff --git a/InnerDetector/InDetDetDescr/InDetServMatGeoModel/InDetServMatGeoModel/ServiceVolume.h b/InnerDetector/InDetDetDescr/InDetServMatGeoModel/InDetServMatGeoModel/ServiceVolume.h index 68b66819a6e3ce4c0c0962e0d22be0627efaad00..f5f5d14461d8706f2d2b96d5b7c1337cdab26e13 100644 --- a/InnerDetector/InDetDetDescr/InDetServMatGeoModel/InDetServMatGeoModel/ServiceVolume.h +++ b/InnerDetector/InDetDetDescr/InDetServMatGeoModel/InDetServMatGeoModel/ServiceVolume.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 ServiceVolume_H @@ -77,7 +77,7 @@ public: LayerContainer layers() const {return m_layers;} - ServiceVolume* next() const {return m_next;} + ServiceVolume* next() {return m_next;} void addPrevious( ServiceVolume* prev) { m_previous.push_back(prev);} diff --git a/InnerDetector/InDetDetDescr/InDetServMatGeoModel/InDetServMatGeoModel/SquirrelCageFactoryFS.h b/InnerDetector/InDetDetDescr/InDetServMatGeoModel/InDetServMatGeoModel/SquirrelCageFactoryFS.h index ddaa209b7ed47f9e94c5f32c32a6d477fac55aa0..991d968647ffe2fe33392f2746f2d84a31b12916 100755 --- a/InnerDetector/InDetDetDescr/InDetServMatGeoModel/InDetServMatGeoModel/SquirrelCageFactoryFS.h +++ b/InnerDetector/InDetDetDescr/InDetServMatGeoModel/InDetServMatGeoModel/SquirrelCageFactoryFS.h @@ -1,11 +1,12 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ #ifndef INDETSERVMATGEOMODEL_SQUIRRELCAGEFACTORYFS_H #define INDETSERVMATGEOMODEL_SQUIRRELCAGEFACTORYFS_H #include "AthenaKernel/MsgStreamMember.h" +#include "CxxUtils/checker_macros.h" #include "GaudiKernel/ServiceHandle.h" class StoreGateSvc; @@ -37,7 +38,7 @@ class SquirrelCageFactoryFS { // private data StoreGateSvc *m_detStore; ServiceHandle<IRDBAccessSvc> m_rdbAccess; - mutable Athena::MsgStreamMember m_msg; + mutable Athena::MsgStreamMember m_msg ATLAS_THREAD_SAFE; }; #endif diff --git a/InnerDetector/InDetDetDescr/InDetServMatGeoModel/InDetServMatGeoModel/SupportRailFactoryFS.h b/InnerDetector/InDetDetDescr/InDetServMatGeoModel/InDetServMatGeoModel/SupportRailFactoryFS.h index 74278e2230e8c74fb413be6a7f63125fb2b8be73..bc8f7ffb0abad50941fac21799f31945d0ee4764 100755 --- a/InnerDetector/InDetDetDescr/InDetServMatGeoModel/InDetServMatGeoModel/SupportRailFactoryFS.h +++ b/InnerDetector/InDetDetDescr/InDetServMatGeoModel/InDetServMatGeoModel/SupportRailFactoryFS.h @@ -1,11 +1,12 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ #ifndef INDETSERVMATGEOMODEL_SUPPORTRAILFACTORYFS_H #define INDETSERVMATGEOMODEL_SUPPORTRAILFACTORYFS_H #include "AthenaKernel/MsgStreamMember.h" +#include "CxxUtils/checker_macros.h" #include "GaudiKernel/ServiceHandle.h" class StoreGateSvc; @@ -37,7 +38,7 @@ class SupportRailFactoryFS { // private data StoreGateSvc *m_detStore; ServiceHandle<IRDBAccessSvc> m_rdbAccess; - mutable Athena::MsgStreamMember m_msg; + mutable Athena::MsgStreamMember m_msg ATLAS_THREAD_SAFE; }; diff --git a/InnerDetector/InDetDetDescr/InDetServMatGeoModel/InDetServMatGeoModel/TRT_ServMatFactoryDC2.h b/InnerDetector/InDetDetDescr/InDetServMatGeoModel/InDetServMatGeoModel/TRT_ServMatFactoryDC2.h index 4fddb6f6baec5def8807afa7966d4a5dda94112a..3daf7df92fa91e7c75649a4aa2c8ede56296d838 100755 --- a/InnerDetector/InDetDetDescr/InDetServMatGeoModel/InDetServMatGeoModel/TRT_ServMatFactoryDC2.h +++ b/InnerDetector/InDetDetDescr/InDetServMatGeoModel/InDetServMatGeoModel/TRT_ServMatFactoryDC2.h @@ -1,10 +1,11 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ #ifndef INDETSERVMATGEOMODEL_TRT_SERVMATFACTORYDC2_H #define INDETSERVMATGEOMODEL_TRT_SERVMATFACTORYDC2_H #include "AthenaKernel/MsgStreamMember.h" +#include "CxxUtils/checker_macros.h" #include "GaudiKernel/ServiceHandle.h" class StoreGateSvc; @@ -56,7 +57,7 @@ class TRT_ServMatFactoryDC2 { StoreGateSvc *m_detStore; ServiceHandle<IRDBAccessSvc> m_rdbAccess; const StoredMaterialManager *m_materialManager; - mutable Athena::MsgStreamMember m_msg; + mutable Athena::MsgStreamMember m_msg ATLAS_THREAD_SAFE; }; #endif // INDETSERVMATGEOMODEL_TRT_SERVMATFACTORYDC2_H diff --git a/InnerDetector/InDetDetDescr/InDetServMatGeoModel/InDetServMatGeoModel/TRT_ServMatFactoryFS.h b/InnerDetector/InDetDetDescr/InDetServMatGeoModel/InDetServMatGeoModel/TRT_ServMatFactoryFS.h index 34ba811ead0a883d7bdee7d8f96b85d1af34f92c..4f7e28e66fe49abe9dcfcb8e981dc771642703a1 100755 --- a/InnerDetector/InDetDetDescr/InDetServMatGeoModel/InDetServMatGeoModel/TRT_ServMatFactoryFS.h +++ b/InnerDetector/InDetDetDescr/InDetServMatGeoModel/InDetServMatGeoModel/TRT_ServMatFactoryFS.h @@ -6,6 +6,7 @@ #define INDETSERVMATGEOMODEL_TRT_SERVMATFACTORYFS_H #include "AthenaKernel/MsgStreamMember.h" +#include "CxxUtils/checker_macros.h" #include "GaudiKernel/ServiceHandle.h" class StoreGateSvc; @@ -42,7 +43,7 @@ class TRT_ServMatFactoryFS { StoreGateSvc *m_detStore; ServiceHandle<IRDBAccessSvc> m_rdbAccess; std::unique_ptr<InDetMaterialManager> m_materialManager; - mutable Athena::MsgStreamMember m_msg; + mutable Athena::MsgStreamMember m_msg ATLAS_THREAD_SAFE; }; #endif diff --git a/InnerDetector/InDetDetDescr/InDetServMatGeoModel/InDetServMatGeoModel/VRoute.h b/InnerDetector/InDetDetDescr/InDetServMatGeoModel/InDetServMatGeoModel/VRoute.h index 67d1cb6d18e93c03601eeb6b61791017e937f0fc..c10afdbb6cfad5fa85979e2443deee826f71f0b5 100644 --- a/InnerDetector/InDetDetDescr/InDetServMatGeoModel/InDetServMatGeoModel/VRoute.h +++ b/InnerDetector/InDetDetDescr/InDetServMatGeoModel/InDetServMatGeoModel/VRoute.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 VRoute_H @@ -29,7 +29,7 @@ public: virtual double exit() const {return rExit();} - virtual Route* nextRoute() const {return m_next;} + virtual Route* nextRoute() {return m_next;} virtual const VolumeContainer& volumes() const {return m_volumes;} diff --git a/InnerDetector/InDetDetDescr/InDetServMatGeoModel/src/InDetServMatAthenaComps.cxx b/InnerDetector/InDetDetDescr/InDetServMatGeoModel/src/InDetServMatAthenaComps.cxx index a1e85356a64785e00ea3a576f47f5708c96db013..e37a4958a677c53661a88968783ce0e3376b8305 100644 --- a/InnerDetector/InDetDetDescr/InDetServMatGeoModel/src/InDetServMatAthenaComps.cxx +++ b/InnerDetector/InDetDetDescr/InDetServMatGeoModel/src/InDetServMatAthenaComps.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 "InDetServMatGeoModel/InDetServMatAthenaComps.h" @@ -17,8 +17,8 @@ InDetServMatAthenaComps::setBuilderTool(IInDetServMatBuilderTool * builderTool) m_builderTool = builderTool; } -IInDetServMatBuilderTool * -InDetServMatAthenaComps::builderTool() const +const IInDetServMatBuilderTool * +InDetServMatAthenaComps::builderTool() const { return m_builderTool; } diff --git a/InnerDetector/InDetDetDescr/InDetServMatGeoModel/src/InDetServMatBuilderToolSLHC.cxx b/InnerDetector/InDetDetDescr/InDetServMatGeoModel/src/InDetServMatBuilderToolSLHC.cxx index c7e100403a0045865804892e6983ef0f522d31a7..c30a08e87c44f08c4253f55d0dc5d1b1714ef843 100644 --- a/InnerDetector/InDetDetDescr/InDetServMatGeoModel/src/InDetServMatBuilderToolSLHC.cxx +++ b/InnerDetector/InDetDetDescr/InDetServMatGeoModel/src/InDetServMatBuilderToolSLHC.cxx @@ -86,6 +86,8 @@ StatusCode InDetServMatBuilderToolSLHC::initialize() m_athenaComps->setRDBAccessSvc(&*m_rdbAccessSvc); m_athenaComps->setGeometryDBSvc(&*m_geometryDBSvc); + build(); + msg(MSG::INFO) << "initialize() successful in " << name() << endmsg; return StatusCode::SUCCESS; } @@ -97,9 +99,8 @@ StatusCode InDetServMatBuilderToolSLHC::finalize() return sc; } -const std::vector<const InDetDD::ServiceVolume *> & InDetServMatBuilderToolSLHC::getServices() +const std::vector<const InDetDD::ServiceVolume *> & InDetServMatBuilderToolSLHC::getServices() const { - if (!m_init) build(); return m_services; } diff --git a/InnerDetector/InDetRecAlgs/SiSPSeededTrackFinder/share/SiSPSeededTracksStandalone.py b/InnerDetector/InDetRecAlgs/SiSPSeededTrackFinder/share/SiSPSeededTracksStandalone.py index 9e15f052297dd87b4cbe232fcda9a3fadeb0101c..6339fa7e3376a8cbda8c2485ad058f33e5d5faf1 100644 --- a/InnerDetector/InDetRecAlgs/SiSPSeededTrackFinder/share/SiSPSeededTracksStandalone.py +++ b/InnerDetector/InDetRecAlgs/SiSPSeededTrackFinder/share/SiSPSeededTracksStandalone.py @@ -453,6 +453,7 @@ else: InDetClusterMakerTool.PixelModuleData = "" InDetClusterMakerTool.PixelChargeCalibCondData = "" InDetClusterMakerTool.PixelLorentzAngleTool = None + InDetClusterMakerTool.PixelOfflineCalibData = "" # Set up Pixel neutral network tools clusterSplitProbTool = None diff --git a/InnerDetector/InDetRecAlgs/SiSPSeededTrackFinder/share/SiSPSeededTracksStandaloneFromESD.py b/InnerDetector/InDetRecAlgs/SiSPSeededTrackFinder/share/SiSPSeededTracksStandaloneFromESD.py index 7d41f64e1579ee364d47f521dbd86daa8a3ba5d3..a7503299a0a444b8c08b6ac90dde0fb5e5feb2e8 100644 --- a/InnerDetector/InDetRecAlgs/SiSPSeededTrackFinder/share/SiSPSeededTracksStandaloneFromESD.py +++ b/InnerDetector/InDetRecAlgs/SiSPSeededTrackFinder/share/SiSPSeededTracksStandaloneFromESD.py @@ -271,7 +271,8 @@ if doPixel: if not hasattr(condSeq, "PixelTDAQCondAlg"): from PixelConditionsAlgorithms.PixelConditionsAlgorithmsConf import PixelTDAQCondAlg - condSeq += PixelTDAQCondAlg(name="PixelTDAQCondAlg") + condSeq += PixelTDAQCondAlg(name="PixelTDAQCondAlg", + ReadKey = '') ##################### # Calibration Setup # @@ -316,6 +317,7 @@ if doPixel: if not hasattr(condSeq, 'PixelCablingCondAlg'): from PixelConditionsAlgorithms.PixelConditionsAlgorithmsConf import PixelCablingCondAlg condSeq += PixelCablingCondAlg(name="PixelCablingCondAlg", + ReadKey='', MappingFile=IdMappingDat, RodIDForSingleLink40=rodIDForSingleLink40) diff --git a/InnerDetector/InDetRecTools/InDetTrackHoleSearch/CMakeLists.txt b/InnerDetector/InDetRecTools/InDetTrackHoleSearch/CMakeLists.txt index 42ec25daa38c10d4047de13ad2e0200f9e329d81..eaf25ab3a11e2663a5548c99a230148d087a190c 100644 --- a/InnerDetector/InDetRecTools/InDetTrackHoleSearch/CMakeLists.txt +++ b/InnerDetector/InDetRecTools/InDetTrackHoleSearch/CMakeLists.txt @@ -33,7 +33,7 @@ atlas_depends_on_subdirs( PUBLIC atlas_add_component( InDetTrackHoleSearch src/*.cxx src/components/*.cxx - LINK_LIBRARIES AthenaBaseComps GaudiKernel TrkEventPrimitives TrkParameters TrkToolInterfaces AtlasDetDescr Identifier InDetReadoutGeometry InDetRecToolInterfaces TrkDetDescrUtils TrkGeometry TrkVolumes TrkEventUtils TrkMeasurementBase TrkTrack TrkTrackSummary TrkExInterfaces ) + LINK_LIBRARIES AthenaBaseComps GaudiKernel TrkEventPrimitives TrkParameters TrkToolInterfaces AtlasDetDescr Identifier InDetReadoutGeometry InDetRecToolInterfaces TrkDetDescrUtils TrkGeometry TrkVolumes TrkEventUtils TrkMeasurementBase TrkTrack TrkTrackSummary TrkExInterfaces InDetConditionsSummaryService ) # Install files from the package: atlas_install_headers( InDetTrackHoleSearch ) diff --git a/InnerDetector/InDetRecTools/SiCombinatorialTrackFinderTool_xk/src/SiCombinatorialTrackFinder_xk.cxx b/InnerDetector/InDetRecTools/SiCombinatorialTrackFinderTool_xk/src/SiCombinatorialTrackFinder_xk.cxx index f9d6a701cfd1eb37a5a5b5c271e057f8126c5e71..ce6e4f5dae799547bb83efe2854c3258673d2669 100644 --- a/InnerDetector/InDetRecTools/SiCombinatorialTrackFinderTool_xk/src/SiCombinatorialTrackFinder_xk.cxx +++ b/InnerDetector/InDetRecTools/SiCombinatorialTrackFinderTool_xk/src/SiCombinatorialTrackFinder_xk.cxx @@ -103,15 +103,12 @@ StatusCode InDet::SiCombinatorialTrackFinder_xk::initialize ATLAS_NOT_THREAD_SAF // m_outputlevel = msg().level()-MSG::DEBUG; - if (m_usePIX) { - ATH_CHECK( m_pixcontainerkey.initialize() ); - ATH_CHECK( m_boundaryPixelKey.initialize() ); - } - if (m_useSCT) { - ATH_CHECK( m_sctcontainerkey.initialize() ); - ATH_CHECK( m_boundarySCTKey.initialize() ); - ATH_CHECK( m_SCTDetEleCollKey.initialize() ); - } + ATH_CHECK( m_pixcontainerkey.initialize (m_usePIX) ); + ATH_CHECK( m_boundaryPixelKey.initialize (m_usePIX) ); + + ATH_CHECK( m_sctcontainerkey.initialize (m_useSCT) ); + ATH_CHECK( m_boundarySCTKey.initialize (m_useSCT) ); + ATH_CHECK( m_SCTDetEleCollKey.initialize (m_useSCT) ); // initialize conditions object key for field cache // diff --git a/InnerDetector/InDetTrigRecAlgs/InDetTrigParticleCreation/src/TrigParticleCreator.cxx b/InnerDetector/InDetTrigRecAlgs/InDetTrigParticleCreation/src/TrigParticleCreator.cxx index cd171e94eb0f4fdb297ca268b42e58c6c2945c59..41d54cb5daabbbba0b5f1c0000013179d2617e27 100755 --- a/InnerDetector/InDetTrigRecAlgs/InDetTrigParticleCreation/src/TrigParticleCreator.cxx +++ b/InnerDetector/InDetTrigRecAlgs/InDetTrigParticleCreation/src/TrigParticleCreator.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ #include "GaudiKernel/ITHistSvc.h" @@ -14,7 +14,6 @@ #include "Particle/TrackParticleContainer.h" #include "TrkToolInterfaces/IPRD_AssociationTool.h" #include "TrigSteeringEvent/TrigRoiDescriptor.h" -#include "IRegionSelector/IRegSelSvc.h" #include "TrkTrackSummary/TrackSummary.h" #include <cmath> diff --git a/InnerDetector/InDetTrigRecAlgs/InDetTrigParticleCreation/src/TrigTrackingxAODCnv.cxx b/InnerDetector/InDetTrigRecAlgs/InDetTrigParticleCreation/src/TrigTrackingxAODCnv.cxx index 626fd69222d4c4268f039c136961926128c652bd..b9723a7c846e8a43775f2d146a9fff8f2c7a12e9 100644 --- a/InnerDetector/InDetTrigRecAlgs/InDetTrigParticleCreation/src/TrigTrackingxAODCnv.cxx +++ b/InnerDetector/InDetTrigRecAlgs/InDetTrigParticleCreation/src/TrigTrackingxAODCnv.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 "GaudiKernel/ITHistSvc.h" @@ -17,7 +17,6 @@ #include "Particle/TrackParticleContainer.h" #include "TrkToolInterfaces/IPRD_AssociationTool.h" #include "TrigSteeringEvent/TrigRoiDescriptor.h" -#include "IRegionSelector/IRegSelSvc.h" #include "TrkTrackSummary/TrackSummary.h" #include "Identifier/Identifier.h" diff --git a/InnerDetector/InDetTrigRecAlgs/InDetTrigVxSecondary/src/TrigVxSecondary.cxx b/InnerDetector/InDetTrigRecAlgs/InDetTrigVxSecondary/src/TrigVxSecondary.cxx index 5763e49b3a38f801345d5d538f70006f57decdd0..3770590294e23e7e7a7c8a8be1296e27510eaf1e 100644 --- a/InnerDetector/InDetTrigRecAlgs/InDetTrigVxSecondary/src/TrigVxSecondary.cxx +++ b/InnerDetector/InDetTrigRecAlgs/InDetTrigVxSecondary/src/TrigVxSecondary.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 "InDetTrigVxSecondary/TrigVxSecondary.h" @@ -11,7 +11,6 @@ #include "InDetBeamSpotService/IBeamCondSvc.h" #include "TrigInDetEvent/TrigVertexCollection.h" #include "TrigSteeringEvent/TrigRoiDescriptor.h" -#include "IRegionSelector/IRegSelSvc.h" #include <sstream> #include <TLorentzVector.h> #include "xAODBase/IParticle.h" diff --git a/InnerDetector/InDetTrigRecAlgs/InDetTrigVxSecondary/src/TrigVxSecondaryCombo.cxx b/InnerDetector/InDetTrigRecAlgs/InDetTrigVxSecondary/src/TrigVxSecondaryCombo.cxx index 8d406973cc6c4c04e0a990f521a4cc4ef5e15ffb..a5216ec2559c0aa1a096762b06c3321e4b8ebc22 100644 --- a/InnerDetector/InDetTrigRecAlgs/InDetTrigVxSecondary/src/TrigVxSecondaryCombo.cxx +++ b/InnerDetector/InDetTrigRecAlgs/InDetTrigVxSecondary/src/TrigVxSecondaryCombo.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 "InDetTrigVxSecondary/TrigVxSecondaryCombo.h" @@ -12,7 +12,6 @@ #include "InDetBeamSpotService/IBeamCondSvc.h" #include "TrigInDetEvent/TrigVertexCollection.h" #include "TrigSteeringEvent/TrigRoiDescriptor.h" -#include "IRegionSelector/IRegSelSvc.h" #include <sstream> #include <TLorentzVector.h> #include "xAODBase/IParticle.h" diff --git a/MagneticField/MagFieldServices/src/AtlasFieldCacheCondAlg.cxx b/MagneticField/MagFieldServices/src/AtlasFieldCacheCondAlg.cxx index 932fd88b12a263c7fadba9c93578ef280b0e840a..f246e474820c2990639aaa6bb2bc3a61644f6c21 100644 --- a/MagneticField/MagFieldServices/src/AtlasFieldCacheCondAlg.cxx +++ b/MagneticField/MagFieldServices/src/AtlasFieldCacheCondAlg.cxx @@ -40,7 +40,7 @@ MagField::AtlasFieldCacheCondAlg::initialize() { ATH_CHECK( m_condSvc.retrieve() ); // Read Handle for the current - ATH_CHECK( m_currInputKey.initialize() ); + ATH_CHECK( m_currInputKey.initialize (m_useDCS) ); // Read handle for the field map cond object ATH_CHECK( m_mapCondObjInputKey.initialize() ); diff --git a/MuonSpectrometer/MuonReconstruction/MuonTrackMakers/MuonTrackMakerTools/MuonTrackFinderTools/src/MuonTrackScoringTool.cxx b/MuonSpectrometer/MuonReconstruction/MuonTrackMakers/MuonTrackMakerTools/MuonTrackFinderTools/src/MuonTrackScoringTool.cxx index d3071039a8f3dd03278810ab50dd0195e8e2bf0a..94fa65cf2246f67d1f16f710cfef85f03d59b985 100755 --- a/MuonSpectrometer/MuonReconstruction/MuonTrackMakers/MuonTrackMakerTools/MuonTrackFinderTools/src/MuonTrackScoringTool.cxx +++ b/MuonSpectrometer/MuonReconstruction/MuonTrackMakers/MuonTrackMakerTools/MuonTrackFinderTools/src/MuonTrackScoringTool.cxx @@ -84,12 +84,15 @@ namespace Muon { Trk::TrackScore MuonTrackScoringTool::score( const Trk::Track& track, const bool /*suppressHoleSearch*/ ) const { - + Trk::TrackScore score; const Trk::TrackSummary* summary = track.trackSummary(); - if (!summary) { throw std::logic_error("Summary requested for a non mutable track without a track summary."); } - - //log <<MSG::DEBUG<<"Track has TrackSummary "<<*summary<<endmsg; - Trk::TrackScore score = Trk::TrackScore( simpleScore(track, *summary) ); + if (summary) { + score = simpleScore(track, *summary); + } else { + // This is potentially slow, so might need revisiting. + std::unique_ptr<Trk::TrackSummary> tmpSummary = m_trkSummaryTool->summaryNoHoleSearch(track); + score = simpleScore(track, *tmpSummary); + } return score; } diff --git a/Reconstruction/MuonIdentification/MuonCombinedBaseTools/src/MuonSegmentTagTool.cxx b/Reconstruction/MuonIdentification/MuonCombinedBaseTools/src/MuonSegmentTagTool.cxx index 4ba31bc953e8efbb799e022007542993bd651320..5d9f4211223e11fd1ecafc3619e6f1acaa03c03f 100644 --- a/Reconstruction/MuonIdentification/MuonCombinedBaseTools/src/MuonSegmentTagTool.cxx +++ b/Reconstruction/MuonIdentification/MuonCombinedBaseTools/src/MuonSegmentTagTool.cxx @@ -55,7 +55,7 @@ namespace MuonCombined { m_printer("Muon::MuonEDMPrinterTool/MuonEDMPrinterTool"), p_MuTagMatchingTool("MuTagMatchingTool/MuTagMatchingTool") , p_MuTagAmbiguitySolverTool("MuTagAmbiguitySolverTool/MuTagAmbiguitySolverTool") , - m_caloExtensionTool("Trk::ParticleCaloExtensionTool/ParticleCaloExtensionTool", this), + m_caloExtensionTool("Trk::ParticleCaloExtensionTool/ParticleCaloExtensionTool", this), m_segmentSelector("Muon::MuonSegmentSelectionTool/MuonSegmentSelectionTool"), m_hitSummaryTool("Muon::MuonSegmentHitSummaryTool/MuonSegmentHitSummaryTool"), m_surfaces(0), @@ -119,38 +119,44 @@ namespace MuonCombined { return StatusCode::SUCCESS; } - StatusCode MuonSegmentTagTool::finalize() { - delete m_surfaces; - ATH_MSG_INFO( "Total number of considered ID tracks " << m_ntotTracks); - ATH_MSG_INFO( "Total number of ID tracks with angular match " << m_nangleMatch); - ATH_MSG_INFO( "Total number of preselected ID tracks " << m_npmatch); - ATH_MSG_INFO( "Total number of ID tracks at MS entry " << m_natMSEntrance); - ATH_MSG_INFO( "Total number of accepted ID tracks " << m_naccepted); - for( unsigned int i=0;i<12;++i ){ - double ratio = m_extrapolated[i] == 0 ? 0 : m_goodExtrapolated[i]/(double)m_extrapolated[i]; - ATH_MSG_INFO( "Layer " << i << " extrap " << m_extrapolated[i] << " good " << m_goodExtrapolated[i] << " ratio " << ratio ); - } - return StatusCode::SUCCESS; + StatusCode MuonSegmentTagTool::finalize() + { + delete m_surfaces; + ATH_MSG_INFO("Total number of considered ID tracks " << m_ntotTracks); + ATH_MSG_INFO("Total number of ID tracks with angular match " << m_nangleMatch); + ATH_MSG_INFO("Total number of preselected ID tracks " << m_npmatch); + ATH_MSG_INFO("Total number of ID tracks at MS entry " << m_natMSEntrance); + ATH_MSG_INFO("Total number of accepted ID tracks " << m_naccepted); + for (unsigned int i = 0; i < 12; ++i) + { + double ratio = m_extrapolated[i] == 0 ? 0 : m_goodExtrapolated[i] / (double)m_extrapolated[i]; + ATH_MSG_INFO("Layer " << i << " extrap " << m_extrapolated[i] << " good " << m_goodExtrapolated[i] << " ratio " << ratio); + } + return StatusCode::SUCCESS; } - void MuonSegmentTagTool::tag( const InDetCandidateCollection& inDetCandidates, const xAOD::MuonSegmentContainer& xaodSegments, InDetCandidateToTagMap* tagMap ) const { - - // loop over segments are extract MuonSegments + create links between segments and xAOD segments - std::map< const Muon::MuonSegment*, ElementLink<xAOD::MuonSegmentContainer> > segmentToxAODSegmentMap; - std::vector< const Muon::MuonSegment* > segments; - segments.reserve(xaodSegments.size()); - unsigned int index = 0; - for( auto it = xaodSegments.begin();it!=xaodSegments.end();++it,++index ){ - if( !(*it)->muonSegment().isValid() ) continue; - const Muon::MuonSegment* mseg = dynamic_cast<const Muon::MuonSegment*>(*(*it)->muonSegment()); - ElementLink<xAOD::MuonSegmentContainer> link(xaodSegments,index); - link.toPersistent(); - if( mseg ) { - segments.push_back(mseg); - segmentToxAODSegmentMap[mseg] = link; - } - } - tag(inDetCandidates, segments, &segmentToxAODSegmentMap, tagMap); + void MuonSegmentTagTool::tag(const InDetCandidateCollection &inDetCandidates, const xAOD::MuonSegmentContainer &xaodSegments, InDetCandidateToTagMap *tagMap) const + { + + // loop over segments are extract MuonSegments + create links between segments and xAOD segments + std::map<const Muon::MuonSegment *, ElementLink<xAOD::MuonSegmentContainer>> segmentToxAODSegmentMap; + std::vector<const Muon::MuonSegment *> segments; + segments.reserve(xaodSegments.size()); + unsigned int index = 0; + for (auto it = xaodSegments.begin(); it != xaodSegments.end(); ++it, ++index) + { + if (!(*it)->muonSegment().isValid()) + continue; + const Muon::MuonSegment *mseg = dynamic_cast<const Muon::MuonSegment *>(*(*it)->muonSegment()); + ElementLink<xAOD::MuonSegmentContainer> link(xaodSegments, index); + link.toPersistent(); + if (mseg) + { + segments.push_back(mseg); + segmentToxAODSegmentMap[mseg] = link; + } + } + tag(inDetCandidates, segments, &segmentToxAODSegmentMap, tagMap); } //todo: fix segmentToxAODSegmentMap void MuonSegmentTagTool::tag( const InDetCandidateCollection& inDetCandidates, const std::vector<const Muon::MuonSegment*>& segments, @@ -266,15 +272,15 @@ namespace MuonCombined { ATH_MSG_VERBOSE( "========================== dumping the full track =========================" ); ATH_MSG_VERBOSE( *track ); - const Trk::TrackSummary* summary = track->trackSummary() ; // Summary retrieved from TrackParticle (not from Track: it might be absent there) bool trkEtaInfo(false); - if( !summary ) { - ATH_MSG_WARNING( "Track has no trackSummary ! No ID eta information retrieved !" ); - } else { - unsigned int nrIDetaHits = summary->get( Trk::numberOfSCTHits ) + summary->get( Trk::numberOfPixelHits ) ; - if( nrIDetaHits >=5 ) trkEtaInfo = true; - if( !trkEtaInfo ) ATH_MSG_DEBUG( "Track has no ID eta information! (" << nrIDetaHits << " etaHits)" ); - } + uint8_t numSCTHits = 0; uint8_t numPixelHits=0; + if (!idTP->indetTrackParticle().summaryValue( numSCTHits, xAOD::numberOfSCTHits ) ) ATH_MSG_DEBUG("TrackParticle missing numberOfSCTHits"); + if (!idTP->indetTrackParticle().summaryValue( numPixelHits, xAOD::numberOfPixelHits ) ) ATH_MSG_DEBUG("TrackParticle missing numberOfPixelHits"); + + unsigned int nrIDetaHits = numSCTHits + numPixelHits; + if( nrIDetaHits >=5 ) trkEtaInfo = true; + if( !trkEtaInfo ) ATH_MSG_DEBUG( "Track has no ID eta information! (" << nrIDetaHits << " etaHits)" ); + ++m_ntotTracks; bool hasMatch = m_doBidirectional; if( !m_doBidirectional ){ @@ -605,7 +611,7 @@ namespace MuonCombined { MuonCombined::MuonSegmentInfo info = p_MuTagMatchingTool->muTagSegmentInfo(track,*itSeg,atSegSurface) ; if(segmentToxAODSegmentMap) - info.link = (*segmentToxAODSegmentMap)[*itSeg]; + info.link = (*segmentToxAODSegmentMap)[*itSeg]; // ATH_MSG_DEBUG( " MuTagSegmentInfo matchPosition pullY " << info.pullY << " pullX " << info.pullX << " resY " << info.resY << " resX " << info.resX << " exErrorY " << info.exErrorY << " ex errorX " << info.exErrorX << " seg errorY " << info.segErrorY << " seg errorX " << info.segErrorX ); // ATH_MSG_DEBUG( " MuTagSegmentInfo matchDirection pullYZ " << info.pullYZ << " pullXZ " << info.pullXZ << " resYZ " << info.dangleYZ << " resXZ " << info.dangleXZ << " exErrorYZ " << info.exErrorYZ << " ex errorXZ " << info.exErrorXZ << " seg errorYZ " << info.segErrorYZ << " seg errorXZ " << info.segErrorXZ ); // ATH_MSG_DEBUG( " MuTagSegmentInfo matchDistance hasPhi " << info.hasPhi << " resX " << info.resX << " dangleXZ " << info.dangleXZ << " maximumResidualAlongTube " << info.maximumResidualAlongTube << " resY " << info.resY << " dangleYZ " << info.dangleYZ ); @@ -614,15 +620,19 @@ namespace MuonCombined { isMatched = p_MuTagMatchingTool->matchSegmentPosition( &info,trkEtaInfo); - if( !isMatched ){ - if( m_doTable ){ - if( !trkEtaInfo ) segVsSurf[segmentCount] = "posPhi" ; - else segVsSurf[segmentCount] = "pos" ; - } - delete atSegSurface; - continue; - } - isMatched = p_MuTagMatchingTool->matchSegmentDirection( &info,trkEtaInfo); + if (!isMatched) + { + if (m_doTable) + { + if (!trkEtaInfo) + segVsSurf[segmentCount] = "posPhi"; + else + segVsSurf[segmentCount] = "pos"; + } + delete atSegSurface; + continue; + } + isMatched = p_MuTagMatchingTool->matchSegmentDirection( &info,trkEtaInfo); if( !isMatched ){ if( m_doTable ){ @@ -783,7 +793,6 @@ namespace MuonCombined { - } void MuonSegmentTagTool::printTable( std::vector< std::string > didEx , diff --git a/Reconstruction/tauRecTools/Root/LinkDef.h b/Reconstruction/tauRecTools/Root/LinkDef.h index f5a919a42f3923dada64bc7e879d0e9131594e8f..cd09769f64ad4d688212129f629ff00af739e8a2 100644 --- a/Reconstruction/tauRecTools/Root/LinkDef.h +++ b/Reconstruction/tauRecTools/Root/LinkDef.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ #include "tauRecTools/TauCalibrateLC.h" @@ -25,10 +25,6 @@ #pragma link off all functions; #pragma link C++ nestedclass; -#endif - -#ifdef __CINT__ - #pragma link C++ class TauCalibrateLC+; #pragma link C++ class TauCommonCalcVars+; #pragma link C++ class TauSubstructureVariables+; diff --git a/Reconstruction/tauRecTools/Root/TauEleOLRDecorator.cxx b/Reconstruction/tauRecTools/Root/TauEleOLRDecorator.cxx index c3f01225741f45880bc9a585ca98f3a47ee91ad2..028b99cd08634f595941ff19778ff76c9a7fafeb 100644 --- a/Reconstruction/tauRecTools/Root/TauEleOLRDecorator.cxx +++ b/Reconstruction/tauRecTools/Root/TauEleOLRDecorator.cxx @@ -2,6 +2,8 @@ Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ +#ifndef XAOD_STANDALONE + /** * Tau Electron Overlap Removal Decorator Tool * @@ -109,3 +111,5 @@ float TauEleOLRDecorator::getCutVal(float fEta, float fPt) const int iBin= m_hCutValues->FindBin(fPt, std::abs(fEta)); return m_hCutValues->GetBinContent(iBin); } + +#endif diff --git a/Reconstruction/tauRecTools/Root/TauPi0ClusterScaler.cxx b/Reconstruction/tauRecTools/src/TauPi0ClusterScaler.cxx similarity index 99% rename from Reconstruction/tauRecTools/Root/TauPi0ClusterScaler.cxx rename to Reconstruction/tauRecTools/src/TauPi0ClusterScaler.cxx index 5568f08bc3044916c947eaee70915bbdca98ccf5..2d9a903a0ac915b636c5e7670e2adef5442da919 100644 --- a/Reconstruction/tauRecTools/Root/TauPi0ClusterScaler.cxx +++ b/Reconstruction/tauRecTools/src/TauPi0ClusterScaler.cxx @@ -12,7 +12,7 @@ #include <vector> -#include "tauRecTools/TauPi0ClusterScaler.h" +#include "TauPi0ClusterScaler.h" #include "xAODTau/TauJet.h" #include "xAODPFlow/PFO.h" #include "tauRecTools/ITauToolBase.h" diff --git a/Reconstruction/tauRecTools/tauRecTools/TauPi0ClusterScaler.h b/Reconstruction/tauRecTools/src/TauPi0ClusterScaler.h similarity index 100% rename from Reconstruction/tauRecTools/tauRecTools/TauPi0ClusterScaler.h rename to Reconstruction/tauRecTools/src/TauPi0ClusterScaler.h diff --git a/Reconstruction/tauRecTools/src/components/tauRecTools_entries.cxx b/Reconstruction/tauRecTools/src/components/tauRecTools_entries.cxx index 83a774a34059c5934f683f8fd5bf67779243cb2d..881c83e2414222a669f3cd842d68ebfd0a85ab68 100644 --- a/Reconstruction/tauRecTools/src/components/tauRecTools_entries.cxx +++ b/Reconstruction/tauRecTools/src/components/tauRecTools_entries.cxx @@ -8,8 +8,10 @@ #include "../TauShotFinder.h" #include "../TauPi0ClusterCreator.h" #include "../TauPi0CreateROI.h" +#include "../TauPi0ClusterScaler.h" #include "../TauVertexVariables.h" #endif + #include "tauRecTools/TauCalibrateLC.h" #include "tauRecTools/TauCommonCalcVars.h" #include "tauRecTools/TauSubstructureVariables.h" @@ -18,7 +20,6 @@ #include "tauRecTools/TauTrackClassifier.h" #include "tauRecTools/TauTrackRNNClassifier.h" #include "tauRecTools/CombinedP4FromRecoTaus.h" -#include "tauRecTools/TauPi0ClusterScaler.h" #include "tauRecTools/TauPi0ScoreCalculator.h" #include "tauRecTools/TauPi0Selector.h" #include "tauRecTools/TauWPDecorator.h" @@ -37,6 +38,7 @@ DECLARE_COMPONENT( TauElectronVetoVariables ) DECLARE_COMPONENT( TauShotFinder ) DECLARE_COMPONENT( TauPi0ClusterCreator ) DECLARE_COMPONENT( TauPi0CreateROI ) +DECLARE_COMPONENT( TauPi0ClusterScaler ) DECLARE_COMPONENT( TauVertexVariables ) #endif @@ -50,7 +52,6 @@ DECLARE_COMPONENT( tauRecTools::TrackRNN ) DECLARE_COMPONENT( CombinedP4FromRecoTaus ) DECLARE_COMPONENT( TauSubstructureVariables ) DECLARE_COMPONENT( TauCommonCalcVars ) -DECLARE_COMPONENT( TauPi0ClusterScaler ) DECLARE_COMPONENT( TauPi0ScoreCalculator ) DECLARE_COMPONENT( TauPi0Selector ) DECLARE_COMPONENT( TauWPDecorator ) diff --git a/Tools/PyUtils/python/FilePeekerTool.py b/Tools/PyUtils/python/FilePeekerTool.py index 18b82f54c7e795f7b6a169f9236e1c675f66945c..da93fbdde436f6709113510918446e905cc5e1fb 100644 --- a/Tools/PyUtils/python/FilePeekerTool.py +++ b/Tools/PyUtils/python/FilePeekerTool.py @@ -265,7 +265,7 @@ class FilePeekerTool(): spec = a.specification() a_type = spec.typeName() if a_type.find('string') >= 0: - a_data = a.data('string')() + a_data = a.data['string']() # a_data = getattr(a, 'data<std::basic_string<char> >') () try: a_data = eval(a_data,{},{}) @@ -274,7 +274,7 @@ class FilePeekerTool(): pass # print (spec.name(),a_data, file=stdout) else: - a_data = a.data(a_type)() + a_data = a.data[a_type]() #print ("%s: %s %s" (spec.name(), a_data, type(a_data) ), file=stdout) attr_data.append( (spec.name(), a_data) ) attrs.append(dict(attr_data)) diff --git a/Tracking/Acts/ActsGeometry/ActsGeometry/ActsExtrapolationAlg.h b/Tracking/Acts/ActsGeometry/ActsGeometry/ActsExtrapolationAlg.h index f7992802058a560e141ad9cc22f194c5cc17f3fd..9c6aa5d3058a8296f7eee7da2395dd427322651d 100755 --- a/Tracking/Acts/ActsGeometry/ActsGeometry/ActsExtrapolationAlg.h +++ b/Tracking/Acts/ActsGeometry/ActsGeometry/ActsExtrapolationAlg.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ #ifndef ACTSGEOMETRY_ACTSEXTRAPOLATIONALG_H @@ -14,9 +14,6 @@ // ACTS #include "Acts/EventData/TrackParameters.hpp" #include "Acts/Geometry/GeometryID.hpp" -#include "Acts/Utilities/Helpers.hpp" - -// PACKAGE // STL #include <memory> @@ -27,12 +24,14 @@ namespace Acts { class TrackingGeometry; - namespace detail { class Step; } } + +class IActsMaterialTrackWriterSvc; + class EventContext; class IAthRNGSvc; class IActsExtrapolationTool; @@ -51,16 +50,15 @@ private: ToolHandle<IActsExtrapolationTool> m_extrapolationTool{this, "ExtrapolationTool", "ActsExtrapolationTool"}; - // std::shared_ptr<RootExCellWriter<Acts::TrackParameters>> m_rootEccWriter; // poor-mans Particle Gun is included here right now Gaudi::Property<std::vector<double>> m_etaRange{this, "EtaRange", {-3, 3}, "The eta range for particles"}; Gaudi::Property<std::vector<double>> m_ptRange{this, "PtRange", {0.1, 1000}, "The pt range for particles"}; Gaudi::Property<size_t> m_nParticlePerEvent{this, "NParticlesPerEvent", 1, "The number of particles per event"}; - // this does not work right now - //Gaudi::Property<bool> m_writeMaterialTracks{this, "WriteMaterialTracks", false, ""}; - //ServiceHandle<IActsMaterialTrackWriterSvc> m_materialTrackWriterSvc; + // material track writer for the material map validation + Gaudi::Property<bool> m_writeMaterialTracks{this, "WriteMaterialTracks", false, "Write material track"}; + ServiceHandle<IActsMaterialTrackWriterSvc> m_materialTrackWriterSvc; mutable std::mutex m_writeMutex{}; mutable std::unique_ptr<std::ofstream> m_objOut; diff --git a/Tracking/Acts/ActsGeometry/ActsGeometry/ActsExtrapolationTool.h b/Tracking/Acts/ActsGeometry/ActsGeometry/ActsExtrapolationTool.h index 1b1b5e3a82b276b96bb451b7458bf3372cb8489a..ddd2a3ca6fc28aa3f60dd6a259cd11fe77654e2a 100644 --- a/Tracking/Acts/ActsGeometry/ActsGeometry/ActsExtrapolationTool.h +++ b/Tracking/Acts/ActsGeometry/ActsGeometry/ActsExtrapolationTool.h @@ -15,16 +15,14 @@ // PACKAGE #include "ActsGeometryInterfaces/IActsExtrapolationTool.h" #include "ActsGeometryInterfaces/IActsTrackingGeometryTool.h" -#include "ActsGeometry/ActsGeometryContext.h" #include "ActsGeometry/ATLASMagneticFieldWrapper.h" // ACTS +#include "Acts/MagneticField/ConstantBField.hpp" +#include "Acts/MagneticField/MagneticFieldContext.hpp" #include "Acts/Propagator/detail/SteppingLogger.hpp" #include "Acts/Propagator/DebugOutputActor.hpp" #include "Acts/Propagator/StandardAborters.hpp" -#include "ActsGeometry/ATLASMagneticFieldWrapper.h" -#include "Acts/MagneticField/ConstantBField.hpp" -#include "Acts/MagneticField/MagneticFieldContext.hpp" #include "Acts/Utilities/Result.hpp" #include "Acts/Utilities/Units.hpp" #include "Acts/Utilities/Helpers.hpp" @@ -48,7 +46,6 @@ namespace ActsExtrapolationDetail { class ActsExtrapolationTool : public extends<AthAlgTool, IActsExtrapolationTool> { - public: virtual StatusCode initialize() override; @@ -62,32 +59,33 @@ private: using SteppingLogger = Acts::detail::SteppingLogger; using DebugOutput = Acts::DebugOutputActor; using EndOfWorld = Acts::EndOfWorldReached; - using ResultType = Acts::Result<std::pair<std::vector<Acts::detail::Step>, + using ResultType = Acts::Result<std::pair<ActsPropagationOutput, DebugOutput::result_type>>; + public: virtual - std::vector<Acts::detail::Step> + ActsPropagationOutput propagationSteps(const EventContext& ctx, const Acts::BoundParameters& startParameters, Acts::NavigationDirection navDir = Acts::forward, double pathLimit = std::numeric_limits<double>::max()) const override; - + virtual std::unique_ptr<const Acts::CurvilinearParameters> propagate(const EventContext& ctx, const Acts::BoundParameters& startParameters, Acts::NavigationDirection navDir = Acts::forward, double pathLimit = std::numeric_limits<double>::max()) const override; - + virtual - std::vector<Acts::detail::Step> + ActsPropagationOutput propagationSteps(const EventContext& ctx, const Acts::BoundParameters& startParameters, const Acts::Surface& target, Acts::NavigationDirection navDir = Acts::forward, double pathLimit = std::numeric_limits<double>::max()) const override; - + virtual std::unique_ptr<const Acts::BoundParameters> propagate(const EventContext& ctx, @@ -114,8 +112,12 @@ private: Gaudi::Property<std::vector<double>> m_constantFieldVector{this, "ConstantFieldVector", {0, 0, 0}, "Constant field value to use if FieldMode == Constant"}; Gaudi::Property<double> m_ptLoopers{this, "PtLoopers", 300, "PT loop protection threshold. Will be converted to Acts MeV unit"}; - Gaudi::Property<double> m_maxStepSize{this, "MaxStepSize", 10, "Max step size in Acts m unit"}; + + // Material inteaction option + Gaudi::Property<bool> m_interactionMultiScatering{this, "InteractionMultiScatering", false, "Whether to consider multiple scattering in the interactor"}; + Gaudi::Property<bool> m_interactionEloss{this, "InteractionEloss", false, "Whether to consider energy loss in the interactor"}; + Gaudi::Property<bool> m_interactionRecord{this, "InteractionRecord", false, "Whether to record all material interactions"}; }; diff --git a/Tracking/Acts/ActsGeometry/ActsGeometry/ActsMaterialJsonWriterTool.h b/Tracking/Acts/ActsGeometry/ActsGeometry/ActsMaterialJsonWriterTool.h new file mode 100644 index 0000000000000000000000000000000000000000..c457d4ee3efc7186e6da1a7b372e6a9b91d97c90 --- /dev/null +++ b/Tracking/Acts/ActsGeometry/ActsGeometry/ActsMaterialJsonWriterTool.h @@ -0,0 +1,50 @@ +/* + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration +*/ + +#ifndef ACTSGEOMETRY_ACTSMATERIALJSONWRITERTOOL_H +#define ACTSGEOMETRY_ACTSMATERIALJSONWRITERTOOL_H + +// ATHENA +#include "AthenaBaseComps/AthAlgTool.h" +#include "AthenaBaseComps/AthService.h" +#include "GaudiKernel/IInterface.h" +#include "GaudiKernel/Property.h" /*no forward decl: typedef*/ + +// PACKAGE +#include "ActsGeometryInterfaces/IActsMaterialJsonWriterTool.h" + +// ACTS +#include "Acts/Plugins/Json/JsonGeometryConverter.hpp" + +namespace Acts { + class TrackingGeometry; +} + +class ActsMaterialJsonWriterTool : public extends<AthAlgTool, IActsMaterialJsonWriterTool> +{ + +public: + + virtual StatusCode initialize() override; + + ActsMaterialJsonWriterTool(const std::string& type, const std::string& name, + const IInterface* parent); + + ~ActsMaterialJsonWriterTool(); + + virtual + void + write(const Acts::JsonGeometryConverter::DetectorMaterialMaps& detMaterial) const override; + + virtual + void + write(const Acts::TrackingGeometry& tGeometry) const override; + + +private: + + Gaudi::Property<std::string> m_filePath{this, "FilePath", "material-maps.json", "Output json file for the Material Map"}; + +}; +#endif diff --git a/Tracking/Acts/ActsGeometry/ActsGeometry/ActsMaterialMapping.h b/Tracking/Acts/ActsGeometry/ActsGeometry/ActsMaterialMapping.h new file mode 100755 index 0000000000000000000000000000000000000000..10a7105a2454a5b577f08d4154d85db3002dfb64 --- /dev/null +++ b/Tracking/Acts/ActsGeometry/ActsGeometry/ActsMaterialMapping.h @@ -0,0 +1,69 @@ +/* + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration +*/ + +#ifndef ACTSMATERIALMAPPING_H +#define ACTSMATERIALMAPPING_H + +// ATHENA +#include "AthenaBaseComps/AthReentrantAlgorithm.h" +#include "GaudiKernel/ToolHandle.h" +#include "GaudiKernel/ServiceHandle.h" +#include "GaudiKernel/Property.h" /*no forward decl: typedef*/ +#include "GaudiKernel/ISvcLocator.h" +#include "StoreGate/ReadHandleKey.h" +#include "TrkGeometry/MaterialStepCollection.h" + +// ACTS +#include "Acts/EventData/TrackParameters.hpp" +#include "Acts/Geometry/GeometryID.hpp" +#include "Acts/Utilities/Helpers.hpp" +#include "Acts/Material/SurfaceMaterialMapper.hpp" + +// PACKAGE +#include "ActsGeometry/ActsTrackingGeometryTool.h" + +// STL +#include <memory> +#include <vector> +#include <fstream> +#include <mutex> + +namespace Acts { + class ISurfaceMaterial; + class IVolumeMaterial; + + using SurfaceMaterialMap + = std::map<GeometryID, std::shared_ptr<const ISurfaceMaterial>>; + + using VolumeMaterialMap + = std::map<GeometryID, std::shared_ptr<const IVolumeMaterial>>; + + using DetectorMaterialMaps = std::pair<SurfaceMaterialMap, VolumeMaterialMap>; +} + +class IActsMaterialTrackWriterSvc; +class IActsMaterialStepConverterTool; +class IActsSurfaceMappingTool; +class IActsMaterialJsonWriterTool; + +class ActsMaterialMapping : public AthReentrantAlgorithm { +public: + ActsMaterialMapping (const std::string& name, ISvcLocator* pSvcLocator); + virtual StatusCode initialize() override; + virtual StatusCode execute(const EventContext& ctx) const override; + virtual StatusCode finalize() override; + +private: + ServiceHandle<IActsMaterialTrackWriterSvc> m_materialTrackWriterSvc; + ToolHandle<IActsMaterialStepConverterTool> m_materialStepConverterTool{this, "MaterialStepConverterTool", "ActsMaterialStepConverterTool"}; + SG::ReadHandleKey<Trk::MaterialStepCollection> m_inputMaterialStepCollection; + ToolHandle<IActsSurfaceMappingTool> m_surfaceMappingTool{this, "SurfaceMappingTool", "ActsSurfaceMappingTool"}; + ToolHandle<IActsMaterialJsonWriterTool> m_materialJsonWriterTool{this, "MaterialJsonWriterTool", "ActsMaterialJsonWriterTool"}; + + Acts::MagneticFieldContext m_mctx; + Acts::GeometryContext m_gctx; + Acts::SurfaceMaterialMapper::State m_mappingState; +}; + +#endif // ActsGeometry_ActsExtrapolation_h diff --git a/Tracking/Acts/ActsGeometry/ActsGeometry/ActsMaterialStepConverterTool.h b/Tracking/Acts/ActsGeometry/ActsGeometry/ActsMaterialStepConverterTool.h new file mode 100644 index 0000000000000000000000000000000000000000..13e05adcf52ea03ffcb6575d1f7277f239cbd57e --- /dev/null +++ b/Tracking/Acts/ActsGeometry/ActsGeometry/ActsMaterialStepConverterTool.h @@ -0,0 +1,34 @@ +/* + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration +*/ + +#ifndef ACTSGEOMETRY_ACTSMATERIALSTEPCONVERTERTOOL_H +#define ACTSGEOMETRY_ACTSMATERIALSTEPCONVERTERTOOL_H + +// ATHENA +#include "AthenaBaseComps/AthAlgTool.h" +#include "GaudiKernel/EventContext.h" +#include "GaudiKernel/IInterface.h" +#include "GaudiKernel/ServiceHandle.h" +#include "StoreGate/ReadCondHandleKey.h" + +// PACKAGE +#include "ActsGeometry/ActsAlignmentStore.h" // ReadCondHandleKey wants complete type +#include "ActsGeometry/ActsGeometryContext.h" +#include "ActsGeometryInterfaces/IActsMaterialStepConverterTool.h" + +class ActsMaterialStepConverterTool : public extends<AthAlgTool, IActsMaterialStepConverterTool> +{ + +public: + virtual StatusCode initialize() override; + + ActsMaterialStepConverterTool(const std::string &type, const std::string &name, + const IInterface *parent); + + virtual + const Acts::RecordedMaterialTrack + convertToMaterialTrack(const Trk::MaterialStepCollection &colStep) const override; + +}; +#endif diff --git a/Tracking/Acts/ActsGeometry/ActsGeometry/ActsMaterialTrackWriterSvc.h b/Tracking/Acts/ActsGeometry/ActsGeometry/ActsMaterialTrackWriterSvc.h index d36b5c8bdd603b30f9957ae125ae14c5b1dabe19..c8aeff8c547570008f850dc0fbe71aa8629fa78e 100644 --- a/Tracking/Acts/ActsGeometry/ActsGeometry/ActsMaterialTrackWriterSvc.h +++ b/Tracking/Acts/ActsGeometry/ActsGeometry/ActsMaterialTrackWriterSvc.h @@ -1,11 +1,11 @@ /* - Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ #ifndef ACTSGEOMETRY_ACTSMATERIALTRACKWRITERSVC_H #define ACTSGEOMETRY_ACTSMATERIALTRACKWRITERSVC_H -#include "ActsGeometry/IActsMaterialTrackWriterSvc.h" +#include "ActsGeometryInterfaces/IActsMaterialTrackWriterSvc.h" #include "AthenaBaseComps/AthService.h" #include "GaudiKernel/IInterface.h" @@ -20,67 +20,63 @@ #include "TTree.h" #include "TFile.h" -namespace Acts { - class MaterialTrack; -} - class ActsMaterialTrackWriterSvc : public extends<AthService, IActsMaterialTrackWriterSvc> { public: - + virtual StatusCode initialize() override; virtual StatusCode finalize() override; - + ActsMaterialTrackWriterSvc( const std::string& name, ISvcLocator* svc ); - void - write(const Acts::MaterialTrack& mTrack) override; + virtual void + write(const Acts::RecordedMaterialTrack& mTrack) override; private: - std::deque<Acts::MaterialTrack> m_mTracks; + std::deque<Acts::RecordedMaterialTrack> m_mTracks; std::mutex m_writeMutex; std::thread m_writeThread; std::atomic<bool> m_doEnd; TFile* p_tFile; TTree* p_tree; - // tree branches - double m_treeX0; - double m_treeL0; - double m_treeTheta; - double m_treePhi; - double m_treeT; - double m_treedInX0; - double m_treedInL0; - - //std::vector<std::array<double, 3>> m_treeStepPos; - std::vector<double> m_treeStepX0; - std::vector<double> m_treeStepL0; - std::vector<double> m_treeStepA; - std::vector<double> m_treeStepZ; - std::vector<double> m_treeStepRho; - std::vector<double> m_treeStepT; - std::vector<double> m_treeStepdInX0; - std::vector<double> m_treeStepdInL0; - - std::vector<double> m_treeStepPosX; - std::vector<double> m_treeStepPosY; - std::vector<double> m_treeStepPosZ; - std::vector<double> m_treeStepPosR; - std::vector<double> m_treeStepPosPhi; - - std::vector<ULong64_t> m_treeStepGeoID; + float m_v_x; ///< start global x + float m_v_y; ///< start global y + float m_v_z; ///< start global z + float m_v_px; ///< start global momentum x + float m_v_py; ///< start global momentum y + float m_v_pz; ///< start global momentum z + float m_v_phi; ///< start phi direction + float m_v_eta; ///< start eta direction + float m_tX0; ///< thickness in X0/L0 + float m_tL0; ///< thickness in X0/L0 + + std::vector<float> m_step_sx; ///< step x (start) position (optional) + std::vector<float> m_step_sy; ///< step y (start) position (optional) + std::vector<float> m_step_sz; ///< step z (start) position (optional) + std::vector<float> m_step_x; ///< step x position + std::vector<float> m_step_y; ///< step y position + std::vector<float> m_step_z; ///< step z position + std::vector<float> m_step_ex; ///< step x (end) position (optional) + std::vector<float> m_step_ey; ///< step y (end) position (optional) + std::vector<float> m_step_ez; ///< step z (end) position (optional) + std::vector<float> m_step_length; ///< step length + std::vector<float> m_step_X0; ///< step material x0 + std::vector<float> m_step_L0; ///< step material l0 + std::vector<float> m_step_A; ///< step material A + std::vector<float> m_step_Z; ///< step material Z + std::vector<float> m_step_rho; ///< step material rho void writerThread(); - void doWrite(const Acts::MaterialTrack &mTrack); + void doWrite(const Acts::RecordedMaterialTrack &mTrack); // jobOptions properties Gaudi::Property<std::string> m_filePath{this, "FilePath", "MaterialTracks.root", "Output root file for charged particle"}; - Gaudi::Property<std::string> m_treeName{this, "TreeName", "MaterialTracks", ""}; + Gaudi::Property<std::string> m_treeName{this, "TreeName", "material-tracks", ""}; Gaudi::Property<size_t> m_maxQueueSize{this, "MaxQueueSize", 5000, "Limit the write queue to this size"}; }; -#endif +#endif diff --git a/Tracking/Acts/ActsGeometry/ActsGeometry/ActsSurfaceMappingTool.h b/Tracking/Acts/ActsGeometry/ActsGeometry/ActsSurfaceMappingTool.h new file mode 100644 index 0000000000000000000000000000000000000000..c2174e4fe61327ff4e6070097cbb3b0828930d07 --- /dev/null +++ b/Tracking/Acts/ActsGeometry/ActsGeometry/ActsSurfaceMappingTool.h @@ -0,0 +1,65 @@ +/* + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration +*/ + +#ifndef ACTSGEOMETRY_ACTSSURFACEMAPPINGTOOL_H +#define ACTSGEOMETRY_ACTSSURFACEMAPPINGTOOL_H + +// ATHENA +#include "AthenaBaseComps/AthAlgTool.h" +#include "GaudiKernel/IInterface.h" +#include "GaudiKernel/ServiceHandle.h" +#include "GaudiKernel/Property.h" +#include "GaudiKernel/EventContext.h" + +// PACKAGE +#include "ActsGeometryInterfaces/IActsSurfaceMappingTool.h" +#include "ActsGeometryInterfaces/IActsTrackingGeometryTool.h" + +// ACTS +#include "Acts/Material/SurfaceMaterialMapper.hpp" + +// BOOST +#include <cmath> + +class ActsSurfaceMappingTool : public extends<AthAlgTool, IActsSurfaceMappingTool> +{ + +public: + virtual StatusCode initialize() override; + + ActsSurfaceMappingTool(const std::string& type, const std::string& name, + const IInterface* parent); + + std::shared_ptr<Acts::SurfaceMaterialMapper> + mapper() const + { + return m_mapper; + }; + + virtual + Acts::SurfaceMaterialMapper::State + mappingState() const override; + + virtual + const IActsTrackingGeometryTool* + trackingGeometryTool() const override + { + return m_trackingGeometryTool.get(); + } + + +private: + // Straight line stepper + Acts::MagneticFieldContext m_magFieldContext; + Acts::GeometryContext m_geoContext; + using SlStepper = Acts::StraightLineStepper; + using StraightLinePropagator = Acts::Propagator<SlStepper, Acts::Navigator>; + ToolHandle<IActsTrackingGeometryTool> m_trackingGeometryTool{this, "TrackingGeometryTool", "ActsTrackingGeometryTool"}; + std::shared_ptr<Acts::SurfaceMaterialMapper> m_mapper; + std::shared_ptr<const Acts::TrackingGeometry> m_trackingGeometry; +}; + + + +#endif diff --git a/Tracking/Acts/ActsGeometry/ActsGeometry/ActsVolumeMappingTool.h b/Tracking/Acts/ActsGeometry/ActsGeometry/ActsVolumeMappingTool.h new file mode 100644 index 0000000000000000000000000000000000000000..e22160eb09baf4e517c8401aa77241a4d72af9ee --- /dev/null +++ b/Tracking/Acts/ActsGeometry/ActsGeometry/ActsVolumeMappingTool.h @@ -0,0 +1,66 @@ +/* + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration +*/ + +#ifndef ACTSGEOMETRY_ACTSVOLUMEMAPPINGTOOL_H +#define ACTSGEOMETRY_ACTSVOLUMEMAPPINGTOOL_H + +// ATHENA +#include "AthenaBaseComps/AthAlgTool.h" +#include "GaudiKernel/IInterface.h" +#include "GaudiKernel/ServiceHandle.h" +#include "GaudiKernel/Property.h" +#include "GaudiKernel/EventContext.h" + +// PACKAGE +#include "ActsGeometryInterfaces/IActsVolumeMappingTool.h" +#include "ActsGeometryInterfaces/IActsTrackingGeometryTool.h" + +// ACTS +#include "Acts/Material/VolumeMaterialMapper.hpp" + +// BOOST + +#include <cmath> + +class ActsVolumeMappingTool : public extends<AthAlgTool, IActsVolumeMappingTool> +{ + +public: + virtual StatusCode initialize() override; + + ActsVolumeMappingTool(const std::string& type, const std::string& name, + const IInterface* parent); + + std::shared_ptr<Acts::VolumeMaterialMapper> + mapper() const + { + return m_mapper; + }; + + virtual + Acts::VolumeMaterialMapper::State + mappingState() const override; + + virtual + const IActsTrackingGeometryTool* + trackingGeometryTool() const override + { + return m_trackingGeometryTool.get(); + } + + +private: + // Straight line stepper + Acts::MagneticFieldContext m_magFieldContext; + Acts::GeometryContext m_geoContext; + using SlStepper = Acts::StraightLineStepper; + using StraightLinePropagator = Acts::Propagator<SlStepper, Acts::Navigator>; + ToolHandle<IActsTrackingGeometryTool> m_trackingGeometryTool{this, "TrackingGeometryTool", "ActsTrackingGeometryTool"}; + std::shared_ptr<Acts::VolumeMaterialMapper> m_mapper; + std::shared_ptr<const Acts::TrackingGeometry> m_trackingGeometry; +}; + + + +#endif diff --git a/Tracking/Acts/ActsGeometry/ActsGeometry/ActsWriteTrackingGeometry.h b/Tracking/Acts/ActsGeometry/ActsGeometry/ActsWriteTrackingGeometry.h index 29a1c517f10c6d31d310c09ebee3ead844ef7059..206e485aed91e915ab4ab6fd57c76cecbc6813d4 100755 --- a/Tracking/Acts/ActsGeometry/ActsGeometry/ActsWriteTrackingGeometry.h +++ b/Tracking/Acts/ActsGeometry/ActsGeometry/ActsWriteTrackingGeometry.h @@ -27,6 +27,7 @@ namespace Acts { } class IActsTrackingGeometrySvc; +class IActsMaterialJsonWriterTool; class ActsWriteTrackingGeometry : public AthReentrantAlgorithm { public: @@ -40,6 +41,7 @@ private: ToolHandle<ActsTrackingGeometryTool> m_trackingGeometryTool{this, "TrackingGeometryTool", "ActsTrackingGeometryTool"}; ToolHandle<ActsObjWriterTool> m_objWriterTool{this, "ObjWriterTool", "ActsObjWriterTool"}; + ToolHandle<IActsMaterialJsonWriterTool> m_materialJsonWriterTool{this, "MaterialJsonWriterTool", "ActsMaterialJsonWriterTool"}; }; diff --git a/Tracking/Acts/ActsGeometry/CMakeLists.txt b/Tracking/Acts/ActsGeometry/CMakeLists.txt index 9bd53b33422c69c7f0fd27bc6a88ab12978c06e4..f3f13b63cca78e91155cd5633323270d99cd0f9d 100755 --- a/Tracking/Acts/ActsGeometry/CMakeLists.txt +++ b/Tracking/Acts/ActsGeometry/CMakeLists.txt @@ -21,14 +21,16 @@ atlas_depends_on_subdirs( PUBLIC MagneticField/MagFieldInterfaces Calorimeter/CaloDetDescr Tracking/Acts/ActsGeometryInterfaces - Tracking/Acts/ActsInterop ) + Tracking/Acts/ActsInterop + Tracking/TrkDetDescr/TrkGeometry) # External dependencies: find_package( CLHEP ) find_package( Eigen ) find_package( Boost ) +find_package( nlohmann_json ) -find_package( Acts COMPONENTS Core ) +find_package( Acts COMPONENTS Core JsonPlugin) # Component(s) in the package: @@ -46,6 +48,8 @@ atlas_add_library( ActsGeometryLib ActsInteropLib ActsGeometryInterfacesLib ActsCore + ActsJsonPlugin + TrkGeometry PixelReadoutGeometry SCT_ReadoutGeometry TRT_ReadoutGeometry) @@ -55,9 +59,14 @@ atlas_add_component( ActsGeometry src/ActsWriteTrackingGeometry.cxx src/ActsWriteTrackingGeometryTransforms.cxx src/ActsExtrapolationTool.cxx + src/ActsMaterialMapping.cxx + src/ActsSurfaceMappingTool.cxx + #src/ActsVolumeMappingTool.cxx src/ActsObjWriterTool.cxx #src/ActsExCellWriterSvc.cxx - #src/ActsMaterialTrackWriterSvc.cxx + src/ActsMaterialStepConverterTool.cxx + src/ActsMaterialJsonWriterTool.cxx + src/ActsMaterialTrackWriterSvc.cxx #src/GeomShiftCondAlg.cxx src/ActsAlignmentCondAlg.cxx src/NominalAlignmentCondAlg.cxx @@ -67,16 +76,16 @@ atlas_add_component( ActsGeometry src/components/*.cxx PUBLIC_HEADERS ActsGeometry INCLUDE_DIRS ${CLHEP_INCLUDE_DIRS} ${EIGEN_INCLUDE_DIRS} ${BOOST_INCLUDE_DIRS} - LINK_LIBRARIES ${CLHEP_LIBRARIES} ${EIGEN_LIBRARIES} + LINK_LIBRARIES ${CLHEP_LIBRARIES} ${EIGEN_LIBRARIES} EventInfo CaloDetDescrLib - ActsInteropLib + ActsInteropLib ActsGeometryLib ActsGeometryInterfacesLib - ActsCore) + ActsCore + ActsJsonPlugin) # Install files from the package: atlas_install_headers( ActsGeometry ) atlas_install_joboptions( share/*.py ) atlas_install_python_modules( python/*.py ) - diff --git a/Tracking/Acts/ActsGeometry/share/ActsExtrapolationAlg.py b/Tracking/Acts/ActsGeometry/share/ActsExtrapolationAlg.py index 8e52e01b92192f930d919ee5b6eb30d8133721bc..e2907f4e0508cd17c93d25e78e576bc4086e63ae 100644 --- a/Tracking/Acts/ActsGeometry/share/ActsExtrapolationAlg.py +++ b/Tracking/Acts/ActsGeometry/share/ActsExtrapolationAlg.py @@ -5,7 +5,7 @@ Acts tracking geometry and the Acts extrapolation toolchain. # start from scratch with component accumulator -from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator +from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator from AthenaConfiguration.ComponentFactory import CompFactory from ActsGeometry.ActsGeometryConfig import ActsExtrapolationToolCfg @@ -33,7 +33,7 @@ if "__main__" == __name__: from AthenaCommon.Logging import log from AthenaCommon.Constants import VERBOSE from AthenaConfiguration.AllConfigFlags import ConfigFlags - from AthenaConfiguration.MainServicesConfig import MainServicesCfg + from AthenaConfiguration.MainServicesConfig import MainServicesCfg Configurable.configurableRun3Behavior = True @@ -43,7 +43,7 @@ if "__main__" == __name__: ConfigFlags.GeoModel.AtlasVersion = "ATLAS-R2-2016-01-00-01" ConfigFlags.IOVDb.GlobalTag = "OFLCOND-SIM-00-00-00" ConfigFlags.Detector.SimulateBpipe = True - ConfigFlags.Detector.SimulateID = True + ConfigFlags.Detector.SimulateID = True ConfigFlags.Detector.GeometryBpipe = True ConfigFlags.Detector.GeometryID = True ConfigFlags.Detector.GeometryPixel = True @@ -81,6 +81,3 @@ if "__main__" == __name__: log.info("CONFIG DONE") cfg.run(1) - - - diff --git a/Tracking/Acts/ActsGeometry/share/ActsMaterialMapping_jobOptions.py b/Tracking/Acts/ActsGeometry/share/ActsMaterialMapping_jobOptions.py index 6283e09a0e480e0e1f1bb99cbfdb3af71915cf3c..b20518e8aa9d2d6d1d72f487d9d35a9351157872 100644 --- a/Tracking/Acts/ActsGeometry/share/ActsMaterialMapping_jobOptions.py +++ b/Tracking/Acts/ActsGeometry/share/ActsMaterialMapping_jobOptions.py @@ -18,13 +18,13 @@ ServiceMgr.MessageSvc.defaultLimit = 20000 DetFlags.ID_setOn() DetFlags.detdescr.pixel_setOn() DetFlags.detdescr.SCT_setOn() - +DetFlags.Calo_setOff() # MC or data - affects which conditions database instance is used globalflags.DataSource='geant4' #globalflags.DataSource='data' -# Select the geometry version. +# Select the geometry version. globalflags.DetDescrVersion = 'ATLAS-R2-2016-00-00-00' # print "HERE" @@ -43,15 +43,11 @@ from IOVDbSvc.CondDB import conddb conddb.setGlobalTag('OFLCOND-SIM-00-00-00') # conddb.addOverride("/Indet/Align", "InDetAlign_R2_Nominal") -import glob -fileList = glob.glob("*root*") #/tmp/salzburg/*/*.root*") - from AthenaCommon.AppMgr import ServiceMgr # Read material step file -import AthenaPoolCnvSvc.ReadAthenaPool -ServiceMgr.EventSelector.InputCollections = ["MaterialStepFile_1e6.root"] - +import AthenaPoolCnvSvc.ReadAthenaPool +ServiceMgr.EventSelector.InputCollections = ["MaterialStepFile.root"] from AthenaCommon.AlgScheduler import AlgScheduler @@ -69,32 +65,52 @@ svcMgr += CondSvc( OutputLevel=INFO ) # ServiceMgr.THistSvc.Output += ["MATTRACKVAL DATAFILE='MaterialTracks.root' OPT='RECREATE'"] # ServiceMgr.ToolSvc.OutputLevel = VERBOSE + # Set up ACTS tracking geometry service -from ActsGeometry.ActsGeometryConfig import TrackingGeometrySvc -trkGeomSvc = TrackingGeometrySvc() +from ActsGeometry.ActsGeometryConf import ActsTrackingGeometrySvc +trkGeomSvc = ActsTrackingGeometrySvc() trkGeomSvc.OutputLevel = INFO trkGeomSvc.BarrelMaterialBins = [40, 60] # phi z trkGeomSvc.EndcapMaterialBins = [50, 20] # phi r +trkGeomSvc.BuildSubDetectors = [ + "Pixel", + "SCT", + # "TRT", + # "Calo", +] ServiceMgr += trkGeomSvc -# Set up ACTS extrapolation cell writer service -exCellWriterSvc = CfgMgr.Acts__ExCellWriterSvc("ExCellWriterSvc") -exCellWriterSvc.FilePath = "excells_charged_mapping.root" -ServiceMgr += exCellWriterSvc +trkGeomTool = CfgMgr.ActsTrackingGeometryTool("ActsTrackingGeometryTool") +trkGeomTool.OutputLevel = INFO; -mTrackWriterSvc = CfgMgr.Acts__MaterialTrackWriterSvc("MaterialTrackWriterSvc") -mTrackWriterSvc.OutputLevel = DEBUG +# Set up ACTS extrapolation cell writer service +# exCellWriterSvc = CfgMgr.ActsExCellWriterSvc("ActsExCellWriterSvc") +# exCellWriterSvc.FilePath = "excells_charged_mapping.root" +# ServiceMgr += exCellWriterSvc +mTrackWriterSvc = CfgMgr.ActsMaterialTrackWriterSvc("ActsMaterialTrackWriterSvc") +mTrackWriterSvc.OutputLevel = INFO mTrackWriterSvc.FilePath = "MaterialTracks_mapping.root" # mTrackWriterSvc.MaxQueueSize = 10 ServiceMgr += mTrackWriterSvc +mMaterialStepConverterTool = CfgMgr.ActsMaterialStepConverterTool("ActsMaterialStepConverterTool") +mMaterialStepConverterTool.OutputLevel = INFO + +mActsSurfaceMappingTool = CfgMgr.ActsSurfaceMappingTool("ActsSurfaceMappingTool") +mActsSurfaceMappingTool.OutputLevel = INFO +mActsSurfaceMappingTool.TrackingGeometryTool = trkGeomTool + +mActsMaterialJsonWriterTool = CfgMgr.ActsMaterialJsonWriterTool("ActsMaterialJsonWriterTool") +mActsMaterialJsonWriterTool.OutputLevel = VERBOSE +mActsMaterialJsonWriterTool.FilePath = "material-maps.json" + from ActsGeometry import ActsGeometryConf ## SET UP ALIGNMENT CONDITIONS ALGORITHM -from AthenaCommon.AlgSequence import AthSequencer -condSeq = AthSequencer("AthCondSeq") -condSeq += ActsGeometryConf.NominalAlignmentCondAlg("NominalAlignmentCondAlg", - OutputLevel=VERBOSE) +from AthenaCommon.AlgSequence import AthSequencer +condSeq = AthSequencer("AthCondSeq") +condSeq += ActsGeometryConf.NominalAlignmentCondAlg("NominalAlignmentCondAlg", + OutputLevel=INFO) ## END OF CONDITIONS SETUP # Set up algorithm sequence @@ -108,20 +124,16 @@ if hasattr(ServiceMgr,"AthenaEventLoopMgr"): if hasattr(ServiceMgr,"AthenaHiveEventLoopMgr"): ServiceMgr.AthenaHiveEventLoopMgr.EventPrintoutInterval = eventPrintFrequency -# from GaudiAlg.GaudiAlgConf import EventCounter -# job += EventCounter(Frequency=1000) +from GaudiAlg.GaudiAlgConf import EventCounter +job += EventCounter(Frequency=1000) # Set up material mapping algorithm from ActsGeometry.ActsGeometryConf import ActsMaterialMapping alg = ActsMaterialMapping() alg.Cardinality = 0#nThreads -alg.OutputLevel = VERBOSE -alg.ExtrapolationTool.FieldMode = "Constant" -alg.ExtrapolationTool.ConstantFieldVector = [0, 0, 0] -alg.ExtrapolationTool.OutputLevel = INFO - - +alg.MaterialStepConverterTool = mMaterialStepConverterTool +alg.SurfaceMappingTool = mActsSurfaceMappingTool +alg.MaterialJsonWriterTool = mActsMaterialJsonWriterTool alg.OutputLevel = INFO job += alg - diff --git a/Tracking/Acts/ActsGeometry/share/ActsMaterialValidationAlg.py b/Tracking/Acts/ActsGeometry/share/ActsMaterialValidationAlg.py new file mode 100644 index 0000000000000000000000000000000000000000..cdaed670692e63b85b2f4357eaeaae204d5200d9 --- /dev/null +++ b/Tracking/Acts/ActsGeometry/share/ActsMaterialValidationAlg.py @@ -0,0 +1,148 @@ +""" +This job options file will run an example extrapolation using the +Acts tracking geometry, the material map and the Acts extrapolation toolchain. +""" + +import os +import logging + +# Use Global flags and DetFlags. +from AthenaCommon.DetFlags import DetFlags +from AthenaCommon.GlobalFlags import globalflags + +from AthenaCommon.ConcurrencyFlags import jobproperties as jp +from AthenaCommon.Logging import log as msg +nThreads = jp.ConcurrencyFlags.NumThreads() +# for some reason, the synchronization fails if we run in ST... +if (nThreads < 1) : + msg.fatal('numThreads must be >0. Did you set the --threads=N option?') + sys.exit(AthenaCommon.ExitCodes.CONFIGURATION_ERROR) + +from AthenaCommon.AthenaCommonFlags import athenaCommonFlags +athenaCommonFlags.FilesInput = [ + "/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/esd/100evts10lumiblocks.ESD.root" +] + +import AthenaPoolCnvSvc.ReadAthenaPool + +# build GeoModel +import AthenaPython.ConfigLib as apcl +cfg = apcl.AutoCfg(name = 'MaterialMapValidation', input_files=athenaCommonFlags.FilesInput()) + +cfg.configure_job() + +from AthenaCommon.GlobalFlags import globalflags +if len(globalflags.ConditionsTag())!=0: + from IOVDbSvc.CondDB import conddb + conddb.setGlobalTag(globalflags.ConditionsTag()) + +from AtlasGeoModel.InDetGMJobProperties import InDetGeometryFlags +InDetGeometryFlags.useDynamicAlignFolders=True + +# Just the pixel and SCT +DetFlags.ID_setOn() +DetFlags.Calo_setOn() + + +# Initialize geometry +# THIS ACTUALLY DOES STUFF!! +from AtlasGeoModel import GeoModelInit +from AtlasGeoModel import SetGeometryVersion + +from AthenaCommon.AlgScheduler import AlgScheduler +AlgScheduler.OutputLevel( INFO ) +AlgScheduler.ShowControlFlow( True ) +AlgScheduler.ShowDataDependencies( True ) +AlgScheduler.EnableConditions( True ) +AlgScheduler.setDataLoaderAlg( "SGInputLoader" ) + +## SET UP ALIGNMENT CONDITIONS ALGORITHM +from IOVSvc.IOVSvcConf import CondSvc +svcMgr += CondSvc( OutputLevel=INFO ) +from ActsGeometry import ActsGeometryConf +from AthenaCommon.AlgSequence import AthSequencer +condSeq = AthSequencer("AthCondSeq") + +# nominal alignment: all deltas are identity +# condSeq += ActsGeometryConf.NominalAlignmentCondAlg("NominalAlignmentCondAlg", + # OutputLevel=VERBOSE) + +condSeq += ActsGeometryConf.ActsAlignmentCondAlg("ActsAlignCondAlg", + OutputLevel=INFO) +# periodic shift alignment. Configurable z-shift per lumiblock. +# (currently pixel only) +# condSeq+=ActsGeometryConf.GeomShiftCondAlg("GeomShiftCondAlg_1", + # ZShiftPerLB=0.5, + # OutputLevel=VERBOSE) +## END OF CONDITIONS SETUP + +from AthenaCommon.AppMgr import ServiceMgr + +# set up and configure the acts geometry construction +from ActsGeometry.ActsGeometryConf import ActsTrackingGeometrySvc +trkGeomSvc = ActsTrackingGeometrySvc() +# used for the proxies during material mapping +trkGeomSvc.BarrelMaterialBins = [40, 60] # phi z +trkGeomSvc.EndcapMaterialBins = [50, 20] # phi r +trkGeomSvc.OutputLevel = INFO +trkGeomSvc.BuildSubDetectors = [ + "Pixel", + "SCT", + # "TRT", + # "Calo", +] +trkGeomSvc.UseMaterialMap = True +trkGeomSvc.MaterialMapInputFile = "material-maps.json" +ServiceMgr += trkGeomSvc + +# We need the Magnetic fiels +import MagFieldServices.SetupField + +from AthenaCommon.AlgSequence import AlgSequence +job = AlgSequence() + +# This is the main extrapolation demo algorithm +from ActsGeometry.ActsGeometryConf import ActsExtrapolationAlg +alg = ActsExtrapolationAlg() +alg.EtaRange = [-2.4, 2.4] +alg.OutputLevel = INFO +alg.NParticlesPerEvent = int(1e4) + + +# Record the material track for material map validation +alg.WriteMaterialTracks = True +# we only need this if the extrap alg is set up to write mat tracks +if alg.WriteMaterialTracks == True: + mTrackWriterSvc = CfgMgr.ActsMaterialTrackWriterSvc("ActsMaterialTrackWriterSvc") + mTrackWriterSvc.OutputLevel = INFO + mTrackWriterSvc.FilePath = "MaterialTracks_mapped.root" + ServiceMgr += mTrackWriterSvc + +# sets up the extrapolation tool +# this sets up the tracking geometry svc through the tracking geometry tool +exTool = CfgMgr.ActsExtrapolationTool("ActsExtrapolationTool") +exTool.OutputLevel = INFO +exTool.FieldMode = "ATLAS" +exTool.InteractionMultiScatering = True +exTool.InteractionEloss = True +exTool.InteractionRecord = True +# The extrapolation tool accesses the trackinggeometry service +# through this tool. This tool has the conditions dependencies +# on the alignment GeoAlignmentStores (pseudo-alignment only right now). +# For each event, the GAS for the IOV needs to be set from the algorithm. +trkGeomTool = CfgMgr.ActsTrackingGeometryTool("ActsTrackingGeometryTool") +trkGeomTool.OutputLevel = INFO; +exTool.TrackingGeometryTool = trkGeomTool + +alg.ExtrapolationTool = exTool + +# Make the event heardbeat output a bit nicer +eventPrintFrequency = 10000 +if hasattr(ServiceMgr,"AthenaEventLoopMgr"): + ServiceMgr.AthenaEventLoopMgr.EventPrintoutInterval = eventPrintFrequency +if hasattr(ServiceMgr,"AthenaHiveEventLoopMgr"): + ServiceMgr.AthenaHiveEventLoopMgr.EventPrintoutInterval = eventPrintFrequency + +job += alg + +theApp.EvtMax = 10000 diff --git a/Tracking/Acts/ActsGeometry/share/ActsWriteTrackingGeometry.py b/Tracking/Acts/ActsGeometry/share/ActsWriteTrackingGeometry.py index af95eb1b81e1808f065610745ceb6cae537c0801..6bdf79f04d72d20f359a127d1c8d743d07253715 100644 --- a/Tracking/Acts/ActsGeometry/share/ActsWriteTrackingGeometry.py +++ b/Tracking/Acts/ActsGeometry/share/ActsWriteTrackingGeometry.py @@ -72,6 +72,12 @@ trkGeomSvc = ActsTrackingGeometrySvc() trkGeomSvc.BarrelMaterialBins = [40, 60] # phi z trkGeomSvc.EndcapMaterialBins = [50, 20] # phi r trkGeomSvc.OutputLevel = INFO +trkGeomSvc.BuildSubDetectors = [ + "Pixel", + "SCT", + # "TRT", + # "Calo", +] ServiceMgr += trkGeomSvc import MagFieldServices.SetupField @@ -87,12 +93,16 @@ trkGeomTool.OutputLevel = INFO; # alg.TrackingGeometryTool = trkGeomTool # job += alg +mActsMaterialJsonWriterTool = CfgMgr.ActsMaterialJsonWriterTool("ActsMaterialJsonWriterTool") +mActsMaterialJsonWriterTool.OutputLevel = VERBOSE +mActsMaterialJsonWriterTool.FilePath = "geometry-maps.json" from ActsGeometry.ActsGeometryConf import ActsWriteTrackingGeometry alg = ActsWriteTrackingGeometry(OutputLevel = VERBOSE) alg.TrackingGeometryTool = trkGeomTool alg.ObjWriterTool.OutputDirectory = "obj" alg.ObjWriterTool.SubDetectors = ["Pixel", "SCT"] +alg.MaterialJsonWriterTool = mActsMaterialJsonWriterTool job += alg @@ -106,4 +116,3 @@ if hasattr(ServiceMgr,"AthenaHiveEventLoopMgr"): theApp.EvtMax = 1 - diff --git a/Tracking/Acts/ActsGeometry/share/GeantinoMapping_jobOptions.py b/Tracking/Acts/ActsGeometry/share/GeantinoMapping_jobOptions.py index 1bd322b752cc7167957005efe845c0109fa66eaf..53291813e5ba7bd9bf411ec83c7138202ed6fb55 100644 --- a/Tracking/Acts/ActsGeometry/share/GeantinoMapping_jobOptions.py +++ b/Tracking/Acts/ActsGeometry/share/GeantinoMapping_jobOptions.py @@ -42,7 +42,7 @@ if 'myRandomSeed2' not in dir() : myRandomSeed2 = int(random.uniform(0,time.time())) if 'myMaxEvent' not in dir() : - myMaxEvent = 10 + myMaxEvent = 100 if 'myPt' not in dir() : myPt = 'pt' # values are 'p' or 'pt' @@ -66,7 +66,7 @@ print globalflags.ConditionsTag from AthenaCommon.AthenaCommonFlags import athenaCommonFlags athenaCommonFlags.PoolEvgenInput.set_Off() ### is this necessary? athenaCommonFlags.PoolHitsOutput = 'Hits.pool.root' -athenaCommonFlags.EvtMax = 1000 +athenaCommonFlags.EvtMax = 1000000 #--- Simulation flags ----------------------------------------- from G4AtlasApps.SimFlags import simFlags @@ -74,19 +74,19 @@ simFlags.load_atlas_flags() # Going to use an ATLAS layout simFlags.SimLayout = myGeo simFlags.EventFilter.set_Off() -myMinEta = -6.0 -myMaxEta = 6.0 +myMinEta = -2.5 +myMaxEta = 2.5 myPDG = 999 # 999 = Geantinos, 13 = Muons include("GeneratorUtils/StdEvgenSetup.py") -theApp.EvtMax = 1000 +theApp.EvtMax = 20000 import ParticleGun as PG pg = PG.ParticleGun() pg.sampler.pid = 999 pg.randomSeed = 123456 -pg.sampler.mom = PG.EEtaMPhiSampler(energy=10000, eta=[-6.,6.]) +pg.sampler.mom = PG.EEtaMPhiSampler(energy=10000, eta=[myMinEta,myMaxEta]) topSeq += pg simFlags.RandomSeedOffset = myRandomOffset @@ -151,4 +151,3 @@ if not hasattr(condSeq, "BeamSpotCondAlg"): #--- End jobOptions.GeantinoMapping.py file ------------------------------ - diff --git a/Tracking/Acts/ActsGeometry/src/ActsExtrapolationAlg.cxx b/Tracking/Acts/ActsGeometry/src/ActsExtrapolationAlg.cxx index 8ed4b0569a2edb170eb83830ef07c3788ad686d6..84ada281557659e88deb733e78e9f084ae7cfc7e 100755 --- a/Tracking/Acts/ActsGeometry/src/ActsExtrapolationAlg.cxx +++ b/Tracking/Acts/ActsGeometry/src/ActsExtrapolationAlg.cxx @@ -1,13 +1,10 @@ /* - 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 "ActsGeometry/ActsExtrapolationAlg.h" // ATHENA -#include "Acts/Surfaces/PerigeeSurface.hpp" -#include "Acts/Utilities/Logger.hpp" -#include "ActsGeometry/IActsPropStepRootWriterSvc.h" #include "AthenaKernel/IAthRNGSvc.h" #include "AthenaKernel/RNGWrapper.h" #include "GaudiKernel/EventContext.h" @@ -15,16 +12,20 @@ #include "MagFieldInterfaces/IMagFieldSvc.h" // ACTS +#include "Acts/Propagator/MaterialInteractor.hpp" #include "Acts/Propagator/detail/SteppingLogger.hpp" +#include "Acts/Surfaces/PerigeeSurface.hpp" #include "Acts/Utilities/Helpers.hpp" #include "Acts/Utilities/Units.hpp" +#include "Acts/Utilities/Logger.hpp" // PACKAGE #include "ActsGeometry/ActsGeometryContext.h" +#include "ActsGeometry/IActsPropStepRootWriterSvc.h" #include "ActsGeometryInterfaces/IActsExtrapolationTool.h" +#include "ActsGeometryInterfaces/IActsMaterialTrackWriterSvc.h" #include "ActsGeometryInterfaces/IActsTrackingGeometryTool.h" #include "ActsInterop/Logger.h" -//#include "ActsGeometry/IActsMaterialTrackWriterSvc.h" // OTHER #include "CLHEP/Random/RandomEngine.h" @@ -35,12 +36,20 @@ using namespace Acts::UnitLiterals; +namespace Acts{ + /// Recorded material track + /// - this is start: position, start momentum + /// and the Recorded material + using RecordedMaterialTrack = + std::pair<std::pair<Acts::Vector3D, Acts::Vector3D>, RecordedMaterial>; +} + ActsExtrapolationAlg::ActsExtrapolationAlg(const std::string &name, ISvcLocator *pSvcLocator) : AthReentrantAlgorithm(name, pSvcLocator), m_propStepWriterSvc("ActsPropStepRootWriterSvc", name), - m_rndmGenSvc("AthRNGSvc", name) //, -// m_materialTrackWriterSvc("ActsMaterialTrackWriterSvc", name) + m_rndmGenSvc("AthRNGSvc", name) , + m_materialTrackWriterSvc("ActsMaterialTrackWriterSvc", name) {} StatusCode ActsExtrapolationAlg::initialize() { @@ -51,9 +60,9 @@ StatusCode ActsExtrapolationAlg::initialize() { ATH_CHECK(m_extrapolationTool.retrieve()); ATH_CHECK(m_propStepWriterSvc.retrieve()); - // if (m_writeMaterialTracks) { - // ATH_CHECK( m_materialTrackWriterSvc.retrieve() ); - //} + if (m_writeMaterialTracks) { + ATH_CHECK( m_materialTrackWriterSvc.retrieve() ); + } m_objOut = std::make_unique<std::ofstream>("steps.obj"); @@ -105,7 +114,7 @@ StatusCode ActsExtrapolationAlg::execute(const EventContext &ctx) const { pars << d0, z0, phi, theta, qop, t; std::optional<Acts::BoundSymMatrix> cov = std::nullopt; - std::vector<Acts::detail::Step> steps; + ActsPropagationOutput output; if (charge != 0.) { // Perigee, no alignment -> default geo context @@ -114,11 +123,18 @@ StatusCode ActsExtrapolationAlg::execute(const EventContext &ctx) const { auto anygctx = gctx.any(); Acts::BoundParameters startParameters( anygctx, std::move(cov), std::move(pars), std::move(surface)); - steps = m_extrapolationTool->propagationSteps(ctx, startParameters); - if(steps.size() == 0) { - ATH_MSG_WARNING("Got ZERO steps from the extrapolation tool"); + output = m_extrapolationTool->propagationSteps(ctx, startParameters); + if(output.first.size() == 0) { + ATH_MSG_WARNING("Got ZERO steps from the extrapolation tool"); + } + m_propStepWriterSvc->write(output.first); + if(m_writeMaterialTracks){ + Acts::RecordedMaterialTrack track; + track.first.first = Acts::Vector3D(0,0,0); + track.first.second = momentum; + track.second = std::move(output.second); + m_materialTrackWriterSvc->write(track); } - m_propStepWriterSvc->write(steps); } ATH_MSG_VERBOSE(name() << " execute done"); diff --git a/Tracking/Acts/ActsGeometry/src/ActsExtrapolationTool.cxx b/Tracking/Acts/ActsGeometry/src/ActsExtrapolationTool.cxx index 1ce2a07cc996a0a4c58ecb38370ba8e13ea9130b..5ba834fc0b993e64f57d356b4fd569d2e695fec8 100644 --- a/Tracking/Acts/ActsGeometry/src/ActsExtrapolationTool.cxx +++ b/Tracking/Acts/ActsGeometry/src/ActsExtrapolationTool.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 "ActsGeometry/ActsExtrapolationTool.h" @@ -9,18 +9,19 @@ #include "MagFieldInterfaces/IMagFieldSvc.h" // PACKAGE +#include "ActsGeometry/ActsGeometryContext.h" #include "ActsGeometry/ActsTrackingGeometrySvc.h" -#include "ActsInterop/Logger.h" #include "ActsGeometry/ActsTrackingGeometryTool.h" +#include "ActsInterop/Logger.h" // ACTS -#include "Acts/Surfaces/Surface.hpp" -#include "Acts/Surfaces/BoundaryCheck.hpp" #include "Acts/Propagator/Navigator.hpp" #include "Acts/Propagator/EigenStepper.hpp" #include "Acts/Propagator/Propagator.hpp" #include "Acts/Propagator/AbortList.hpp" #include "Acts/Propagator/ActionList.hpp" +#include "Acts/Surfaces/BoundaryCheck.hpp" +#include "Acts/Surfaces/Surface.hpp" // BOOST #include <boost/variant/variant.hpp> @@ -31,7 +32,6 @@ #include <iostream> #include <memory> - namespace ActsExtrapolationDetail { using VariantPropagatorBase = boost::variant< Acts::Propagator<Acts::EigenStepper<ATLASMagneticFieldWrapper>, Acts::Navigator>, @@ -46,7 +46,6 @@ namespace ActsExtrapolationDetail { } - using ActsExtrapolationDetail::VariantPropagator; @@ -55,7 +54,6 @@ ActsExtrapolationTool::ActsExtrapolationTool(const std::string& type, const std: : base_class(type, name, parent), m_fieldServiceHandle("AtlasFieldSvc", name) { - } @@ -85,7 +83,7 @@ ActsExtrapolationTool::initialize() using BField_t = ATLASMagneticFieldWrapper; BField_t bField(m_fieldServiceHandle.get()); auto stepper = Acts::EigenStepper<BField_t>(std::move(bField)); - auto propagator = Acts::Propagator<decltype(stepper), Acts::Navigator>(std::move(stepper), + auto propagator = Acts::Propagator<decltype(stepper), Acts::Navigator>(std::move(stepper), std::move(navigator)); m_varProp = std::make_unique<VariantPropagator>(propagator); } @@ -98,7 +96,7 @@ ActsExtrapolationTool::initialize() using BField_t = Acts::ConstantBField; BField_t bField(Bx, By, Bz); auto stepper = Acts::EigenStepper<BField_t>(std::move(bField)); - auto propagator = Acts::Propagator<decltype(stepper), Acts::Navigator>(std::move(stepper), + auto propagator = Acts::Propagator<decltype(stepper), Acts::Navigator>(std::move(stepper), std::move(navigator)); m_varProp = std::make_unique<VariantPropagator>(propagator); } @@ -108,7 +106,7 @@ ActsExtrapolationTool::initialize() } -std::vector<Acts::detail::Step> +ActsPropagationOutput ActsExtrapolationTool::propagationSteps(const EventContext& ctx, const Acts::BoundParameters& startParameters, Acts::NavigationDirection navDir /*= Acts::forward*/, @@ -124,7 +122,8 @@ ActsExtrapolationTool::propagationSteps(const EventContext& ctx, auto anygctx = gctx.any(); // Action list and abort list - using ActionList = Acts::ActionList<SteppingLogger, DebugOutput>; + using ActionList = + Acts::ActionList<SteppingLogger, Acts::MaterialInteractor, DebugOutput>; using AbortConditions = Acts::AbortList<EndOfWorld>; using Options = Acts::PropagatorOptions<ActionList, AbortConditions>; @@ -140,7 +139,12 @@ ActsExtrapolationTool::propagationSteps(const EventContext& ctx, options.maxStepSize = m_maxStepSize * 1_m; options.direction = navDir; - std::vector<Acts::detail::Step> steps; + auto& mInteractor = options.actionList.get<Acts::MaterialInteractor>(); + mInteractor.multipleScattering = m_interactionMultiScatering; + mInteractor.energyLoss = m_interactionEloss; + mInteractor.recordInteractions = m_interactionRecord; + + ActsPropagationOutput output; DebugOutput::result_type debugOutput; auto res = boost::apply_visitor([&](const auto& propagator) -> ResultType { @@ -152,33 +156,37 @@ ActsExtrapolationTool::propagationSteps(const EventContext& ctx, auto steppingResults = propRes.template get<SteppingLogger::result_type>(); auto debugOutput = propRes.template get<DebugOutput::result_type>(); + auto materialResult = propRes.template get<Acts::MaterialInteractor::result_type>(); + output.first = std::move(steppingResults.steps); + output.second = std::move(materialResult); // try to force return value optimization, not sure this is necessary - return std::make_pair(std::move(steppingResults.steps), std::move(debugOutput)); + return std::make_pair(std::move(output), std::move(debugOutput)); }, *m_varProp); if (!res.ok()) { - ATH_MSG_ERROR("Got error during propagation: " + ATH_MSG_ERROR("Got error during propagation: " << res.error() << " " << res.error().message() << ". Returning empty step vector."); return {}; } - std::tie(steps, debugOutput) = std::move(*res); + std::tie(output, debugOutput) = std::move(*res); if(debug) { ATH_MSG_VERBOSE(debugOutput.debugString); } - ATH_MSG_VERBOSE("Collected " << steps.size() << " steps"); - if(steps.size() == 0) { + ATH_MSG_VERBOSE("Collected " << output.first.size() << " steps"); + if(output.first.size() == 0) { ATH_MSG_WARNING("ZERO steps returned by stepper, that is not typically a good sign"); } ATH_MSG_VERBOSE(name() << "::" << __FUNCTION__ << " end"); - return steps; + return output; } + std::unique_ptr<const Acts::CurvilinearParameters> ActsExtrapolationTool::propagate(const EventContext& ctx, const Acts::BoundParameters& startParameters, @@ -195,7 +203,8 @@ ActsExtrapolationTool::propagate(const EventContext& ctx, auto anygctx = gctx.any(); // Action list and abort list - using ActionList = Acts::ActionList<DebugOutput>; + using ActionList = + Acts::ActionList<Acts::MaterialInteractor, DebugOutput>; using AbortConditions = Acts::AbortList<EndOfWorld>; using Options = Acts::PropagatorOptions<ActionList, AbortConditions>; @@ -210,8 +219,10 @@ ActsExtrapolationTool::propagate(const EventContext& ctx, options.maxStepSize = m_maxStepSize * 1_m; options.direction = navDir; - std::vector<Acts::detail::Step> steps; - DebugOutput::result_type debugOutput; + auto& mInteractor = options.actionList.get<Acts::MaterialInteractor>(); + mInteractor.multipleScattering = m_interactionMultiScatering; + mInteractor.energyLoss = m_interactionEloss; + mInteractor.recordInteractions = m_interactionRecord; auto parameters = boost::apply_visitor([&](const auto& propagator) -> std::unique_ptr<const Acts::CurvilinearParameters> { auto result = propagator.propagate(startParameters, options); @@ -222,16 +233,16 @@ ActsExtrapolationTool::propagate(const EventContext& ctx, } return std::move(result.value().endParameters); }, *m_varProp); - + return parameters; } - -std::vector<Acts::detail::Step> + +ActsPropagationOutput ActsExtrapolationTool::propagationSteps(const EventContext& ctx, const Acts::BoundParameters& startParameters, const Acts::Surface& target, Acts::NavigationDirection navDir /*= Acts::forward*/, - double pathLimit /*= std::numeric_limits<double>::max()*/) const + double pathLimit /*= std::numeric_limits<double>::max()*/) const { using namespace Acts::UnitLiterals; ATH_MSG_VERBOSE(name() << "::" << __FUNCTION__ << " begin"); @@ -243,7 +254,8 @@ ActsExtrapolationTool::propagationSteps(const EventContext& ctx, auto anygctx = gctx.any(); // Action list and abort list - using ActionList = Acts::ActionList<SteppingLogger, DebugOutput>; + using ActionList = + Acts::ActionList<SteppingLogger, Acts::MaterialInteractor, DebugOutput>; using AbortConditions = Acts::AbortList<EndOfWorld>; using Options = Acts::PropagatorOptions<ActionList, AbortConditions>; @@ -258,7 +270,12 @@ ActsExtrapolationTool::propagationSteps(const EventContext& ctx, options.maxStepSize = m_maxStepSize * 1_m; options.direction = navDir; - std::vector<Acts::detail::Step> steps; + auto& mInteractor = options.actionList.get<Acts::MaterialInteractor>(); + mInteractor.multipleScattering = m_interactionMultiScatering; + mInteractor.energyLoss = m_interactionEloss; + mInteractor.recordInteractions = m_interactionRecord; + + ActsPropagationOutput output; DebugOutput::result_type debugOutput; auto res = boost::apply_visitor([&](const auto& propagator) -> ResultType { @@ -270,8 +287,10 @@ ActsExtrapolationTool::propagationSteps(const EventContext& ctx, auto steppingResults = propRes.template get<SteppingLogger::result_type>(); auto debugOutput = propRes.template get<DebugOutput::result_type>(); - // try to force return value optimization, not sure this is necessary - return std::make_pair(std::move(steppingResults.steps), std::move(debugOutput)); + auto materialResult = propRes.template get<Acts::MaterialInteractor::result_type>(); + output.first = std::move(steppingResults.steps); + output.second = std::move(materialResult); + return std::make_pair(std::move(output), std::move(debugOutput)); }, *m_varProp); if (!res.ok()) { @@ -279,24 +298,24 @@ ActsExtrapolationTool::propagationSteps(const EventContext& ctx, << ". Returning empty step vector."); return {}; } - std::tie(steps, debugOutput) = std::move(*res); + std::tie(output, debugOutput) = std::move(*res); if(debug) { ATH_MSG_VERBOSE(debugOutput.debugString); } - ATH_MSG_VERBOSE("Collected " << steps.size() << " steps"); + ATH_MSG_VERBOSE("Collected " << output.first.size() << " steps"); ATH_MSG_VERBOSE(name() << "::" << __FUNCTION__ << " end"); - return steps; + return output; } - + std::unique_ptr<const Acts::BoundParameters> ActsExtrapolationTool::propagate(const EventContext& ctx, const Acts::BoundParameters& startParameters, const Acts::Surface& target, Acts::NavigationDirection navDir /*= Acts::forward*/, - double pathLimit /*= std::numeric_limits<double>::max()*/) const + double pathLimit /*= std::numeric_limits<double>::max()*/) const { using namespace Acts::UnitLiterals; ATH_MSG_VERBOSE(name() << "::" << __FUNCTION__ << " begin"); @@ -308,23 +327,26 @@ ActsExtrapolationTool::propagate(const EventContext& ctx, auto anygctx = gctx.any(); // Action list and abort list - using ActionList = Acts::ActionList<DebugOutput>; + using ActionList = + Acts::ActionList<Acts::MaterialInteractor, DebugOutput>; using AbortConditions = Acts::AbortList<EndOfWorld>; using Options = Acts::PropagatorOptions<ActionList, AbortConditions>; - + Options options(anygctx, mctx); options.pathLimit = pathLimit; bool debug = msg().level() == MSG::VERBOSE; options.debug = debug; - + options.loopProtection = (Acts::VectorHelpers::perp(startParameters.momentum()) < m_ptLoopers * 1_MeV); options.maxStepSize = m_maxStepSize * 1_m; options.direction = navDir; - std::vector<Acts::detail::Step> steps; - DebugOutput::result_type debugOutput; + auto& mInteractor = options.actionList.get<Acts::MaterialInteractor>(); + mInteractor.multipleScattering = m_interactionMultiScatering; + mInteractor.energyLoss = m_interactionEloss; + mInteractor.recordInteractions = m_interactionRecord; auto parameters = boost::apply_visitor([&](const auto& propagator) -> std::unique_ptr<const Acts::BoundParameters> { auto result = propagator.propagate(startParameters, target, options); @@ -335,6 +357,6 @@ ActsExtrapolationTool::propagate(const EventContext& ctx, } return std::move(result.value().endParameters); }, *m_varProp); - - return parameters; + + return parameters; } diff --git a/Tracking/Acts/ActsGeometry/src/ActsMaterialJsonWriterTool.cxx b/Tracking/Acts/ActsGeometry/src/ActsMaterialJsonWriterTool.cxx new file mode 100644 index 0000000000000000000000000000000000000000..b13694f69ac0b6c95fc8a4c37196315722870fc6 --- /dev/null +++ b/Tracking/Acts/ActsGeometry/src/ActsMaterialJsonWriterTool.cxx @@ -0,0 +1,52 @@ +/* + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration +*/ + +#include "ActsGeometry/ActsMaterialJsonWriterTool.h" + +#include <fstream> +#include <ios> +#include <iostream> +#include <stdexcept> + +ActsMaterialJsonWriterTool::ActsMaterialJsonWriterTool(const std::string &type, const std::string &name, + const IInterface *parent) + : base_class(type, name, parent) +{ +} + +ActsMaterialJsonWriterTool::~ActsMaterialJsonWriterTool() +{ +} + +StatusCode +ActsMaterialJsonWriterTool::initialize() +{ + ATH_MSG_INFO("Starting Material writer"); + + return StatusCode::SUCCESS; +} + +void +ActsMaterialJsonWriterTool::write(const Acts::JsonGeometryConverter::DetectorMaterialMaps& detMaterial) const +{ + Acts::JsonGeometryConverter::Config cfg; + // Evoke the converter + Acts::JsonGeometryConverter jmConverter(cfg); + auto jout = jmConverter.materialMapsToJson(detMaterial); + // And write the file + std::ofstream ofj(m_filePath); + ofj << std::setw(4) << jout << std::endl; +} + +void +ActsMaterialJsonWriterTool::write(const Acts::TrackingGeometry& tGeometry) const +{ + Acts::JsonGeometryConverter::Config cfg; + // Evoke the converter + Acts::JsonGeometryConverter jmConverter(cfg); + auto jout = jmConverter.trackingGeometryToJson(tGeometry); + // And write the file + std::ofstream ofj(m_filePath); + ofj << std::setw(4) << jout << std::endl; +} diff --git a/Tracking/Acts/ActsGeometry/src/ActsMaterialMapping.cxx b/Tracking/Acts/ActsGeometry/src/ActsMaterialMapping.cxx new file mode 100755 index 0000000000000000000000000000000000000000..3efd705c4e61e6e64b3e091458bd745f2d52dfbb --- /dev/null +++ b/Tracking/Acts/ActsGeometry/src/ActsMaterialMapping.cxx @@ -0,0 +1,107 @@ +/* + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration +*/ + +#include "ActsGeometry/ActsMaterialMapping.h" + +// ATHENA +#include "Acts/Surfaces/PerigeeSurface.hpp" +#include "Acts/Utilities/Logger.hpp" +#include "ActsGeometry/IActsPropStepRootWriterSvc.h" +#include "GaudiKernel/EventContext.h" +#include "GaudiKernel/ISvcLocator.h" +#include "MagFieldInterfaces/IMagFieldSvc.h" + +// ACTS +#include "Acts/Propagator/detail/SteppingLogger.hpp" +#include "Acts/Utilities/Helpers.hpp" +#include "Acts/Utilities/Units.hpp" + +// PACKAGE +#include "ActsInterop/Logger.h" +#include "ActsGeometry/ActsGeometryContext.h" +#include "ActsGeometryInterfaces/IActsMaterialJsonWriterTool.h" +#include "ActsGeometryInterfaces/IActsMaterialStepConverterTool.h" +#include "ActsGeometryInterfaces/IActsMaterialTrackWriterSvc.h" +#include "ActsGeometryInterfaces/IActsTrackingGeometryTool.h" +#include "ActsGeometryInterfaces/IActsSurfaceMappingTool.h" + +// STL +#include <fstream> +#include <string> + +//TEST +#include "Acts/EventData/NeutralParameters.hpp" +#include "Acts/Propagator/ActionList.hpp" +#include "Acts/Propagator/DebugOutputActor.hpp" +#include "Acts/Propagator/Navigator.hpp" +#include "Acts/Propagator/Propagator.hpp" +#include "Acts/Propagator/StandardAborters.hpp" +#include "Acts/Propagator/StraightLineStepper.hpp" + +ActsMaterialMapping::ActsMaterialMapping(const std::string &name, + ISvcLocator *pSvcLocator) + : AthReentrantAlgorithm(name, pSvcLocator), + m_materialTrackWriterSvc("ActsMaterialTrackWriterSvc", name), + m_inputMaterialStepCollection("MaterialStepRecords"), + m_mappingState(m_gctx,m_mctx) +{} + +StatusCode ActsMaterialMapping::initialize() { + + ATH_MSG_DEBUG(name() << "::" << __FUNCTION__); + + ATH_CHECK(m_materialStepConverterTool.retrieve() ); + ATH_CHECK(m_materialTrackWriterSvc.retrieve() ); + ATH_CHECK(m_surfaceMappingTool.retrieve() ); + ATH_CHECK(m_materialJsonWriterTool.retrieve() ); + + ATH_CHECK( m_inputMaterialStepCollection.initialize() ); + + m_mappingState = m_surfaceMappingTool->mappingState(); + + return StatusCode::SUCCESS; +} + +StatusCode ActsMaterialMapping::execute(const EventContext &ctx) const { + + ATH_MSG_VERBOSE(name() << "::" << __FUNCTION__); + + m_surfaceMappingTool->trackingGeometryTool()->getGeometryContext(ctx); + + Acts::RecordedMaterialTrack mTrack; + + SG::ReadHandle<Trk::MaterialStepCollection> materialStepCollection(m_inputMaterialStepCollection, ctx); + + mTrack = m_materialStepConverterTool->convertToMaterialTrack(*materialStepCollection); + + m_materialTrackWriterSvc->write(mTrack); + + auto mappingState + = const_cast<Acts::SurfaceMaterialMapper::State*>(&m_mappingState); + + + m_surfaceMappingTool->mapper()->mapMaterialTrack(*mappingState, mTrack); + + ATH_MSG_VERBOSE(name() << " execute done"); + + return StatusCode::SUCCESS; +} + +StatusCode ActsMaterialMapping::finalize() { + + // Finalize all the maps using the cached state + m_surfaceMappingTool->mapper()->finalizeMaps(m_mappingState); + + Acts::DetectorMaterialMaps detectorMaterial; + + // Loop over the state, and collect the maps for surfaces + for (auto& [key, value] : m_mappingState.surfaceMaterial) { + detectorMaterial.first.insert({key, std::move(value)}); + } + + m_materialJsonWriterTool->write(detectorMaterial); + + return StatusCode::SUCCESS; + +} diff --git a/Tracking/Acts/ActsGeometry/src/ActsMaterialStepConverterTool.cxx b/Tracking/Acts/ActsGeometry/src/ActsMaterialStepConverterTool.cxx new file mode 100644 index 0000000000000000000000000000000000000000..9d1c0703ad4c35317020cad8830c1da9463d97b2 --- /dev/null +++ b/Tracking/Acts/ActsGeometry/src/ActsMaterialStepConverterTool.cxx @@ -0,0 +1,84 @@ +/* + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration +*/ + +#include "ActsGeometry/ActsMaterialStepConverterTool.h" + +// ATHENA +#include "GaudiKernel/EventContext.h" + +// PACKAGE +#include "ActsGeometryInterfaces/IActsTrackingGeometrySvc.h" + +// Tracking +#include "TrkGeometry/MaterialStep.h" + +// ACTS +#include "Acts/Material/MaterialProperties.hpp" + +// STL +#include <iostream> +#include <memory> + +ActsMaterialStepConverterTool::ActsMaterialStepConverterTool(const std::string& type, const std::string& name, + const IInterface* parent) + : base_class(type, name, parent) +{ +} + +StatusCode +ActsMaterialStepConverterTool::initialize() +{ + ATH_MSG_INFO(name() << " initializing"); + + return StatusCode::SUCCESS; +} + + +const Acts::RecordedMaterialTrack +ActsMaterialStepConverterTool::convertToMaterialTrack(const Trk::MaterialStepCollection &colStep) const +{ + Acts::RecordedMaterialTrack mTrack; + std::vector<Acts::MaterialInteraction> nStep; + Acts::RecordedMaterial recorded; + double sum_X0 = 0; + double sum_L0 = 0; + + double x_lengh = colStep.back()->hitX() - colStep.front()->hitX(); + double y_lengh = colStep.back()->hitY() - colStep.front()->hitY(); + double z_lengh = colStep.back()->hitZ() - colStep.front()->hitZ(); + double r_lengh = colStep.back()->hitR() - colStep.front()->hitR(); + + double norm = 1/(std::sqrt(x_lengh*x_lengh + + y_lengh*y_lengh + + z_lengh*z_lengh)); + + + Acts::Vector3D v_pos{0, 0, colStep.front()->hitZ() - (z_lengh/r_lengh)*colStep.front()->hitR() }; + // Acts::Vector3D v_pos{0, 0, 0}; + + Acts::Vector3D v_imp{x_lengh*norm, y_lengh*norm, z_lengh*norm}; + // Acts::Vector3D v_imp{1, 0, 0}; + + for(auto const& step: colStep) { + + Acts::MaterialInteraction interaction; + + Acts::Vector3D pos{step->hitX(), step->hitY(), step->hitZ()}; + Acts::MaterialProperties matProp(step->x0(), step->l0(), step->A(), step->Z(), step->rho(),step->steplength()); + interaction.position = pos; + interaction.materialProperties = matProp; + sum_X0 += step->steplengthInX0(); + sum_L0 += step->steplengthInL0(); + nStep.push_back(interaction); + } + + recorded.materialInX0 = sum_X0; + recorded.materialInL0 = sum_L0; + recorded.materialInteractions = nStep; + + mTrack = std::make_pair(std::make_pair(v_pos, v_imp), recorded); + +return mTrack; + +} diff --git a/Tracking/Acts/ActsGeometry/src/ActsMaterialTrackWriterSvc.cxx b/Tracking/Acts/ActsGeometry/src/ActsMaterialTrackWriterSvc.cxx index c307ada289638de80a38e8b38a0602cf64c7a4d9..dd5b9ad679b3cb19b64ea336ec5df7975e5fc020 100644 --- a/Tracking/Acts/ActsGeometry/src/ActsMaterialTrackWriterSvc.cxx +++ b/Tracking/Acts/ActsGeometry/src/ActsMaterialTrackWriterSvc.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ #include "ActsGeometry/ActsMaterialTrackWriterSvc.h" @@ -8,7 +8,6 @@ #include "TTree.h" #include "TFile.h" -#include "Acts/Plugins/MaterialMapping/MaterialTrack.hpp" #include "Acts/Material/MaterialProperties.hpp" #include "Acts/Utilities/Helpers.hpp" @@ -33,30 +32,27 @@ ActsMaterialTrackWriterSvc::initialize() p_tFile->cd(); p_tree = new TTree(treeName.c_str(), treeName.c_str()); - p_tree->Branch("X0", &m_treeX0); - p_tree->Branch("L0", &m_treeL0); - p_tree->Branch("phi", &m_treePhi); - p_tree->Branch("theta", &m_treeTheta); - p_tree->Branch("T", &m_treeT); - p_tree->Branch("dInX0", &m_treedInX0); - p_tree->Branch("dInL0", &m_treedInL0); - - p_tree->Branch("step_X0", &m_treeStepX0); - p_tree->Branch("step_L0", &m_treeStepL0); - p_tree->Branch("step_A", &m_treeStepA); - p_tree->Branch("step_Z", &m_treeStepZ); - p_tree->Branch("step_rho", &m_treeStepRho); - p_tree->Branch("step_t", &m_treeStepT); - p_tree->Branch("step_dInX0", &m_treeStepdInX0); - p_tree->Branch("step_dInL0", &m_treeStepdInL0); - - p_tree->Branch("step_x", &m_treeStepPosX); - p_tree->Branch("step_y", &m_treeStepPosY); - p_tree->Branch("step_z", &m_treeStepPosZ); - p_tree->Branch("step_r", &m_treeStepPosR); - p_tree->Branch("step_phi", &m_treeStepPosPhi); - - p_tree->Branch("step_geo_id", &m_treeStepGeoID); + p_tree->Branch("v_x", &m_v_x); + p_tree->Branch("v_y", &m_v_y); + p_tree->Branch("v_z", &m_v_z); + p_tree->Branch("v_px", &m_v_px); + p_tree->Branch("v_py", &m_v_py); + p_tree->Branch("v_pz", &m_v_pz); + p_tree->Branch("v_phi", &m_v_phi); + p_tree->Branch("v_eta", &m_v_eta); + + p_tree->Branch("t_X0", &m_tX0); + p_tree->Branch("t_L0", &m_tL0); + + p_tree->Branch("mat_x", &m_step_x); + p_tree->Branch("mat_y", &m_step_y); + p_tree->Branch("mat_z", &m_step_z); + p_tree->Branch("mat_step_length", &m_step_length); + p_tree->Branch("mat_X0", &m_step_X0); + p_tree->Branch("mat_L0", &m_step_L0); + p_tree->Branch("mat_A", &m_step_A); + p_tree->Branch("mat_Z", &m_step_Z); + p_tree->Branch("mat_rho", &m_step_rho); ATH_MSG_INFO("Starting writer thread"); ATH_MSG_DEBUG("Maximum queue size is set to:" << m_maxQueueSize); @@ -65,8 +61,8 @@ ActsMaterialTrackWriterSvc::initialize() return StatusCode::SUCCESS; } - -StatusCode + +StatusCode ActsMaterialTrackWriterSvc::finalize() { @@ -74,20 +70,20 @@ ActsMaterialTrackWriterSvc::finalize() m_doEnd = true; m_writeThread.join(); ATH_MSG_INFO("Writer thread has terminated."); - + ATH_MSG_INFO("Closing TFile"); p_tFile->cd(); p_tree->FlushBaskets(); p_tree->AutoSave(); p_tree->Write(); - //p_tFile->Write() + p_tFile->Write(); p_tFile->Close(); return StatusCode::SUCCESS; } -void -ActsMaterialTrackWriterSvc::write(const Acts::MaterialTrack& mTrack) +void +ActsMaterialTrackWriterSvc::write(const Acts::RecordedMaterialTrack& mTrack) { std::lock_guard<std::mutex> lock(m_writeMutex); @@ -109,7 +105,7 @@ ActsMaterialTrackWriterSvc::writerThread() while(true) { ATH_MSG_VERBOSE("Obtaining write lock"); std::unique_lock<std::mutex> lock(m_writeMutex); - + if (m_mTracks.empty()) { lock.unlock(); if (!m_doEnd) { @@ -124,111 +120,115 @@ ActsMaterialTrackWriterSvc::writerThread() } - //if(m_mTracks.size() < m_maxQueueSize) { + if(m_mTracks.size() < m_maxQueueSize) { // just pop one - ATH_MSG_VERBOSE("Queue at " << m_mTracks.size() << "/" << m_maxQueueSize + ATH_MSG_VERBOSE("Queue at " << m_mTracks.size() << "/" << m_maxQueueSize << ": Pop entry and write"); - Acts::MaterialTrack mTrack = std::move(m_mTracks.front()); + Acts::RecordedMaterialTrack mTrack = std::move(m_mTracks.front()); m_mTracks.pop_front(); // writing can now happen without lock lock.unlock(); doWrite(std::move(mTrack)); - //} - //else { - //ATH_MSG_DEBUG("Queue at " << m_mTracks.size() << "/" << m_maxQueueSize - //<< ": Lock and write until empty"); - //while(!m_mTracks.empty()) { - //ATH_MSG_VERBOSE("Pop entry and write"); - //// keep the lock! - //MaterialTrack mTrack = std::move(m_mTracks.front()); - //m_mTracks.pop_front(); - //doWrite(std::move(mTrack)); - //} - //ATH_MSG_DEBUG("Queue is empty, continue"); - - //} - + } + else { + ATH_MSG_DEBUG("Queue at " << m_mTracks.size() << "/" << m_maxQueueSize + << ": Lock and write until empty"); + while(!m_mTracks.empty()) { + ATH_MSG_VERBOSE("Pop entry and write"); + // keep the lock! + Acts::RecordedMaterialTrack mTrack = std::move(m_mTracks.front()); + m_mTracks.pop_front(); + doWrite(std::move(mTrack)); + } + ATH_MSG_DEBUG("Queue is empty, continue"); + } } } void -ActsMaterialTrackWriterSvc::doWrite(const Acts::MaterialTrack& mTrack) +ActsMaterialTrackWriterSvc::doWrite(const Acts::RecordedMaterialTrack& mTrack) { ATH_MSG_VERBOSE("Write to tree"); - size_t nSteps = mTrack.materialSteps().size(); - //m_treeStepPos.clear(); - //m_treeStepPos.reserve(nSteps); - m_treeStepX0.clear(); - m_treeStepX0.reserve(nSteps); - m_treeStepL0.clear(); - m_treeStepL0.reserve(nSteps); - m_treeStepA.clear(); - m_treeStepA.reserve(nSteps); - m_treeStepZ.clear(); - m_treeStepZ.reserve(nSteps); - m_treeStepRho.clear(); - m_treeStepRho.reserve(nSteps); - m_treeStepT.clear(); - m_treeStepT.reserve(nSteps); - m_treeStepdInX0.clear(); - m_treeStepdInX0.reserve(nSteps); - m_treeStepdInL0.clear(); - m_treeStepdInL0.reserve(nSteps); - - m_treeStepPosX.clear(); - m_treeStepPosX.reserve(nSteps); - m_treeStepPosY.clear(); - m_treeStepPosY.reserve(nSteps); - m_treeStepPosZ.clear(); - m_treeStepPosZ.reserve(nSteps); - m_treeStepPosR.clear(); - m_treeStepPosR.reserve(nSteps); - m_treeStepPosPhi.clear(); - m_treeStepPosPhi.reserve(nSteps); - - m_treeStepGeoID.clear(); - m_treeStepGeoID.reserve(nSteps); - - - m_treeX0 = mTrack.thicknessInX0(); // name? - m_treeL0 = mTrack.thicknessInL0(); // name? - m_treeTheta = mTrack.theta(); - m_treePhi = mTrack.phi(); - m_treeT = 0; - m_treedInX0 = 0; - m_treedInL0 = 0; - - for(const auto& step : mTrack.materialSteps()) { - const Acts::MaterialProperties& matProp = step.materialProperties(); - const Acts::Material& mat = matProp.material(); - const Acts::Vector3D pos = step.position(); - - m_treeStepPosX.push_back(pos.x()); - m_treeStepPosY.push_back(pos.y()); - m_treeStepPosZ.push_back(pos.z()); - m_treeStepPosR.push_back(perp(pos)); - m_treeStepPosPhi.push_back(phi(pos)); - - m_treeStepX0.push_back(mat.X0()); - m_treeStepL0.push_back(mat.L0()); - m_treeStepA.push_back(mat.A()); - m_treeStepZ.push_back(mat.Z()); - m_treeStepRho.push_back(mat.rho()); - m_treeStepT.push_back(matProp.thickness()); - m_treeStepdInX0.push_back(matProp.thicknessInX0()); - m_treeStepdInX0.push_back(matProp.thicknessInL0()); - - m_treeT += matProp.thickness(); - m_treedInX0 += matProp.thicknessInX0(); - m_treedInL0 += matProp.thicknessInL0(); - - m_treeStepGeoID.push_back(step.geoID()); + size_t mints = mTrack.second.materialInteractions.size(); + + // Clearing the vector first + m_step_sx.clear(); + m_step_sy.clear(); + m_step_sz.clear(); + m_step_x.clear(); + m_step_y.clear(); + m_step_z.clear(); + m_step_ex.clear(); + m_step_ey.clear(); + m_step_ez.clear(); + m_step_length.clear(); + m_step_X0.clear(); + m_step_L0.clear(); + m_step_A.clear(); + m_step_Z.clear(); + m_step_rho.clear(); + + // Reserve the vector then + m_step_sx.reserve(mints); + m_step_sy.reserve(mints); + m_step_sz.reserve(mints); + m_step_x.reserve(mints); + m_step_y.reserve(mints); + m_step_ez.reserve(mints); + m_step_ex.reserve(mints); + m_step_ey.reserve(mints); + m_step_ez.reserve(mints); + m_step_length.reserve(mints); + m_step_X0.reserve(mints); + m_step_L0.reserve(mints); + m_step_A.reserve(mints); + m_step_Z.reserve(mints); + m_step_rho.reserve(mints); + + + // reset the global counter + m_tX0 = mTrack.second.materialInX0; + m_tL0 = mTrack.second.materialInL0; + + // set the track information at vertex + m_v_x = mTrack.first.first.x(); + m_v_y = mTrack.first.first.y(); + m_v_z = mTrack.first.first.z(); + m_v_px = mTrack.first.second.x(); + m_v_py = mTrack.first.second.y(); + m_v_pz = mTrack.first.second.z(); + m_v_phi = phi(mTrack.first.second); + m_v_eta = eta(mTrack.first.second); + + // an now loop over the material + for (auto& mint : mTrack.second.materialInteractions) { + // The material step position information + m_step_x.push_back(mint.position.x()); + m_step_y.push_back(mint.position.y()); + m_step_z.push_back(mint.position.z()); + + Acts::Vector3D prePos + = mint.position - 0.5 * mint.pathCorrection * mint.direction; + Acts::Vector3D posPos + = mint.position + 0.5 * mint.pathCorrection * mint.direction; + m_step_sx.push_back(prePos.x()); + m_step_sy.push_back(prePos.y()); + m_step_sz.push_back(prePos.z()); + m_step_ex.push_back(posPos.x()); + m_step_ey.push_back(posPos.y()); + m_step_ez.push_back(posPos.z()); + + // the material information + const auto& mprops = mint.materialProperties; + m_step_length.push_back(mprops.thickness()); + m_step_X0.push_back(mprops.material().X0()); + m_step_L0.push_back(mprops.material().L0()); + m_step_A.push_back(mprops.material().Ar()); + m_step_Z.push_back(mprops.material().Z()); + m_step_rho.push_back(mprops.material().massDensity()); } - p_tree->Fill(); - //m_treeTTot = 0; - ATH_MSG_VERBOSE("Write complete"); } diff --git a/Tracking/Acts/ActsGeometry/src/ActsObjWriterTool.cxx b/Tracking/Acts/ActsGeometry/src/ActsObjWriterTool.cxx index 21c97a0b5cc135f1e4f69dd6816868bd9a7ee9ac..b9165d762733d775a9357757181ae030120e1917 100644 --- a/Tracking/Acts/ActsGeometry/src/ActsObjWriterTool.cxx +++ b/Tracking/Acts/ActsGeometry/src/ActsObjWriterTool.cxx @@ -24,8 +24,8 @@ ActsObjWriterTool::ActsObjWriterTool(const std::string& type, const std::string& const IInterface* parent) : AthAlgTool(type, name, parent) { - //declareProperty("OutputDirectory", m_outputDirectory = ""); - //declareProperty("SubDetectors", m_subDetectors = {}); + // declareProperty("OutputDirectory", m_outputDirectory = ""); + // declareProperty("SubDetectors", m_subDetectors = {}); } StatusCode @@ -38,8 +38,7 @@ ActsObjWriterTool::initialize() void ActsObjWriterTool::write(const ActsGeometryContext& gctx, const Acts::TrackingGeometry& tg) const -{ - +{ const auto& ctx = Gaudi::Hive::currentContext(); std::stringstream ss; ss << ctx.eventID().run_number() << "_" << ctx.eventID().event_number(); diff --git a/Tracking/Acts/ActsGeometry/src/ActsSurfaceMappingTool.cxx b/Tracking/Acts/ActsGeometry/src/ActsSurfaceMappingTool.cxx new file mode 100644 index 0000000000000000000000000000000000000000..ce6e4327358d5bbb5fe371612fd2e684ef69e248 --- /dev/null +++ b/Tracking/Acts/ActsGeometry/src/ActsSurfaceMappingTool.cxx @@ -0,0 +1,69 @@ +/* + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration +*/ + +#include "ActsGeometry/ActsSurfaceMappingTool.h" + +// ATHENA +#include "GaudiKernel/IInterface.h" +#include "MagFieldInterfaces/IMagFieldSvc.h" + +// PACKAGE +#include "ActsInterop/Logger.h" +#include "ActsGeometry/ActsGeometryContext.h" +#include "ActsGeometry/ActsTrackingGeometryTool.h" +#include "ActsGeometryInterfaces/IActsTrackingGeometryTool.h" + +// ActsSurfaceMappingTool +#include "Acts/Geometry/GeometryContext.hpp" +#include "Acts/Propagator/Navigator.hpp" +#include "Acts/Propagator/Propagator.hpp" +#include "Acts/Propagator/StraightLineStepper.hpp" + +// STL +#include <iostream> +#include <memory> + + +ActsSurfaceMappingTool::ActsSurfaceMappingTool(const std::string& type, const std::string& name, + const IInterface* parent) + : base_class(type, name, parent) +{ +} + +StatusCode +ActsSurfaceMappingTool::initialize() +{ + ATH_MSG_INFO("Initializing ACTS Surface Mapper"); + + ATH_CHECK( m_trackingGeometryTool.retrieve() ); + + m_trackingGeometry = m_trackingGeometryTool->trackingGeometry(); + + Acts::Navigator navigator(m_trackingGeometry); + // Make stepper and propagator + SlStepper stepper; + StraightLinePropagator propagator = StraightLinePropagator(std::move(stepper), std::move(navigator)); + + /// The material mapper + Acts::SurfaceMaterialMapper::Config smmConfig; + smmConfig.mapperDebugOutput = true; + m_mapper = std::make_shared<Acts::SurfaceMaterialMapper>( + smmConfig, + std::move(propagator), + Acts::getDefaultLogger("SurfaceMaterialMapper", Acts::Logging::INFO)); + + m_geoContext = m_trackingGeometryTool->getNominalGeometryContext().any(); + + ATH_MSG_INFO("ACTS Surface Mapper successfully initialized"); + return StatusCode::SUCCESS; +} + +Acts::SurfaceMaterialMapper::State +ActsSurfaceMappingTool::mappingState() const +{ + auto mappingState = m_mapper->createState( + m_geoContext, m_magFieldContext, *m_trackingGeometry); + + return mappingState; +} diff --git a/Tracking/Acts/ActsGeometry/src/ActsTrackingGeometryTool.cxx b/Tracking/Acts/ActsGeometry/src/ActsTrackingGeometryTool.cxx index 76cb9dad074fcdee9f35dada7ca50faa11e43be7..49717d0da5f5dcc2d0e9f9543803a0ad42166696 100644 --- a/Tracking/Acts/ActsGeometry/src/ActsTrackingGeometryTool.cxx +++ b/Tracking/Acts/ActsGeometry/src/ActsTrackingGeometryTool.cxx @@ -16,7 +16,7 @@ #include <memory> ActsTrackingGeometryTool::ActsTrackingGeometryTool(const std::string& type, const std::string& name, - const IInterface* parent) + const IInterface* parent) : base_class(type, name, parent), m_trackingGeometrySvc("ActsTrackingGeometrySvc", name) { diff --git a/Tracking/Acts/ActsGeometry/src/ActsVolumeMappingTool.cxx b/Tracking/Acts/ActsGeometry/src/ActsVolumeMappingTool.cxx new file mode 100644 index 0000000000000000000000000000000000000000..627bc1cfdf82a5a0a94f7bc8a32c5728e175e2f3 --- /dev/null +++ b/Tracking/Acts/ActsGeometry/src/ActsVolumeMappingTool.cxx @@ -0,0 +1,70 @@ +/* + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration +*/ + +#include "ActsGeometry/ActsVolumeMappingTool.h" + +// ATHENA +#include "GaudiKernel/IInterface.h" +#include "MagFieldInterfaces/IMagFieldSvc.h" + +// PACKAGE +#include "ActsGeometry/ActsGeometryContext.h" +#include "ActsInterop/Logger.h" +#include "ActsGeometry/ActsTrackingGeometryTool.h" +#include "ActsGeometry/ActsGeometryContext.h" +#include "ActsGeometryInterfaces/IActsTrackingGeometryTool.h" + +// ACTS +#include "Acts/Propagator/Navigator.hpp" +#include "Acts/Propagator/Propagator.hpp" +#include "Acts/Propagator/StraightLineStepper.hpp" +#include "Acts/Geometry/GeometryContext.hpp" + +// STL +#include <iostream> +#include <memory> + + +ActsVolumeMappingTool::ActsVolumeMappingTool(const std::string& type, const std::string& name, + const IInterface* parent) + : base_class(type, name, parent) +{ +} + +StatusCode +ActsVolumeMappingTool::initialize() +{ + ATH_MSG_INFO("Initializing ACTS Volume Mapper"); + + ATH_CHECK( m_trackingGeometryTool.retrieve() ); + + m_trackingGeometry = m_trackingGeometryTool->trackingGeometry(); + + Acts::Navigator navigator(m_trackingGeometry); + // Make stepper and propagator + SlStepper stepper; + StraightLinePropagator propagator = StraightLinePropagator(std::move(stepper), std::move(navigator)); + + /// The material mapper + Acts::VolumeMaterialMapper::Config smmConfig; + smmConfig.mapperDebugOutput = true; + m_mapper = std::make_shared<Acts::VolumeMaterialMapper>( + smmConfig, + std::move(propagator), + Acts::getDefaultLogger("VolumeMaterialMapper", Acts::Logging::INFO)); + + m_geoContext = m_trackingGeometryTool->getNominalGeometryContext().any(); + + ATH_MSG_INFO("ACTS Surface Mapper successfully initialized"); + return StatusCode::SUCCESS; +} + +Acts::VolumeMaterialMapper::State +ActsVolumeMappingTool::mappingState() const +{ + auto mappingState = m_mapper->createState( + m_geoContext, m_magFieldContext, *m_trackingGeometry); + + return mappingState; +} diff --git a/Tracking/Acts/ActsGeometry/src/ActsWriteTrackingGeometry.cxx b/Tracking/Acts/ActsGeometry/src/ActsWriteTrackingGeometry.cxx index 30ee723e10ffd7a2a87102f39644fbf9a07909fa..59d221239de58eb7b61ef32e9994aaaed867439e 100755 --- a/Tracking/Acts/ActsGeometry/src/ActsWriteTrackingGeometry.cxx +++ b/Tracking/Acts/ActsGeometry/src/ActsWriteTrackingGeometry.cxx @@ -12,6 +12,7 @@ // PACKAGE #include "ActsGeometryInterfaces/IActsTrackingGeometrySvc.h" +#include "ActsGeometryInterfaces/IActsMaterialJsonWriterTool.h" #include "ActsGeometry/ActsGeometryContext.h" // STL @@ -28,7 +29,7 @@ StatusCode ActsWriteTrackingGeometry::initialize() { ATH_CHECK(m_objWriterTool.retrieve()); ATH_CHECK(m_trackingGeometryTool.retrieve()); - + ATH_CHECK(m_materialJsonWriterTool.retrieve() ); return StatusCode::SUCCESS; @@ -42,6 +43,7 @@ StatusCode ActsWriteTrackingGeometry::execute(const EventContext& ctx) const { const ActsGeometryContext& gctx = m_trackingGeometryTool->getGeometryContext(ctx); m_objWriterTool->write(gctx, *trackingGeometry); + m_materialJsonWriterTool->write(*trackingGeometry); return StatusCode::SUCCESS; } diff --git a/Tracking/Acts/ActsGeometry/src/components/ActsGeometry_entries.cxx b/Tracking/Acts/ActsGeometry/src/components/ActsGeometry_entries.cxx index 5c7f1a4f204aa5c6fe4277fc8e83b894febbba1f..311f5dfe30a87475d7db65a09f2266b8f930d1f9 100755 --- a/Tracking/Acts/ActsGeometry/src/components/ActsGeometry_entries.cxx +++ b/Tracking/Acts/ActsGeometry/src/components/ActsGeometry_entries.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 "ActsGeometry/ActsExtrapolationAlg.h" @@ -7,9 +7,13 @@ #include "ActsGeometry/ActsWriteTrackingGeometryTransforms.h" #include "ActsGeometry/ActsTrackingGeometrySvc.h" #include "ActsGeometry/ActsExtrapolationTool.h" + +#include "ActsGeometry/ActsMaterialMapping.h" +#include "ActsGeometry/ActsSurfaceMappingTool.h" +// #include "ActsGeometry/ActsVolumeMappingTool.h" #include "ActsGeometry/ActsObjWriterTool.h" //#include "ActsGeometry/ActsExCellWriterSvc.h" -//#include "ActsGeometry/ActsMaterialTrackWriterSvc.h" +#include "ActsGeometry/ActsMaterialTrackWriterSvc.h" //#include "ActsGeometry/GeomShiftCondAlg.h" #include "ActsGeometry/NominalAlignmentCondAlg.h" @@ -18,15 +22,23 @@ #include "ActsGeometry/ActsPropStepRootWriterSvc.h" #include "ActsGeometry/ActsCaloTrackingVolumeBuilder.h" +#include "ActsGeometry/ActsMaterialStepConverterTool.h" +#include "ActsGeometry/ActsMaterialJsonWriterTool.h" DECLARE_COMPONENT( ActsExtrapolationAlg ) DECLARE_COMPONENT( ActsWriteTrackingGeometry ) DECLARE_COMPONENT( ActsWriteTrackingGeometryTransforms ) DECLARE_COMPONENT( ActsTrackingGeometrySvc ) DECLARE_COMPONENT( ActsExtrapolationTool ) + +DECLARE_COMPONENT( ActsMaterialMapping ) +DECLARE_COMPONENT( ActsSurfaceMappingTool ) +// DECLARE_COMPONENT( ActsVolumeMappingTool ) DECLARE_COMPONENT( ActsObjWriterTool ) //DECLARE_COMPONENT( ActsExCellWriterSvc ) -//DECLARE_COMPONENT( ActsMaterialTrackWriterSvc ) +DECLARE_COMPONENT( ActsMaterialTrackWriterSvc ) +DECLARE_COMPONENT( ActsMaterialStepConverterTool ) +DECLARE_COMPONENT( ActsMaterialJsonWriterTool ) //DECLARE_COMPONENT( GeomShiftCondAlg ) DECLARE_COMPONENT( NominalAlignmentCondAlg ) diff --git a/Tracking/Acts/ActsGeometryInterfaces/ActsGeometryInterfaces/IActsExtrapolationTool.h b/Tracking/Acts/ActsGeometryInterfaces/ActsGeometryInterfaces/IActsExtrapolationTool.h index 03ecfe769983bd51d4b3327db61b98c2b92661a2..380aa667da03ab1e3af50ec604946092a5ff5f08 100644 --- a/Tracking/Acts/ActsGeometryInterfaces/ActsGeometryInterfaces/IActsExtrapolationTool.h +++ b/Tracking/Acts/ActsGeometryInterfaces/ActsGeometryInterfaces/IActsExtrapolationTool.h @@ -11,12 +11,16 @@ #include "GaudiKernel/EventContext.h" #include "ActsGeometry/ActsGeometryContext.h" +#include "Acts/Propagator/MaterialInteractor.hpp" #include "Acts/Propagator/detail/SteppingLogger.hpp" #include "Acts/EventData/TrackParameters.hpp" -namespace Acts { - class TrackingGeometry; -} +/// Using some short hands for Recorded Material +using ActsRecordedMaterial = Acts::MaterialInteractor::result_type; +/// Finally the output of the propagation test +using ActsPropagationOutput = + std::pair<std::vector<Acts::detail::Step>, ActsRecordedMaterial>; + class IActsTrackingGeometryTool; @@ -27,27 +31,27 @@ class IActsExtrapolationTool : virtual public IAlgTool { DeclareInterfaceID(IActsExtrapolationTool, 1, 0); virtual - std::vector<Acts::detail::Step> + ActsPropagationOutput propagationSteps(const EventContext& ctx, const Acts::BoundParameters& startParameters, Acts::NavigationDirection navDir = Acts::forward, double pathLimit = std::numeric_limits<double>::max()) const = 0; - + virtual std::unique_ptr<const Acts::CurvilinearParameters> propagate(const EventContext& ctx, const Acts::BoundParameters& startParameters, Acts::NavigationDirection navDir = Acts::forward, double pathLimit = std::numeric_limits<double>::max()) const = 0; - + virtual - std::vector<Acts::detail::Step> + ActsPropagationOutput propagationSteps(const EventContext& ctx, const Acts::BoundParameters& startParameters, const Acts::Surface& target, Acts::NavigationDirection navDir = Acts::forward, double pathLimit = std::numeric_limits<double>::max()) const = 0; - + virtual std::unique_ptr<const Acts::BoundParameters> propagate(const EventContext& ctx, diff --git a/Tracking/Acts/ActsGeometryInterfaces/ActsGeometryInterfaces/IActsMaterialJsonWriterTool.h b/Tracking/Acts/ActsGeometryInterfaces/ActsGeometryInterfaces/IActsMaterialJsonWriterTool.h new file mode 100644 index 0000000000000000000000000000000000000000..b18d4e56a7a780af10af55e7d7c51703bb95477b --- /dev/null +++ b/Tracking/Acts/ActsGeometryInterfaces/ActsGeometryInterfaces/IActsMaterialJsonWriterTool.h @@ -0,0 +1,34 @@ +/* + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration +*/ + +#ifndef ACTSGEOMETRY_IACTSMATERIALJSONWRITERTOOL_H +#define ACTSGEOMETRY_IACTSMATERIALJSONWRITERTOOL_H + +#include "AthenaBaseComps/AthAlgTool.h" +#include "GaudiKernel/IInterface.h" +#include "GaudiKernel/IAlgTool.h" + +#include "Acts/Plugins/Json/JsonGeometryConverter.hpp" + +namespace Acts { + class TrackingGeometry; +} + +class IActsMaterialJsonWriterTool : virtual public IAlgTool { +public: + + DeclareInterfaceID(IActsMaterialJsonWriterTool, 1, 0); + + virtual + void + write(const Acts::JsonGeometryConverter::DetectorMaterialMaps& detMaterial) const = 0; + + virtual + void + write(const Acts::TrackingGeometry& tGeometry) const = 0; + +}; + + +#endif diff --git a/Tracking/Acts/ActsGeometryInterfaces/ActsGeometryInterfaces/IActsMaterialStepConverterTool.h b/Tracking/Acts/ActsGeometryInterfaces/ActsGeometryInterfaces/IActsMaterialStepConverterTool.h new file mode 100644 index 0000000000000000000000000000000000000000..e42a4c3b218f9a925c6a61d54f9cec92c246a073 --- /dev/null +++ b/Tracking/Acts/ActsGeometryInterfaces/ActsGeometryInterfaces/IActsMaterialStepConverterTool.h @@ -0,0 +1,23 @@ +/* + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration +*/ + +#ifndef ACTSGEOMETRYINTERFACES_IACTSMATERIALSTEPCONVERTERTOOL_H +#define ACTSGEOMETRYINTERFACES_IACTSMATERIALSTEPCONVERTERTOOL_H + +#include "AthenaBaseComps/AthAlgTool.h" +#include "GaudiKernel/IInterface.h" +#include "Acts/Propagator/MaterialInteractor.hpp" +#include "TrkGeometry/MaterialStepCollection.h" + +class IActsMaterialStepConverterTool : virtual public IAlgTool { + public: + + DeclareInterfaceID(IActsMaterialStepConverterTool, 1, 0); + + virtual + const Acts::RecordedMaterialTrack + convertToMaterialTrack(const Trk::MaterialStepCollection &colStep) const = 0; +}; + +#endif diff --git a/Tracking/Acts/ActsGeometry/ActsGeometry/IActsMaterialTrackWriterSvc.h b/Tracking/Acts/ActsGeometryInterfaces/ActsGeometryInterfaces/IActsMaterialTrackWriterSvc.h similarity index 68% rename from Tracking/Acts/ActsGeometry/ActsGeometry/IActsMaterialTrackWriterSvc.h rename to Tracking/Acts/ActsGeometryInterfaces/ActsGeometryInterfaces/IActsMaterialTrackWriterSvc.h index 8f3804142e7656afd9b17835078149bc659a1f8f..d7453618305823adcdc2b8cd1832f2955392f060 100644 --- a/Tracking/Acts/ActsGeometry/ActsGeometry/IActsMaterialTrackWriterSvc.h +++ b/Tracking/Acts/ActsGeometryInterfaces/ActsGeometryInterfaces/IActsMaterialTrackWriterSvc.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ #ifndef ACTSGEOMETRY_IACTSMATERIALTRACKWRITERSVC_H @@ -8,21 +8,19 @@ #include "GaudiKernel/IInterface.h" #include "Acts/EventData/TrackParameters.hpp" -namespace Acts { -class MaterialTrack; -} +#include "Acts/Propagator/MaterialInteractor.hpp" class IActsMaterialTrackWriterSvc : virtual public IInterface { public: - + DeclareInterfaceID(IActsMaterialTrackWriterSvc, 1, 0); IActsMaterialTrackWriterSvc() {;} - + void virtual - write(const Acts::MaterialTrack& mTrack) = 0; + write(const Acts::RecordedMaterialTrack& mTrack) = 0; }; -#endif +#endif diff --git a/Tracking/Acts/ActsGeometryInterfaces/ActsGeometryInterfaces/IActsSurfaceMappingTool.h b/Tracking/Acts/ActsGeometryInterfaces/ActsGeometryInterfaces/IActsSurfaceMappingTool.h new file mode 100644 index 0000000000000000000000000000000000000000..e0c5e7cbe13c9ee4ca3859bb1843310cd95096bc --- /dev/null +++ b/Tracking/Acts/ActsGeometryInterfaces/ActsGeometryInterfaces/IActsSurfaceMappingTool.h @@ -0,0 +1,37 @@ +/* + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration +*/ + +#ifndef ACTSGEOMETRYINTERFACES_IACTSSURFACEMAPPINGTOOL_H +#define ACTSGEOMETRYINTERFACES_IACTSSURFACEMAPPINGTOOL_H + +#include "AthenaBaseComps/AthAlgTool.h" +#include "GaudiKernel/IInterface.h" +#include "GaudiKernel/IAlgTool.h" +#include "GaudiKernel/EventContext.h" + +#include "Acts/Material/SurfaceMaterialMapper.hpp" + +class IActsTrackingGeometryTool; + +class IActsSurfaceMappingTool : virtual public IAlgTool { + public: + + DeclareInterfaceID(IActsSurfaceMappingTool, 1, 0); + + + virtual + std::shared_ptr<Acts::SurfaceMaterialMapper> + mapper() const = 0; + + virtual + Acts::SurfaceMaterialMapper::State + mappingState() const = 0; + + virtual + const IActsTrackingGeometryTool* + trackingGeometryTool() const = 0; + +}; + +#endif diff --git a/Tracking/Acts/ActsGeometryInterfaces/ActsGeometryInterfaces/IActsVolumeMappingTool.h b/Tracking/Acts/ActsGeometryInterfaces/ActsGeometryInterfaces/IActsVolumeMappingTool.h new file mode 100644 index 0000000000000000000000000000000000000000..cedc321f3388fcb3535c684cffcefd16afe1c9c5 --- /dev/null +++ b/Tracking/Acts/ActsGeometryInterfaces/ActsGeometryInterfaces/IActsVolumeMappingTool.h @@ -0,0 +1,37 @@ +/* + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration +*/ + +#ifndef ACTSGEOMETRYINTERFACES_IACTSVOLUMEMAPPINGTOOL_H +#define ACTSGEOMETRYINTERFACES_IACTSVOLUMEMAPPINGTOOL_H + +#include "AthenaBaseComps/AthAlgTool.h" +#include "GaudiKernel/IInterface.h" +#include "GaudiKernel/IAlgTool.h" +#include "GaudiKernel/EventContext.h" + +#include "Acts/Material/VolumeMaterialMapper.hpp" + +class IActsTrackingGeometryTool; + +class IActsVolumeMappingTool : virtual public IAlgTool { + public: + + DeclareInterfaceID(IActsVolumeMappingTool, 1, 0); + + + virtual + std::shared_ptr<Acts::VolumeMaterialMapper> + mapper() const = 0; + + virtual + Acts::VolumeMaterialMapper::State + mappingState() const = 0; + + virtual + const IActsTrackingGeometryTool* + trackingGeometryTool() const = 0; + +}; + +#endif diff --git a/Tracking/TrkConfig/python/TrackCollectionReadConfig.py b/Tracking/TrkConfig/python/TrackCollectionReadConfig.py index 13be290062348a0f1bc29768fb4c98479c579f86..9ef0980dcb088f8c19e5b223b98d1c2908cadb73 100644 --- a/Tracking/TrkConfig/python/TrackCollectionReadConfig.py +++ b/Tracking/TrkConfig/python/TrackCollectionReadConfig.py @@ -64,7 +64,8 @@ in the input file.""" Key = 'TrackCollection/' + key, Aliases = aliases, ExtraInputs = [('InDetDD::SiDetectorElementCollection', 'ConditionStore+PixelDetectorElementCollection'), - ('InDetDD::SiDetectorElementCollection', 'ConditionStore+SCT_DetectorElementCollection')]) + ('InDetDD::SiDetectorElementCollection', 'ConditionStore+SCT_DetectorElementCollection'), + ( 'InDetDD::TRT_DetElementContainer' , 'ConditionStore+TRT_DetElementContainer' ) ]) result.addEventAlgo (alg) # We also require AddressRemappingSvc. diff --git a/Tracking/TrkTools/TrkParticleCreator/src/TrackParticleCreatorTool.cxx b/Tracking/TrkTools/TrkParticleCreator/src/TrackParticleCreatorTool.cxx index 4d3f381d258fea0a44a2afd8e5f3bb9b4e07c65d..a928cff654bd9c3d12e781fccdb23b1a374d39d1 100644 --- a/Tracking/TrkTools/TrkParticleCreator/src/TrackParticleCreatorTool.cxx +++ b/Tracking/TrkTools/TrkParticleCreator/src/TrackParticleCreatorTool.cxx @@ -363,7 +363,7 @@ TrackParticleCreatorTool::TrackParticleCreatorTool(const std::string& t, const s std::unique_ptr<const Trk::TrackSummary> summary; if (m_trackSummaryTool.get()!=nullptr) { - summary.reset(m_trackSummaryTool->createSummary(*track)); + summary = m_trackSummaryTool->summary(*track, nullptr); if (summary == nullptr) { ATH_MSG_DEBUG ("No proper TrackSummary was returned. Creating TrackParticle with a dummy TrackSummary"); summary = std::make_unique<Trk::TrackSummary>(); diff --git a/Trigger/TrigAlgorithms/TrigFastTrackFinder/src/TrigFastTrackFinder.cxx b/Trigger/TrigAlgorithms/TrigFastTrackFinder/src/TrigFastTrackFinder.cxx index 206ec3bd3a03dba04207dfb255be2cb1694f9af4..2491f08ee73933f90093f282127fe4c4f8a024d0 100644 --- a/Trigger/TrigAlgorithms/TrigFastTrackFinder/src/TrigFastTrackFinder.cxx +++ b/Trigger/TrigAlgorithms/TrigFastTrackFinder/src/TrigFastTrackFinder.cxx @@ -38,8 +38,6 @@ #include "TrkTrackSummary/TrackSummary.h" #include "TrkToolInterfaces/ITrackSummaryTool.h" -#include "IRegionSelector/IRegSelSvc.h" - #include "TrigInDetEvent/TrigSiSpacePointBase.h" #include "InDetIdentifier/SCT_ID.h" diff --git a/Trigger/TrigAlgorithms/TrigFastTrackFinder/src/TrigFastTrackFinder.h b/Trigger/TrigAlgorithms/TrigFastTrackFinder/src/TrigFastTrackFinder.h index d4f73491854a1413a7739477abdae14482ebad2a..e44ad23760b606c2a32dfb2f2361228622c0da22 100644 --- a/Trigger/TrigAlgorithms/TrigFastTrackFinder/src/TrigFastTrackFinder.h +++ b/Trigger/TrigAlgorithms/TrigFastTrackFinder/src/TrigFastTrackFinder.h @@ -39,7 +39,6 @@ class ITrigSpacePointConversionTool; class ITrigL2ResidualCalculator; class ITrigInDetTrackFitter; class ITrigZFinder; -class IRegSelSvc; class TrigRoiDescriptor; class TrigSiSpacePointBase; class Identifier; diff --git a/Trigger/TrigAlgorithms/TrigL2MuonSA/TrigL2MuonSA/MuFastDataPreparator.h b/Trigger/TrigAlgorithms/TrigL2MuonSA/TrigL2MuonSA/MuFastDataPreparator.h index b79f4232cb3ee156e975d5a60f06f538c8b37db4..40b1865f6aeb12047db5929cd6e1e0b4781064d8 100644 --- a/Trigger/TrigAlgorithms/TrigL2MuonSA/TrigL2MuonSA/MuFastDataPreparator.h +++ b/Trigger/TrigAlgorithms/TrigL2MuonSA/TrigL2MuonSA/MuFastDataPreparator.h @@ -32,7 +32,6 @@ #include "TrigMuonBackExtrapolator/ITrigMuonBackExtrapolator.h" #include "TrigL2MuonSA/PtEndcapLUTSvc.h" -#include "RegionSelector/IRegSelSvc.h" #include "RPC_CondCabling/RpcCablingCondData.h" #include "StoreGate/ReadCondHandleKey.h" diff --git a/Trigger/TrigAlgorithms/TrigL2MuonSA/TrigL2MuonSA/PtEndcapLUT.h b/Trigger/TrigAlgorithms/TrigL2MuonSA/TrigL2MuonSA/PtEndcapLUT.h index ea7c83c8b02e854e697c4be3e267ea9a748233f1..3344eb1cc6f62e429be582c9975e9fb9de677a11 100644 --- a/Trigger/TrigAlgorithms/TrigL2MuonSA/TrigL2MuonSA/PtEndcapLUT.h +++ b/Trigger/TrigAlgorithms/TrigL2MuonSA/TrigL2MuonSA/PtEndcapLUT.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 TRIGL2MUONSA_PTENDCAPLUT_H @@ -9,7 +9,6 @@ #include "GaudiKernel/Service.h" #include "GaudiKernel/IInterface.h" -#include "GaudiKernel/StatusCode.h" #include <map> #include <cstring> @@ -25,16 +24,12 @@ class PtEndcapLUT: public AthAlgTool enum DataType { INVALID, ALPHAPOL2, BETAPOL2, TGCALPHAPOL2, INVRADIUSPOL2, CSCPOL2 }; public: - static const InterfaceID& interfaceID(); PtEndcapLUT(const std::string& type, const std::string& name, const IInterface* parent); ~PtEndcapLUT(void); - virtual StatusCode initialize(); - virtual StatusCode finalize (); - StatusCode readLUT(std::string lut_fileName); StatusCode readLUTSigmaMean(std::string lut_mean, std::string lut_sigma); diff --git a/Trigger/TrigAlgorithms/TrigL2MuonSA/TrigL2MuonSA/PtEndcapLUTSvc.h b/Trigger/TrigAlgorithms/TrigL2MuonSA/TrigL2MuonSA/PtEndcapLUTSvc.h index b87d9d408af486eac3bb5539abbf3bef76bbca95..936393e4d4a1906965ef76d35cf93cf781650f86 100644 --- a/Trigger/TrigAlgorithms/TrigL2MuonSA/TrigL2MuonSA/PtEndcapLUTSvc.h +++ b/Trigger/TrigAlgorithms/TrigL2MuonSA/TrigL2MuonSA/PtEndcapLUTSvc.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 TRIGL2MUONSA_PTENDCAPLUTSVC_H @@ -7,7 +7,6 @@ #include "AthenaBaseComps/AthService.h" #include "GaudiKernel/IInterface.h" -#include "GaudiKernel/StatusCode.h" #include "GaudiKernel/ServiceHandle.h" #include "GaudiKernel/ToolHandle.h" @@ -34,8 +33,7 @@ class PtEndcapLUTSvc : public AthService, virtual public IInterface virtual StatusCode queryInterface(const InterfaceID& riid, void** ppvIF); - virtual StatusCode initialize(); - virtual StatusCode finalize(); + virtual StatusCode initialize() override; private: Gaudi::Property< std::string > m_lut_fileNameRun2 { @@ -47,7 +45,7 @@ class PtEndcapLUTSvc : public AthService, virtual public IInterface Gaudi::Property< std::string > m_lut_sigma { this, "ESigmaLUT", "pt_comb_sigma.lut", ""}; - ToolHandle<PtEndcapLUT> m_ptEndcapLUT; + ToolHandle<PtEndcapLUT> m_ptEndcapLUT{this, "PtEndcapLUT", "TrigL2MuonSA::PtEndcapLUT"}; public: const ToolHandle<PtEndcapLUT>* ptEndcapLUT(void) const diff --git a/Trigger/TrigAlgorithms/TrigL2MuonSA/TrigL2MuonSA/PtFromAlphaBeta.h b/Trigger/TrigAlgorithms/TrigL2MuonSA/TrigL2MuonSA/PtFromAlphaBeta.h index c77cb56ac585f5b9e0e78c48469f86e6566f0a91..cef2d61e21b07ad0239bb104f637a1b291278704 100644 --- a/Trigger/TrigAlgorithms/TrigL2MuonSA/TrigL2MuonSA/PtFromAlphaBeta.h +++ b/Trigger/TrigAlgorithms/TrigL2MuonSA/TrigL2MuonSA/PtFromAlphaBeta.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ #ifndef TRIGL2MUONSA_PTFROMALPHABETA_H @@ -20,16 +20,11 @@ class PtFromAlphaBeta: public AthAlgTool { public: - static const InterfaceID& interfaceID(); - PtFromAlphaBeta(const std::string& type, const std::string& name, const IInterface* parent); - ~PtFromAlphaBeta(); - - virtual StatusCode initialize(); - virtual StatusCode finalize (); + virtual StatusCode initialize() override; void setMCFlag(BooleanProperty use_mcLUT, const TrigL2MuonSA::PtEndcapLUTSvc* ptEndcapLUTSvc); @@ -54,7 +49,7 @@ class PtFromAlphaBeta: public AthAlgTool Gaudi::Property< bool > m_avoid_misaligned_cscs { this, "AvoidMisalignedCSCs", true, "avoid using the 2 new chambers, whose alignment is not completed"}; - const ToolHandle<PtEndcapLUT>* m_ptEndcapLUT; + const ToolHandle<PtEndcapLUT>* m_ptEndcapLUT{nullptr}; }; diff --git a/Trigger/TrigAlgorithms/TrigL2MuonSA/TrigL2MuonSA/PtFromRadius.h b/Trigger/TrigAlgorithms/TrigL2MuonSA/TrigL2MuonSA/PtFromRadius.h index cf86ee8db5c7940860a502533def879d24e68847..9e1020c3efe212f8dc5762f0eb00f0aba6afdb3c 100644 --- a/Trigger/TrigAlgorithms/TrigL2MuonSA/TrigL2MuonSA/PtFromRadius.h +++ b/Trigger/TrigAlgorithms/TrigL2MuonSA/TrigL2MuonSA/PtFromRadius.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ #ifndef TRIGL2MUONSA_PTFROMRADIUS_H @@ -19,17 +19,10 @@ class PtFromRadius: public AthAlgTool { public: - static const InterfaceID& interfaceID(); - PtFromRadius(const std::string& type, const std::string& name, const IInterface* parent); - ~PtFromRadius(); - - virtual StatusCode initialize(); - virtual StatusCode finalize (); - void setMCFlag(BooleanProperty m_use_mcLUT, const TrigL2MuonSA::PtBarrelLUTSvc* ptBarrelLUTSvc); @@ -39,9 +32,9 @@ class PtFromRadius: public AthAlgTool StatusCode setPt(TrigL2MuonSA::TrackPattern& trackPattern); private: - BooleanProperty m_use_mcLUT; + BooleanProperty m_use_mcLUT{0}; - const ToolHandle<PtBarrelLUT>* m_ptBarrelLUT; + const ToolHandle<PtBarrelLUT>* m_ptBarrelLUT{nullptr}; }; } // namespace PtFromRadius diff --git a/Trigger/TrigAlgorithms/TrigL2MuonSA/TrigL2MuonSA/RecMuonRoIUtils.h b/Trigger/TrigAlgorithms/TrigL2MuonSA/TrigL2MuonSA/RecMuonRoIUtils.h index d438ea1b66690a63e6ce2928d57ae6810d1c341c..091cedda2bd8c7db61789e79efcc8d88e861dbf0 100644 --- a/Trigger/TrigAlgorithms/TrigL2MuonSA/TrigL2MuonSA/RecMuonRoIUtils.h +++ b/Trigger/TrigAlgorithms/TrigL2MuonSA/TrigL2MuonSA/RecMuonRoIUtils.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ #ifndef TRIGL2MUONSA_RECMUONROIUTILS_H @@ -16,9 +16,15 @@ class RecMuonRoIUtils ~RecMuonRoIUtils() {}; public: - bool isBarrel(const LVL1::RecMuonRoI* p_roi); - bool isLowPt(const LVL1::RecMuonRoI* p_roi); - bool isHighPt(const LVL1::RecMuonRoI* p_roi); + bool isBarrel(const LVL1::RecMuonRoI* p_roi){ + return (p_roi->sysID()==0) ? true : false; + }; + bool isLowPt(const LVL1::RecMuonRoI* p_roi){ + return (p_roi->getThresholdNumber() <4) ? true : false; + }; + bool isHighPt(const LVL1::RecMuonRoI* p_roi){ + return (p_roi->getThresholdNumber()>=4) ? true : false; + }; }; } diff --git a/Trigger/TrigAlgorithms/TrigL2MuonSA/TrigL2MuonSA/RpcPatFinder.h b/Trigger/TrigAlgorithms/TrigL2MuonSA/TrigL2MuonSA/RpcPatFinder.h index e13832c443619c84d7bc6df0b0b60d29a89389da..68982e7c1cfdc0bd092867d2ddaf731897c85b46 100644 --- a/Trigger/TrigAlgorithms/TrigL2MuonSA/TrigL2MuonSA/RpcPatFinder.h +++ b/Trigger/TrigAlgorithms/TrigL2MuonSA/TrigL2MuonSA/RpcPatFinder.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ #ifndef TRIGL2MUONSA_RPAPATFINDER_H @@ -21,15 +21,10 @@ class RpcPatFinder: public AthAlgTool { public: - static const InterfaceID& interfaceID(); RpcPatFinder(const std::string& type, const std::string& name, const IInterface* parent); - ~RpcPatFinder(void); - - virtual StatusCode initialize(); - virtual StatusCode finalize (); public: @@ -62,7 +57,7 @@ class RpcPatFinder: public AthAlgTool double result_dist[]); bool deltaOK(int l1, int l2, double x1, double x2, int isphi, double &delta); - double calibR(std::string stationName, double R, double Phi); + double calibR(std::string stationName, double R, double Phi) const; void abcal(unsigned int result_pat, size_t index[], double aw[], double bw[]); }; diff --git a/Trigger/TrigAlgorithms/TrigL2MuonSA/src/PtEndcapLUT.cxx b/Trigger/TrigAlgorithms/TrigL2MuonSA/src/PtEndcapLUT.cxx index c7c95442f850ba601c368f051d2c6d02c2142dec..06ad499b6a58c11d38e5814eaddc12246a03c3c2 100644 --- a/Trigger/TrigAlgorithms/TrigL2MuonSA/src/PtEndcapLUT.cxx +++ b/Trigger/TrigAlgorithms/TrigL2MuonSA/src/PtEndcapLUT.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ #include "TrigL2MuonSA/PtEndcapLUT.h" @@ -12,19 +12,11 @@ // -------------------------------------------------------------------------------- // -------------------------------------------------------------------------------- -static const InterfaceID IID_PtEndcapLUT("IID_PtEndcapLUT", 1, 0); - -const InterfaceID& TrigL2MuonSA::PtEndcapLUT::interfaceID() { return IID_PtEndcapLUT; } - -// -------------------------------------------------------------------------------- -// -------------------------------------------------------------------------------- - TrigL2MuonSA::PtEndcapLUT::PtEndcapLUT(const std::string& type, const std::string& name, const IInterface* parent): AthAlgTool(type, name, parent) { - declareInterface<TrigL2MuonSA::PtEndcapLUT>(this); } // -------------------------------------------------------------------------------- @@ -40,24 +32,6 @@ TrigL2MuonSA::PtEndcapLUT::~PtEndcapLUT() // -------------------------------------------------------------------------------- // -------------------------------------------------------------------------------- -StatusCode TrigL2MuonSA::PtEndcapLUT::initialize() -{ - ATH_MSG_DEBUG("Initializing PtEndcapLUT - package version " << PACKAGE_VERSION) ; - - StatusCode sc; - sc = AthAlgTool::initialize(); - if (!sc.isSuccess()) { - ATH_MSG_ERROR("Could not initialize the AthAlgTool base class."); - return sc; - } - - // - return StatusCode::SUCCESS; -} - -// -------------------------------------------------------------------------------- -// -------------------------------------------------------------------------------- - bool TrigL2MuonSA::PtEndcapLUT::KeyType::operator<(const KeyType& other) const { if (m_side < other.m_side) return (true); @@ -330,31 +304,21 @@ const char* TrigL2MuonSA::PtEndcapLUT::dt2s(TrigL2MuonSA::PtEndcapLUT::DataType // -------------------------------------------------------------------------------- // -------------------------------------------------------------------------------- -StatusCode TrigL2MuonSA::PtEndcapLUT::finalize() -{ - ATH_MSG_DEBUG("Finalizing TgcRoadDefiner - package version " << PACKAGE_VERSION); - - StatusCode sc = AthAlgTool::finalize(); - return sc; -} - -// -------------------------------------------------------------------------------- -// -------------------------------------------------------------------------------- double TrigL2MuonSA::PtEndcapLUT::ptcombined(int iEta, int iPhi, double ApT, double BpT, double &CApT, \ double &CBpT) const { - msg() << MSG::DEBUG << "pTcombined(" + ATH_MSG_DEBUG("pTcombined(" << "iEta=" << iEta << "iPhi=" << iPhi << "Alpha pT=" << ApT << "Beta pT=" << BpT - << ")" << endmsg; + << ")" ); if (iEta == -1) iEta = 0; if (iEta == 30) iEta = 29; if (iEta < 0 || iEta >= ETAS || iPhi < 0 || iPhi >= PHIS) { - msg() << MSG::WARNING << "pTcombined("<< iEta << ", " << iPhi << ") Invalid indices" << endmsg; + ATH_MSG_WARNING("pTcombined("<< iEta << ", " << iPhi << ") Invalid indices"); return 0.0; } @@ -420,11 +384,11 @@ StatusCode TrigL2MuonSA::PtEndcapLUT::readLUTSigmaMean(std::string lut_mean, std std::ifstream ifsmean(lut_mean.c_str()); std::ifstream ifssigma(lut_sigma.c_str()); if (!ifsmean.is_open()) { - msg() << MSG::ERROR << "Cannot open EndcapLUT Mean file " << lut_mean << endmsg; + ATH_MSG_ERROR("Cannot open EndcapLUT Mean file " << lut_mean); return StatusCode::FAILURE; } if (!ifssigma.is_open()) { - msg() << MSG::ERROR << "Cannot open EndcapLUT Sigma file " << lut_sigma << endmsg; + ATH_MSG_ERROR("Cannot open EndcapLUT Sigma file " << lut_sigma); return StatusCode::FAILURE; } @@ -450,7 +414,7 @@ StatusCode TrigL2MuonSA::PtEndcapLUT::readLUTSigmaMean(std::string lut_mean, std int iEta, iPhi, iNP; double tmp_par1, tmp_par2, tmp_par3; if (sscanf(line.c_str(), "%d %d %d %lf %lf %lf", &iEta, &iPhi, &iNP, &tmp_par1, &tmp_par2, &tmp_par3) != 6) { - msg() << MSG::ERROR << " Invalid data in mean EndcapLUT file " << lut_mean << endmsg; + ATH_MSG_ERROR(" Invalid data in mean EndcapLUT file " << lut_mean); return StatusCode::FAILURE; } @@ -467,7 +431,7 @@ StatusCode TrigL2MuonSA::PtEndcapLUT::readLUTSigmaMean(std::string lut_mean, std int iEta, iPhi, iNP; double tmp_par1, tmp_par2, tmp_par3; if (sscanf(line2.c_str(), "%d %d %d %lf %lf %lf", &iEta, &iPhi, &iNP, &tmp_par1, &tmp_par2, &tmp_par3) != 6) { - msg() << MSG::ERROR << " Invalid data in mean EndcapLUT file " << lut_mean << endmsg; + ATH_MSG_ERROR(" Invalid data in mean EndcapLUT file " << lut_mean); return StatusCode::FAILURE; } diff --git a/Trigger/TrigAlgorithms/TrigL2MuonSA/src/PtEndcapLUTSvc.cxx b/Trigger/TrigAlgorithms/TrigL2MuonSA/src/PtEndcapLUTSvc.cxx index 96cac233b8f865572bd6824bf683e381dd600342..85633851c2e4c0a0e0f3e837d5d6b9f6af9f1efd 100644 --- a/Trigger/TrigAlgorithms/TrigL2MuonSA/src/PtEndcapLUTSvc.cxx +++ b/Trigger/TrigAlgorithms/TrigL2MuonSA/src/PtEndcapLUTSvc.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ #include "GaudiKernel/ISvcLocator.h" @@ -13,8 +13,7 @@ // -------------------------------------------------------------------------------- TrigL2MuonSA::PtEndcapLUTSvc::PtEndcapLUTSvc(const std::string& name, ISvcLocator* sl) : - AthService(name,sl), - m_ptEndcapLUT("TrigL2MuonSA::PtEndcapLUT") + AthService(name,sl) { } @@ -37,11 +36,6 @@ StatusCode TrigL2MuonSA::PtEndcapLUTSvc::queryInterface(const InterfaceID& riid, StatusCode TrigL2MuonSA::PtEndcapLUTSvc::initialize() { - StatusCode sc; - - sc = AthService::initialize(); - if ( sc.isFailure() ) return sc; - // implement the search of LUT trought the pathresolver Tool. std::string lut_fileName = PathResolver::find_file(m_lut_fileNameRun2, "DATAPATH"); ATH_MSG_INFO(lut_fileName); @@ -55,11 +49,8 @@ StatusCode TrigL2MuonSA::PtEndcapLUTSvc::initialize() ATH_MSG_DEBUG("Retrieved service " << m_ptEndcapLUT); // read LUT - sc = m_ptEndcapLUT->readLUT(lut_fileName); - if ( sc.isFailure() ) { - ATH_MSG_ERROR("Failed to read endcap LUT" << m_lut_fileNameRun2); - return sc; - } + ATH_CHECK( m_ptEndcapLUT->readLUT(lut_fileName) ); + ATH_MSG_DEBUG("Read endcap LUT" << m_lut_fileNameRun2); return StatusCode::SUCCESS; } @@ -67,10 +58,3 @@ StatusCode TrigL2MuonSA::PtEndcapLUTSvc::initialize() // -------------------------------------------------------------------------------- // -------------------------------------------------------------------------------- -StatusCode TrigL2MuonSA::PtEndcapLUTSvc::finalize() -{ - return StatusCode::SUCCESS; -} - -// -------------------------------------------------------------------------------- -// -------------------------------------------------------------------------------- diff --git a/Trigger/TrigAlgorithms/TrigL2MuonSA/src/PtFromAlphaBeta.cxx b/Trigger/TrigAlgorithms/TrigL2MuonSA/src/PtFromAlphaBeta.cxx index 19f747512c9e0e6ea1f39af4a4c06a94e58f7f97..eaafa5c07189a2c4576b37970b85ea5ebf6e5d25 100644 --- a/Trigger/TrigAlgorithms/TrigL2MuonSA/src/PtFromAlphaBeta.cxx +++ b/Trigger/TrigAlgorithms/TrigL2MuonSA/src/PtFromAlphaBeta.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ #include "TrigL2MuonSA/PtFromAlphaBeta.h" @@ -12,26 +12,10 @@ // -------------------------------------------------------------------------------- // -------------------------------------------------------------------------------- -static const InterfaceID IID_PtFromAlphaBeta("IID_PtFromAlphaBeta", 1, 0); - -const InterfaceID& TrigL2MuonSA::PtFromAlphaBeta::interfaceID() { return IID_PtFromAlphaBeta; } - -// -------------------------------------------------------------------------------- -// -------------------------------------------------------------------------------- - TrigL2MuonSA::PtFromAlphaBeta::PtFromAlphaBeta(const std::string& type, const std::string& name, const IInterface* parent): - AthAlgTool(type, name, parent), - m_ptEndcapLUT(0) -{ - declareInterface<TrigL2MuonSA::PtFromAlphaBeta>(this); -} - -// -------------------------------------------------------------------------------- -// -------------------------------------------------------------------------------- - -TrigL2MuonSA::PtFromAlphaBeta::~PtFromAlphaBeta() + AthAlgTool(type, name, parent) { } @@ -40,15 +24,6 @@ TrigL2MuonSA::PtFromAlphaBeta::~PtFromAlphaBeta() StatusCode TrigL2MuonSA::PtFromAlphaBeta::initialize() { - ATH_MSG_DEBUG("Initializing PtFromAlphaBeta - package version " << PACKAGE_VERSION) ; - - StatusCode sc; - sc = AthAlgTool::initialize(); - if (!sc.isSuccess()) { - ATH_MSG_ERROR("Could not initialize the AthAlgTool base class."); - return sc; - } - ATH_MSG_DEBUG(m_use_cscpt); // return StatusCode::SUCCESS; @@ -62,8 +37,6 @@ void TrigL2MuonSA::PtFromAlphaBeta::setMCFlag(BooleanProperty use_mcLUT, { m_use_mcLUT = use_mcLUT; m_ptEndcapLUT = ptEndcapLUTSvc->ptEndcapLUT(); - - return; } // -------------------------------------------------------------------------------- @@ -82,11 +55,11 @@ StatusCode TrigL2MuonSA::PtFromAlphaBeta::setPt(TrigL2MuonSA::TrackPattern& trac if ( fabs(trackPattern.slope)<ZERO_LIMIT && fabs(trackPattern.intercept)<ZERO_LIMIT ) return StatusCode::SUCCESS; - float tgcPt = tgcFitResult.tgcPT ; + const float tgcPt = tgcFitResult.tgcPT ; // MDT pT by alpha - int side = (trackPattern.etaMap <= 0.0) ? 0 : 1; - int charge = (trackPattern.intercept * trackPattern.etaMap) < 0.0 ? 0 : 1; + const int side = (trackPattern.etaMap <= 0.0) ? 0 : 1; + const int charge = (trackPattern.intercept * trackPattern.etaMap) < 0.0 ? 0 : 1; float mdtPt = (*m_ptEndcapLUT)->lookup(side, charge, PtEndcapLUT::ALPHAPOL2, trackPattern.etaBin, trackPattern.phiBin, trackPattern.endcapAlpha) / 1000; @@ -107,7 +80,7 @@ StatusCode TrigL2MuonSA::PtFromAlphaBeta::setPt(TrigL2MuonSA::TrackPattern& trac if (charge == 0) betaPt = -betaPt; trackPattern.ptEndcapBeta = betaPt;//pt calculated by beta - int outer = xAOD::L2MuonParameters::Chamber::EndcapOuter; + const int outer = xAOD::L2MuonParameters::Chamber::EndcapOuter; if ( fabs((betaPt - mdtPt) / mdtPt) < ALPHA_TO_BETA_RATIO ) { mdtPt = betaPt; } else if ( fabs(trackPattern.superPoints[outer].Z) < ZERO_LIMIT) { @@ -116,7 +89,7 @@ StatusCode TrigL2MuonSA::PtFromAlphaBeta::setPt(TrigL2MuonSA::TrackPattern& trac } if (trackPattern.endcapRadius3P>0) {//calculate pt from radius ATH_MSG_DEBUG("calculate pt from Radius"); - float invR = 1. / trackPattern.endcapRadius3P; + const float invR = 1. / trackPattern.endcapRadius3P; if (trackPattern.etaBin<8){ trackPattern.ptEndcapRadius = (*m_ptEndcapLUT)->lookup(side, charge, PtEndcapLUT::INVRADIUSPOL2, @@ -141,8 +114,8 @@ StatusCode TrigL2MuonSA::PtFromAlphaBeta::setPt(TrigL2MuonSA::TrackPattern& trac if(m_use_cscpt){ const float &cscPt = trackPattern.ptCSC; const int &etabin = trackPattern.etaBin; - bool validrange = (20<=etabin && etabin<=27) || (etabin==20 && abs(side-charge)!=1);//side-charge==0 <=> Qeta==1 - bool validchamber = !m_avoid_misaligned_cscs || (16!=trackPattern.hashID_CSC && 17!=trackPattern.hashID_CSC); + const bool validrange = (20<=etabin && etabin<=27) || (etabin==20 && abs(side-charge)!=1);//side-charge==0 <=> Qeta==1 + const bool validchamber = !m_avoid_misaligned_cscs || (16!=trackPattern.hashID_CSC && 17!=trackPattern.hashID_CSC); if( etabin !=23 && etabin!=24 && validrange && validchamber){ if(fabs(trackPattern.ptEndcapBeta)<ZERO_LIMIT && fabs(cscPt)>ZERO_LIMIT && fabs((cscPt - mdtPt) / mdtPt)<ALPHA_TO_CSC_RATIO && fabs(1./cscPt-1./mdtPt)<ALPHA_TO_CSC_RATIO_PT ){ @@ -190,13 +163,3 @@ StatusCode TrigL2MuonSA::PtFromAlphaBeta::setPt(TrigL2MuonSA::TrackPattern& trac // -------------------------------------------------------------------------------- // -------------------------------------------------------------------------------- -StatusCode TrigL2MuonSA::PtFromAlphaBeta::finalize() -{ - ATH_MSG_DEBUG("Finalizing PtFromAlphaBeta - package version " << PACKAGE_VERSION); - - StatusCode sc = AthAlgTool::finalize(); - return sc; -} - -// -------------------------------------------------------------------------------- -// -------------------------------------------------------------------------------- diff --git a/Trigger/TrigAlgorithms/TrigL2MuonSA/src/PtFromRadius.cxx b/Trigger/TrigAlgorithms/TrigL2MuonSA/src/PtFromRadius.cxx index 2436a85aab7e61d7079d7fda8844ee2bc7fa9f65..267c73445a9d4727a1878af8ab2da0d10a8c4750 100644 --- a/Trigger/TrigAlgorithms/TrigL2MuonSA/src/PtFromRadius.cxx +++ b/Trigger/TrigAlgorithms/TrigL2MuonSA/src/PtFromRadius.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ #include "TrigL2MuonSA/PtFromRadius.h" @@ -12,51 +12,16 @@ // -------------------------------------------------------------------------------- // -------------------------------------------------------------------------------- -static const InterfaceID IID_PtFromRadius("IID_PtFromRadius", 1, 0); - -const InterfaceID& TrigL2MuonSA::PtFromRadius::interfaceID() { return IID_PtFromRadius; } - -// -------------------------------------------------------------------------------- -// -------------------------------------------------------------------------------- - TrigL2MuonSA::PtFromRadius::PtFromRadius(const std::string& type, const std::string& name, const IInterface* parent): - AthAlgTool(type, name, parent), - m_use_mcLUT(0), - m_ptBarrelLUT(0) -{ - declareInterface<TrigL2MuonSA::PtFromRadius>(this); -} - -// -------------------------------------------------------------------------------- -// -------------------------------------------------------------------------------- - -TrigL2MuonSA::PtFromRadius::~PtFromRadius() + AthAlgTool(type, name, parent) { } // -------------------------------------------------------------------------------- // -------------------------------------------------------------------------------- -StatusCode TrigL2MuonSA::PtFromRadius::initialize() -{ - ATH_MSG_DEBUG("Initializing PtFromRadius - package version " << PACKAGE_VERSION) ; - - StatusCode sc; - sc = AthAlgTool::initialize(); - if (!sc.isSuccess()) { - ATH_MSG_ERROR("Could not initialize the AthAlgTool base class."); - return sc; - } - - // - return StatusCode::SUCCESS; -} - -// -------------------------------------------------------------------------------- -// -------------------------------------------------------------------------------- - void TrigL2MuonSA::PtFromRadius::setMCFlag(BooleanProperty use_mcLUT, const TrigL2MuonSA::PtBarrelLUTSvc* ptBarrelLUTSvc) { @@ -69,6 +34,8 @@ void TrigL2MuonSA::PtFromRadius::setMCFlag(BooleanProperty use_mcLUT, StatusCode TrigL2MuonSA::PtFromRadius::setPt(TrigL2MuonSA::TrackPattern& trackPattern) { + const double ZERO_LIMIT = 1e-5; + const PtBarrelLUT::LUT& lut = (*m_ptBarrelLUT)->lut(); const PtBarrelLUT::LUTsp& lutSP = (*m_ptBarrelLUT)->lutSP(); @@ -81,94 +48,91 @@ StatusCode TrigL2MuonSA::PtFromRadius::setPt(TrigL2MuonSA::TrackPattern& trackPa float phistep,etastep,pstep,dist,distp,disteta,distphi; float A0[6]={0.,0.,0.,0.,0.,0.},A1[6]={0.,0.,0.,0.,0.,0.}; - float scale = 0.1; - - if(trackPattern.barrelRadius > 0.) { + const float scale = 0.1; + + if(trackPattern.barrelRadius > ZERO_LIMIT) { add = trackPattern.s_address; etabin = (int)((trackPattern.etaMap - lut.EtaMin[add])/lut.EtaStep[add]); phibin = (int)((trackPattern.phiMap - lut.PhiMin[add])/lut.PhiStep[add]); - + if(etabin<=-1) etabin = 0; if(etabin>=lut.NbinEta[add]) etabin = lut.NbinEta[add]-1; if(phibin<=-1) phibin = 0; if(phibin>=lut.NbinPhi[add]) phibin = lut.NbinPhi[add]-1; - + disteta = trackPattern.etaMap - (etabin*lut.EtaStep[add] + - lut.EtaStep[add]/2. + lut.EtaMin[add]); + lut.EtaStep[add]/2. + lut.EtaMin[add]); distphi = trackPattern.phiMap - (phibin*lut.PhiStep[add] + - lut.PhiStep[add]/2. + lut.PhiMin[add]); + lut.PhiStep[add]/2. + lut.PhiMin[add]); neweta = (disteta >= 0.) ? etabin+1 : etabin-1; newphi = (distphi >= 0.) ? phibin+1 : phibin-1; etastep = (disteta >= 0.) ? lut.EtaStep[add] : -lut.EtaStep[add]; phistep = (distphi >= 0.) ? lut.PhiStep[add] : -lut.PhiStep[add]; - if(trackPattern.barrelRadius!=0.) { - - ch = (trackPattern.charge>=0.)? 1 : 0; - - if( add==1 ) { - // Use special table for Large-SP data - - int iR = ( superPoints[0]->R > 6000 )? 1: 0; - int qeta = ( trackPattern.charge*trackPattern.etaMap >= 0.)? 1 : 0; - - A0[0] = lutSP.table_LargeSP[qeta][iR][etabin][phibin][0]; - A1[0] = lutSP.table_LargeSP[qeta][iR][etabin][phibin][1]; - - trackPattern.pt = trackPattern.barrelRadius*A0[0] + A1[0]; - + ch = (trackPattern.charge>=0.)? 1 : 0; + + if( add==1 ) { + // Use special table for Large-SP data + + int iR = ( superPoints[0]->R > 6000 )? 1: 0; + int qeta = ( trackPattern.charge*trackPattern.etaMap >= 0.)? 1 : 0; + + A0[0] = lutSP.table_LargeSP[qeta][iR][etabin][phibin][0]; + A1[0] = lutSP.table_LargeSP[qeta][iR][etabin][phibin][1]; + + trackPattern.pt = trackPattern.barrelRadius*A0[0] + A1[0]; + + } else { + + A0[0] = lut.table[add][ch][etabin][phibin][0]; + A1[0] = lut.table[add][ch][etabin][phibin][1]; + if((neweta<0||neweta>=lut.NbinEta[add])&& + (newphi<0||newphi>=lut.NbinPhi[add])) { + trackPattern.pt = trackPattern.barrelRadius*scale*A0[0] + A1[0]; + } else if (neweta<0||neweta>=lut.NbinEta[add]) { + A0[1] = lut.table[add][ch][etabin][newphi][0]; + A1[1] = lut.table[add][ch][etabin][newphi][1]; + A0[2] = A0[0] + ((A0[1] - A0[0])/phistep)*distphi; + A1[2] = A1[0] + ((A1[1] - A1[0])/phistep)*distphi; + trackPattern.pt = trackPattern.barrelRadius*scale*A0[2] + A1[2]; + } else if (newphi<0||newphi>=lut.NbinPhi[add]) { + A0[1] = lut.table[add][ch][neweta][phibin][0]; + A1[1] = lut.table[add][ch][neweta][phibin][1]; + A0[2] = A0[0] + ((A0[1] - A0[0])/etastep)*disteta; + A1[2] = A1[0] + ((A1[1] - A1[0])/etastep)*disteta; + trackPattern.pt = trackPattern.barrelRadius*scale*A0[2] + A1[2]; } else { - - A0[0] = lut.table[add][ch][etabin][phibin][0]; - A1[0] = lut.table[add][ch][etabin][phibin][1]; - if((neweta<0||neweta>=lut.NbinEta[add])&& - (newphi<0||newphi>=lut.NbinPhi[add])) { - trackPattern.pt = trackPattern.barrelRadius*scale*A0[0] + A1[0]; - } else if (neweta<0||neweta>=lut.NbinEta[add]) { - A0[1] = lut.table[add][ch][etabin][newphi][0]; - A1[1] = lut.table[add][ch][etabin][newphi][1]; - A0[2] = A0[0] + ((A0[1] - A0[0])/phistep)*distphi; - A1[2] = A1[0] + ((A1[1] - A1[0])/phistep)*distphi; - trackPattern.pt = trackPattern.barrelRadius*scale*A0[2] + A1[2]; - } else if (newphi<0||newphi>=lut.NbinPhi[add]) { - A0[1] = lut.table[add][ch][neweta][phibin][0]; - A1[1] = lut.table[add][ch][neweta][phibin][1]; - A0[2] = A0[0] + ((A0[1] - A0[0])/etastep)*disteta; - A1[2] = A1[0] + ((A1[1] - A1[0])/etastep)*disteta; - trackPattern.pt = trackPattern.barrelRadius*scale*A0[2] + A1[2]; - } else { - if(disteta >= distphi*lut.EtaStep[add]/lut.PhiStep[add]) { - A0[1] = lut.table[add][ch][neweta][phibin][0]; - A1[1] = lut.table[add][ch][neweta][phibin][1]; - A0[2] = lut.table[add][ch][neweta][newphi][0]; - A1[2] = lut.table[add][ch][neweta][newphi][1]; - A0[3] = A0[0] + ((A0[1] - A0[0])/etastep)*disteta; - A1[3] = A1[0] + ((A1[1] - A1[0])/etastep)*disteta; - dist = sqrt(phistep*phistep + etastep*etastep); - distp = sqrt(disteta*disteta + distphi*distphi); - A0[4] = A0[0] + ((A0[2] - A0[0])/dist)*distp; - A1[4] = A1[0] + ((A1[2] - A1[0])/dist)*distp; - pstep = (phistep/dist)*distp; - A0[5] = A0[3] + ((A0[4] - A0[3])/pstep)*distphi; - A1[5] = A1[3] + ((A1[4] - A1[3])/pstep)*distphi; - trackPattern.pt = trackPattern.barrelRadius*scale*A0[5] + A1[5]; - } else { - A0[1] = lut.table[add][ch][etabin][newphi][0]; - A1[1] = lut.table[add][ch][etabin][newphi][1]; - A0[2] = lut.table[add][ch][neweta][newphi][0]; - A1[2] = lut.table[add][ch][neweta][newphi][1]; - A0[3] = A0[0] + ((A0[1] - A0[0])/phistep)*distphi; - A1[3] = A1[0] + ((A1[1] - A1[0])/phistep)*distphi; - dist = sqrt(phistep*phistep + etastep*etastep); - distp = sqrt(disteta*disteta + distphi*distphi); - A0[4] = A0[0] + ((A0[2] - A0[0])/dist)*distp; - A1[4] = A1[0] + ((A1[2] - A1[0])/dist)*distp; - pstep = (etastep/dist)*distp; - A0[5] = A0[3] + ((A0[4] - A0[3])/pstep)*disteta; - A1[5] = A1[3] + ((A1[4] - A1[3])/pstep)*disteta; - trackPattern.pt = trackPattern.barrelRadius*scale*A0[5] + A1[5]; - } - } + if(disteta >= distphi*lut.EtaStep[add]/lut.PhiStep[add]) { + A0[1] = lut.table[add][ch][neweta][phibin][0]; + A1[1] = lut.table[add][ch][neweta][phibin][1]; + A0[2] = lut.table[add][ch][neweta][newphi][0]; + A1[2] = lut.table[add][ch][neweta][newphi][1]; + A0[3] = A0[0] + ((A0[1] - A0[0])/etastep)*disteta; + A1[3] = A1[0] + ((A1[1] - A1[0])/etastep)*disteta; + dist = sqrt(phistep*phistep + etastep*etastep); + distp = sqrt(disteta*disteta + distphi*distphi); + A0[4] = A0[0] + ((A0[2] - A0[0])/dist)*distp; + A1[4] = A1[0] + ((A1[2] - A1[0])/dist)*distp; + pstep = (phistep/dist)*distp; + A0[5] = A0[3] + ((A0[4] - A0[3])/pstep)*distphi; + A1[5] = A1[3] + ((A1[4] - A1[3])/pstep)*distphi; + trackPattern.pt = trackPattern.barrelRadius*scale*A0[5] + A1[5]; + } else { + A0[1] = lut.table[add][ch][etabin][newphi][0]; + A1[1] = lut.table[add][ch][etabin][newphi][1]; + A0[2] = lut.table[add][ch][neweta][newphi][0]; + A1[2] = lut.table[add][ch][neweta][newphi][1]; + A0[3] = A0[0] + ((A0[1] - A0[0])/phistep)*distphi; + A1[3] = A1[0] + ((A1[1] - A1[0])/phistep)*distphi; + dist = sqrt(phistep*phistep + etastep*etastep); + distp = sqrt(disteta*disteta + distphi*distphi); + A0[4] = A0[0] + ((A0[2] - A0[0])/dist)*distp; + A1[4] = A1[0] + ((A1[2] - A1[0])/dist)*distp; + pstep = (etastep/dist)*distp; + A0[5] = A0[3] + ((A0[4] - A0[3])/pstep)*disteta; + A1[5] = A1[3] + ((A1[4] - A1[3])/pstep)*disteta; + trackPattern.pt = trackPattern.barrelRadius*scale*A0[5] + A1[5]; + } } } } @@ -184,13 +148,3 @@ StatusCode TrigL2MuonSA::PtFromRadius::setPt(TrigL2MuonSA::TrackPattern& trackPa // -------------------------------------------------------------------------------- // -------------------------------------------------------------------------------- -StatusCode TrigL2MuonSA::PtFromRadius::finalize() -{ - ATH_MSG_DEBUG("Finalizing PtFromRadius - package version " << PACKAGE_VERSION); - - StatusCode sc = AthAlgTool::finalize(); - return sc; -} - -// -------------------------------------------------------------------------------- -// -------------------------------------------------------------------------------- diff --git a/Trigger/TrigAlgorithms/TrigL2MuonSA/src/RecMuonRoIUtils.cxx b/Trigger/TrigAlgorithms/TrigL2MuonSA/src/RecMuonRoIUtils.cxx deleted file mode 100644 index ea259af42189c1cc36e010cc1186b722e82c7abb..0000000000000000000000000000000000000000 --- a/Trigger/TrigAlgorithms/TrigL2MuonSA/src/RecMuonRoIUtils.cxx +++ /dev/null @@ -1,18 +0,0 @@ -/* - Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration -*/ - -#include "TrigL2MuonSA/RecMuonRoIUtils.h" - -bool TrigL2MuonSA::RecMuonRoIUtils::isBarrel(const LVL1::RecMuonRoI* p_roi) { - return (p_roi->sysID()==0) ? true : false; -} -bool TrigL2MuonSA::RecMuonRoIUtils::isLowPt(const LVL1::RecMuonRoI* p_roi) { - return (p_roi->getThresholdNumber() <4) ? true : false; -} -bool TrigL2MuonSA::RecMuonRoIUtils::isHighPt(const LVL1::RecMuonRoI* p_roi) { - return (p_roi->getThresholdNumber()>=4) ? true : false; -} - -// -------------------------------------------------------------------------------- -// -------------------------------------------------------------------------------- diff --git a/Trigger/TrigAlgorithms/TrigL2MuonSA/src/RpcDataPreparator.cxx b/Trigger/TrigAlgorithms/TrigL2MuonSA/src/RpcDataPreparator.cxx index 4e4d4efa032056599e50e4d2d888e130ca103316..0acee76cb2f5c39f67335d4c2946ba2c6938b1d2 100644 --- a/Trigger/TrigAlgorithms/TrigL2MuonSA/src/RpcDataPreparator.cxx +++ b/Trigger/TrigAlgorithms/TrigL2MuonSA/src/RpcDataPreparator.cxx @@ -256,9 +256,7 @@ StatusCode TrigL2MuonSA::RpcDataPreparator::prepareData(const TrigRoiDescriptor* lutDigit.layer = layer; const float r2 = hitx*hitx+hity*hity; - float phi = atan(hity/hitx); - if (hitx<0 && hity>0) phi += M_PI; - if (hitx<0 && hity<0) phi -= M_PI; + float phi = atan2(hity,hitx); const float l = sqrt(hitz*hitz+r2); const float tan = sqrt( (l-hitz)/(l+hitz) ); const float eta = -log(tan); diff --git a/Trigger/TrigAlgorithms/TrigL2MuonSA/src/RpcPatFinder.cxx b/Trigger/TrigAlgorithms/TrigL2MuonSA/src/RpcPatFinder.cxx index 0277aeb3dbf28a5533b227336b9b947c0c57b7b1..1c432aad75f2ac9ec15d4bcad8289b1cd50bed7e 100644 --- a/Trigger/TrigAlgorithms/TrigL2MuonSA/src/RpcPatFinder.cxx +++ b/Trigger/TrigAlgorithms/TrigL2MuonSA/src/RpcPatFinder.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ #include "TrigL2MuonSA/RpcPatFinder.h" @@ -15,44 +15,11 @@ // -------------------------------------------------------------------------------- // -------------------------------------------------------------------------------- -static const InterfaceID IID_RpcPatFinder("IID_RpcPatFinder", 1, 0); - -const InterfaceID& TrigL2MuonSA::RpcPatFinder::interfaceID() { return IID_RpcPatFinder; } - -// -------------------------------------------------------------------------------- -// -------------------------------------------------------------------------------- - TrigL2MuonSA::RpcPatFinder::RpcPatFinder(const std::string& type, const std::string& name, const IInterface* parent): AthAlgTool(type, name, parent) { - declareInterface<TrigL2MuonSA::RpcPatFinder>(this); -} - -// -------------------------------------------------------------------------------- -// -------------------------------------------------------------------------------- - -TrigL2MuonSA::RpcPatFinder::~RpcPatFinder() -{ -} - -// -------------------------------------------------------------------------------- -// -------------------------------------------------------------------------------- - -StatusCode TrigL2MuonSA::RpcPatFinder::initialize() -{ - ATH_MSG_DEBUG("Initializing RpcPatFinder - package version " << PACKAGE_VERSION) ; - - StatusCode sc; - sc = AthAlgTool::initialize(); - if (!sc.isSuccess()) { - ATH_MSG_ERROR("Could not initialize the AthAlgTool base class."); - return sc; - } - - // - return StatusCode::SUCCESS; } // -------------------------------------------------------------------------------- @@ -92,7 +59,7 @@ void TrigL2MuonSA::RpcPatFinder::addHit(std::string stationName, ilay+=gasGap-1; double R=sqrt(gPosX*gPosX+gPosY*gPosY); - double Phi=atan2(gPosY,gPosX); + const double Phi=atan2(gPosY,gPosX); if (!measuresPhi){ // if eta measurement then save Z/R @@ -417,7 +384,7 @@ bool TrigL2MuonSA::RpcPatFinder::deltaOK(int l1, int l2, double x1, double x2, // -------------------------------------------------------------------------------- // -------------------------------------------------------------------------------- -double TrigL2MuonSA::RpcPatFinder::calibR(std::string stationName, double R, double Phi){ +double TrigL2MuonSA::RpcPatFinder::calibR(std::string stationName, double R, double Phi) const{ double DeltaPhi, temp_phi; double calibPhi = acos(cos(Phi)); // 0 < Phi < 2PI @@ -584,13 +551,3 @@ void TrigL2MuonSA::RpcPatFinder::abcal(unsigned int result_pat, size_t index[], // -------------------------------------------------------------------------------- // -------------------------------------------------------------------------------- -StatusCode TrigL2MuonSA::RpcPatFinder::finalize() -{ - ATH_MSG_DEBUG("Finalizing RpcPatFinder - package version " << PACKAGE_VERSION); - - StatusCode sc = AthAlgTool::finalize(); - return sc; -} - -// -------------------------------------------------------------------------------- -// -------------------------------------------------------------------------------- diff --git a/Trigger/TrigAlgorithms/TrigT2CaloCommon/TrigT2CaloCommon/ITrigDataAccess.h b/Trigger/TrigAlgorithms/TrigT2CaloCommon/TrigT2CaloCommon/ITrigDataAccess.h index 7a6fd0057a29e8bc742f343bc530f637d819b8e0..945d829fa8db9a4c7f89f95cca1a07bc66bf01c8 100644 --- a/Trigger/TrigAlgorithms/TrigT2CaloCommon/TrigT2CaloCommon/ITrigDataAccess.h +++ b/Trigger/TrigAlgorithms/TrigT2CaloCommon/TrigT2CaloCommon/ITrigDataAccess.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ /******************************************************************** @@ -25,7 +25,8 @@ #include "LArRecEvent/LArFebEnergyCollection.h" #include "TileEvent/TileCellCollection.h" #include "TileEvent/TileL2Container.h" -#include "IRegionSelector/IRegSelSvc.h" +#include "IRegionSelector/IRoiDescriptor.h" +#include "IRegionSelector/RegSelEnums.h" #include "CaloEvent/CaloCellContainer.h" #include "ZdcEvent/ZdcRawChannelCollection.h" diff --git a/Trigger/TrigAlgorithms/TrigT2MinBias/src/TrigCountSpacePoints.h b/Trigger/TrigAlgorithms/TrigT2MinBias/src/TrigCountSpacePoints.h index abb9dc2f8206c4b989e428516c9d92ca5b4d2bb2..e1ae048b3b8edca80a87b9926bee56c4f2deddfa 100644 --- a/Trigger/TrigAlgorithms/TrigT2MinBias/src/TrigCountSpacePoints.h +++ b/Trigger/TrigAlgorithms/TrigT2MinBias/src/TrigCountSpacePoints.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ #ifndef TRIGMINBIAS_TRIGCOUNTSPACEPOINTS_H @@ -16,7 +16,6 @@ class SCT_ID; class PixelID; class TrigSpacePointCounts; class IRegSelSvc; -class IRegSelSvc; /** @class TrigCountSpacePoints diff --git a/Trigger/TrigAlgorithms/TrigTRTHighTHitCounter/src/TrigTRTHTHCounter.h b/Trigger/TrigAlgorithms/TrigTRTHighTHitCounter/src/TrigTRTHTHCounter.h index 7258f0defc645557011018f14412587a2b0ca404..3ad5f917ea4bb37dccf744347d0ff076e85bc9f5 100644 --- a/Trigger/TrigAlgorithms/TrigTRTHighTHitCounter/src/TrigTRTHTHCounter.h +++ b/Trigger/TrigAlgorithms/TrigTRTHighTHitCounter/src/TrigTRTHTHCounter.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ #ifndef TRIGTRTHTHCOUNTER_H @@ -18,7 +18,6 @@ */ class TRT_ID; -class IRegSelSvc; class ITrigTRT_DriftCircleProviderTool; class IdentifierHash; @@ -37,7 +36,6 @@ class TrigTRTHTHCounter: public HLT::FexAlgo { const TRT_ID *m_trtHelper; //!< TRT ID helper - // ServiceHandle<IRegSelSvc> m_regionSelector; //!< region selector service std::vector<IdentifierHash> m_listOfTrtIds; //!< IDs of DE from regionSelector diff --git a/Trigger/TrigAlgorithms/TrigTileMuId/src/TrigTileLookForMuAlg.cxx b/Trigger/TrigAlgorithms/TrigTileMuId/src/TrigTileLookForMuAlg.cxx index f986cecb066cb0d44ea92309253989f97fd877ac..4f0265c5e8bc463f546e100c8c83af091f448dee 100755 --- a/Trigger/TrigAlgorithms/TrigTileMuId/src/TrigTileLookForMuAlg.cxx +++ b/Trigger/TrigAlgorithms/TrigTileMuId/src/TrigTileLookForMuAlg.cxx @@ -13,7 +13,6 @@ #include "GaudiKernel/ITHistSvc.h" #include "TrigT1Interfaces/TrigT1Interfaces_ClassDEF.h" #include "TrigSteeringEvent/TrigRoiDescriptor.h" -#include "RegionSelector/IRegSelSvc.h" #include "ByteStreamCnvSvcBase/IROBDataProviderSvc.h" #include "CaloIdentifier/TileID.h" #include "ByteStreamData/ROBData.h" diff --git a/Trigger/TrigAlgorithms/TrigTileMuId/src/TrigTileLookForMuAlg.h b/Trigger/TrigAlgorithms/TrigTileMuId/src/TrigTileLookForMuAlg.h index be9685ec38b80b330781e6049c43a48ae431b633..4aa9f20b71fee67fc6743a757f10bad0442fcf19 100755 --- a/Trigger/TrigAlgorithms/TrigTileMuId/src/TrigTileLookForMuAlg.h +++ b/Trigger/TrigAlgorithms/TrigTileMuId/src/TrigTileLookForMuAlg.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ //**************************************************************************** @@ -30,7 +30,6 @@ namespace HLT { class TriggerElement; } -class IRegSelSvc; class Identifier; class TileID; diff --git a/Trigger/TrigHypothesis/TrigHypoCommonTools/TrigHypoCommonTools/L1InfoHypo.hxx b/Trigger/TrigHypothesis/TrigHypoCommonTools/TrigHypoCommonTools/L1InfoHypo.hxx index 1c899f4a209341a1b484eba7edfdc0c5083e269c..9936bbd30c89d972704403aec1332eef56da5366 100755 --- a/Trigger/TrigHypothesis/TrigHypoCommonTools/TrigHypoCommonTools/L1InfoHypo.hxx +++ b/Trigger/TrigHypothesis/TrigHypoCommonTools/TrigHypoCommonTools/L1InfoHypo.hxx @@ -19,8 +19,6 @@ #include "TrigSteering/LvlConverter.h" #include "TrigConfInterfaces/ILVL1ConfigSvc.h" -class IRegSelSvc; - namespace HLT { class ILvl1ResultAccessTool; diff --git a/Trigger/TrigHypothesis/TrigHypoCommonTools/src/L1InfoHypo.cxx b/Trigger/TrigHypothesis/TrigHypoCommonTools/src/L1InfoHypo.cxx index 221bbaed6c72a93b53955b0decbf09cf0d67ad6d..b6f8e0fca95f1271a8d89c7338d081e4b3ff250e 100755 --- a/Trigger/TrigHypothesis/TrigHypoCommonTools/src/L1InfoHypo.cxx +++ b/Trigger/TrigHypothesis/TrigHypoCommonTools/src/L1InfoHypo.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 */ /* @@ -12,7 +12,6 @@ #include "EventInfo/TriggerInfo.h" #include "EventInfo/EventInfo.h" -#include "RegionSelector/IRegSelSvc.h" #include "PathResolver/PathResolver.h" #include "GaudiKernel/ITHistSvc.h" #include "TrigSteeringEvent/TrigRoiDescriptor.h" diff --git a/Trigger/TrigTools/TrigOnlineSpacePointTool/src/TrigSpacePointConversionTool.cxx b/Trigger/TrigTools/TrigOnlineSpacePointTool/src/TrigSpacePointConversionTool.cxx index 6217d130fd8ed4b755625cbc721b366053e3a0b4..aefb54809a0679ba70330baed16593d7c8e9faa5 100644 --- a/Trigger/TrigTools/TrigOnlineSpacePointTool/src/TrigSpacePointConversionTool.cxx +++ b/Trigger/TrigTools/TrigOnlineSpacePointTool/src/TrigSpacePointConversionTool.cxx @@ -13,7 +13,6 @@ #include "TrigInDetToolInterfaces/ITrigL2LayerNumberTool.h" #include "SpacePointConversionUtils.h" -#include "IRegionSelector/IRegSelSvc.h" #include "IRegionSelector/IRegSelTool.h" diff --git a/Trigger/TrigTools/TrigOnlineSpacePointTool/src/TrigSpacePointConversionTool.h b/Trigger/TrigTools/TrigOnlineSpacePointTool/src/TrigSpacePointConversionTool.h index 26b3e6e7da0bf99cdde58469217d85a6b1b8f6b9..284bf60acc22c8b876c6f612496af444d471cc03 100644 --- a/Trigger/TrigTools/TrigOnlineSpacePointTool/src/TrigSpacePointConversionTool.h +++ b/Trigger/TrigTools/TrigOnlineSpacePointTool/src/TrigSpacePointConversionTool.h @@ -21,7 +21,6 @@ class AtlasDetectorID; class SCT_ID; class PixelID; -class IRegSelSvc; class ITrigL2LayerNumberTool; @@ -49,9 +48,6 @@ class TrigSpacePointConversionTool : virtual public ITrigSpacePointConversionToo const SCT_ID* m_sctId; const PixelID* m_pixelId; - // std::string m_regionSelectorName; - // IRegSelSvc* m_regionSelector; - SG::ReadCondHandleKey<InDet::BeamSpotData> m_beamSpotKey { this, "BeamSpotKey", "BeamSpotData", "SG key for beam spot" }; std::string m_pixelSpContName,m_sctSpContName;// offline/EF containers