ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Trigger
TrigT1
Global
GlobalSimulation
src
Hypothesis
CommonMultAlgTool.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 "
./CommonMultAlgTool.h
"
6
#include "
./CommonSelector.h
"
7
8
#include <fstream>
9
10
namespace
GlobalSim
{
11
12
CommonMultAlgTool::CommonMultAlgTool
(
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
CommonMultAlgTool::initialize
() {
21
22
ATH_CHECK
(
TIPWriterAlgTool::initialize
() );
23
24
CHECK
(
m_CommonTOBContainerKey
.initialize());
25
26
// create the necessary selector objects
27
m_c_selector
= std::make_unique<CommonSelector>(
m_et_low_str
,
28
m_et_high_str
,
29
m_eta_low_str
,
30
m_eta_high_str
,
31
m_phi_low_str
,
32
m_phi_high_str
33
);
34
35
return
StatusCode::SUCCESS;
36
}
37
38
39
StatusCode
CommonMultAlgTool::countPassingTOBs
(
const
EventContext& ctx,
unsigned
int
& N_pass_tobs)
const
{
40
auto
tobs =
41
SG::ReadHandle<GlobalSim::IOBitwise::CommonTOBContainer>
(
m_CommonTOBContainerKey
,
42
ctx);
43
44
CHECK
(tobs.isValid());
45
46
// check if any of the incoming tobs is selected.
47
N_pass_tobs = 0;
48
std::vector<bool> tob_pass(tobs->size(),
false
);
49
for
(
int
tob_it = 0;
const
GlobalSim::IOBitwise::CommonTOB
* t : *tobs){
50
if
(
m_c_selector
->select(*t)) {
51
tob_pass[tob_it] =
true
;
52
if
(++N_pass_tobs == m_maxtob){
53
break
;
54
}
55
}
56
tob_it++;
57
}
58
59
if
(
m_enableDump
) {
60
std::stringstream
ss
;
61
ss
<<
"\nRun "
<< ctx <<
'\n'
;
62
std::size_t ind{0};
63
for
(
const
GlobalSim::IOBitwise::CommonTOB
* tob : *tobs) {
64
ss
<< tob->to_string() <<
' '
<< std::boolalpha <<
" pass "
<< tob_pass[ind++] <<
'\n'
;
65
}
66
ss
<<
"tob count "
<< N_pass_tobs <<
'\n'
;
67
68
std::ofstream out(name() +
".log"
, std::ios_base::app);
69
out <<
ss
.str();
70
out.close();
71
}
72
73
return
StatusCode::SUCCESS;
74
}
75
76
std::string
CommonMultAlgTool::toString
()
const
{
77
std::stringstream
ss
;
78
ss
<<name () <<
": "
<<
m_menu_name
<<
' '
79
<<
"CommonMultAlgTool read, select, count and report number of related CommonTOBS\n"
80
<<
m_c_selector
->to_string() <<
'\n'
81
<< m_TIP_position <<
' '
<< m_TIP_width;
82
83
return
ss
.str();
84
}
85
86
}
ATH_CHECK
#define ATH_CHECK
Evaluate an expression and check for errors.
Definition
AthCheckMacros.h:40
CommonMultAlgTool.h
CommonSelector.h
CHECK
#define CHECK(...)
Evaluate an expression and check for errors.
Definition
Control/AthenaKernel/AthenaKernel/errorcheck.h:422
ss
static Double_t ss
Definition
LArPhysWaveHECTool.cxx:37
GlobalSim::CommonMultAlgTool::m_CommonTOBContainerKey
SG::ReadHandleKey< IOBitwise::CommonTOBContainer > m_CommonTOBContainerKey
Definition
CommonMultAlgTool.h:46
GlobalSim::CommonMultAlgTool::m_et_high_str
Gaudi::Property< std::string > m_et_high_str
Definition
CommonMultAlgTool.h:58
GlobalSim::CommonMultAlgTool::m_eta_low_str
Gaudi::Property< std::string > m_eta_low_str
Definition
CommonMultAlgTool.h:64
GlobalSim::CommonMultAlgTool::countPassingTOBs
virtual StatusCode countPassingTOBs(const EventContext &, unsigned int &N_pass_tobs) const override
Definition
CommonMultAlgTool.cxx:39
GlobalSim::CommonMultAlgTool::m_menu_name
Gaudi::Property< std::string > m_menu_name
Definition
CommonMultAlgTool.h:88
GlobalSim::CommonMultAlgTool::m_et_low_str
Gaudi::Property< std::string > m_et_low_str
Definition
CommonMultAlgTool.h:52
GlobalSim::CommonMultAlgTool::m_phi_low_str
Gaudi::Property< std::string > m_phi_low_str
Definition
CommonMultAlgTool.h:76
GlobalSim::CommonMultAlgTool::toString
virtual std::string toString() const override
Definition
CommonMultAlgTool.cxx:76
GlobalSim::CommonMultAlgTool::CommonMultAlgTool
CommonMultAlgTool(const std::string &type, const std::string &name, const IInterface *parent)
Definition
CommonMultAlgTool.cxx:12
GlobalSim::CommonMultAlgTool::m_eta_high_str
Gaudi::Property< std::string > m_eta_high_str
Definition
CommonMultAlgTool.h:70
GlobalSim::CommonMultAlgTool::m_enableDump
Gaudi::Property< bool > m_enableDump
Definition
CommonMultAlgTool.h:95
GlobalSim::CommonMultAlgTool::m_c_selector
std::unique_ptr< ICommonSelector > m_c_selector
Definition
CommonMultAlgTool.h:44
GlobalSim::CommonMultAlgTool::initialize
virtual StatusCode initialize() override
Initialize function running before first event.
Definition
CommonMultAlgTool.cxx:20
GlobalSim::CommonMultAlgTool::m_phi_high_str
Gaudi::Property< std::string > m_phi_high_str
Definition
CommonMultAlgTool.h:82
GlobalSim::IOBitwise::CommonTOB
Definition
CommonTOB.h:22
GlobalSim::TIPWriterAlgTool::initialize
virtual StatusCode initialize() override
Initialize function running before first event.
Definition
TIPWriterAlgTool.cxx:20
SG::ReadHandle
Definition
StoreGate/StoreGate/ReadHandle.h:67
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