ATLAS Offline Software
Loading...
Searching...
No Matches
GlobalSim::eEmMultAlgTool Class Reference

AlgTool to count GlobalSim::IOBitwise::eEmTOB objects. More...

#include <eEmMultAlgTool.h>

Inheritance diagram for GlobalSim::eEmMultAlgTool:
Collaboration diagram for GlobalSim::eEmMultAlgTool:

Public Member Functions

 eEmMultAlgTool (const std::string &type, const std::string &name, const IInterface *parent)
virtual ~eEmMultAlgTool () override=default
virtual StatusCode initialize () override
 Initialize function running before first event.
virtual StatusCode countPassingTOBs (const EventContext &, unsigned int &N_pass_tobs) const override
virtual std::string toString () const override
virtual StatusCode updateTIP (std::bitset< s_nbits_TIP > &, const EventContext &) const override

Private Attributes

std::unique_ptr< ICommonSelectorm_c_selector {nullptr}
std::unique_ptr< IeEmSelectorm_e_selector {nullptr}
SG::ReadHandleKey< IOBitwise::eEmTOBContainerm_eEmTOBContainerKey
Gaudi::Property< std::string > m_et_low_str
Gaudi::Property< std::string > m_et_high_str
Gaudi::Property< std::string > m_eta_low_str
Gaudi::Property< std::string > m_eta_high_str
Gaudi::Property< std::string > m_phi_low_str
Gaudi::Property< std::string > m_phi_high_str
Gaudi::Property< std::string > m_rhad_str
Gaudi::Property< std::string > m_rhad_op
Gaudi::Property< std::string > m_reta_str
Gaudi::Property< std::string > m_reta_op
Gaudi::Property< std::string > m_wstot_str
Gaudi::Property< std::string > m_wstot_op
Gaudi::Property< std::string > m_menu_name
Gaudi::Property< bool > m_enableDump

Detailed Description

AlgTool to count GlobalSim::IOBitwise::eEmTOB objects.

Definition at line 25 of file eEmMultAlgTool.h.

Constructor & Destructor Documentation

◆ eEmMultAlgTool()

GlobalSim::eEmMultAlgTool::eEmMultAlgTool ( const std::string & type,
const std::string & name,
const IInterface * parent )

Definition at line 13 of file eEmMultAlgTool.cxx.

15 :
16 base_class(type, name, parent) {
17 }

◆ ~eEmMultAlgTool()

virtual GlobalSim::eEmMultAlgTool::~eEmMultAlgTool ( )
overridevirtualdefault

Member Function Documentation

◆ countPassingTOBs()

StatusCode GlobalSim::eEmMultAlgTool::countPassingTOBs ( const EventContext & ctx,
unsigned int & N_pass_tobs ) const
overridevirtual

Definition at line 54 of file eEmMultAlgTool.cxx.

54 {
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 }
#define ATH_MSG_DEBUG(x)
#define CHECK(...)
Evaluate an expression and check for errors.
unsigned int uint
static Double_t ss
Gaudi::Property< bool > m_enableDump
std::unique_ptr< IeEmSelector > m_e_selector
SG::ReadHandleKey< IOBitwise::eEmTOBContainer > m_eEmTOBContainerKey
std::unique_ptr< ICommonSelector > m_c_selector

◆ initialize()

StatusCode GlobalSim::eEmMultAlgTool::initialize ( )
overridevirtual

Initialize function running before first event.

Definition at line 21 of file eEmMultAlgTool.cxx.

21 {
22
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,
34 );
35
36 try {
37 m_e_selector = std::make_unique<eEmSelector>(std::stoul(m_rhad_str),
39 std::stoul(m_reta_str),
41 std::stoul(m_wstot_str),
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 }
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_ERROR(x)
virtual StatusCode initialize() override
Initialize function running before first event.
Gaudi::Property< std::string > m_reta_str
Gaudi::Property< std::string > m_rhad_op
Gaudi::Property< std::string > m_et_high_str
Gaudi::Property< std::string > m_rhad_str
Gaudi::Property< std::string > m_eta_high_str
Gaudi::Property< std::string > m_wstot_op
Gaudi::Property< std::string > m_eta_low_str
Gaudi::Property< std::string > m_et_low_str
Gaudi::Property< std::string > m_phi_low_str
Gaudi::Property< std::string > m_phi_high_str
Gaudi::Property< std::string > m_reta_op
Gaudi::Property< std::string > m_wstot_str

◆ toString()

std::string GlobalSim::eEmMultAlgTool::toString ( ) const
overridevirtual

Definition at line 94 of file eEmMultAlgTool.cxx.

94 {
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 }
Gaudi::Property< std::string > m_menu_name

◆ updateTIP()

StatusCode GlobalSim::TIPWriterAlgTool::updateTIP ( std::bitset< s_nbits_TIP > & word,
const EventContext & ctx ) const
override

Definition at line 34 of file TIPWriterAlgTool.cxx.

41 {
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 }
virtual StatusCode countPassingTOBs(const EventContext &, unsigned int &N_pass_tobs) const override

Member Data Documentation

◆ m_c_selector

std::unique_ptr<ICommonSelector> GlobalSim::eEmMultAlgTool::m_c_selector {nullptr}
private

Definition at line 45 of file eEmMultAlgTool.h.

45{nullptr};

◆ m_e_selector

std::unique_ptr<IeEmSelector> GlobalSim::eEmMultAlgTool::m_e_selector {nullptr}
private

Definition at line 46 of file eEmMultAlgTool.h.

46{nullptr};

◆ m_eEmTOBContainerKey

SG::ReadHandleKey<IOBitwise::eEmTOBContainer> GlobalSim::eEmMultAlgTool::m_eEmTOBContainerKey
private
Initial value:
{
this,
"eEmTOBs",
"eEmTOBs",
"Key for GlobalSim eEmTOB container"}

Definition at line 49 of file eEmMultAlgTool.h.

49 {
50 this,
51 "eEmTOBs",
52 "eEmTOBs",
53 "Key for GlobalSim eEmTOB container"};

◆ m_enableDump

Gaudi::Property<bool> GlobalSim::eEmMultAlgTool::m_enableDump
private
Initial value:
{
this,
"enable_dump",
false,
"flag to enable debug dumps"
}

Definition at line 134 of file eEmMultAlgTool.h.

134 {
135 this,
136 "enable_dump",
137 false,
138 "flag to enable debug dumps"
139 };

◆ m_et_high_str

Gaudi::Property<std::string> GlobalSim::eEmMultAlgTool::m_et_high_str
private
Initial value:
{
this,
"et_high",
"inf",
"et high for window selector"}

Definition at line 61 of file eEmMultAlgTool.h.

61 {
62 this,
63 "et_high",
64 "inf",
65 "et high for window selector"};

◆ m_et_low_str

Gaudi::Property<std::string> GlobalSim::eEmMultAlgTool::m_et_low_str
private
Initial value:
{
this,
"et_low",
"0",
"et low for window selector"}

Definition at line 55 of file eEmMultAlgTool.h.

55 {
56 this,
57 "et_low",
58 "0",
59 "et low for window selector"};

◆ m_eta_high_str

Gaudi::Property<std::string> GlobalSim::eEmMultAlgTool::m_eta_high_str
private
Initial value:
{
this,
"eta_high",
"inf",
"eta high for window selector"}

Definition at line 73 of file eEmMultAlgTool.h.

73 {
74 this,
75 "eta_high",
76 "inf",
77 "eta high for window selector"};

◆ m_eta_low_str

Gaudi::Property<std::string> GlobalSim::eEmMultAlgTool::m_eta_low_str
private
Initial value:
{
this,
"eta_low",
"0",
"eta low for window selector"}

Definition at line 67 of file eEmMultAlgTool.h.

67 {
68 this,
69 "eta_low",
70 "0",
71 "eta low for window selector"};

◆ m_menu_name

Gaudi::Property<std::string> GlobalSim::eEmMultAlgTool::m_menu_name
private
Initial value:
{
this,
"menu_name",
"unknown",
"name from json menu file"
}

Definition at line 127 of file eEmMultAlgTool.h.

127 {
128 this,
129 "menu_name",
130 "unknown",
131 "name from json menu file"
132 };

◆ m_phi_high_str

Gaudi::Property<std::string> GlobalSim::eEmMultAlgTool::m_phi_high_str
private
Initial value:
{
this,
"phi_high",
"inf",
"phi high for window selector"}

Definition at line 85 of file eEmMultAlgTool.h.

85 {
86 this,
87 "phi_high",
88 "inf",
89 "phi high for window selector"};

◆ m_phi_low_str

Gaudi::Property<std::string> GlobalSim::eEmMultAlgTool::m_phi_low_str
private
Initial value:
{
this,
"phi_low",
"0",
"phi low for window selector"}

Definition at line 79 of file eEmMultAlgTool.h.

79 {
80 this,
81 "phi_low",
82 "0",
83 "phi low for window selector"};

◆ m_reta_op

Gaudi::Property<std::string> GlobalSim::eEmMultAlgTool::m_reta_op
private
Initial value:
{
this,
"reta_op",
"unknown",
"reta cut operator"}

Definition at line 109 of file eEmMultAlgTool.h.

109 {
110 this,
111 "reta_op",
112 "unknown",
113 "reta cut operator"};

◆ m_reta_str

Gaudi::Property<std::string> GlobalSim::eEmMultAlgTool::m_reta_str
private
Initial value:
{
this,
"reta",
"0",
"reta cut value"}

Definition at line 103 of file eEmMultAlgTool.h.

103 {
104 this,
105 "reta",
106 "0",
107 "reta cut value"};

◆ m_rhad_op

Gaudi::Property<std::string> GlobalSim::eEmMultAlgTool::m_rhad_op
private
Initial value:
{
this,
"rhad_op",
"unknown",
"rhad cut operator"}

Definition at line 97 of file eEmMultAlgTool.h.

97 {
98 this,
99 "rhad_op",
100 "unknown",
101 "rhad cut operator"};

◆ m_rhad_str

Gaudi::Property<std::string> GlobalSim::eEmMultAlgTool::m_rhad_str
private
Initial value:
{
this,
"rhad",
"0",
"rhad cut value"}

Definition at line 91 of file eEmMultAlgTool.h.

91 {
92 this,
93 "rhad",
94 "0",
95 "rhad cut value"};

◆ m_wstot_op

Gaudi::Property<std::string> GlobalSim::eEmMultAlgTool::m_wstot_op
private
Initial value:
{
this,
"wstot_op",
"unknown",
"wstot cut_operator"}

Definition at line 121 of file eEmMultAlgTool.h.

121 {
122 this,
123 "wstot_op",
124 "unknown",
125 "wstot cut_operator"};

◆ m_wstot_str

Gaudi::Property<std::string> GlobalSim::eEmMultAlgTool::m_wstot_str
private
Initial value:
{
this,
"wstot",
"0",
"wstot lcut_value"}

Definition at line 115 of file eEmMultAlgTool.h.

115 {
116 this,
117 "wstot",
118 "0",
119 "wstot lcut_value"};

The documentation for this class was generated from the following files: