ATLAS Offline Software
Loading...
Searching...
No Matches
EventErrorStateFillerTool.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
3*/
4
5// $Id$
12
13
15#include "EventFlagNames.h"
18#include <string>
19#include <cassert>
20
21using xAOD::EventInfo;
22
23namespace D3PD {
24
25
33 (const std::string& type,
34 const std::string& name,
35 const IInterface* parent)
36 : BlockFillerTool<EventInfo> (type, name, parent)
37{
38}
39
40
45{
46 m_errs.resize (EventInfo::nDets);
47 for (size_t i = 0; i < nEventFlagNames; i++) {
48 unsigned int flag = eventFlagNames[i].m_flag;
49 assert (flag < m_errs.size());
50 std::string name = eventFlagNames[i].m_name;
51 name += "Error";
52 CHECK( addVariable (name, m_errs[flag]) );
53 }
54 return StatusCode::SUCCESS;
55}
56
57
59{
60 for (size_t i = 0; i < m_errs.size(); i++) {
61 if (m_errs[i])
62 *m_errs[i] = p.errorState(static_cast<EventInfo::EventFlagSubDet>(i));
63 }
64 return StatusCode::SUCCESS;
65}
66
67
68} // namespace D3PD
Helpers for checking error return status codes and reporting errors.
#define CHECK(...)
Evaluate an expression and check for errors.
Block filler tool for event error state from EventInfo.
Assign names to subdet symbols used in EventID.
virtual StatusCode addVariable(const std::string &name, const std::type_info &ti, void *&ptr, const std::string &docstring="", const void *defval=0)
Type-safe wrapper for block filler tools.
EventErrorStateFillerTool(const std::string &type, const std::string &name, const IInterface *parent)
Standard Gaudi tool constructor.
virtual StatusCode book()
Book variables for this block.
std::vector< unsigned int * > m_errs
virtual StatusCode fill(const xAOD::EventInfo &p)
Fill one block — type-safe version.
EventFlagSubDet
Sub-detector types for which we store event-level flags.
@ nDets
Number of sub-detector type in this enumeration.
Block filler tool for noisy FEB information.
static const EventFlagNames eventFlagNames[]
static constexpr size_t nEventFlagNames
EventInfo_v1 EventInfo
Definition of the latest event info version.