ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Trigger
TrigT1
Global
GlobalSimulation
src
GlobalSimComponents
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
5
#include "
./TIPWriterAlgTool.h
"
6
7
#include <cmath>
8
#include <fstream>
9
10
namespace
GlobalSim
{
11
12
TIPWriterAlgTool::TIPWriterAlgTool
(
const
std::string&
type
,
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
20
StatusCode
TIPWriterAlgTool::initialize
() {
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;
30
ATH_MSG_VERBOSE
(
31
"TIP position "
<<
m_TIP_position
<<
32
", width "
<<
m_TIP_width
<<
33
", max TOBs "
<<
m_maxtob
);
34
35
return
StatusCode::SUCCESS;
36
}
37
38
39
StatusCode
TIPWriterAlgTool::updateTIP
(
40
std::bitset<s_nbits_TIP>& word,
41
const
std::unique_ptr<IDataCollector>& dc,
42
const
EventContext& ctx)
const
{
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
}
58
59
60
TIPword
TIPWriterAlgTool::getFullTIPWord
()
const
{
61
TIPword
word(
m_maxtob
);
62
word <<=
m_TIP_position
;
63
return
word;
64
}
65
66
}
ATH_CHECK
#define ATH_CHECK
Evaluate an expression and check for errors.
Definition
AthCheckMacros.h:40
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition
AthMsgStreamMacros.h:33
ATH_MSG_VERBOSE
#define ATH_MSG_VERBOSE(x)
Definition
AthMsgStreamMacros.h:28
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition
AthMsgStreamMacros.h:29
TIPWriterAlgTool.h
GlobalSim::TIPWriterAlgTool::m_TIP_position
Gaudi::Property< unsigned int > m_TIP_position
Definition
TIPWriterAlgTool.h:45
GlobalSim::TIPWriterAlgTool::m_TIP_width
Gaudi::Property< unsigned int > m_TIP_width
Definition
TIPWriterAlgTool.h:51
GlobalSim::TIPWriterAlgTool::countPassingTOBs
virtual StatusCode countPassingTOBs(const EventContext &, unsigned int &) const =0
GlobalSim::TIPWriterAlgTool::TIPWriterAlgTool
TIPWriterAlgTool(const std::string &type, const std::string &name, const IInterface *parent)
Definition
TIPWriterAlgTool.cxx:12
GlobalSim::TIPWriterAlgTool::updateTIP
virtual StatusCode updateTIP(std::bitset< s_nbits_TIP > &, const std::unique_ptr< IDataCollector > &, const EventContext &) const override
Definition
TIPWriterAlgTool.cxx:39
GlobalSim::TIPWriterAlgTool::initialize
virtual StatusCode initialize() override
Initialize function running before first event.
Definition
TIPWriterAlgTool.cxx:20
GlobalSim::TIPWriterAlgTool::m_maxtob
ulong m_maxtob
Definition
TIPWriterAlgTool.h:57
GlobalSim::TIPWriterAlgTool::getFullTIPWord
TIPword getFullTIPWord() const override
Definition
TIPWriterAlgTool.cxx:60
GlobalSim
AlgTool to read in LArStripNeighborhoods, and run the BDT Algorithm.
Definition
Trigger/TrigT1/Global/GlobalSimulation/src/Egamma1BDT/Egamma1BDT/BDT.h:11
GlobalSim::TIPword
std::bitset< ITIPWriterAlgTool::s_nbits_TIP > TIPword
Definition
ITIPWriterAlgTool.h:40
type
Generated on
for ATLAS Offline Software by
1.17.0