ATLAS Offline Software
Loading...
Searching...
No Matches
GlobalSim::TIPWriterAlgTool Class Referenceabstract

AlgTool base class for all TIP writers Implements common TIP-handling operations and checks. More...

#include <TIPWriterAlgTool.h>

Inheritance diagram for GlobalSim::TIPWriterAlgTool:
Collaboration diagram for GlobalSim::TIPWriterAlgTool:

Public Member Functions

 TIPWriterAlgTool (const std::string &type, const std::string &name, const IInterface *parent)
virtual ~TIPWriterAlgTool () override=default
virtual StatusCode initialize () override
 Initialize function running before first event.
virtual StatusCode updateTIP (std::bitset< s_nbits_TIP > &, const EventContext &) const override
virtual StatusCode countPassingTOBs (const EventContext &, unsigned int &) const =0
TIPword getFullTIPWord () const override

Protected Attributes

Gaudi::Property< unsigned int > m_TIP_position
Gaudi::Property< unsigned int > m_TIP_width
ulong m_maxtob {0}

Detailed Description

AlgTool base class for all TIP writers Implements common TIP-handling operations and checks.

Definition at line 22 of file TIPWriterAlgTool.h.

Constructor & Destructor Documentation

◆ TIPWriterAlgTool()

GlobalSim::TIPWriterAlgTool::TIPWriterAlgTool ( const std::string & type,
const std::string & name,
const IInterface * parent )

Definition at line 12 of file TIPWriterAlgTool.cxx.

14 :
15 base_class(type, name, parent) {
16 }

◆ ~TIPWriterAlgTool()

virtual GlobalSim::TIPWriterAlgTool::~TIPWriterAlgTool ( )
overridevirtualdefault

Member Function Documentation

◆ countPassingTOBs()

virtual StatusCode GlobalSim::TIPWriterAlgTool::countPassingTOBs ( const EventContext & ,
unsigned int &  ) const
pure virtual

◆ getFullTIPWord()

TIPword GlobalSim::TIPWriterAlgTool::getFullTIPWord ( ) const
override

Definition at line 56 of file TIPWriterAlgTool.cxx.

56 {
57 TIPword word(m_maxtob);
58 word <<= m_TIP_position;
59 return word;
60 }
Gaudi::Property< unsigned int > m_TIP_position
std::bitset< ITIPWriterAlgTool::s_nbits_TIP > TIPword

◆ initialize()

StatusCode GlobalSim::TIPWriterAlgTool::initialize ( )
overridevirtual

Initialize function running before first event.

Definition at line 20 of file TIPWriterAlgTool.cxx.

20 {
21
22 unsigned int max_tip_pos = s_nbits_TIP - m_TIP_width;
23
24 if (m_TIP_position > max_tip_pos) {
25 ATH_MSG_ERROR("TIP word out of bounds " << m_TIP_position);
26 return StatusCode::FAILURE;
27 }
28
29 m_maxtob = std::pow(2,m_TIP_width.value()) - 1;
31 "TIP position " << m_TIP_position <<
32 ", width " << m_TIP_width <<
33 ", max TOBs " << m_maxtob);
34
35 return StatusCode::SUCCESS;
36 }
#define ATH_MSG_ERROR(x)
#define ATH_MSG_VERBOSE(x)
Gaudi::Property< unsigned int > m_TIP_width

◆ updateTIP()

StatusCode GlobalSim::TIPWriterAlgTool::updateTIP ( std::bitset< s_nbits_TIP > & word,
const EventContext & ctx ) const
overridevirtual

Definition at line 39 of file TIPWriterAlgTool.cxx.

41 {
42
43 unsigned int N_pass_tobs{0};
44 ATH_CHECK( countPassingTOBs(ctx, N_pass_tobs) );
45 ATH_MSG_DEBUG("no of passing TOBS" << N_pass_tobs);
46
47 auto count_bits = std::bitset<s_nbits_TIP>(N_pass_tobs);
48 word |= (count_bits << m_TIP_position);
49
50 ATH_MSG_DEBUG("TIP word " << word);
51
52 return StatusCode::SUCCESS;
53 }
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_DEBUG(x)
virtual StatusCode countPassingTOBs(const EventContext &, unsigned int &) const =0

Member Data Documentation

◆ m_maxtob

ulong GlobalSim::TIPWriterAlgTool::m_maxtob {0}
protected

Definition at line 56 of file TIPWriterAlgTool.h.

56{0};

◆ m_TIP_position

Gaudi::Property<unsigned int> GlobalSim::TIPWriterAlgTool::m_TIP_position
protected
Initial value:
{
this,
"TIPposition",
0,
"start position to write into the TIP"}

Definition at line 44 of file TIPWriterAlgTool.h.

44 {
45 this,
46 "TIPposition",
47 0,
48 "start position to write into the TIP"};

◆ m_TIP_width

Gaudi::Property<unsigned int> GlobalSim::TIPWriterAlgTool::m_TIP_width
protected
Initial value:
{
this,
"TIPwidth",
1,
"number of bits to write into the TIP"}

Definition at line 50 of file TIPWriterAlgTool.h.

50 {
51 this,
52 "TIPwidth",
53 1,
54 "number of bits to write into the TIP"};

The documentation for this class was generated from the following files: