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