|
ATLAS Offline Software
|
Algorithm for fixing dynamic variable corruption on xAOD containers.
More...
#include <DynVarFixerAlg.h>
|
StatusCode | initialize () override |
| Function initialising the algorithm. More...
|
|
StatusCode | execute () override |
| Function executing the algorithm. More...
|
|
| AthAlgorithm (const std::string &name, ISvcLocator *pSvcLocator) |
| Inherit the base class's constructor. More...
|
|
virtual StatusCode | sysInitialize () override |
| Override sysInitialize. More...
|
|
virtual const DataObjIDColl & | extraOutputDeps () const override |
| Return the list of extra output dependencies. More...
|
|
ServiceHandle< StoreGateSvc > & | evtStore () |
| The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc . More...
|
|
const ServiceHandle< StoreGateSvc > & | evtStore () const |
| The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc . More...
|
|
const ServiceHandle< StoreGateSvc > & | detStore () const |
| The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc . More...
|
|
virtual StatusCode | sysStart () override |
| Handle START transition. More...
|
|
virtual std::vector< Gaudi::DataHandle * > | inputHandles () const override |
| Return this algorithm's input handles. More...
|
|
virtual std::vector< Gaudi::DataHandle * > | outputHandles () const override |
| Return this algorithm's output handles. More...
|
|
Gaudi::Details::PropertyBase & | declareProperty (Gaudi::Property< T > &t) |
|
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, SG::VarHandleKey &hndl, const std::string &doc, const SG::VarHandleKeyType &) |
| Declare a new Gaudi property. More...
|
|
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, SG::VarHandleBase &hndl, const std::string &doc, const SG::VarHandleType &) |
| Declare a new Gaudi property. More...
|
|
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, SG::VarHandleKeyArray &hndArr, const std::string &doc, const SG::VarHandleKeyArrayType &) |
|
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, T &property, const std::string &doc, const SG::NotHandleType &) |
| Declare a new Gaudi property. More...
|
|
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, T &property, const std::string &doc="none") |
| Declare a new Gaudi property. More...
|
|
void | updateVHKA (Gaudi::Details::PropertyBase &) |
|
MsgStream & | msg () const |
|
MsgStream & | msg (const MSG::Level lvl) const |
|
bool | msgLvl (const MSG::Level lvl) const |
|
Algorithm for fixing dynamic variable corruption on xAOD containers.
This is a general algorithm for fixing problems where a dynamic auxiliary variable of a container is not the right size. Which can happen when the algorithm creating the container doesn't consistently create dynamic variables for all objects. (Not creating some variables if some selection fails for instance.)
This is a generalisation of algorithms like xAODMaker::TrackLinkFixerAlg
and xAODMaker::BTaggingAuxFixerAlg
.
- Author
- Attila Krasznahorkay Attil.nosp@m.a.Kr.nosp@m.aszna.nosp@m.hork.nosp@m.ay@ce.nosp@m.rn.c.nosp@m.h
Definition at line 41 of file DynVarFixerAlg.h.
◆ StoreGateSvc_t
◆ AthAlgorithm()
AthAlgorithm::AthAlgorithm |
Inherit the base class's constructor.
Definition at line 51 of file AthAlgorithm.cxx.
32 std::make_unique<AthenaBaseComps::AthAlgorithmDHUpdate>
34 std::move (m_updateDataHandles));
◆ declareGaudiProperty() [1/4]
specialization for handling Gaudi::Property<SG::VarHandleKeyArray>
Definition at line 170 of file AthCommonDataStore.h.
175 hndl.documentation());
◆ declareGaudiProperty() [2/4]
specialization for handling Gaudi::Property<SG::VarHandleKey>
Definition at line 156 of file AthCommonDataStore.h.
161 hndl.documentation());
◆ declareGaudiProperty() [3/4]
specialization for handling Gaudi::Property<SG::VarHandleBase>
Definition at line 184 of file AthCommonDataStore.h.
189 hndl.documentation());
◆ declareGaudiProperty() [4/4]
◆ declareProperty() [1/6]
Declare a new Gaudi property.
- Parameters
-
name | Name of the property. |
hndl | Object holding the property value. |
doc | Documentation string for the property. |
This is the version for types that derive from SG::VarHandleBase
. The property value object is put on the input and output lists as appropriate; then we forward to the base class.
Definition at line 245 of file AthCommonDataStore.h.
250 this->declare(hndl.
vhKey());
251 hndl.
vhKey().setOwner(
this);
253 return PBASE::declareProperty(
name,hndl,
doc);
◆ declareProperty() [2/6]
Declare a new Gaudi property.
- Parameters
-
name | Name of the property. |
hndl | Object holding the property value. |
doc | Documentation string for the property. |
This is the version for types that derive from SG::VarHandleKey
. The property value object is put on the input and output lists as appropriate; then we forward to the base class.
Definition at line 221 of file AthCommonDataStore.h.
229 return PBASE::declareProperty(
name,hndl,
doc);
◆ declareProperty() [3/6]
◆ declareProperty() [4/6]
Declare a new Gaudi property.
- Parameters
-
name | Name of the property. |
property | Object holding the property value. |
doc | Documentation string for the property. |
This is the generic version, for types that do not derive from SG::VarHandleKey
. It just forwards to the base class version of declareProperty
.
Definition at line 333 of file AthCommonDataStore.h.
338 return PBASE::declareProperty(
name, property,
doc);
◆ declareProperty() [5/6]
Declare a new Gaudi property.
- Parameters
-
name | Name of the property. |
property | Object holding the property value. |
doc | Documentation string for the property. |
This dispatches to either the generic declareProperty
or the one for VarHandle/Key/KeyArray.
Definition at line 352 of file AthCommonDataStore.h.
◆ declareProperty() [6/6]
◆ detStore()
◆ evtStore() [1/2]
◆ evtStore() [2/2]
◆ execute()
StatusCode xAODMaker::DynVarFixerAlg::execute |
( |
| ) |
|
|
override |
Function executing the algorithm.
Definition at line 47 of file DynVarFixerAlg.cxx.
51 auto ioHandles =
m_ioKeys.makeHandles();
52 assert( constHandles.size() == ioHandles.size() );
55 for( std::size_t
i = 0;
i < constHandles.size(); ++
i ) {
64 if( constHandle->
size() == 0 ) {
69 const std::string& cname = constHandle.
key();
70 const size_t size = constHandle->
size();
81 << reg.getName( auxid ) <<
"\"" );
84 const void* vecPtr = ioHandle->
getIOData( auxid );
93 ::TVirtualCollectionProxy*
proxy =
cl->GetCollectionProxy();
95 ATH_MSG_FATAL(
"Couldn't get collection proxy for variable \""
96 << reg.getName( auxid ) <<
"\"" );
97 return StatusCode::FAILURE;
110 << reg.getName( auxid ) <<
"\": "
115 ::TGenCollectionProxy* genProxy =
116 dynamic_cast< ::TGenCollectionProxy*
>(
proxy );
119 <<
"\" doesn't have a TGenCollectionProxy. "
120 <<
"Variable not fixed!" );
125 static const ::Bool_t FORCE_DELETE = kFALSE;
126 genProxy->Resize(
size, FORCE_DELETE );
128 << reg.getName( auxid ) <<
"\" after resize: "
130 ATH_MSG_DEBUG(
"Fixed variable: \"" << cname << reg.getName( auxid )
136 return StatusCode::SUCCESS;
◆ extraDeps_update_handler()
Add StoreName to extra input/output deps as needed.
use the logic of the VarHandleKey to parse the DataObjID keys supplied via the ExtraInputs and ExtraOuputs Properties to add the StoreName if it's not explicitly given
◆ extraOutputDeps()
const DataObjIDColl & AthAlgorithm::extraOutputDeps |
( |
| ) |
const |
|
overridevirtualinherited |
Return the list of extra output dependencies.
This list is extended to include symlinks implied by inheritance relations.
Definition at line 50 of file AthAlgorithm.cxx.
57 return Algorithm::extraOutputDeps();
◆ getClass()
TClass * xAODMaker::DynVarFixerAlg::getClass |
( |
SG::auxid_t |
auxid | ) |
|
|
private |
Get the dictionary describing an auxiliary vector variable.
Definition at line 139 of file DynVarFixerAlg.cxx.
153 if(
m_dicts.size() <= auxid ) {
154 m_dicts.resize( auxid + 1,
nullptr );
157 m_noDict.resize( auxid + 1,
false );
162 static const ::Bool_t LOAD = kTRUE;
163 static const ::Bool_t
SILENT = kTRUE;
164 ::TClass*
cl = ::TClass::GetClass( reg.getVecTypeName( auxid ).c_str(),
172 << reg.getName( auxid ) <<
"\"" );
◆ initialize()
StatusCode xAODMaker::DynVarFixerAlg::initialize |
( |
| ) |
|
|
override |
Function initialising the algorithm.
Definition at line 24 of file DynVarFixerAlg.cxx.
28 ATH_MSG_DEBUG(
"Will be fixing dynamic variables in container(s):" );
36 return key.key(); } );
44 return StatusCode::SUCCESS;
◆ inputHandles()
Return this algorithm's input handles.
We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.
◆ msg() [1/2]
◆ msg() [2/2]
◆ msgLvl()
◆ outputHandles()
Return this algorithm's output handles.
We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.
◆ renounce()
◆ renounceArray()
◆ sysInitialize()
StatusCode AthAlgorithm::sysInitialize |
( |
| ) |
|
|
overridevirtualinherited |
◆ sysStart()
Handle START transition.
We override this in order to make sure that conditions handle keys can cache a pointer to the conditions container.
◆ updateVHKA()
◆ m_constKeys
Initial value:{
this, "Containers", {}, "Containers to fix up the dynamic variables of" }
Containers to access with the SG::IConstAuxStore
interface.
Definition at line 60 of file DynVarFixerAlg.h.
◆ m_detStore
◆ m_dicts
std::vector< ::TClass* > xAODMaker::DynVarFixerAlg::m_dicts |
|
private |
◆ m_evtStore
◆ m_extendedExtraObjects
DataObjIDColl AthAlgorithm::m_extendedExtraObjects |
|
privateinherited |
◆ m_ioKeys
Containers to access with the SG::IAuxStoreIO
interface.
Note that this variable is not set up as a property on the algorithm. It is instead filled by the algorithm in its initialize()
function. (Based on the content of m_constKeys
)
Definition at line 71 of file DynVarFixerAlg.h.
◆ m_noDict
std::vector< bool > xAODMaker::DynVarFixerAlg::m_noDict |
|
private |
Flag showing which variables don't have a dictionary for them.
Definition at line 76 of file DynVarFixerAlg.h.
◆ m_varHandleArraysDeclared
◆ m_vhka
The documentation for this class was generated from the following files:
SG::ReadHandleKeyArray< SG::IAuxStoreIO > m_ioKeys
Containers to access with the SG::IAuxStoreIO interface.
std::vector< ::TClass * > m_dicts
Cache of the dictionaries used.
static AuxTypeRegistry & instance()
Return the singleton registry instance.
@ SILENT
don't print anything and return success
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
StoreGateSvc_t m_evtStore
Pointer to StoreGate (event store by default)
std::vector< SG::VarHandleKeyArray * > m_vhka
#define ATH_MSG_VERBOSE(x)
Property holding a SG store/key/clid from which a ReadHandle is made.
virtual size_t size() const =0
Return the number of elements in the store.
virtual void setOwner(IDataHandleHolder *o)=0
size_t auxid_t
Identifier for a particular aux data item.
virtual StatusCode sysInitialize() override
Override sysInitialize.
virtual std::vector< Gaudi::DataHandle * > outputHandles() const override
Return this algorithm's output handles.
::StatusCode StatusCode
StatusCode definition for legacy code.
Amg::Vector3D transform(Amg::Vector3D &v, Amg::Transform3D &tr)
Transform a point from a Trasformation3D.
StoreGateSvc_t m_detStore
Pointer to StoreGate (detector store by default)
SG::ReadHandleKeyArray< SG::IConstAuxStore > m_constKeys
Containers to access with the SG::IConstAuxStore interface.
virtual const SG::auxid_set_t & getDynamicAuxIDs() const =0
Get the list of all dynamically created variables.
virtual void renounce()=0
std::conditional< std::is_base_of< SG::VarHandleKeyArray, T >::value, VarHandleKeyArrayType, type2 >::type type
virtual const void * getIOData(SG::auxid_t auxid) const =0
Return a pointer to the data to be stored for one aux data item.
virtual const std::string & key() const override final
Return the StoreGate ID for the referenced object.
DataObjIDColl m_extendedExtraObjects
#define ATH_MSG_WARNING(x)
SG::VarHandleKey & vhKey()
Return a non-const reference to the HandleKey.
::TClass * getClass(SG::auxid_t auxid)
Get the dictionary describing an auxiliary vector variable.
cl
print [x.__class__ for x in toList(dqregion.getSubRegions()) ]
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>
std::vector< bool > m_noDict
Flag showing which variables don't have a dictionary for them.