ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
PhysicsAnalysis
D3PDMaker
EventCommonD3PDMaker
src
EventTrigInfoFillerTool.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
// Gaudi/Athena include(s):
6
#include "
AthenaKernel/errorcheck.h
"
7
8
// Local include(s):
9
#include "
EventTrigInfoFillerTool.h
"
10
11
using
xAOD::EventInfo
;
12
13
namespace
D3PD
{
14
15
EventTrigInfoFillerTool::EventTrigInfoFillerTool
(
const
std::string&
type
,
16
const
std::string& name,
17
const
IInterface* parent )
18
:
BlockFillerTool
<
EventInfo
>(
type
, name, parent ) {
19
20
declareProperty(
"Streams"
,
m_configStreams
,
21
"Streams for which the decision should be stored"
);
22
23
EventTrigInfoFillerTool::book
().ignore();
// Avoid coverity warnings.
24
}
25
26
StatusCode
EventTrigInfoFillerTool::book
() {
27
28
//
29
// Create boolean variables with the names of the streams in question:
30
//
31
m_streams
.resize(
m_configStreams
.size(), 0 );
32
for
(
size_t
i = 0; i <
m_configStreams
.size(); ++i ) {
33
CHECK
(
addVariable
(
"streamDecision_"
+
m_configStreams
[ i ],
34
m_streams
[ i ],
35
"Did this event end up in the '"
+
m_configStreams
[ i ] +
36
"' stream?"
) );
37
}
38
39
CHECK
(
addVariable
(
"l1id"
,
m_l1id
,
"Extended LVL1 ID"
) );
40
41
return
StatusCode::SUCCESS;
42
}
43
44
StatusCode
EventTrigInfoFillerTool::fill
(
const
EventInfo
& ei ) {
45
46
// Access the needed information:
47
const
auto
& stags = ei.streamTags();
48
49
// Set the flags according to the stream decisions:
50
for
(
size_t
i = 0; i <
m_configStreams
.size(); ++i ) {
51
if
(
streamPassed
( stags,
m_configStreams
[ i ] ) ) {
52
*(
m_streams
[ i ] ) =
true
;
53
}
else
{
54
*(
m_streams
[ i ] ) =
false
;
55
}
56
}
57
58
*
m_l1id
= ei.extendedLevel1ID();
59
60
return
StatusCode::SUCCESS;
61
}
62
72
bool
73
EventTrigInfoFillerTool::streamPassed
(
const
std::vector< EventInfo::StreamTag >& stags,
74
const
std::string& sname ) {
75
76
//std::vector< TriggerInfo::StreamTag >::const_iterator itr = stags.begin();
77
//std::vector< TriggerInfo::StreamTag >::const_iterator end = stags.end();
78
//for( ; itr != end; ++itr ) {
79
for
(
const
auto
& itr : stags) {
80
if
( itr.name() == sname )
return
true
;
81
}
82
83
return
false
;
84
}
85
86
}
// namespace D3PD
errorcheck.h
Helpers for checking error return status codes and reporting errors.
CHECK
#define CHECK(...)
Evaluate an expression and check for errors.
Definition
Control/AthenaKernel/AthenaKernel/errorcheck.h:422
EventTrigInfoFillerTool.h
D3PD::BlockFillerTool< xAOD::EventInfo >::addVariable
virtual StatusCode addVariable(const std::string &name, const std::type_info &ti, void *&ptr, const std::string &docstring="", const void *defval=0)
Definition
AddVariable.cxx:85
D3PD::BlockFillerTool
Type-safe wrapper for block filler tools.
Definition
BlockFillerTool.h:65
D3PD::EventTrigInfoFillerTool::EventTrigInfoFillerTool
EventTrigInfoFillerTool(const std::string &type, const std::string &name, const IInterface *parent)
Standard AlgTool constructor.
Definition
EventTrigInfoFillerTool.cxx:15
D3PD::EventTrigInfoFillerTool::streamPassed
static bool streamPassed(const std::vector< xAOD::EventInfo::StreamTag > &stags, const std::string &sname)
Function deciding if a given stream was passed.
Definition
EventTrigInfoFillerTool.cxx:73
D3PD::EventTrigInfoFillerTool::fill
virtual StatusCode fill(const xAOD::EventInfo &ei)
Fill the variables for this block.
Definition
EventTrigInfoFillerTool.cxx:44
D3PD::EventTrigInfoFillerTool::m_l1id
unsigned int * m_l1id
Variable: Extended level 1 ID.
Definition
EventTrigInfoFillerTool.h:61
D3PD::EventTrigInfoFillerTool::m_streams
std::vector< bool * > m_streams
Streams to which this event was written.
Definition
EventTrigInfoFillerTool.h:55
D3PD::EventTrigInfoFillerTool::m_configStreams
std::vector< std::string > m_configStreams
Streams for which the decision should be stored.
Definition
EventTrigInfoFillerTool.h:58
D3PD::EventTrigInfoFillerTool::book
virtual StatusCode book()
Book variables for this block.
Definition
EventTrigInfoFillerTool.cxx:26
D3PD
Block filler tool for noisy FEB information.
Definition
CaloCellDetailsFillerTool.cxx:29
EventInfo
Definition
EventInfo.py:1
xAOD::EventInfo
EventInfo_v1 EventInfo
Definition of the latest event info version.
Definition
IEventInfoCnvTool.h:16
type
Generated on
for ATLAS Offline Software by
1.17.0