ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Trigger
TrigT1
Global
GlobalSimulation
src
Hypothesis
eEmMultAlgTool.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 "
./eEmMultAlgTool.h
"
6
#include "
./CommonSelector.h
"
7
#include "
./eEmSelector.h
"
8
9
#include <fstream>
10
11
namespace
GlobalSim
{
12
13
eEmMultAlgTool::eEmMultAlgTool
(
const
std::string&
type
,
14
const
std::string& name,
15
const
IInterface* parent) :
16
base_class(
type
, name, parent) {
17
}
18
19
20
// Initialize function running before first event
21
StatusCode
eEmMultAlgTool::initialize
() {
22
23
ATH_CHECK
(
TIPWriterAlgTool::initialize
() );
24
25
CHECK
(
m_eEmTOBContainerKey
.initialize());
26
27
// create the necessary selector objects
28
m_c_selector
= std::make_unique<CommonSelector>(
m_et_low_str
,
29
m_et_high_str
,
30
m_eta_low_str
,
31
m_eta_high_str
,
32
m_phi_low_str
,
33
m_phi_high_str
34
);
35
36
try
{
37
m_e_selector
= std::make_unique<eEmSelector>(std::stoul(
m_rhad_str
),
38
m_rhad_op
,
39
std::stoul(
m_reta_str
),
40
m_reta_op
,
41
std::stoul(
m_wstot_str
),
42
m_wstot_op
43
);
44
}
catch
(
const
std::exception& e) {
45
46
ATH_MSG_ERROR
(
"Error initialising eEMSelector "
<< e.what());
47
return
StatusCode::FAILURE;
48
}
49
50
return
StatusCode::SUCCESS;
51
}
52
53
54
StatusCode
eEmMultAlgTool::countPassingTOBs
(
const
EventContext& ctx,
unsigned
int
& N_pass_tobs)
const
{
55
56
auto
tobs =
57
SG::ReadHandle<GlobalSim::IOBitwise::eEmTOBContainer>
(
m_eEmTOBContainerKey
,
58
ctx);
59
60
CHECK
(tobs.isValid());
61
62
// check if any of the incoming tobs is selected.
63
64
std::vector<bool> tob_pass(tobs->size(),
false
);
65
for
(
uint
tob_it = 0;
const
GlobalSim::IOBitwise::eEmTOB
* t : *tobs){
66
if
(
m_c_selector
->select(*t) and
m_e_selector
->select(*t)) {
67
tob_pass[tob_it] =
true
;
68
if
(++N_pass_tobs == m_maxtob){
69
break
;
70
}
71
}
72
tob_it++;
73
}
74
75
ATH_MSG_DEBUG
(
"no of passing TOBS"
<< N_pass_tobs);
76
77
if
(
m_enableDump
) {
78
std::stringstream
ss
;
79
ss
<<
"\nRun "
<< ctx <<
'\n'
;
80
std::size_t ind{0};
81
for
(
const
GlobalSim::IOBitwise::eEmTOB
* tob : *tobs) {
82
ss
<< tob->to_string() <<
' '
<< std::boolalpha <<
" pass "
<< tob_pass[ind++] <<
'\n'
;
83
}
84
ss
<<
"tob count "
<< N_pass_tobs <<
'\n'
;
85
86
std::ofstream out(name() +
".log"
, std::ios_base::app);
87
out <<
ss
.str();
88
out.close();
89
}
90
91
return
StatusCode::SUCCESS;
92
}
93
94
std::string
eEmMultAlgTool::toString
()
const
{
95
std::stringstream
ss
;
96
ss
<<name () <<
": "
<<
m_menu_name
<<
' '
97
<<
"eEmMultAlgTool read, select, count and report number of related eEmTOBS\n"
98
<<
m_c_selector
->to_string() <<
'\n'
99
<<
m_e_selector
->to_string() <<
'\n'
100
<< m_TIP_position <<
' '
<< m_TIP_width;
101
102
return
ss
.str();
103
}
104
105
}
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_DEBUG
#define ATH_MSG_DEBUG(x)
Definition
AthMsgStreamMacros.h:29
CommonSelector.h
CHECK
#define CHECK(...)
Evaluate an expression and check for errors.
Definition
Control/AthenaKernel/AthenaKernel/errorcheck.h:422
uint
unsigned int uint
Definition
LArOFPhaseFill.cxx:19
ss
static Double_t ss
Definition
LArPhysWaveHECTool.cxx:37
GlobalSim::IOBitwise::eEmTOB
Definition
Global/GlobalSimulation/src/IO/eEmTOB.h:24
GlobalSim::TIPWriterAlgTool::initialize
virtual StatusCode initialize() override
Initialize function running before first event.
Definition
TIPWriterAlgTool.cxx:20
GlobalSim::eEmMultAlgTool::m_reta_str
Gaudi::Property< std::string > m_reta_str
Definition
eEmMultAlgTool.h:103
GlobalSim::eEmMultAlgTool::m_rhad_op
Gaudi::Property< std::string > m_rhad_op
Definition
eEmMultAlgTool.h:97
GlobalSim::eEmMultAlgTool::m_enableDump
Gaudi::Property< bool > m_enableDump
Definition
eEmMultAlgTool.h:134
GlobalSim::eEmMultAlgTool::m_et_high_str
Gaudi::Property< std::string > m_et_high_str
Definition
eEmMultAlgTool.h:61
GlobalSim::eEmMultAlgTool::m_rhad_str
Gaudi::Property< std::string > m_rhad_str
Definition
eEmMultAlgTool.h:91
GlobalSim::eEmMultAlgTool::m_e_selector
std::unique_ptr< IeEmSelector > m_e_selector
Definition
eEmMultAlgTool.h:46
GlobalSim::eEmMultAlgTool::m_eta_high_str
Gaudi::Property< std::string > m_eta_high_str
Definition
eEmMultAlgTool.h:73
GlobalSim::eEmMultAlgTool::m_wstot_op
Gaudi::Property< std::string > m_wstot_op
Definition
eEmMultAlgTool.h:121
GlobalSim::eEmMultAlgTool::m_eEmTOBContainerKey
SG::ReadHandleKey< IOBitwise::eEmTOBContainer > m_eEmTOBContainerKey
Definition
eEmMultAlgTool.h:49
GlobalSim::eEmMultAlgTool::eEmMultAlgTool
eEmMultAlgTool(const std::string &type, const std::string &name, const IInterface *parent)
Definition
eEmMultAlgTool.cxx:13
GlobalSim::eEmMultAlgTool::m_eta_low_str
Gaudi::Property< std::string > m_eta_low_str
Definition
eEmMultAlgTool.h:67
GlobalSim::eEmMultAlgTool::m_et_low_str
Gaudi::Property< std::string > m_et_low_str
Definition
eEmMultAlgTool.h:55
GlobalSim::eEmMultAlgTool::m_phi_low_str
Gaudi::Property< std::string > m_phi_low_str
Definition
eEmMultAlgTool.h:79
GlobalSim::eEmMultAlgTool::toString
virtual std::string toString() const override
Definition
eEmMultAlgTool.cxx:94
GlobalSim::eEmMultAlgTool::countPassingTOBs
virtual StatusCode countPassingTOBs(const EventContext &, unsigned int &N_pass_tobs) const override
Definition
eEmMultAlgTool.cxx:54
GlobalSim::eEmMultAlgTool::m_c_selector
std::unique_ptr< ICommonSelector > m_c_selector
Definition
eEmMultAlgTool.h:45
GlobalSim::eEmMultAlgTool::initialize
virtual StatusCode initialize() override
Initialize function running before first event.
Definition
eEmMultAlgTool.cxx:21
GlobalSim::eEmMultAlgTool::m_phi_high_str
Gaudi::Property< std::string > m_phi_high_str
Definition
eEmMultAlgTool.h:85
GlobalSim::eEmMultAlgTool::m_menu_name
Gaudi::Property< std::string > m_menu_name
Definition
eEmMultAlgTool.h:127
GlobalSim::eEmMultAlgTool::m_reta_op
Gaudi::Property< std::string > m_reta_op
Definition
eEmMultAlgTool.h:109
GlobalSim::eEmMultAlgTool::m_wstot_str
Gaudi::Property< std::string > m_wstot_str
Definition
eEmMultAlgTool.h:115
SG::ReadHandle
Definition
StoreGate/StoreGate/ReadHandle.h:67
eEmMultAlgTool.h
eEmSelector.h
GlobalSim
AlgTool to read in LArStripNeighborhoods, and run the BDT Algorithm.
Definition
Trigger/TrigT1/Global/GlobalSimulation/src/Egamma1BDT/Egamma1BDT/BDT.h:11
type
Generated on
for ATLAS Offline Software by
1.17.0