ATLAS Offline Software
Loading...
Searching...
No Matches
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
6#include "TBEvent/TBPhase.h"
7#include <string>
8#include <ios>
9
11 const std::string& name,
12 const IInterface* parent)
13 : TBEventStreamerTool(type,name,parent)
14 , m_guardValue(11.) // in TDC counts
15 , m_TBPhaseKey("TBPhase")
16{
17 declareInterface<TBEventStreamerTool>(this);
18 declareProperty("TBPhaseKey",m_TBPhaseKey);
20}
21
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}
#define ATH_CHECK
Evaluate an expression and check for errors.
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)
ServiceHandle< StoreGateSvc > & evtStore()
TBEventStreamerTool(const std::string &name, const std::string &type, const IInterface *parent)
TBPhaseStreamerTool(const std::string &type, const std::string &name, const IInterface *parent)
virtual StatusCode accept() override
virtual StatusCode initializeTool() override
float getdTtoWAC() const
Definition TBPhase.h:45