ATLAS Offline Software
Loading...
Searching...
No Matches
TIPWriterAlgTool.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
3*/
4
6
7#include <cmath>
8#include <fstream>
9
10namespace GlobalSim {
11
13 const std::string& name,
14 const IInterface* parent) :
15 base_class(type, name, parent) {
16 }
17
18
19 // Initialize function running before first event
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);
35 return StatusCode::SUCCESS;
36 }
37
38
40 std::bitset<s_nbits_TIP>& word,
41 const EventContext& ctx) const {
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 }
54
55
57 TIPword word(m_maxtob);
58 word <<= m_TIP_position;
59 return word;
60 }
61
62}
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_ERROR(x)
#define ATH_MSG_VERBOSE(x)
#define ATH_MSG_DEBUG(x)
virtual StatusCode updateTIP(std::bitset< s_nbits_TIP > &, const EventContext &) const override
Gaudi::Property< unsigned int > m_TIP_position
Gaudi::Property< unsigned int > m_TIP_width
virtual StatusCode countPassingTOBs(const EventContext &, unsigned int &) const =0
TIPWriterAlgTool(const std::string &type, const std::string &name, const IInterface *parent)
virtual StatusCode initialize() override
Initialize function running before first event.
TIPword getFullTIPWord() const override
AlgTool to read in LArStripNeighborhoods, and run the eRatio Algorithm.
std::bitset< ITIPWriterAlgTool::s_nbits_TIP > TIPword