ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
DataQuality
GoodRunsLists
Root
GRLSelectorAlg.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
// GoodRunsLists includes
6
#include <
AsgMessaging/MessageCheck.h
>
7
#include <
EventBookkeeperTools/FilterReporter.h
>
8
#include <
GoodRunsLists/GRLSelectorAlg.h
>
9
#include <
xAODEventInfo/EventInfo.h
>
10
#include "
AsgDataHandles/WriteDecorHandle.h
"
11
12
GRLSelectorAlg::GRLSelectorAlg
(
const
std::string& name, ISvcLocator* pSvcLocator ) :
AnaAlgorithm
( name, pSvcLocator )
13
,
m_grlTool
(
"GoodRunsListSelectionTool"
, this)
14
{
15
16
declareProperty
(
"Tool"
,
m_grlTool
,
"The GoodRunsListSelectionTool"
);
17
18
}
19
20
21
GRLSelectorAlg::~GRLSelectorAlg
() {}
22
23
24
StatusCode
GRLSelectorAlg::initialize
() {
25
//ATH_MSG_INFO ("Initializing " << name() << "...");
26
ANA_CHECK
(
m_grlTool
.retrieve() );
27
ANA_CHECK
(
m_filterParams
.initialize() );
28
ANA_CHECK
(
m_grlKey
.initialize() );
29
return
StatusCode::SUCCESS;
30
}
31
32
StatusCode
GRLSelectorAlg::finalize
() {
33
//ATH_MSG_INFO ("Finalizing " << name() << "...");
34
ANA_MSG_INFO
(
m_filterParams
.summary());
35
return
StatusCode::SUCCESS;
36
}
37
38
StatusCode
GRLSelectorAlg::execute
() {
39
FilterReporter
filter (
m_filterParams
,
m_noFilter
.value());
40
41
const
xAOD::EventInfo
* evtInfo = 0;
42
ANA_CHECK
(
evtStore
()->retrieve( evtInfo,
"EventInfo"
) );
43
44
SG::WriteDecorHandle<xAOD::EventInfo,char>
dec_isGRLDecorator(
m_grlKey
);
45
46
const
bool
isSelected =
m_grlTool
->passRunLB(*evtInfo);
47
dec_isGRLDecorator(*evtInfo) = isSelected;
48
if
(!isSelected)
return
StatusCode::SUCCESS;
49
50
filter.setPassed (
true
);
51
52
return
StatusCode::SUCCESS;
53
}
WriteDecorHandle.h
Handle class for adding a decoration to an object.
MessageCheck.h
macros for messaging and checking status codes
ANA_MSG_INFO
#define ANA_MSG_INFO(xmsg)
Macro printing info messages.
Definition
Control/AthToolSupport/AsgMessaging/AsgMessaging/MessageCheck.h:288
ANA_CHECK
#define ANA_CHECK(EXP)
check whether the given expression was successful
Definition
Control/AthToolSupport/AsgMessaging/AsgMessaging/MessageCheck.h:322
FilterReporter.h
GRLSelectorAlg.h
AthCommonAlgorithm< Gaudi::Algorithm >::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)
Definition
AthCommonDataStore.h:145
AthCommonAlgorithm< Gaudi::Algorithm >::evtStore
ServiceHandle< StoreGateSvc > & evtStore()
Definition
AthCommonDataStore.h:85
EL::AnaAlgorithm::AnaAlgorithm
AnaAlgorithm(const std::string &name, ISvcLocator *pSvcLocator)
constructor with parameters
Definition
AnaAlgorithm.cxx:40
FilterReporter
a guard class for use with ref FilterReporterParams
Definition
FilterReporter.h:35
GRLSelectorAlg::GRLSelectorAlg
GRLSelectorAlg(const std::string &name, ISvcLocator *pSvcLocator)
Definition
GRLSelectorAlg.cxx:12
GRLSelectorAlg::initialize
virtual StatusCode initialize()
Definition
GRLSelectorAlg.cxx:24
GRLSelectorAlg::finalize
virtual StatusCode finalize()
Definition
GRLSelectorAlg.cxx:32
GRLSelectorAlg::~GRLSelectorAlg
virtual ~GRLSelectorAlg()
Definition
GRLSelectorAlg.cxx:21
GRLSelectorAlg::m_filterParams
FilterReporterParams m_filterParams
Definition
GRLSelectorAlg.h:33
GRLSelectorAlg::m_noFilter
Gaudi::Property< bool > m_noFilter
Definition
GRLSelectorAlg.h:34
GRLSelectorAlg::execute
virtual StatusCode execute()
Definition
GRLSelectorAlg.cxx:38
GRLSelectorAlg::m_grlTool
ToolHandle< IGoodRunsListSelectionTool > m_grlTool
Definition
GRLSelectorAlg.h:32
GRLSelectorAlg::m_grlKey
SG::WriteDecorHandleKey< xAOD::EventInfo > m_grlKey
Definition
GRLSelectorAlg.h:31
SG::WriteDecorHandle
Handle class for adding a decoration to an object.
Definition
StoreGate/StoreGate/WriteDecorHandle.h:100
xAOD::EventInfo
EventInfo_v1 EventInfo
Definition of the latest event info version.
Definition
IEventInfoCnvTool.h:16
EventInfo.h
Generated on
for ATLAS Offline Software by
1.17.0