ATLAS Offline Software
Public Member Functions | Private Attributes | List of all members
DMTest::xAODTestWriteCInfoTool Class Reference

Algorithm for creating test aux data. More...

#include <xAODTestWriteCInfoTool.h>

Inheritance diagram for DMTest::xAODTestWriteCInfoTool:
Collaboration diagram for DMTest::xAODTestWriteCInfoTool:

Public Member Functions

 xAODTestWriteCInfoTool (const std::string &type, const std::string &name, const IInterface *parent)
 Constructor. More...
 
virtual StatusCode initialize () override
 Tool initialization; called at the beginning of the job. More...
 
virtual StatusCode doit (const EventContext &ctx) const override
 Tool event processing. More...
 

Private Attributes

SG::ReadHandleKey< DMTest::CVecm_cvecKey
 
SG::WriteHandleKey< DMTest::Cm_cinfoKey
 

Detailed Description

Algorithm for creating test aux data.

Definition at line 34 of file xAODTestWriteCInfoTool.h.

Constructor & Destructor Documentation

◆ xAODTestWriteCInfoTool()

DMTest::xAODTestWriteCInfoTool::xAODTestWriteCInfoTool ( const std::string &  type,
const std::string &  name,
const IInterface *  parent 
)

Constructor.

Parameters
typeThe tool type.
nameThe tool name.
parentThe tool's parent.

Definition at line 29 of file xAODTestWriteCInfoTool.cxx.

33  : base_class (type, name, parent),
34  m_cvecKey ("cvec"),
35  m_cinfoKey ("cinfo")
36 {
37  declareProperty ("CVecKey", m_cvecKey);
38  declareProperty ("CInfoKey", m_cinfoKey);
39 }

Member Function Documentation

◆ doit()

StatusCode DMTest::xAODTestWriteCInfoTool::doit ( const EventContext &  ctx) const
overridevirtual

Tool event processing.

Definition at line 56 of file xAODTestWriteCInfoTool.cxx.

57 {
58  unsigned int count = ctx.eventID().event_number() + 1;
59 
61 
62  auto cinfo = std::make_unique<DMTest::C>();
63  auto info_store = std::make_unique<DMTest::CInfoAuxContainer>();
64  cinfo->setStore (info_store.get());
65 
66  static const C::Accessor<int> anInt2 ("anInt2");
67  static const C::Accessor<ElementLink<DMTest::CVec> > cEL ("cEL");
68 
69  cinfo->setAnInt (count * 1000);
70  cinfo->setAFloat ((float)count * 0.1);
71  anInt2(*cinfo) = count * 2000;
72 
73  if (!cvec->empty()) {
74  cEL(*cinfo).toIndexedElement (*cvec, count % cvec->size());
75  }
76 
78  std::unique_ptr<const DMTest::C> cinfo_c (std::move (cinfo));
79  std::unique_ptr<const DMTest::CInfoAuxContainer> info_store_c (std::move (info_store));
80  if (cinfoH.put (std::move(cinfo_c), std::move(info_store_c)) == nullptr) {
81  ATH_MSG_ERROR ("Can't record CInfo");
82  return StatusCode::FAILURE;
83  }
84 
85  return StatusCode::SUCCESS;
86 }

◆ initialize()

StatusCode DMTest::xAODTestWriteCInfoTool::initialize ( )
overridevirtual

Tool initialization; called at the beginning of the job.

Definition at line 45 of file xAODTestWriteCInfoTool.cxx.

46 {
47  ATH_CHECK( m_cvecKey.initialize() );
48  ATH_CHECK( m_cinfoKey.initialize() );
49  return StatusCode::SUCCESS;
50 }

Member Data Documentation

◆ m_cinfoKey

SG::WriteHandleKey<DMTest::C> DMTest::xAODTestWriteCInfoTool::m_cinfoKey
private

Definition at line 63 of file xAODTestWriteCInfoTool.h.

◆ m_cvecKey

SG::ReadHandleKey<DMTest::CVec> DMTest::xAODTestWriteCInfoTool::m_cvecKey
private

Definition at line 62 of file xAODTestWriteCInfoTool.h.


The documentation for this class was generated from the following files:
SG::ReadHandle
Definition: StoreGate/StoreGate/ReadHandle.h:70
DMTest::xAODTestWriteCInfoTool::m_cinfoKey
SG::WriteHandleKey< DMTest::C > m_cinfoKey
Definition: xAODTestWriteCInfoTool.h:63
XMLtoHeader.count
count
Definition: XMLtoHeader.py:85
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
test_pyathena.parent
parent
Definition: test_pyathena.py:15
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:221
SG::WriteHandle
Definition: StoreGate/StoreGate/WriteHandle.h:76
DMTest::xAODTestWriteCInfoTool::m_cvecKey
SG::ReadHandleKey< DMTest::CVec > m_cvecKey
Definition: xAODTestWriteCInfoTool.h:62
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78