diff --git a/Control/AthToolSupport/AsgDataHandles/AsgDataHandles/HandleKeyArray.h b/Control/AthToolSupport/AsgDataHandles/AsgDataHandles/HandleKeyArray.h new file mode 100644 index 0000000000000000000000000000000000000000..0908e71f27eacaf779284a2507df10b818643bd6 --- /dev/null +++ b/Control/AthToolSupport/AsgDataHandles/AsgDataHandles/HandleKeyArray.h @@ -0,0 +1,139 @@ +/* + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration +*/ + +#ifndef ASG_DATA_HANDLES_HANDLE_KEY_ARRAY_H +#define ASG_DATA_HANDLES_HANDLE_KEY_ARRAY_H + +#ifndef XAOD_STANDALONE +#include <StoreGate/HandleKeyArray.h> +#else + +#include "AsgDataHandles/VarHandleKeyArray.h" + +namespace SG { + + /** + * @class SG::HandleKeyArray<T> + * @brief class to hold an array of HandleKeys + * + * See StoreGate/HandleKeyArray for details. + * + * This currently (13 Aug 20) contains a number of commented out + * members that were part of the original handle implementation, but + * have not yet been implemented in the standalone version. The plan + * is to either implement or remove them, depending on what is needed + * in AnalysisBase as we add more packages. + */ + + template <class T_Handle, class T_HandleKey/*, Gaudi::DataHandle::Mode MODE*/> + class HandleKeyArray : public VarHandleKeyArrayCommon< T_HandleKey > { + public: + // /** + // * @brief default Constructor from a HandleKeyArray + // */ + // HandleKeyArray(){} + + // /** + // * @brief Constructor from a HandleKeyArray that takes a vector + // * of ReadHandleKeys + // * @param v vector of HandleKey + // */ + // HandleKeyArray( const std::vector<T_HandleKey>& v ) : + // VarHandleKeyArrayCommon<T_HandleKey> ( v ) {} + + // /** + // * @brief Constructor from a HandleKeyArray that takes an + // * initializer list of HandleKeys + // * @param l initializer list of HandleKey + // */ + // HandleKeyArray( std::initializer_list<T_HandleKey> l ): + // VarHandleKeyArrayCommon<T_HandleKey> {l} {} + + // /** + // * @brief Constructor from a HandleKeyArray that takes an + // * initializer list of std::strings. + // * @param l initializer list of std::strings used to create the + // * HandleKeys + // */ + // HandleKeyArray( std::initializer_list<std::string> key_names): + // VarHandleKeyArrayCommon<T_HandleKey> {key_names} {} + + /** + * @brief auto-declaring Property Constructor from a HandleKeyArray + * that takes an initializer list of std::strings, and associates the WHKA + * with the specified Property name + * @param name name of Property + * @param l initializer list of std::strings used to create the + * HandleKeys + * @param doc documentation string + */ + template <class OWNER> + inline HandleKeyArray( OWNER* owner, + std::string name, + std::initializer_list<std::string> l, + std::string doc="") : + VarHandleKeyArrayCommon<T_HandleKey> {l} { + owner->declareProperty(std::move(name), *this, std::move(doc)); + } + + + // /** + // * @brief return the type (Read/Write/Update) of handle + // */ + // Gaudi::DataHandle::Mode mode() const { return MODE; } + + /** + * @brief create a vector of Handles from the HandleKeys + * in the array + */ + std::vector< T_Handle > makeHandles() const { + std::vector< T_Handle > hndl; + typename std::vector<T_HandleKey>::const_iterator itr; + for (itr = this->begin(); itr != this->end(); ++itr) { + hndl.push_back ( T_Handle( *itr) ); + } + return hndl; + } + + // /** + // * @brief create a vector of Handles from the HandleKeys + // * in the array, with explicit EventContext. + // */ + // std::vector< T_Handle > makeHandles (const EventContext& ctx) const + // { + // std::vector< T_Handle > hndl; + // typename std::vector<T_HandleKey>::const_iterator itr; + // for (itr = this->begin(); itr != this->end(); ++itr) { + // hndl.push_back ( T_Handle( *itr, ctx) ); + // } + // return hndl; + // } + + }; + +} // namespace SG + +namespace asg +{ + namespace detail + { + template<typename T> struct GetStringHelper; + + template<typename T1,typename T2> struct GetStringHelper<SG::HandleKeyArray<T1,T2> > + : public GetStringHelper<std::vector<T2> > + { + }; + + template<typename T> struct SetStringHelper; + + template<typename T1,typename T2> struct SetStringHelper<SG::HandleKeyArray<T1,T2> > + : public SetStringHelper<std::vector<T2> > + { + }; + } +} + +#endif + +#endif diff --git a/Control/AthToolSupport/AsgDataHandles/AsgDataHandles/ReadHandle.h b/Control/AthToolSupport/AsgDataHandles/AsgDataHandles/ReadHandle.h index de53f22450117dcbb087af8722f5eaa462092699..8def1a1c230d8be24d36b14044e870e32579bacd 100644 --- a/Control/AthToolSupport/AsgDataHandles/AsgDataHandles/ReadHandle.h +++ b/Control/AthToolSupport/AsgDataHandles/AsgDataHandles/ReadHandle.h @@ -50,12 +50,12 @@ public: // - // /** - // * @brief Default constructor. - // * - // * The handle will not be usable until a non-blank key is assigned. - // */ - // ReadHandle(); + /** + * @brief Default constructor. + * + * The handle will not be usable until a non-blank key is assigned. + */ + ReadHandle() = default; /** @@ -134,6 +134,14 @@ public: const_pointer_type get (const EventContext& ctx) const; + /** + * @brief Is the referenced object present in SG? + * + * Const method; the handle does not change as a result of this. + */ + bool isPresent() const; + + /** * @brief Is the referenced object present in SG? * @param key SG key to test. diff --git a/Control/AthToolSupport/AsgDataHandles/AsgDataHandles/ReadHandle.icc b/Control/AthToolSupport/AsgDataHandles/AsgDataHandles/ReadHandle.icc index f35c97693e2b7378288eeb824940d6f5870ff352..f351894667bb15a46fbb4b0d81fb28cbab6c4f1c 100644 --- a/Control/AthToolSupport/AsgDataHandles/AsgDataHandles/ReadHandle.icc +++ b/Control/AthToolSupport/AsgDataHandles/AsgDataHandles/ReadHandle.icc @@ -174,6 +174,18 @@ ReadHandle<T>::get (const EventContext& /*ctx*/) const } +/** +* @brief Is the referenced object present in SG? +* +* Const method; the handle does not change as a result of this. +*/ +template <class T> +bool ReadHandle<T>::isPresent() const +{ +return isPresent_impl (key()); +} + + /** * @brief Is the referenced object present in SG? * @param key SG key to test. diff --git a/Control/AthToolSupport/AsgDataHandles/AsgDataHandles/ReadHandleKeyArray.h b/Control/AthToolSupport/AsgDataHandles/AsgDataHandles/ReadHandleKeyArray.h new file mode 100644 index 0000000000000000000000000000000000000000..217824acc2b183a2372b97f52610b5fb1b337626 --- /dev/null +++ b/Control/AthToolSupport/AsgDataHandles/AsgDataHandles/ReadHandleKeyArray.h @@ -0,0 +1,39 @@ +/* + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration +*/ + +#ifndef ASG_DATA_HANDLES_READ_HANDLE_KEY_ARRAY_H +#define ASG_DATA_HANDLES_READ_HANDLE_KEY_ARRAY_H + +#ifndef XAOD_STANDALONE +#include "StoreGate/ReadHandleKeyArray.h" +#else + +#include "AsgDataHandles/HandleKeyArray.h" + +#include "AsgDataHandles/ReadHandleKey.h" +#include "AsgDataHandles/ReadHandle.h" + +namespace SG { + + /** + * @class SG::ReadHandleKeyArray<T> + * @brief class to hold an array of ReadHandleKeys + * + * See StoreGate/ReadHandleKeyArray for details. + * + * This currently (13 Aug 20) contains a commented out template + * argument that was part of the original handle implementation, but + * has not yet been implemented in the standalone version. The plan + * is to either implement or remove them, depending on what is + * needed in AnalysisBase as we add more packages. + */ + template <class T> + using ReadHandleKeyArray = HandleKeyArray<ReadHandle<T>, ReadHandleKey<T>/*, Gaudi::DataHandle::Reader*/ >; + + +} // namespace SG + +#endif + +#endif diff --git a/Control/AthToolSupport/AsgDataHandles/AsgDataHandles/VarHandleBase.h b/Control/AthToolSupport/AsgDataHandles/AsgDataHandles/VarHandleBase.h index 4813b8d60e8de68f92912e247dc399b5294a6966..c833a27cfcb2fca0e732c5dbec03625ce7bcf8ca 100644 --- a/Control/AthToolSupport/AsgDataHandles/AsgDataHandles/VarHandleBase.h +++ b/Control/AthToolSupport/AsgDataHandles/AsgDataHandles/VarHandleBase.h @@ -42,6 +42,13 @@ namespace SG { { public: + /** + * @brief Default constructor. + * + * The handle will not be usable until a non-blank key is assigned. + */ + VarHandleBase() = default; + /** * @brief Constructor from a VarHandleKey. * @param key The key object holding the clid/key/store. diff --git a/Control/AthToolSupport/AsgDataHandles/AsgDataHandles/VarHandleKeyArray.h b/Control/AthToolSupport/AsgDataHandles/AsgDataHandles/VarHandleKeyArray.h new file mode 100644 index 0000000000000000000000000000000000000000..868f200abd3cb2fb0a48b8c2d359ccdaa64cfa3e --- /dev/null +++ b/Control/AthToolSupport/AsgDataHandles/AsgDataHandles/VarHandleKeyArray.h @@ -0,0 +1,173 @@ +/* + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration +*/ + +#ifndef ASG_DATA_HANDLES_VAR_HANDLE_KEY_ARRAY_H +#define ASG_DATA_HANDLES_VAR_HANDLE_KEY_ARRAY_H + +#ifndef XAOD_STANDALONE +#include <StoreGate/VarHandleKeyArray.h> +#else + +/** + * @file StoreGate/VarHandleKeyArray.h + * @author Nils Krumnack <Nils.Erik.Krumnack@cern.h> + * @author C. Leggett (for original version) + * @brief Base class for VarHandleKeyArray for reading from StoreGate. + */ + +#include <AsgMessaging/StatusCode.h> +#include <vector> +#include <string> + +namespace SG { + + /** + * @class SG::VarHandleKeyArray<T> + * @brief untemplated base class for VarHandleKeyArrays + * + * See StoreGate/VarHandleKeyArray for details. + * + * This currently (13 Aug 20) contains a number of commented out + * members that were part of the original handle implementation, but + * have not yet been implemented in the standalone version. The plan + * is to either implement or remove them, depending on what is needed + * in AnalysisBase as we add more packages. + */ + class VarHandleKeyArray { + public: + VarHandleKeyArray(){}; + virtual ~VarHandleKeyArray() = default; + // virtual StatusCode assign(const std::vector<std::string>& vs)=0; + virtual std::string toString() const = 0; + // virtual Gaudi::DataHandle::Mode mode() const = 0; + + // virtual std::vector<SG::VarHandleKey*> keys() const = 0; + + // virtual void renounce() = 0; + // virtual bool renounced() const = 0; + // virtual void declare(IDataHandleHolder*) = 0; + + // virtual void setOwner( IDataHandleHolder* o ) = 0; + // virtual const IDataHandleHolder* owner() const = 0; + // virtual IDataHandleHolder* owner() = 0; + + }; + +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ +// mixin class for common functionality +// + + /** + * @class SG::VarHandleKeyArrayCommon<T> + * @brief mixin base class for VarHandleKeyArrays, inheriting from + * std::vector as well as VarHandleKeyArray to provide vector-like + * access + * + * See StoreGate/VarHandleKeyArrayCommon for details. + * + * This currently (13 Aug 20) contains a number of commented out + * members that were part of the original handle implementation, but + * have not yet been implemented in the standalone version. The plan + * is to either implement or remove them, depending on what is needed + * in AnalysisBase as we add more packages. + * + */ + + template <class Base> + class VarHandleKeyArrayCommon : public VarHandleKeyArray, + public std::vector<Base> { + public: + /** + * @brief default base Constructor of mixin + * + */ + VarHandleKeyArrayCommon() : std::vector<Base>() {}; + + /** + * @brief base Constructor from a VarHandleKeyArray that takes a vector + * @param v vector of Read/Write/UpdateHandleKey + */ + VarHandleKeyArrayCommon( const std::vector<Base>& v ): + std::vector<Base>(v) {}; + + /** + * @brief base Constructor from a VarHandleKeyArray that takes an + * initializer list of VarHandleKeys + * @param l initializer list of Read/Write/UpdateHandleKey + */ + VarHandleKeyArrayCommon( std::initializer_list<Base> l ): + std::vector<Base>{l} {}; + + /** + * @brief base Constructor from a VarHandleKeyArray that takes an + * initializer list of std::strings. + * @param l initializer list of std::strings used to create the + * VarHandleKeys + */ + VarHandleKeyArrayCommon( std::initializer_list<std::string> l ) { + for (auto &e : l) { + this->push_back( Base{e} ); + } + } + + /** + * @brief forward the initialization to the member VarHandleKeys + * @param used If false, then this handle is not to be used. + * Instead of normal initialization, the key will be cleared. + */ + StatusCode initialize (bool used = true); + + // /** + // * @brief Set the contents of the VarHandleKeyArray from a + // * vector of std::strings + // * @param vs vector of initializer strings + // */ + // virtual StatusCode assign(const std::vector<std::string>& vs) override; + + /** + * @brief string representation of the VarHandleKeyArray + */ + virtual std::string toString() const override; + + // /** + // * @brief create array of all base VarHandleKeys in the Array + // */ + // virtual std::vector<SG::VarHandleKey*> keys() const override; + + + // /** + // * @brief if called, handles will not be declared in the algorithm I/O + // */ + // virtual void renounce() override { m_isRenounced = true; } + + // /** + // * @brief query renounced state + // **/ + // virtual bool renounced() const override { return m_isRenounced; } + + // virtual void declare( IDataHandleHolder* ) override; + + // virtual void setOwner( IDataHandleHolder* o ) override { m_owner = o; } + // virtual const IDataHandleHolder* owner() const override { return m_owner; } + // virtual IDataHandleHolder* owner() override { return m_owner; } + + private: + + // bool m_isRenounced{ false }; + // IDataHandleHolder* m_owner{ nullptr }; + + }; + +} // namespace SG + +namespace std { + ostream& operator<<(ostream& s, const SG::VarHandleKeyArray& m); +} + + +#include "AsgDataHandles/VarHandleKeyArray.icc" + +#endif + +#endif diff --git a/Control/AthToolSupport/AsgDataHandles/AsgDataHandles/VarHandleKeyArray.icc b/Control/AthToolSupport/AsgDataHandles/AsgDataHandles/VarHandleKeyArray.icc new file mode 100644 index 0000000000000000000000000000000000000000..d682c50ba5fa6fd1d42e1e730d23c257dd300a32 --- /dev/null +++ b/Control/AthToolSupport/AsgDataHandles/AsgDataHandles/VarHandleKeyArray.icc @@ -0,0 +1,105 @@ +/* + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration +*/ + + +#include <sstream> + + +namespace SG { + /** + * @brief forward the initialization to the member VarHandleKeys + * @param used If false, then this handle is not to be used. + * Instead of normal initialization, the key will be cleared. + */ + template <class Base> + inline + StatusCode VarHandleKeyArrayCommon<Base>::initialize (bool used /*= true*/) { + StatusCode sc(StatusCode::SUCCESS); + if (used) { + // IDataHandleHolder* const owner = this->owner(); + for (Base& b : *this) { + // if (owner != nullptr) { + // b.setOwner(owner); + // } + if ( b.initialize().isFailure() ) { + sc = StatusCode::FAILURE; + } + } + } + else { + this->clear(); + } + return sc; + } + + // // + // // Set the VarHandleKey from a string + // // + // template <class Base> + // inline + // StatusCode VarHandleKeyArrayCommon<Base>::assign(const std::vector<std::string>& vs) { + // StatusCode sc(StatusCode::SUCCESS); + // this->clear(); + // for (auto & s : vs) { + // Base b; + // if (!b.assign(s)) { + // sc = StatusCode::FAILURE; + // } else { + // // Skip blank keys + // if (b.key() != "") { + // this->push_back(b); + // } + // } + // } + // return sc; + // } + + // + // string representation of VarHandleKeyArray + // + template <class Base> + inline + std::string VarHandleKeyArrayCommon<Base>::toString() const { + std::ostringstream ost; + typename std::vector<Base>::const_iterator itr; + itr = this->begin(); + size_t sz = this->size(); + for ( size_t i=0; i < sz; ++i, ++itr) { + // ost << "'" << itr->objKey() << "'"; + ost << "'" << itr->key() << "'"; + if (i != sz-1) { + ost << ","; + } + } + return ost.str(); + } + + // // + // // create array of all base VarHandleKeys in the Array + // // + // template <class Base> + // inline + // std::vector<SG::VarHandleKey*> VarHandleKeyArrayCommon<Base>::keys() const { + // std::vector<SG::VarHandleKey*> keys; + // for (const SG::VarHandleKey& k : *this) { + // // FIXME: This is a rule violation, but we can't really fix it without + // // changing the IDataHandleHolder base class from Gaudi. + // SG::VarHandleKey* k_nc ATLAS_THREAD_SAFE = const_cast<SG::VarHandleKey*>(&k); + // keys.push_back (k_nc); + // } + // return keys; + // } + + // template <class Base> + // inline + // void VarHandleKeyArrayCommon<Base>::declare(IDataHandleHolder* owner) { + // if ( renounced() ) { + // return; + // } + // for (auto k: keys() ) { + // owner->declare ( *k ); + // k->setOwner( owner ); + // } + // } +} diff --git a/Control/AthToolSupport/AsgDataHandles/AsgDataHandles/WriteHandle.h b/Control/AthToolSupport/AsgDataHandles/AsgDataHandles/WriteHandle.h index c9eca0dcfd6881c73cf1282f28be09290bbf74c8..09cdf8b738dc88b38f2fb8badfa9d2b20bf476cf 100644 --- a/Control/AthToolSupport/AsgDataHandles/AsgDataHandles/WriteHandle.h +++ b/Control/AthToolSupport/AsgDataHandles/AsgDataHandles/WriteHandle.h @@ -141,11 +141,11 @@ public: // pointer_type operator->(); - // /** - // * @brief Dereference the pointer. - // * Returns the cached pointer. Throws ExcNullWriteHandle if null. - // */ - // reference_type operator*(); + /** + * @brief Dereference the pointer. + * Returns the cached pointer. Throws ExcNullWriteHandle if null. + */ + reference_type operator*(); // /** @@ -168,10 +168,10 @@ public: // pointer_type cachedPtr(); - // /** - // * @brief Can the handle be successfully dereferenced? - // */ - // virtual bool isValid() override final; + /** + * @brief Can the handle be successfully dereferenced? + */ + bool isValid(); //************************************************************************ @@ -179,11 +179,11 @@ public: // - // /** - // * @brief Record a const object to the store. - // * @param data The object to record. - // */ - // StatusCode record (std::unique_ptr<T> data); + /** + * @brief Record a const object to the store. + * @param data The object to record. + */ + StatusCode record (std::unique_ptr<T> data); // /** @@ -231,22 +231,22 @@ public: // StatusCode recordNonConst (SG::DataObjectSharedPtr<T> data); - // /** - // * @brief Record an object to the store. - // * @param data The object to record. - // * @param returnExisting Allow an existing object? - // * - // * Unlike record(), this does not change the handle object. - // * That means that one will not be able to get the object back - // * by dereferencing the handle. - // * Returns the object placed in the store, or nullptr if there - // * was an error. - // * If there was already an object in the store with the given key, - // * then return null, unless @c returnExisting is true, in which case - // * return success. In either case, @c data is destroyed. - // */ - // const_pointer_type put (std::unique_ptr<T> data, - // bool returnExisting = false) const; + /** + * @brief Record an object to the store. + * @param data The object to record. + * @param returnExisting Allow an existing object? + * + * Unlike record(), this does not change the handle object. + * That means that one will not be able to get the object back + * by dereferencing the handle. + * Returns the object placed in the store, or nullptr if there + * was an error. + * If there was already an object in the store with the given key, + * then return null, unless @c returnExisting is true, in which case + * return success. In either case, @c data is destroyed. + */ + const_pointer_type put (std::unique_ptr<T> data/*, + bool returnExisting = false*/) const; // /** @@ -630,6 +630,9 @@ private: // /// set it const on the record, but instead set this and do the // /// setConst in the destructor. // SG::DataProxy* m_lockAuxPending = nullptr; + + /// the cached pointer we recorded + T *m_ptr {nullptr}; }; diff --git a/Control/AthToolSupport/AsgDataHandles/AsgDataHandles/WriteHandle.icc b/Control/AthToolSupport/AsgDataHandles/AsgDataHandles/WriteHandle.icc index a4df5df2e34646e81522ffc8d1de6d0d4c139b74..16a98097c0a9efed69f5432334dd7c5aaceb5a5a 100644 --- a/Control/AthToolSupport/AsgDataHandles/AsgDataHandles/WriteHandle.icc +++ b/Control/AthToolSupport/AsgDataHandles/AsgDataHandles/WriteHandle.icc @@ -171,17 +171,19 @@ WriteHandle<T>::~WriteHandle() // } -// /** -// * @brief Dereference the pointer. -// * Returns the cached pointer. Throws ExcNullWriteHandle if null. -// */ -// template <class T> -// inline -// typename WriteHandle<T>::reference_type -// WriteHandle<T>::operator*() -// { -// return *WriteHandle<T>::checkedCachedPtr(); -// } +/** + * @brief Dereference the pointer. + * Returns the cached pointer. Throws ExcNullWriteHandle if null. + */ +template <class T> +inline +typename WriteHandle<T>::reference_type +WriteHandle<T>::operator*() +{ + if (m_ptr == nullptr) + throw std::runtime_error ("dereferenced handle is null: " + key()); + return *m_ptr; +} // /** @@ -222,32 +224,35 @@ WriteHandle<T>::~WriteHandle() // } -// /** -// * @brief Can the handle be successfully dereferenced? -// */ -// template <class T> -// inline -// bool WriteHandle<T>::isValid() -// { -// return this->m_ptr != nullptr; -// } +/** + * @brief Can the handle be successfully dereferenced? + */ +template <class T> +inline +bool WriteHandle<T>::isValid() +{ + return this->m_ptr != nullptr; +} //************************************************************************ // Record. -// /** -// * @brief Record a const object to the store. -// * @param data The object to record. -// */ -// template <class T> -// inline -// StatusCode -// WriteHandle<T>::WriteHandle::record (std::unique_ptr<T> data) -// { -// return this->doRecord (std::move(data), true, false); -// } +/** + * @brief Record a const object to the store. + * @param data The object to record. + */ +template <class T> +inline +StatusCode +WriteHandle<T>::WriteHandle::record (std::unique_ptr<T> data) +{ + m_ptr = data.get(); + if (xAOD::TActiveStore::store()->record (std::move (data), key()).isFailure()) + return StatusCode::FAILURE; + return StatusCode::SUCCESS; +} // /** @@ -276,6 +281,7 @@ StatusCode WriteHandle<T>::WriteHandle::record (std::unique_ptr<T> data, std::unique_ptr<AUXSTORE> auxstore) { + m_ptr = data.get(); if (xAOD::TActiveStore::store()->record (std::move (auxstore), key() + "Aux.").isFailure()) return StatusCode::FAILURE; if (xAOD::TActiveStore::store()->record (std::move (data), key()).isFailure()) @@ -330,29 +336,31 @@ WriteHandle<T>::WriteHandle::record (std::unique_ptr<T> data, // } -// /** -// * @brief Record an object to the store. -// * @param data The object to record. -// * @param returnExisting Allow an existing object? -// * -// * Unlike record(), this does not change the handle object. -// * That means that one will not be able to get the object back -// * by dereferencing the handle. -// * Returns the object placed in the store, or nullptr if there -// * was an error. -// * If there was already an object in the store with the given key, -// * then return null, unless @c returnExisting is true, in which case -// * return success. In either case, @c data is destroyed. -// */ -// template <class T> -// inline -// typename WriteHandle<T>::const_pointer_type -// WriteHandle<T>::put (std::unique_ptr<T> data, -// bool returnExisting /*= false*/) const -// { -// IProxyDict* store = nullptr; -// return doPut (nullptr, std::move(data), returnExisting, store); -// } +/** + * @brief Record an object to the store. + * @param data The object to record. + * @param returnExisting Allow an existing object? + * + * Unlike record(), this does not change the handle object. + * That means that one will not be able to get the object back + * by dereferencing the handle. + * Returns the object placed in the store, or nullptr if there + * was an error. + * If there was already an object in the store with the given key, + * then return null, unless @c returnExisting is true, in which case + * return success. In either case, @c data is destroyed. + */ +template <class T> +inline +typename WriteHandle<T>::const_pointer_type +WriteHandle<T>::put (std::unique_ptr<T> data/*, + bool returnExisting / *= false*/) const +{ + const_pointer_type result = data.get(); + if (xAOD::TActiveStore::store()->record (std::move (data), key()).isFailure()) + throw std::runtime_error ("failed to record object: " + key()); + return result; +} // /** diff --git a/Control/AthToolSupport/AsgDataHandles/Root/VarHandleKeyArray.cxx b/Control/AthToolSupport/AsgDataHandles/Root/VarHandleKeyArray.cxx new file mode 100644 index 0000000000000000000000000000000000000000..49fec6e74e0e9986c8280972e3356cf04143aff4 --- /dev/null +++ b/Control/AthToolSupport/AsgDataHandles/Root/VarHandleKeyArray.cxx @@ -0,0 +1,70 @@ +/* + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration +*/ + +#ifdef XAOD_STANDALONE + +#include "AsgDataHandles/VarHandleKeyArray.h" + +// namespace Gaudi { +// namespace Parsers { + + +// /** +// * @brief Gaudi function used to initialize a property from a string. +// * @param v The object to initialize. +// * @param s The string from which to initialize. +// * +// * Used during Gaudi property handling to set object @c v from the string @c s. +// * Note that @c s is a representation of the property setting; thus, in the +// * case of setting a property from a string, @c s will contain quote marks. +// */ +// StatusCode +// GAUDI_API +// parse(SG::VarHandleKeyArray& v, const std::string& s) +// { +// std::vector<std::string> vp; +// StatusCode sc = Gaudi::Parsers::parse(vp, s); + +// if (sc.isSuccess()) +// sc = v.assign( vp ); + +// return sc; +// } + +// } //> ns Parsers + +// namespace Utils { + + +// /** +// * @brief Gaudi function used to convert a property to a string. +// * @param v The object to convert. +// * @param o Stream to which to do the conversion. +// * +// * Used during Gaudi property handling to get a string representation of @c v. +// * Note that if the representation is a string, it should be surrounded +// * by quote marks. +// */ +// std::ostream& +// GAUDI_API +// toStream(const SG::VarHandleKeyArray& v, std::ostream& o) +// { +// o << "[" << v.toString() << "]"; +// return o; +// } + +// } //> ns Utils +// } //> ns Gaudi + + + + +namespace std { + ostream& operator<<(ostream& s, const SG::VarHandleKeyArray& m) { + s << "[" << m.toString() << "]"; + return s; + } +} + +#endif diff --git a/Control/AthToolSupport/AsgExampleTools/AsgExampleTools/DataHandleTestTool.h b/Control/AthToolSupport/AsgExampleTools/AsgExampleTools/DataHandleTestTool.h index 50ebcd680701cdac544cccac3a5c479b6e147e2d..6f8489f0ebfdd9ae7ea2295f1d6ba5c5f77004bb 100644 --- a/Control/AthToolSupport/AsgExampleTools/AsgExampleTools/DataHandleTestTool.h +++ b/Control/AthToolSupport/AsgExampleTools/AsgExampleTools/DataHandleTestTool.h @@ -12,6 +12,7 @@ #include <AsgTools/AsgTool.h> #include <AsgExampleTools/IDataHandleTestTool.h> #include <AsgDataHandles/ReadHandleKey.h> +#include <AsgDataHandles/ReadHandleKeyArray.h> #include <AsgDataHandles/ReadDecorHandleKey.h> #include <AsgDataHandles/WriteHandleKey.h> @@ -52,9 +53,11 @@ namespace asg #ifndef SIMULATIONBASE SG::ReadHandleKey<xAOD::MuonContainer> m_readKey {this, "readKey", "Muons", "regular read key"}; SG::ReadDecorHandleKey<xAOD::MuonContainer> m_readDecorKey {this, "readDecorKey", "Muons.pt", "read decor key"}; + SG::ReadHandleKeyArray<xAOD::MuonContainer> m_readKeyArray {this, "readKeyArray", {}, "array read key"}; SG::WriteHandleKey<xAOD::MuonContainer> m_writeKey {this, "writeKey", "", "regular write key"}; #endif bool m_readFailure {false}; + bool m_readArray {false}; bool m_readDecorFailure {false}; std::string m_doWriteName; }; diff --git a/Control/AthToolSupport/AsgExampleTools/Root/DataHandleTestTool.cxx b/Control/AthToolSupport/AsgExampleTools/Root/DataHandleTestTool.cxx index 8193fd471e4d5dd844297b0619c4f394585b6579..d7fa05bab3a299203b38cc0ecc6d86aaef5a9ab2 100644 --- a/Control/AthToolSupport/AsgExampleTools/Root/DataHandleTestTool.cxx +++ b/Control/AthToolSupport/AsgExampleTools/Root/DataHandleTestTool.cxx @@ -35,6 +35,7 @@ namespace asg { declareProperty ("readFailure", m_readFailure, "whether to expect a read failure"); declareProperty ("readDecorFailure", m_readDecorFailure, "whether to expect a read decoration failure"); + declareProperty ("readArray", m_readArray, "whether to read from the array"); declareProperty ("doWriteName", m_doWriteName, "if we should write, the name we expect to write to"); } @@ -55,6 +56,7 @@ namespace asg ANA_CHECK (m_readDecorKey.initialize ()); if (!m_writeKey.empty()) ANA_CHECK (m_writeKey.initialize ()); + ANA_CHECK (m_readKeyArray.initialize()); #endif return StatusCode::SUCCESS; } @@ -73,10 +75,12 @@ namespace asg auto readHandle = makeHandle (m_readKey); if (m_readFailure == true) { + EXPECT_FALSE (readHandle.isPresent()); EXPECT_EQ (nullptr, readHandle.get()); EXPECT_FALSE (readHandle.isValid()); } else { + EXPECT_TRUE (readHandle.isPresent()); EXPECT_EQ (muonsStore, readHandle.get()); EXPECT_TRUE (readHandle.isValid()); } @@ -91,6 +95,16 @@ namespace asg EXPECT_EQ (acc (*testMuon), readDecorHandle (*testMuon)); } + if (m_readArray) + { + EXPECT_EQ (1u, m_readKeyArray.size()); + auto handles = m_readKeyArray.makeHandles(); + EXPECT_EQ (muonsStore, handles[0].get()); + } else + { + EXPECT_EQ (0u, m_readKeyArray.size()); + } + if (!m_doWriteName.empty()) { auto writeHandle = makeHandle (m_writeKey); diff --git a/Control/AthToolSupport/AsgExampleTools/test/gt_DataHandlesTest.cxx b/Control/AthToolSupport/AsgExampleTools/test/gt_DataHandlesTest.cxx index 74f2a8e1db31b4d8b5f4415dea2659f795745c11..2122e8f24fb7c46fbbb50fe3bf12170dc69712ff 100644 --- a/Control/AthToolSupport/AsgExampleTools/test/gt_DataHandlesTest.cxx +++ b/Control/AthToolSupport/AsgExampleTools/test/gt_DataHandlesTest.cxx @@ -117,6 +117,17 @@ namespace asg + // test that the read-key-array works + TEST_F (DataHandlesTest, read_array) + { + config.setPropertyFromString ("readKeyArray", "['Muons']"); + config.setPropertyFromString ("readArray", "1"); + ASSERT_SUCCESS (config.makeTool (tool, cleanup)); + tool->runTest (); + } + + + // do a write handle test TEST_F (DataHandlesTest, write_handle) { diff --git a/Control/AthToolSupport/AsgTools/AsgTools/PropertyWrapper.h b/Control/AthToolSupport/AsgTools/AsgTools/PropertyWrapper.h new file mode 100644 index 0000000000000000000000000000000000000000..9d69b11ff61cd5cab09791b0306dea977e9fa230 --- /dev/null +++ b/Control/AthToolSupport/AsgTools/AsgTools/PropertyWrapper.h @@ -0,0 +1,96 @@ +/* + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration +*/ + +/// @author Nils Krumnack + + + +#ifndef ASG_TOOLS__PROPERTY_WRAPPER_H +#define ASG_TOOLS__PROPERTY_WRAPPER_H + + +#ifdef XAOD_STANDALONE + +#include <iosfwd> +#include <string> +#include <utility> + +namespace Gaudi +{ + /// \brief this is the standalone version of the \ref + /// Gaudi::Property wrapper + /// + /// This makes it simpler to declare properties by just wrapping the + /// property in this template and then using the inline constructor + /// for it in the class definition: + /// ``` + /// Gaudi::Property<int> m_property { + /// this, "propertyName", startingValue, "property description"}; + /// ``` + + template<typename T> class Property final + { + public: + template<typename T2> + Property (T2 *owner, const std::string& name, const T& value, + const std::string& title = ""); + + public: + template<typename T2> + Property (T2 *owner, const std::string& name, T&& value, + const std::string& title = ""); + + public: + operator const T& () const noexcept; + + private: + T m_value; + }; + + + + /// Template Methods + /// ================ + + template<typename T> template<typename T2> + Property<T> :: + Property (T2 *owner, const std::string& name, const T& value, + const std::string& title) + : m_value (value) + { + owner->declareProperty (name, m_value, title); + } + + + + template<typename T> template<typename T2> + Property<T> :: + Property (T2 *owner, const std::string& name, T&& value, + const std::string& title) + : m_value (std::move (value)) + { + owner->declareProperty (name, m_value, title); + } + + + + template<typename T> + Property<T> :: + operator const T& () const noexcept + { + return m_value; + } + + + + template<typename T> + std::ostream& operator << (std::ostream& str, const Property<T>& property) + { + return str << property.operator const T&(); + } +} + +#endif + +#endif diff --git a/Control/AthToolSupport/AsgTools/AsgTools/ToolHandle.h b/Control/AthToolSupport/AsgTools/AsgTools/ToolHandle.h index df8abf5522b8e03142fa3ac319462348bfba9cde..b9f73f58ec201cab1e1535eb5de0dd454f8107e9 100644 --- a/Control/AthToolSupport/AsgTools/AsgTools/ToolHandle.h +++ b/Control/AthToolSupport/AsgTools/AsgTools/ToolHandle.h @@ -86,6 +86,12 @@ public: /// Constructor from a tool name. ToolHandle( const std::string& toolname, INamedInterface* parent = 0 ); + /// Constructor declaring a property + template<typename T2> + ToolHandle (T2 *parent, const std::string& propertyName, + const std::string& toolName, + const std::string& propertyTitle = ""); + /// Dereferencing operator T& operator*(); /// Dereferencing operator @@ -100,6 +106,9 @@ public: /// Returns success if pointer is non-null and of the correct type. StatusCode retrieve() const; + /// Clear out the tool + void disable () noexcept; + /// Return true if tool has no pointer or name bool empty() const; @@ -108,7 +117,7 @@ public: private: /// Pointer to the tool - mutable T* m_ptool; + mutable T* m_ptool {nullptr}; }; // class ToolHandle diff --git a/Control/AthToolSupport/AsgTools/AsgTools/ToolHandle.icc b/Control/AthToolSupport/AsgTools/AsgTools/ToolHandle.icc index 7986a16352a97385bb7626cce1b901325a2490bc..bebde6798056c8d1211d9a97eb1856dd4d839be3 100644 --- a/Control/AthToolSupport/AsgTools/AsgTools/ToolHandle.icc +++ b/Control/AthToolSupport/AsgTools/AsgTools/ToolHandle.icc @@ -27,6 +27,16 @@ ToolHandle< T >::ToolHandle( const std::string& typeAndName, INamedInterface* pa } +template<typename T> template<typename T2> +ToolHandle<T> :: +ToolHandle (T2 *parent, const std::string& propertyName, + const std::string& toolName, + const std::string& propertyTitle) + : ToolHandle (toolName, parent) +{ + parent->declareProperty (propertyName, *this, propertyTitle); +} + template< class T > T& ToolHandle< T >::operator*() { @@ -114,6 +124,11 @@ StatusCode ToolHandle< T >::retrieve() const { } } +template< class T > +void ToolHandle< T >::disable () noexcept { + m_ptool = nullptr; +} + template< class T > bool ToolHandle< T >::empty() const { diff --git a/PhysicsAnalysis/AnalysisCommon/ParticleJetTools/ParticleJetTools/CopyTruthParticles.h b/PhysicsAnalysis/AnalysisCommon/ParticleJetTools/ParticleJetTools/CopyTruthParticles.h index 2a6bb9b4e9a49e26d9def94f63911a90507951c3..fb6b6cde2e7069c02c9d1d7c0bbbfff6cf87e618 100644 --- a/PhysicsAnalysis/AnalysisCommon/ParticleJetTools/ParticleJetTools/CopyTruthParticles.h +++ b/PhysicsAnalysis/AnalysisCommon/ParticleJetTools/ParticleJetTools/CopyTruthParticles.h @@ -10,8 +10,8 @@ #include "xAODTruth/TruthParticleContainer.h" #include "xAODTruth/TruthEventContainer.h" #include "AthContainers/ConstDataVector.h" -#include "StoreGate/ReadHandleKey.h" -#include "StoreGate/WriteHandleKey.h" +#include "AsgDataHandles/ReadHandleKey.h" +#include "AsgDataHandles/WriteHandleKey.h" // Do I need IAsgTool? I need AsgTool for the eventStore() class CopyTruthParticles : public IJetExecuteTool, public asg::AsgTool { diff --git a/PhysicsAnalysis/AnalysisCommon/ParticleJetTools/ParticleJetTools/JetQuarkLabel.h b/PhysicsAnalysis/AnalysisCommon/ParticleJetTools/ParticleJetTools/JetQuarkLabel.h index a20f3aafae700b3f1892c781e83e91b050fc437a..4bddc094e79a7c0d9641e90d22f59489cf8d8190 100644 --- a/PhysicsAnalysis/AnalysisCommon/ParticleJetTools/ParticleJetTools/JetQuarkLabel.h +++ b/PhysicsAnalysis/AnalysisCommon/ParticleJetTools/ParticleJetTools/JetQuarkLabel.h @@ -18,6 +18,7 @@ #ifndef PARTICLEJETTOOLS_JETQUARKLABEL_H #define PARTICLEJETTOOLS_JETQUARKLABEL_H +#include "AsgDataHandles/ReadHandleKey.h" #include "AsgTools/AsgTool.h" #include "ParticleJetTools/IJetTruthMatching.h" #include "EventPrimitives/EventPrimitives.h" diff --git a/PhysicsAnalysis/AnalysisCommon/ParticleJetTools/ParticleJetTools/ParticleJetDeltaRLabelTool.h b/PhysicsAnalysis/AnalysisCommon/ParticleJetTools/ParticleJetTools/ParticleJetDeltaRLabelTool.h index 3238fdf12461ab056044bc9f43835e9968619b78..e4665acc9d5180cea6c0a3ce957b6ee5629ca2a3 100644 --- a/PhysicsAnalysis/AnalysisCommon/ParticleJetTools/ParticleJetTools/ParticleJetDeltaRLabelTool.h +++ b/PhysicsAnalysis/AnalysisCommon/ParticleJetTools/ParticleJetTools/ParticleJetDeltaRLabelTool.h @@ -5,6 +5,7 @@ #ifndef PARTICLEJETDELTARLABELTOOL_H #define PARTICLEJETDELTARLABELTOOL_H +#include "AsgDataHandles/ReadHandleKey.h" #include "AsgTools/AsgTool.h" #include "JetInterface/IJetModifier.h" #include "xAODTruth/TruthParticle.h" diff --git a/PhysicsAnalysis/AnalysisCommon/ParticleJetTools/Root/CopyTruthJetParticles.cxx b/PhysicsAnalysis/AnalysisCommon/ParticleJetTools/Root/CopyTruthJetParticles.cxx index 4f895354ab28f69b32417111bfd41245f1a9f24d..3cf158009215a96dbe24eaf7233fcc94c214c888 100644 --- a/PhysicsAnalysis/AnalysisCommon/ParticleJetTools/Root/CopyTruthJetParticles.cxx +++ b/PhysicsAnalysis/AnalysisCommon/ParticleJetTools/Root/CopyTruthJetParticles.cxx @@ -10,6 +10,8 @@ #include "xAODTruth/TruthParticleAuxContainer.h" #include "xAODTruth/TruthEventContainer.h" #include "AthContainers/ConstDataVector.h" +#include "AsgDataHandles/ReadHandle.h" +#include "AsgDataHandles/WriteHandle.h" #include "AsgTools/Check.h" #ifndef XAOD_STANDALONE @@ -183,10 +185,10 @@ int CopyTruthJetParticles::setBarCodeFromMetaDataCheck() const{ // if m_barcodeFromMetadata is set to 1, the check is performed and a warning is set out // explicitly set out when nothing is foun if(m_barcodeFromMetadata>0){ + // Usage of metadata is only possible in Athena (not supported by dual-use tools yet)... +#ifndef XAOD_STANDALONE bool found = false; // retrieve the value for the current sample from metadata -#ifndef XAOD_STANDALONE - // Usage of metadata is only possible in Athena (not supported by dual-use tools yet)... int barcodeOffset_tmp(0); ATH_MSG_INFO("Look for barcode offset in metadata ... "); diff --git a/PhysicsAnalysis/AnalysisCommon/ParticleJetTools/Root/CopyTruthParticles.cxx b/PhysicsAnalysis/AnalysisCommon/ParticleJetTools/Root/CopyTruthParticles.cxx index 4bc0236b822d864f052a007856d0bb4c0cffe2de..dc75e27f179b9c4b53c499ba4059d151c3cff04f 100644 --- a/PhysicsAnalysis/AnalysisCommon/ParticleJetTools/Root/CopyTruthParticles.cxx +++ b/PhysicsAnalysis/AnalysisCommon/ParticleJetTools/Root/CopyTruthParticles.cxx @@ -6,6 +6,8 @@ #include <memory> #include "TruthUtils/PIDHelpers.h" #include "AsgTools/Check.h" +#include "AsgDataHandles/ReadHandle.h" +#include "AsgDataHandles/WriteHandle.h" using namespace std; diff --git a/PhysicsAnalysis/AnalysisCommon/ParticleJetTools/Root/JetQuarkLabel.cxx b/PhysicsAnalysis/AnalysisCommon/ParticleJetTools/Root/JetQuarkLabel.cxx index ef34e98c328ac9ba20c634850a6a23347441ef7d..d0a794bac26c3bb1676e5934e114c91d6a6b5fe0 100644 --- a/PhysicsAnalysis/AnalysisCommon/ParticleJetTools/Root/JetQuarkLabel.cxx +++ b/PhysicsAnalysis/AnalysisCommon/ParticleJetTools/Root/JetQuarkLabel.cxx @@ -15,6 +15,7 @@ #include "ParticleJetTools/JetQuarkLabel.h" #include "ParticleJetTools/HadronUtils.h" +#include "AsgDataHandles/ReadHandle.h" #include <algorithm> diff --git a/PhysicsAnalysis/AnalysisCommon/ParticleJetTools/Root/ParticleJetDeltaRLabelTool.cxx b/PhysicsAnalysis/AnalysisCommon/ParticleJetTools/Root/ParticleJetDeltaRLabelTool.cxx index 4c5f4598a1ff03d4745849755920f31ce173692a..27040971a9f2fa4993b6d715ba22f0a3b4e99a55 100644 --- a/PhysicsAnalysis/AnalysisCommon/ParticleJetTools/Root/ParticleJetDeltaRLabelTool.cxx +++ b/PhysicsAnalysis/AnalysisCommon/ParticleJetTools/Root/ParticleJetDeltaRLabelTool.cxx @@ -5,6 +5,7 @@ #include "ParticleJetTools/ParticleJetDeltaRLabelTool.h" #include "ParticleJetTools/ParticleJetLabelCommon.h" #include "xAODJet/JetContainer.h" +#include "AsgDataHandles/ReadHandle.h" #include "AsgTools/Check.h" using namespace std; diff --git a/Projects/AnalysisBase/package_filters.txt b/Projects/AnalysisBase/package_filters.txt index 38b5904e54252b60343e01862b79e3c5d599b9cc..435110a5c9822d396085e575ba6f8ec6c3009909 100644 --- a/Projects/AnalysisBase/package_filters.txt +++ b/Projects/AnalysisBase/package_filters.txt @@ -14,8 +14,21 @@ - PhysicsAnalysis/ElectronPhotonID/ElectronPhotonFourMomentumCorrection - PhysicsAnalysis/ElectronPhotonID/PhotonVertexSelection - Reconstruction/Jet/JetMomentTools -- Reconstruction/Jet/JetRec -- Reconstruction/Jet/JetSubStructureMomentTools + + + +# these packages existed in 21.2, but no longer exist in master. +# remove these lines if you are confident that these packages have +# been retired. + +#+ External/AtlasPyFwdBwdPorts +#+ ForwardDetectors/ZDC/ZdcNtuple +#+ PhysicsAnalysis/AnalysisCommon/FakeBkgTools +#+ PhysicsAnalysis/BPhys/BPhysTools +#+ PhysicsAnalysis/DerivationFramework/DerivationFrameworkAnalysisTests +#+ Reconstruction/Jet/BoostedJetTaggers +#+ Trigger/TrigAnalysis/TrigGlobalEfficiencyCorrection +#+ Trigger/TriggerSimulation/TrigBtagEmulationTool @@ -48,9 +61,7 @@ #+ Event/xAOD/xAODTruthCnv - Event/xAOD/.*Cnv + Event/xAOD/.* -#+ External/AtlasPyFwdBwdPorts + ForwardDetectors/ZDC/ZdcAnalysis -#+ ForwardDetectors/ZDC/ZdcNtuple + Generators/TruthUtils + InnerDetector/InDetRecTools/InDetTrackSelectionTool + InnerDetector/InDetRecTools/TrackVertexAssociationTool @@ -59,7 +70,6 @@ + PhysicsAnalysis/AnalysisCommon/AssociationUtils #+ PhysicsAnalysis/AnalysisCommon/CPAnalysisExamples + PhysicsAnalysis/AnalysisCommon/CutBookkeeperUtils -#+ PhysicsAnalysis/AnalysisCommon/FakeBkgTools + PhysicsAnalysis/AnalysisCommon/FsrUtils + PhysicsAnalysis/AnalysisCommon/HDF5Utils + PhysicsAnalysis/AnalysisCommon/IsolationSelection @@ -68,12 +78,10 @@ + PhysicsAnalysis/AnalysisCommon/PMGOverlapRemovalTools/GammaORTools + PhysicsAnalysis/AnalysisCommon/PMGOverlapRemovalTools/HFORTools + PhysicsAnalysis/AnalysisCommon/PMGTools -#+ PhysicsAnalysis/AnalysisCommon/ParticleJetTools ++ PhysicsAnalysis/AnalysisCommon/ParticleJetTools + PhysicsAnalysis/AnalysisCommon/PileupReweighting + PhysicsAnalysis/AnalysisCommon/ReweightUtils -#+ PhysicsAnalysis/BPhys/BPhysTools + PhysicsAnalysis/D3PDTools/.* -#+ PhysicsAnalysis/DerivationFramework/DerivationFrameworkAnalysisTests - PhysicsAnalysis/ElectronPhotonID/ElectronPhotonTagTools + PhysicsAnalysis/ElectronPhotonID/.* + PhysicsAnalysis/HeavyIonPhys/HIEventUtils @@ -90,7 +98,6 @@ + PhysicsAnalysis/TauID/TauAnalysisTools + PhysicsAnalysis/TrackingID/.* + Reconstruction/EventShapes/EventShapeInterface -#+ Reconstruction/Jet/BoostedJetTaggers - Reconstruction/Jet/JetAnalysisTools/JetAnalysisEDM - Reconstruction/Jet/JetEvent.* - Reconstruction/Jet/JetMonitoring @@ -100,10 +107,10 @@ - Reconstruction/Jet/JetValidation + Reconstruction/Jet/Jet.* + Reconstruction/MET/METInterface -#+ Reconstruction/MET/METUtilities ++ Reconstruction/MET/METUtilities + Reconstruction/MVAUtils + Reconstruction/PFlow/PFlowUtils -#+ Reconstruction/RecoTools/IsolationTool ++ Reconstruction/RecoTools/IsolationTool + Reconstruction/RecoTools/RecoToolInterfaces + Reconstruction/egamma/egammaLayerRecalibTool + Reconstruction/egamma/egammaMVACalib @@ -116,7 +123,6 @@ + Trigger/TrigAnalysis/TrigAnalysisInterfaces + Trigger/TrigAnalysis/TrigBunchCrossingTool #+ Trigger/TrigAnalysis/TrigDecisionTool -#+ Trigger/TrigAnalysis/TrigGlobalEfficiencyCorrection #+ Trigger/TrigAnalysis/TrigTauAnalysis/TrigTauMatching #+ Trigger/TrigAnalysis/TriggerMatchingTool + Trigger/TrigConfiguration/TrigConfBase @@ -131,6 +137,5 @@ + Trigger/TrigEvent/TrigSteeringEvent + Trigger/TrigSteer/TrigCompositeUtils #+ Trigger/TrigValidation/TrigAnalysisTest -#+ Trigger/TriggerSimulation/TrigBtagEmulationTool - .* diff --git a/Reconstruction/Jet/JetInterface/CMakeLists.txt b/Reconstruction/Jet/JetInterface/CMakeLists.txt index 17d8b97fc2142cb664dd715fb361f09681e4ef28..75b10d8229ab1b3d7a3460153424e617c85ccc20 100644 --- a/Reconstruction/Jet/JetInterface/CMakeLists.txt +++ b/Reconstruction/Jet/JetInterface/CMakeLists.txt @@ -21,7 +21,7 @@ atlas_depends_on_subdirs( atlas_add_library( JetInterface JetInterface/*.h Root/*.cxx PUBLIC_HEADERS JetInterface - LINK_LIBRARIES AsgTools xAODEventInfo xAODJet xAODTracking xAODBase ) + LINK_LIBRARIES AsgTools AsgDataHandlesLib xAODEventInfo xAODJet xAODTracking xAODBase ) atlas_add_dictionary( JetInterfaceDict JetInterface/JetInterfaceDict.h diff --git a/Reconstruction/Jet/JetInterface/JetInterface/IJetProvider.h b/Reconstruction/Jet/JetInterface/JetInterface/IJetProvider.h index 5d564de9efed672d7731486081dadb42286f7680..ac0d0eab46c424b99b374e2cef128e80ebf371ea 100644 --- a/Reconstruction/Jet/JetInterface/JetInterface/IJetProvider.h +++ b/Reconstruction/Jet/JetInterface/JetInterface/IJetProvider.h @@ -16,9 +16,9 @@ #include <utility> #include <memory> +#include "AsgDataHandles/WriteHandle.h" #include "AsgTools/IAsgTool.h" #include "xAODJet/JetContainer.h" -#include "StoreGate/WriteHandle.h" namespace SG { class IAuxStore; diff --git a/Reconstruction/Jet/JetRec/CMakeLists.txt b/Reconstruction/Jet/JetRec/CMakeLists.txt index a0b25cc6ff22dd4d56324b4c93de985df4fbad74..66d1012f8071ac945cc0ac90665b2e544ecff106 100644 --- a/Reconstruction/Jet/JetRec/CMakeLists.txt +++ b/Reconstruction/Jet/JetRec/CMakeLists.txt @@ -14,7 +14,7 @@ endif() set( mon_deps ) set( mon_lib ) -if( NOT GENERATIONBASE ) +if( NOT GENERATIONBASE AND NOT XAOD_STANDALONE ) set( mon_deps Control/AthenaMonitoringKernel ) set( mon_lib AthenaMonitoringKernelLib ) endif() @@ -54,7 +54,7 @@ atlas_add_library( JetRecLib INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} ${FASTJET_INCLUDE_DIRS} ${FASTJETCONTRIB_INCLUDE_DIRS} LINK_LIBRARIES ${ROOT_LIBRARIES} ${FASTJETCONTRIB_LIBRARIES} ${FASTJET_LIBRARIES} AthLinks AthContainers AsgTools xAODCaloEvent xAODJet xAODMuon EventShapeInterface JetEDM - JetInterface ${mon_lib} + JetInterface ${mon_lib} AsgDataHandlesLib PRIVATE_LINK_LIBRARIES CxxUtils xAODBase xAODCore xAODEventInfo xAODTracking ) @@ -77,19 +77,23 @@ atlas_add_test( TestTests INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} ${GTEST_INCLUDE_DIRS} LINK_LIBRARIES ${ROOT_LIBRARIES} ${GTEST_LIBRARIES} JetRecLib ) +if ( NOT XAOD_STANDALONE ) atlas_add_test(JetTests SOURCES test/JetTest.cxx INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} ${GTEST_INCLUDE_DIRS} LINK_LIBRARIES ${ROOT_LIBRARIES} ${GTEST_LIBRARIES} JetRecLib ) +endif() +if ( NOT XAOD_STANDALONE ) atlas_add_test(PseudoJetContainerOffline SOURCES test/PseudoJetContainerOfflineTest.cxx INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} ${GTEST_INCLUDE_DIRS} LINK_LIBRARIES ${ROOT_LIBRARIES} ${GTEST_LIBRARIES} JetRecLib ) +endif() -if ( NOT GENERATIONBASE ) +if ( NOT GENERATIONBASE AND NOT XAOD_STANDALONE ) atlas_add_test(PseudoJetContainerTrigger SOURCES test/PseudoJetContainerTriggerTest.cxx @@ -97,11 +101,13 @@ atlas_add_test(PseudoJetContainerTrigger LINK_LIBRARIES ${ROOT_LIBRARIES} ${GTEST_LIBRARIES} JetRecLib ) endif() +if ( NOT XAOD_STANDALONE ) atlas_add_test(ExtractorUnitTests SOURCES test/ExtractorTest.cxx INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} ${GTEST_INCLUDE_DIRS} LINK_LIBRARIES ${ROOT_LIBRARIES} ${GTEST_LIBRARIES} JetRecLib ) +endif() atlas_add_test(JetClustererTest SOURCES @@ -109,7 +115,7 @@ atlas_add_test(JetClustererTest INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} ${GTEST_INCLUDE_DIRS} LINK_LIBRARIES ${ROOT_LIBRARIES} ${GTEST_LIBRARIES} JetRecLib ) -if ( NOT GENERATIONBASE ) +if ( NOT GENERATIONBASE AND NOT XAOD_STANDALONE ) atlas_add_test(JetRecAlg_Test SCRIPT share/JetRecAlgTestCfg.py ) endif() diff --git a/Reconstruction/Jet/JetRec/JetRec/JetClusterer.h b/Reconstruction/Jet/JetRec/JetRec/JetClusterer.h index 64b71f7bd2e950f6d0c316b40ef139c8b640341b..bee4d61cbcfa1a10af4f45ca8f854fef6669a4ea 100644 --- a/Reconstruction/Jet/JetRec/JetRec/JetClusterer.h +++ b/Reconstruction/Jet/JetRec/JetRec/JetClusterer.h @@ -18,11 +18,12 @@ #include "xAODEventInfo/EventInfo.h" -#include "StoreGate/ReadHandleKey.h" -#include "StoreGate/WriteHandleKey.h" +#include "AsgDataHandles/ReadHandleKey.h" +#include "AsgDataHandles/WriteHandleKey.h" #include "JetInterface/IJetProvider.h" #include "AsgTools/AsgTool.h" +#include "AsgTools/PropertyWrapper.h" #include "JetRec/PseudoJetContainer.h" #include "JetRec/JetFromPseudojet.h" diff --git a/Reconstruction/Jet/JetRec/JetRec/JetConstitRemover.h b/Reconstruction/Jet/JetRec/JetRec/JetConstitRemover.h index 51d81b92c6d3c6f4b8ef19c538e7a50dc7bfee3f..a1c598a1ee8a333676286b7ffa3943d6880c9e05 100644 --- a/Reconstruction/Jet/JetRec/JetRec/JetConstitRemover.h +++ b/Reconstruction/Jet/JetRec/JetRec/JetConstitRemover.h @@ -19,7 +19,7 @@ #include "JetRec/JetModifierBase.h" class JetConstitRemover : public JetModifierBase { - ASG_TOOL_CLASS(JetConstitRemover, IJetModifier); + ASG_TOOL_CLASS(JetConstitRemover, IJetModifier) public: diff --git a/Reconstruction/Jet/JetRec/JetRec/JetCopier.h b/Reconstruction/Jet/JetRec/JetRec/JetCopier.h index 11fe9b4c30309b96ba21605dbfc50778d2e986bd..bc7534bca579c46d1bc190ae24a13f26fd7a4909 100644 --- a/Reconstruction/Jet/JetRec/JetRec/JetCopier.h +++ b/Reconstruction/Jet/JetRec/JetRec/JetCopier.h @@ -16,8 +16,9 @@ /// The JetVector key is also a Property of the tool. /// +#include "AsgTools/PropertyWrapper.h" #include "AsgTools/AsgTool.h" -#include "StoreGate/ReadHandleKey.h" +#include "AsgDataHandles/ReadHandleKey.h" #include "JetInterface/IJetProvider.h" #include "xAODJet/JetContainer.h" #include "xAODCore/ShallowAuxContainer.h" diff --git a/Reconstruction/Jet/JetRec/JetRec/JetFinder.h b/Reconstruction/Jet/JetRec/JetRec/JetFinder.h index f87d90fd259e7c383b32b814e95894c56892f7ef..ab6cbdc63e4d8038f1c5e05345dd8bb66dd87e7c 100644 --- a/Reconstruction/Jet/JetRec/JetRec/JetFinder.h +++ b/Reconstruction/Jet/JetRec/JetRec/JetFinder.h @@ -20,6 +20,8 @@ #include "AsgTools/ToolHandle.h" #include "JetRec/PseudoJetContainer.h" #include "xAODEventInfo/EventInfo.h" +#include "AsgDataHandles/ReadHandleKey.h" +#include "AsgDataHandles/WriteHandleKey.h" namespace fastjet { class ClusterSequence; diff --git a/Reconstruction/Jet/JetRec/JetRec/JetGroomer.h b/Reconstruction/Jet/JetRec/JetRec/JetGroomer.h index 60bca3c63ccdc57afbdca8c32a31ad5505fbdab6..666bb45ff75369d989f0628a4e5e7f6959ef34ce 100644 --- a/Reconstruction/Jet/JetRec/JetRec/JetGroomer.h +++ b/Reconstruction/Jet/JetRec/JetRec/JetGroomer.h @@ -18,8 +18,8 @@ #include "AsgTools/AsgTool.h" -#include "StoreGate/ReadHandleKey.h" -#include "StoreGate/WriteHandleKey.h" +#include "AsgDataHandles/ReadHandleKey.h" +#include "AsgDataHandles/WriteHandleKey.h" #include "JetInterface/IJetProvider.h" diff --git a/Reconstruction/Jet/JetRec/JetRec/JetPseudojetCopier.h b/Reconstruction/Jet/JetRec/JetRec/JetPseudojetCopier.h index c4a03bcd719ffdf2f763658f9c3b789348f03e80..8a4f854da80d5221b76170d426a91b6c005b2890 100644 --- a/Reconstruction/Jet/JetRec/JetRec/JetPseudojetCopier.h +++ b/Reconstruction/Jet/JetRec/JetRec/JetPseudojetCopier.h @@ -33,7 +33,7 @@ class JetPseudojetCopier : virtual public asg::AsgTool, virtual public IJetConsumer { - ASG_TOOL_CLASS(JetPseudojetCopier, IJetConsumer); + ASG_TOOL_CLASS(JetPseudojetCopier, IJetConsumer) public: diff --git a/Reconstruction/Jet/JetRec/JetRec/JetRecTool.h b/Reconstruction/Jet/JetRec/JetRec/JetRecTool.h index 4c4b97e85e2590d6dc05977f1adedc70aefaa968..4b6ea2a453c225621eaca9602fe84d665fb71764 100644 --- a/Reconstruction/Jet/JetRec/JetRec/JetRecTool.h +++ b/Reconstruction/Jet/JetRec/JetRec/JetRecTool.h @@ -58,10 +58,11 @@ #include "JetInterface/IJetPseudojetRetriever.h" #include "JetInterface/IJetConsumer.h" #include "TStopwatch.h" -#include "StoreGate/ReadHandleKeyArray.h" +#include "AsgDataHandles/ReadHandleKeyArray.h" +#include "AsgDataHandles/WriteHandleKey.h" #include "JetEDM/PseudoJetVector.h" #include "JetRec/PseudoJetContainer.h" -#ifndef GENERATIONBASE +#if !defined(GENERATIONBASE) && !defined(XAOD_STANDALONE) #include "AthenaMonitoringKernel/GenericMonitoringTool.h" #endif @@ -78,8 +79,17 @@ public: /// Initialization. Check all tools here. StatusCode initialize() override; + // FIX ME: This method is removed in AnalysisBase, because tools + // don't finalize in AnalysisBase. In AnalysisBase tools are + // generally meant to be stateless, so it makes less sense for them + // to be finalized, and that aside there is nobody around that can + // guarantee that `finalize` does get called anyways. If this does + // anything more than print out accounting-info this tool should + // probably be turned into a service (or an algorithm). +#ifndef XAOD_STANDALONE /// Finalization. Write summary report. StatusCode finalize() override; +#endif /// Retrieve inputs with tools and construct new /// jet collection. @@ -121,17 +131,17 @@ private: // Properties. - SG::WriteHandleKey<xAOD::JetContainer> m_outcoll; - SG::ReadHandleKey<xAOD::JetContainer> m_incoll; + SG::WriteHandleKey<xAOD::JetContainer> m_outcoll {this, "OutputContainer", ""}; + SG::ReadHandleKey<xAOD::JetContainer> m_incoll {this, "InputContainer", ""}; // The template argument should become PseudoJetContainer - SG::ReadHandleKeyArray<PseudoJetContainer> m_psjsin; + SG::ReadHandleKeyArray<PseudoJetContainer> m_psjsin {this, "InputPseudoJets", {}}; ToolHandle<IJetExecuteTool> m_intool; ToolHandle<IJetPseudojetRetriever> m_hpjr; ToolHandle<IJetFinder> m_finder; ToolHandle<IJetGroomer> m_groomer; - ToolHandleArray<IJetModifier> m_modifiers; - ToolHandleArray<IJetConsumer> m_consumers; + ToolHandleArray<IJetModifier> m_modifiers {this, "JetModifiers", {}}; + ToolHandleArray<IJetConsumer> m_consumers {this, "JetConsumers", {}}; bool m_trigger; int m_timer; @@ -160,7 +170,7 @@ private: mutable std::vector<TStopwatch> m_modclocks; mutable std::vector<TStopwatch> m_conclocks; -#ifndef GENERATIONBASE +#if !defined (GENERATIONBASE) && !defined (XAOD_STANDALONE) ToolHandle<GenericMonitoringTool> m_monTool{this,"MonTool","","Monitoring tool"}; #endif diff --git a/Reconstruction/Jet/JetRec/JetRec/JetToolRunner.h b/Reconstruction/Jet/JetRec/JetRec/JetToolRunner.h index 2cff3918577f88b0dfb8e3908544cac7d9a1f65f..efd865afedef5528a731249aa82f60bdcec7b2fb 100644 --- a/Reconstruction/Jet/JetRec/JetRec/JetToolRunner.h +++ b/Reconstruction/Jet/JetRec/JetRec/JetToolRunner.h @@ -48,8 +48,8 @@ public: private: // Properties. - ToolHandleArray<IEventShapeTool> m_evstools; - ToolHandleArray<IJetExecuteTool> m_exetools; + ToolHandleArray<IEventShapeTool> m_evstools {this, "EventShapeTools", {}}; + ToolHandleArray<IJetExecuteTool> m_exetools {this, "Tools", {}}; int m_timer; // Clocks. diff --git a/Reconstruction/Jet/JetRec/Root/IParticleExtractor.cxx b/Reconstruction/Jet/JetRec/Root/IParticleExtractor.cxx index f1fdd906fd70a2386e92d8d7d2eaab77b37fa1b7..743a27f559d866921c7394e33b1b28c8d5f7411e 100644 --- a/Reconstruction/Jet/JetRec/Root/IParticleExtractor.cxx +++ b/Reconstruction/Jet/JetRec/Root/IParticleExtractor.cxx @@ -7,6 +7,7 @@ #include "JetRec/IParticleExtractor.h" #include "JetRec/LineFormatter.h" // helper class for debug printing #include "xAODBase/IParticle.h" +#include <numeric> #include <vector> IParticleExtractor::IParticleExtractor(const xAOD::IParticleContainer* ips, diff --git a/Reconstruction/Jet/JetRec/Root/JetClusterer.cxx b/Reconstruction/Jet/JetRec/Root/JetClusterer.cxx index 2d0e2b1d462ba752fb02943342a762590175db2d..acad6882e30dce3bb48e9a140bcc405b3336af84 100644 --- a/Reconstruction/Jet/JetRec/Root/JetClusterer.cxx +++ b/Reconstruction/Jet/JetRec/Root/JetClusterer.cxx @@ -3,6 +3,7 @@ */ #include <memory> +#include "AsgDataHandles/ReadHandle.h" #include "JetRec/JetClusterer.h" #include "fastjet/PseudoJet.hh" #include "fastjet/ClusterSequence.hh" @@ -115,7 +116,7 @@ std::pair<std::unique_ptr<xAOD::JetContainer>, std::unique_ptr<SG::IAuxStore> > // Thus the contained PseudoJet will be kept frozen there and we can safely use pointer to them from the xAOD::Jet objects auto pjVector = std::make_unique<PseudoJetVector>(fastjet::sorted_by_pt(clSequence->inclusive_jets(m_ptmin)) ); ATH_MSG_DEBUG("Found jet count: " << pjVector->size()); - if(msgLevel(MSG::VERBOSE)) { + if(msgLvl(MSG::VERBOSE)) { for(const auto& pj : *pjVector) { msg() << " Pseudojet with pt " << std::setprecision(4) << pj.Et()*1e-3 << " has " << pj.constituents().size() << " constituents" << endmsg; } diff --git a/Reconstruction/Jet/JetRec/Root/JetCopier.cxx b/Reconstruction/Jet/JetRec/Root/JetCopier.cxx index b4d808c73cfae74dc62649441563c13f019d7145..f27f31e349387dbebb9d0b139b9773718037c126 100644 --- a/Reconstruction/Jet/JetRec/Root/JetCopier.cxx +++ b/Reconstruction/Jet/JetRec/Root/JetCopier.cxx @@ -4,6 +4,7 @@ #include "JetRec/JetCopier.h" +#include "AsgDataHandles/ReadHandle.h" #include "xAODJet/JetContainer.h" #include "xAODJet/JetAuxContainer.h" #include "xAODBase/IParticleHelpers.h" diff --git a/Reconstruction/Jet/JetRec/Root/JetFinder.cxx b/Reconstruction/Jet/JetRec/Root/JetFinder.cxx index d1472a19d27e061c14df393cf5f47d1952a7ada3..aa6b08f15753ba76e90c4de4d5994b866e192c2d 100644 --- a/Reconstruction/Jet/JetRec/Root/JetFinder.cxx +++ b/Reconstruction/Jet/JetRec/Root/JetFinder.cxx @@ -13,6 +13,8 @@ #ifndef NO_JET_VARIABLER #include "fastjet/contrib/VariableRPlugin.hh" #endif +#include "AsgDataHandles/ReadHandle.h" +#include "AsgDataHandles/WriteHandle.h" #include "xAODEventInfo/EventInfo.h" #include "JetEDM/FastJetUtils.h" #include "JetEDM/PseudoJetVector.h" diff --git a/Reconstruction/Jet/JetRec/Root/JetGroomer.cxx b/Reconstruction/Jet/JetRec/Root/JetGroomer.cxx index 65138a0b6222fda95d80f2f654a301bcaf3b9164..a54de07cdb9763f74dbe82e9beb8b747ea04eb21 100644 --- a/Reconstruction/Jet/JetRec/Root/JetGroomer.cxx +++ b/Reconstruction/Jet/JetRec/Root/JetGroomer.cxx @@ -4,6 +4,7 @@ #include "JetRec/JetGroomer.h" +#include "AsgDataHandles/ReadHandle.h" #include "fastjet/PseudoJet.hh" #include "JetRec/PseudoJetContainer.h" diff --git a/Reconstruction/Jet/JetRec/Root/JetRecTool.cxx b/Reconstruction/Jet/JetRec/Root/JetRecTool.cxx index 723c7b242bf05ac1128914e72a88b38b700777ec..6de287fc69973822022b2c084f337a22e496a7ba 100644 --- a/Reconstruction/Jet/JetRec/Root/JetRecTool.cxx +++ b/Reconstruction/Jet/JetRec/Root/JetRecTool.cxx @@ -20,9 +20,10 @@ #include "JetRec/PseudoJetContainer.h" #include <algorithm> -#include "StoreGate/ReadHandle.h" +#include "AsgDataHandles/ReadHandle.h" +#include "AsgDataHandles/WriteHandle.h" -#ifndef GENERATIONBASE +#if !defined (GENERATIONBASE) && !defined (XAOD_STANDALONE) #include "AthenaMonitoringKernel/Monitored.h" #endif @@ -48,22 +49,15 @@ JetRecTool::JetRecTool(std::string myname) #endif m_finder("",this), m_groomer("",this), - m_modifiers(this), - m_consumers(this), m_trigger(false), m_initCount(0), m_find(false), m_groom(false), m_copy(false), m_inputtype(xAOD::JetInput::Uncategorized), m_ppjr(nullptr) { - declareProperty("OutputContainer", m_outcoll); - declareProperty("InputContainer", m_incoll); declareProperty("InputTool", m_intool); - declareProperty("InputPseudoJets", m_psjsin); declareProperty("JetPseudojetRetriever", m_hpjr); declareProperty("JetFinder", m_finder); declareProperty("JetGroomer", m_groomer); - declareProperty("JetModifiers", m_modifiers); - declareProperty("JetConsumers", m_consumers); declareProperty("Trigger", m_trigger); declareProperty("Timer", m_timer =0); } @@ -225,7 +219,7 @@ StatusCode JetRecTool::initialize() { m_conclock.Reset(); m_nevt = 0; -#ifndef GENERATIONBASE +#if !defined (GENERATIONBASE) && !defined (XAOD_STANDALONE) if (!m_monTool.empty()) ATH_CHECK(m_monTool.retrieve()); #endif @@ -235,6 +229,7 @@ StatusCode JetRecTool::initialize() { //********************************************************************** +#ifndef XAOD_STANDALONE StatusCode JetRecTool::finalize() { ATH_MSG_INFO ("Finalizing " << name() << "..."); string tname = ""; @@ -320,6 +315,7 @@ StatusCode JetRecTool::finalize() { if( saveToFile ) outfile.close(); return StatusCode::SUCCESS; } +#endif //********************************************************************** @@ -412,7 +408,7 @@ const JetContainer* JetRecTool::build() const { } -#ifndef GENERATIONBASE +#if !defined (GENERATIONBASE) && !defined (XAOD_STANDALONE) // monitor jet multiplicity and basic jet kinematics auto njets = Monitored::Scalar<int>("nJets"); auto pt = Monitored::Collection("pt", *jetsHandle, [c=m_mevtogev]( const xAOD::Jet* jet ) { return jet->pt()*c; }); diff --git a/Reconstruction/Jet/JetRec/Root/JetToolRunner.cxx b/Reconstruction/Jet/JetRec/Root/JetToolRunner.cxx index bb78502c9c23169adb5c9a6156fc4e6828bad038..ea20cd52222ed9569aea37caaf02d905a2cf13a3 100644 --- a/Reconstruction/Jet/JetRec/Root/JetToolRunner.cxx +++ b/Reconstruction/Jet/JetRec/Root/JetToolRunner.cxx @@ -19,11 +19,7 @@ using std::fixed; //********************************************************************** JetToolRunner::JetToolRunner(const std::string& myname): - AsgTool(myname), - m_evstools(this), - m_exetools(this){ - declareProperty("Tools", m_exetools); - declareProperty("EventShapeTools", m_evstools); + AsgTool(myname){ declareProperty("Timer", m_timer =0); } diff --git a/Reconstruction/Jet/JetRec/Root/setAssocObjectsSummary.cxx b/Reconstruction/Jet/JetRec/Root/setAssocObjectsSummary.cxx index e5640afaadcb16247dbaf38477de2936c78396a0..db12ab60fb169f3ba363b3de371cf75413ce44b9 100644 --- a/Reconstruction/Jet/JetRec/Root/setAssocObjectsSummary.cxx +++ b/Reconstruction/Jet/JetRec/Root/setAssocObjectsSummary.cxx @@ -2,6 +2,7 @@ Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration */ #include "JetRec/setAssocObjectsSummary.h" +#include <numeric> void setAssocObjectsSummary(const std::vector<const xAOD::IParticle*>& constituents, diff --git a/Reconstruction/MET/METUtilities/CMakeLists.txt b/Reconstruction/MET/METUtilities/CMakeLists.txt index 1e55f1340d0988b947002b6b58ae35d26c70c575..87d5220ad7f46bf77598f65880fbefba984a5165 100644 --- a/Reconstruction/MET/METUtilities/CMakeLists.txt +++ b/Reconstruction/MET/METUtilities/CMakeLists.txt @@ -55,7 +55,7 @@ atlas_add_library( METUtilitiesLib INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} ${GTEST_INCLUDE_DIRS} LINK_LIBRARIES ${ROOT_LIBRARIES} AsgTools xAODEgamma xAODJet xAODMissingET xAODMuon xAODTau xAODTracking InDetTrackSelectionToolLib PATInterfaces - METInterface + METInterface AsgDataHandlesLib PRIVATE_LINK_LIBRARIES EventPrimitives FourMomUtils xAODCore PathResolver ) if( NOT XAOD_STANDALONE ) @@ -83,8 +83,11 @@ endif() # Executable(s) in the package: # only compiled in analysis releases if( XAOD_ANALYSIS ) - foreach( utility example_METMaker_METSystematicsTool - example_METMaker_advanced example_rebuildTrackMET ) + # FIX ME: temporarily disabled utilities relying on non-existant code + + # foreach( utility example_METMaker_METSystematicsTool + # example_METMaker_advanced example_rebuildTrackMET ) + foreach( utility example_rebuildTrackMET ) atlas_add_executable( ${utility} util/${utility}.cxx INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} diff --git a/Reconstruction/MET/METUtilities/METUtilities/METMaker.h b/Reconstruction/MET/METUtilities/METUtilities/METMaker.h index 5c100b8ed7b8bbfe588af6dad928b4b36eac9423..5d92d554aed9c2fc794f5baac5f93401bab29174 100644 --- a/Reconstruction/MET/METUtilities/METUtilities/METMaker.h +++ b/Reconstruction/MET/METUtilities/METUtilities/METMaker.h @@ -15,9 +15,9 @@ #include <string> // FrameWork includes +#include "AsgDataHandles/ReadHandleKey.h" #include "AsgTools/ToolHandle.h" #include "AsgTools/AsgTool.h" -#include "StoreGate/DataHandle.h" // METInterface includes #include "METInterface/IMETMaker.h" diff --git a/Reconstruction/MET/METUtilities/METUtilities/METRebuilder.h b/Reconstruction/MET/METUtilities/METUtilities/METRebuilder.h index 30594d2c3e8a0fecba493124c1c45ae71341507f..5973a835985dcb060227db572b6b55b85ca8e89d 100644 --- a/Reconstruction/MET/METUtilities/METUtilities/METRebuilder.h +++ b/Reconstruction/MET/METUtilities/METUtilities/METRebuilder.h @@ -15,9 +15,10 @@ #include <string> // FrameWork includes +#include "AsgDataHandles/ReadHandleKey.h" +#include "AsgDataHandles/WriteHandleKey.h" #include "AsgTools/AsgTool.h" #include "AsgTools/ToolHandle.h" -#include "StoreGate/DataHandle.h" // METInterface includes diff --git a/Reconstruction/MET/METUtilities/METUtilities/METSystematicsTool.h b/Reconstruction/MET/METUtilities/METUtilities/METSystematicsTool.h index befa34d398ad1f1d04ca595678283bd548241457..3cd07106f014c39d433285c24ef50c34377a6238 100644 --- a/Reconstruction/MET/METUtilities/METUtilities/METSystematicsTool.h +++ b/Reconstruction/MET/METUtilities/METUtilities/METSystematicsTool.h @@ -16,8 +16,8 @@ class TH2D; class TH1D; #include "METInterface/IMETSystematicsTool.h" +#include "AsgDataHandles/ReadHandleKey.h" #include "AsgTools/AsgTool.h" -#include "StoreGate/DataHandle.h" #include "PATInterfaces/SystematicsTool.h" diff --git a/Reconstruction/MET/METUtilities/Root/METMaker.cxx b/Reconstruction/MET/METUtilities/Root/METMaker.cxx index d2c2182f42a77c94339f58afcc134ec78e14eccc..8cf2a1da64f1dd5277f9e68b3d7a7d7ffbc4a4c6 100644 --- a/Reconstruction/MET/METUtilities/Root/METMaker.cxx +++ b/Reconstruction/MET/METUtilities/Root/METMaker.cxx @@ -36,6 +36,9 @@ #include "xAODEgamma/ElectronContainer.h" #include "xAODEgamma/EgammaxAODHelpers.h" +// framework includes +#include "AsgDataHandles/ReadHandle.h" + namespace met { using std::vector; diff --git a/Reconstruction/MET/METUtilities/Root/METRebuilder.cxx b/Reconstruction/MET/METUtilities/Root/METRebuilder.cxx index 95f7866b4aa8fad7b39d9ad5ee39201b09b41020..330fa6c402898f6f4642322721db19c88852ed61 100644 --- a/Reconstruction/MET/METUtilities/Root/METRebuilder.cxx +++ b/Reconstruction/MET/METUtilities/Root/METRebuilder.cxx @@ -38,6 +38,9 @@ // Track errors #include "EventPrimitives/EventPrimitivesHelpers.h" +#include "AsgDataHandles/ReadHandle.h" +#include "AsgDataHandles/WriteHandle.h" + #ifndef ROOTCORE #include "GaudiKernel/IJobOptionsSvc.h" #endif diff --git a/Reconstruction/MET/METUtilities/Root/METSystematicsTool.cxx b/Reconstruction/MET/METUtilities/Root/METSystematicsTool.cxx index 5a7ffa166be74c7fed9bc04fa13a63e4bae9db70..ae9010d1a523972c459b38562d2ad96006e3f5cd 100644 --- a/Reconstruction/MET/METUtilities/Root/METSystematicsTool.cxx +++ b/Reconstruction/MET/METUtilities/Root/METSystematicsTool.cxx @@ -11,6 +11,7 @@ #include <iostream> // #include <boost/filesystem.hpp> +#include "AsgDataHandles/ReadHandle.h" #include "PathResolver/PathResolver.h" // xAOD includes diff --git a/Reconstruction/RecoTools/IsolationTool/IsolationTool/CaloIsolationTool.h b/Reconstruction/RecoTools/IsolationTool/IsolationTool/CaloIsolationTool.h index cfb5bcdb4cc5ec8b2ac9f8d9208132c96b4a0c54..9623048b73082067e3651f54fd6c31f7ef717f9f 100644 --- a/Reconstruction/RecoTools/IsolationTool/IsolationTool/CaloIsolationTool.h +++ b/Reconstruction/RecoTools/IsolationTool/IsolationTool/CaloIsolationTool.h @@ -6,6 +6,7 @@ #define ISOLATIONTOOL_CALOISOLATIONTOOL_H #include "AsgTools/AsgTool.h" +#include "AsgTools/PropertyWrapper.h" #include "AsgTools/ToolHandle.h" #include "AsgDataHandles/ReadHandleKey.h" diff --git a/Reconstruction/RecoTools/IsolationTool/IsolationTool/TrackIsolationTool.h b/Reconstruction/RecoTools/IsolationTool/IsolationTool/TrackIsolationTool.h index 2fd543bc011fecd5e6aa8786fdca8267c1d0559e..f494ff171566c6f4394402b214c9809988c3e46e 100644 --- a/Reconstruction/RecoTools/IsolationTool/IsolationTool/TrackIsolationTool.h +++ b/Reconstruction/RecoTools/IsolationTool/IsolationTool/TrackIsolationTool.h @@ -6,6 +6,7 @@ #define ISOLATIONTOOL_TRACKISOLATIONTOOL_H #include "AsgTools/AsgTool.h" +#include "AsgTools/PropertyWrapper.h" #include "AsgTools/ToolHandle.h" #include "AsgDataHandles/ReadHandleKey.h" #include "RecoToolInterfaces/ITrackIsolationTool.h" diff --git a/Reconstruction/RecoTools/IsolationTool/Root/CaloIsolationTool.cxx b/Reconstruction/RecoTools/IsolationTool/Root/CaloIsolationTool.cxx index 5061bcef0593931cc7b3609bba493cd19eb02f8f..09b79dc0fc888e104a4861cd1531d16600c5a11f 100644 --- a/Reconstruction/RecoTools/IsolationTool/Root/CaloIsolationTool.cxx +++ b/Reconstruction/RecoTools/IsolationTool/Root/CaloIsolationTool.cxx @@ -132,6 +132,11 @@ namespace xAOD { CaloCorrection corrlist, const CaloCellContainer* container) const { #ifdef XAOD_ANALYSIS + (void) result; + (void) particle; + (void) cones; + (void) corrlist; + (void) container; return false; #else // XAOD_ANALYSIS derefMap_t derefMap; diff --git a/Reconstruction/RecoTools/IsolationTool/Root/TrackIsolationTool.cxx b/Reconstruction/RecoTools/IsolationTool/Root/TrackIsolationTool.cxx index 222499de9dcbf22157c13a403eb9de19c1c86203..db4daaa00cb3acf53360a1285bb6708fa9a62816 100644 --- a/Reconstruction/RecoTools/IsolationTool/Root/TrackIsolationTool.cxx +++ b/Reconstruction/RecoTools/IsolationTool/Root/TrackIsolationTool.cxx @@ -9,6 +9,7 @@ ////////////////////////////////////////////////////////////////////////////// //<<<<<< INCLUDES >>>>>> +#include "AsgDataHandles/ReadHandle.h" #include "IsolationTool/TrackIsolationTool.h" // #include "InDetTrackSelectionTool/IInDetTrackSelectionTool.h" #include "xAODTracking/VertexContainer.h"