ATLAS Offline Software
AuxDataFillerTool.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 /*
4  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
5 */
6 
7 // $Id$
15 #ifndef D3PDMAKERCORECOMPS_AUXDATAFILLERTOOL_H
16 #define D3PDMAKERCORECOMPS_AUXDATAFILLERTOOL_H
17 
18 
21 #include "RootUtils/Type.h"
22 #include <vector>
23 #include <string>
24 #include <memory>
25 
26 
27 namespace D3PD {
28 
29 
34  : public BlockFillerTool<SG::AuxElement>
35 {
36 public:
43  AuxDataFillerTool (const std::string& type,
44  const std::string& name,
45  const IInterface* parent);
46 
47 
49  virtual StatusCode initialize();
50 
51 
53  virtual StatusCode book();
54 
55 
64  virtual StatusCode fill (const SG::AuxElement& p);
65 
66 
67 private:
70 
72  std::string m_auxprefix;
73 
76  std::vector<std::string> m_varString;
77 
78 
80  struct Var
81  {
92  Var (const std::string& the_name,
93  const std::string& the_docstring,
94  const std::vector<std::string>& the_labels,
95  const std::vector<std::string>& the_label_classes,
96  const std::string& the_defstring,
97  bool the_has_default);
98 
99 
106  const void* access (const SG::AuxElement& p) const;
107 
109  std::string name;
110 
112  std::string docstring;
113 
117 
120 
123 
125  const std::type_info* ti;
126 
128  std::vector<SG::AuxElement::TypelessConstAccessor> accessors;
129 
131  void* ptr;
132 
134  std::string label;
135  };
136 
137 
139  std::vector<std::unique_ptr<Var> > m_vars;
140 };
141 
142 
143 } // namespace D3PD
144 
145 
146 #endif // not D3PDMAKERCORECOMPS_AUXDATAFILLERTOOL_H
D3PD::AuxDataFillerTool
Copy aux data to D3PD.
Definition: AuxDataFillerTool.h:35
SG::AuxElement
Base class for elements of a container that can have aux data.
Definition: AuxElement.h:472
D3PD::AuxDataFillerTool::Var::has_default
bool has_default
If true, this aux variable can be defaulted.
Definition: AuxDataFillerTool.h:119
D3PD::AuxDataFillerTool::Var::accessors
std::vector< SG::AuxElement::TypelessConstAccessor > accessors
Aux data accessor(s) for the item.
Definition: AuxDataFillerTool.h:128
D3PD::AuxDataFillerTool::Var::label
std::string label
Name of the aux data item(s).
Definition: AuxDataFillerTool.h:134
D3PD::AuxDataFillerTool::m_vars
std::vector< std::unique_ptr< Var > > m_vars
Parsed list of variables.
Definition: AuxDataFillerTool.h:139
D3PD::AuxDataFillerTool::parseVars
StatusCode parseVars()
Parse the variables property and fill m_vars.
Definition: AuxDataFillerTool.cxx:189
BlockFillerTool.h
Type-safe wrapper for block filler tools.
D3PD::AuxDataFillerTool::Var::access
const void * access(const SG::AuxElement &p) const
Try to retrieve an aux data item from p.
Definition: AuxDataFillerTool.cxx:94
D3PD
Block filler tool for noisy FEB information.
Definition: CaloCellDetailsFillerTool.cxx:29
python.utils.AtlRunQueryDQUtils.p
p
Definition: AtlRunQueryDQUtils.py:210
Type.h
Wrapper for ROOT types.
D3PD::AuxDataFillerTool::fill
virtual StatusCode fill(const SG::AuxElement &p)
Fill one block — type-safe version.
Definition: AuxDataFillerTool.cxx:170
D3PD::AuxDataFillerTool::Var::Var
Var(const std::string &the_name, const std::string &the_docstring, const std::vector< std::string > &the_labels, const std::vector< std::string > &the_label_classes, const std::string &the_defstring, bool the_has_default)
Constructor.
Definition: AuxDataFillerTool.cxx:36
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
D3PD::AuxDataFillerTool::Var::name
std::string name
Name of the variable.
Definition: AuxDataFillerTool.h:109
D3PD::AuxDataFillerTool::Var::ti
const std::type_info * ti
Type of the variable, as type_info.
Definition: AuxDataFillerTool.h:125
D3PD::AuxDataFillerTool::AuxDataFillerTool
AuxDataFillerTool(const std::string &type, const std::string &name, const IInterface *parent)
Standard Gaudi tool constructor.
Definition: AuxDataFillerTool.cxx:110
D3PD::AuxDataFillerTool::Var::ptr
void * ptr
Pointer passed to ID3PD.
Definition: AuxDataFillerTool.h:131
test_pyathena.parent
parent
Definition: test_pyathena.py:15
D3PD::AuxDataFillerTool::Var::defobj
RootUtils::Type::unique_ptr defobj
If present, a default object instance to use if the aux variable is not present.
Definition: AuxDataFillerTool.h:116
D3PD::BlockFillerTool
Type-safe wrapper for block filler tools.
Definition: BlockFillerTool.h:68
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:221
D3PD::AuxDataFillerTool::Var::docstring
std::string docstring
Docstring for the variable.
Definition: AuxDataFillerTool.h:112
RootUtils::Type::unique_ptr
std::unique_ptr< void, Deleter > unique_ptr
A std::unique_ptr type referencing a generic pointer.
Definition: Type.h:344
D3PD::AuxDataFillerTool::Var
Describe one variable.
Definition: AuxDataFillerTool.h:81
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
D3PD::AuxDataFillerTool::book
virtual StatusCode book()
Book variables for this block.
Definition: AuxDataFillerTool.cxx:148
RootUtils::Type
Wrapper for ROOT types.
Definition: Type.h:40
D3PD::AuxDataFillerTool::m_varString
std::vector< std::string > m_varString
Property: Specify variables to fill.
Definition: AuxDataFillerTool.h:76
D3PD::AuxDataFillerTool::m_auxprefix
std::string m_auxprefix
Property: Prefix to add to aux data names.
Definition: AuxDataFillerTool.h:72
D3PD::AuxDataFillerTool::initialize
virtual StatusCode initialize()
Standard Gaudi initialize method.
Definition: AuxDataFillerTool.cxx:139
AuxElement.h
Base class for elements of a container that can have aux data.
D3PD::AuxDataFillerTool::Var::type
RootUtils::Type type
Type of the item.
Definition: AuxDataFillerTool.h:122