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 std::unique_ptr< IDataCollector > &, 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 60 of file TIPWriterAlgTool.cxx.

60 {
61 TIPword word(m_maxtob);
62 word <<= m_TIP_position;
63 return word;
64 }
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 std::unique_ptr< IDataCollector > & dc,
const EventContext & ctx ) const
overridevirtual

Definition at line 39 of file TIPWriterAlgTool.cxx.

42 {
43
44 if (dc){dc->collect(*this, "start");}
45
46 unsigned int N_pass_tobs{0};
47 ATH_CHECK( countPassingTOBs(ctx, N_pass_tobs) );
48 ATH_MSG_DEBUG("no of passing TOBS" << N_pass_tobs);
49
50 auto count_bits = std::bitset<s_nbits_TIP>(N_pass_tobs);
51 word |= (count_bits << m_TIP_position);
52
53 ATH_MSG_DEBUG("TIP word " << word);
54 if (dc){dc->collect(*this, "end");}
55
56 return StatusCode::SUCCESS;
57 }
#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 57 of file TIPWriterAlgTool.h.

57{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 45 of file TIPWriterAlgTool.h.

45 {
46 this,
47 "TIPposition",
48 0,
49 "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 51 of file TIPWriterAlgTool.h.

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

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