ATLAS Offline Software
MultiAssociationToolMulti.h
Go to the documentation of this file.
1 // This file's extension implies that it's C, but it's really -*- C++ -*-.
2 /*
3  Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
4 */
14 #ifndef D3PDMAKERUTILS_MULTIASSOCIATIONTOOLMULTI_H
15 #define D3PDMAKERUTILS_MULTIASSOCIATIONTOOLMULTI_H
16 
17 
18 #include "D3PDMakerUtils/Types.h"
20 #ifndef D3PDMAKERUTILS_MULTIASSOCIATIONTOOL_H // prevent recursive include
22 #endif
23 
24 #include <cstdlib>
25 
26 
27 
28 namespace D3PD {
29 
30 
45 template <class T0, class TO_T>
46 class MultiAssociationTool<Types<T0>, TO_T>
47  : public MultiAssociationToolTo<TO_T>
48 {
49 public:
56  MultiAssociationTool (const std::string& type,
57  const std::string& name,
58  const IInterface* parent);
59 
60 
70  const std::type_info& ti) override;
71 
72 
76  virtual const std::type_info& fromTypeinfo() const override;
77 
78 
83  virtual StatusCode resetUntyped (const void* p) override;
84 
85 
90  virtual StatusCode reset (const T0& p) = 0;
91 
92 
93 protected:
95  size_t m_which;
96 
97 
108  virtual StatusCode doResetUntyped (const void* p, size_t count);
109 
110 
118  virtual void push_ti (std::vector<const std::type_info*>& tis);
119 
120 
121 
122 private:
124  const std::type_info* m_fromTypeinfo;
125 };
126 
127 
134 template <class T0, class U0>
136  : public MultiAssociationTool<Types<T0>, U0>
137 {
138 public:
145  MultiAssociationTool (const std::string& type,
146  const std::string& name,
147  const IInterface* parent);
148 
149 
154  virtual StatusCode reset (const T0& p) override = 0;
155 
156 
164  virtual const U0* next () override;
165 
166 
173  virtual const U0* next (const T0* dummy) = 0;
174 
175 
181  virtual const std::type_info& elementTypeinfo() const override;
182 
183 
193  virtual void releaseElement (const U0* /*p*/) override;
194 
195 
205  virtual void releaseElementUntyped (const void* p) override;
206 
207 
213  virtual const void* nextUntyped() override;
214 };
215 
216 
217 } // namespace D3PD
218 
219 
221 
222 
223 #endif // not D3PDMAKERUTILS_MULTIASSOCIATIONTOOLMULTI_H
D3PD::MultiAssociationTool< Types< T0 >, TO_T >::m_fromTypeinfo
const std::type_info * m_fromTypeinfo
type_info for the selected type.
Definition: MultiAssociationToolMulti.h:124
D3PD::IAddVariable
Common interface for adding a variable to a tuple.
Definition: IAddVariable.h:70
D3PD::MultiAssociationTool< Types< T0 >, Types< U0 > >::next
virtual const U0 * next() override
Return a pointer to the next element in the association.
python.PerfMonSerializer.p
def p
Definition: PerfMonSerializer.py:743
MultiAssociationTool.h
Type-safe wrapper for multiple-target associator tools.
D3PD::MultiAssociationTool< Types< T0 >, TO_T >::configureD3PD
virtual StatusCode configureD3PD(IAddVariable *tree, const std::type_info &ti) override
Configure during initialization: type-check.
tree
TChain * tree
Definition: tile_monitor.h:30
MultiAssociationToolMulti.icc
D3PD::MultiAssociationToolTo
Helper for MultiAssociationTool.
Definition: MultiAssociationTool.h:34
D3PD::MultiAssociationTool
Type-safe wrapper for multiple-target associator tools.
Definition: MultiAssociationTool.h:158
D3PD::Types
std::tuple< WrapType< TYPES >... > Types
A simple tuple of multiple types.
Definition: PhysicsAnalysis/D3PDMaker/D3PDMakerUtils/D3PDMakerUtils/Types.h:61
D3PD::MultiAssociationTool< Types< T0 >, TO_T >::m_which
size_t m_which
Index of which type we're expecting.
Definition: MultiAssociationToolMulti.h:95
D3PD::MultiAssociationTool< Types< T0 >, Types< U0 > >::reset
virtual StatusCode reset(const T0 &p) override=0
Start the iteration for a new association.
XMLtoHeader.count
count
Definition: XMLtoHeader.py:85
D3PD::MultiAssociationTool< Types< T0 >, Types< U0 > >::next
virtual const U0 * next(const T0 *dummy)=0
Return a pointer to the next element in the association.
D3PD::MultiAssociationTool< Types< T0 >, TO_T >::doResetUntyped
virtual StatusCode doResetUntyped(const void *p, size_t count)
Helper to decide which which reset method to call.
D3PD
Block filler tool for noisy FEB information.
Definition: InnerDetector/InDetMonitoring/InDetGlobalMonitoring/macros/EnhancedPrimaryVertexMonitoring/TrigD3PD/ChainGroup.h:21
D3PD::MultiAssociationTool< Types< T0 >, TO_T >::MultiAssociationTool
MultiAssociationTool(const std::string &type, const std::string &name, const IInterface *parent)
Standard Gaudi tool constructor.
Types.h
A simple tuple of multiple types.
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
test_pyathena.parent
parent
Definition: test_pyathena.py:15
python.xAODType.dummy
dummy
Definition: xAODType.py:4
D3PD::MultiAssociationTool< Types< T0 >, TO_T >::fromTypeinfo
virtual const std::type_info & fromTypeinfo() const override
Return the std::type_info for the source of the association.
D3PD::MultiAssociationTool< Types< T0 >, Types< U0 > >::MultiAssociationTool
MultiAssociationTool(const std::string &type, const std::string &name, const IInterface *parent)
Standard Gaudi tool constructor.
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:195
D3PD::MultiAssociationTool< Types< T0 >, TO_T >::push_ti
virtual void push_ti(std::vector< const std::type_info * > &tis)
Helper to collect the list of type_info's that we accept.
MultiAssociationToolImpl.h
Non-template parts of MultiAssociationTool.
D3PD::MultiAssociationTool< Types< T0 >, Types< U0 > >::elementTypeinfo
virtual const std::type_info & elementTypeinfo() const override
Return the element type for the target of the association.
D3PD::MultiAssociationTool< Types< T0 >, TO_T >::reset
virtual StatusCode reset(const T0 &p)=0
Start the iteration for a new association.
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
D3PD::MultiAssociationTool< Types< T0 >, Types< U0 > >::nextUntyped
virtual const void * nextUntyped() override
Return a pointer to the next element in the association.
D3PD::MultiAssociationTool< Types< T0 >, Types< U0 > >::releaseElement
virtual void releaseElement(const U0 *) override
Release an object retrieved from the association.
D3PD::MultiAssociationTool< Types< T0 >, Types< U0 > >::releaseElementUntyped
virtual void releaseElementUntyped(const void *p) override
Release an object retrieved from the association.
D3PD::MultiAssociationTool< Types< T0 >, TO_T >::resetUntyped
virtual StatusCode resetUntyped(const void *p) override
Start the iteration for a new association.