ATLAS Offline Software
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
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 
22 
23 
25  //ATH_MSG_INFO ("Initializing " << name() << "...");
26  ANA_CHECK( m_grlTool.retrieve() );
29  return StatusCode::SUCCESS;
30 }
31 
33  //ATH_MSG_INFO ("Finalizing " << name() << "...");
35  return StatusCode::SUCCESS;
36 }
37 
40 
41  const xAOD::EventInfo* evtInfo = 0;
42  ANA_CHECK( evtStore()->retrieve( evtInfo, "EventInfo" ) );
43 
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 }
python.PyKernel.retrieve
def retrieve(aClass, aKey=None)
Definition: PyKernel.py:110
FilterReporter
a guard class for use with ref FilterReporterParams
Definition: FilterReporter.h:35
GRLSelectorAlg::execute
virtual StatusCode execute()
Definition: GRLSelectorAlg.cxx:38
AthCommonDataStore< AthCommonMsg< Algorithm > >::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
Definition: AthCommonDataStore.h:145
GRLSelectorAlg::m_noFilter
Gaudi::Property< bool > m_noFilter
Definition: GRLSelectorAlg.h:34
ANA_CHECK
#define ANA_CHECK(EXP)
check whether the given expression was successful
Definition: Control/AthToolSupport/AsgMessaging/AsgMessaging/MessageCheck.h:324
GRLSelectorAlg::~GRLSelectorAlg
virtual ~GRLSelectorAlg()
Definition: GRLSelectorAlg.cxx:21
covarianceTool.filter
filter
Definition: covarianceTool.py:514
GRLSelectorAlg::m_grlTool
ToolHandle< IGoodRunsListSelectionTool > m_grlTool
Definition: GRLSelectorAlg.h:32
AthCommonDataStore< AthCommonMsg< Algorithm > >::evtStore
ServiceHandle< StoreGateSvc > & evtStore()
The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.
Definition: AthCommonDataStore.h:85
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
SG::WriteDecorHandle
Handle class for adding a decoration to an object.
Definition: StoreGate/StoreGate/WriteDecorHandle.h:100
ANA_MSG_INFO
#define ANA_MSG_INFO(xmsg)
Macro printing info messages.
Definition: Control/AthToolSupport/AsgMessaging/AsgMessaging/MessageCheck.h:290
MessageCheck.h
macros for messaging and checking status codes
FilterReporterParams::initialize
StatusCode initialize(bool enabled=true)
do anything we need to do in initialize
Definition: FilterReporterParams.cxx:24
GRLSelectorAlg::GRLSelectorAlg
GRLSelectorAlg(const std::string &name, ISvcLocator *pSvcLocator)
Definition: GRLSelectorAlg.cxx:12
WriteDecorHandle.h
Handle class for adding a decoration to an object.
FilterReporter.h
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:221
GRLSelectorAlg::m_grlKey
SG::WriteDecorHandleKey< xAOD::EventInfo > m_grlKey
Definition: GRLSelectorAlg.h:31
EventInfo.h
xAOD::EventInfo_v1
Class describing the basic event information.
Definition: EventInfo_v1.h:43
GRLSelectorAlg::initialize
virtual StatusCode initialize()
Definition: GRLSelectorAlg.cxx:24
SG::WriteDecorHandleKey::initialize
StatusCode initialize(bool used=true)
If this object is used as a property, then this should be called during the initialize phase.
GRLSelectorAlg.h
GRLSelectorAlg::m_filterParams
FilterReporterParams m_filterParams
Definition: GRLSelectorAlg.h:33
GRLSelectorAlg::finalize
virtual StatusCode finalize()
Definition: GRLSelectorAlg.cxx:32
FilterReporterParams::summary
std::string summary()
report the status of filtering
Definition: FilterReporterParams.cxx:60