ATLAS Offline Software
TBPhaseStreamerTool.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #include "TBPhaseStreamerTool.h"
6 #include "TBEvent/TBPhase.h"
7 #include <string>
8 #include <ios>
9 
11  const std::string& name,
12  const IInterface* parent)
14  , m_guardValue(11.) // in TDC counts
15  , m_TBPhaseKey("TBPhase")
16 {
17  declareInterface<TBEventStreamerTool>(this);
18  declareProperty("TBPhaseKey",m_TBPhaseKey);
20 }
21 
23 { }
24 
26 // Initialize //
28 
30 {
31  MsgStream report(msgSvc(),name());
32 
33  report << MSG::INFO << " Cut events using guard value: " << m_guardValue;
34 
35  return StatusCode::SUCCESS;
36 }
37 
39 // Accept/Reject //
41 
43 {
44  MsgStream report(msgSvc(),name());
45 
46  const TBPhase* thePhase = 0;
47  ATH_CHECK( evtStore()->retrieve(thePhase,m_TBPhaseKey) );
48 
49  // Get the absolute value of the distance of the TDC-WAC
50  float dTtoWAC = thePhase->getdTtoWAC();
51 
52  return (dTtoWAC > m_guardValue)
53  ? StatusCode::SUCCESS
54  : StatusCode::FAILURE;
55 }
python.PyKernel.retrieve
def retrieve(aClass, aKey=None)
Definition: PyKernel.py:110
TBPhaseStreamerTool::accept
virtual StatusCode accept() override
Definition: TBPhaseStreamerTool.cxx:42
TBPhase::getdTtoWAC
float getdTtoWAC() const
Definition: TBPhase.h:45
AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
Definition: AthCommonDataStore.h:145
TBPhaseStreamerTool::m_TBPhaseKey
std::string m_TBPhaseKey
Definition: TBPhaseStreamerTool.h:44
checkTP.report
report
Definition: checkTP.py:127
TBPhaseStreamerTool::TBPhaseStreamerTool
TBPhaseStreamerTool(const std::string &type, const std::string &name, const IInterface *parent)
Definition: TBPhaseStreamerTool.cxx:10
TBPhaseStreamerTool.h
AthCommonDataStore< AthCommonMsg< AlgTool > >::evtStore
ServiceHandle< StoreGateSvc > & evtStore()
The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.
Definition: AthCommonDataStore.h:85
StdJOSetup.msgSvc
msgSvc
Provide convenience handles for various services.
Definition: StdJOSetup.py:36
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
test_pyathena.parent
parent
Definition: test_pyathena.py:15
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
TBPhaseStreamerTool::initializeTool
virtual StatusCode initializeTool() override
Definition: TBPhaseStreamerTool.cxx:29
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:195
TBPhase
Definition: TBPhase.h:22
TBEventStreamerTool
Definition: TBEventStreamerTool.h:15
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
TBPhase.h
TBPhaseStreamerTool::m_guardValue
float m_guardValue
Definition: TBPhaseStreamerTool.h:43
TBPhaseStreamerTool::~TBPhaseStreamerTool
virtual ~TBPhaseStreamerTool()
Definition: TBPhaseStreamerTool.cxx:22