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 &, const std::unique_ptr< IDataCollector > &dc, unsigned int &N_pass_tobs) const override
virtual std::string toString () const override
virtual StatusCode updateTIP (std::bitset< s_nbits_TIP > &, const std::unique_ptr< IDataCollector > &, 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 14 of file eEmMultAlgTool.cxx.

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

◆ ~eEmMultAlgTool()

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

Member Function Documentation

◆ countPassingTOBs()

StatusCode GlobalSim::eEmMultAlgTool::countPassingTOBs ( const EventContext & ctx,
const std::unique_ptr< IDataCollector > & dc,
unsigned int & N_pass_tobs ) const
overridevirtual

Definition at line 56 of file eEmMultAlgTool.cxx.

58 {
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 }
#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 22 of file eEmMultAlgTool.cxx.

22 {
23
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,
35 );
36
37 try {
38 m_e_selector = std::make_unique<eEmSelector>(std::stoul(m_rhad_str),
40 std::stoul(m_reta_str),
42 std::stoul(m_wstot_str),
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 }
#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 107 of file eEmMultAlgTool.cxx.

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

◆ updateTIP()

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

Definition at line 34 of file TIPWriterAlgTool.cxx.

42 {
43
44 if (dc){dc->collect(*this, "start");}
45
46 unsigned int N_pass_tobs{0};
47 ATH_CHECK( countPassingTOBs(ctx, dc, 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 }
virtual StatusCode countPassingTOBs(const EventContext &, const std::unique_ptr< IDataCollector > &dc, 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 48 of file eEmMultAlgTool.h.

48{nullptr};

◆ m_e_selector

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

Definition at line 49 of file eEmMultAlgTool.h.

49{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 52 of file eEmMultAlgTool.h.

52 {
53 this,
54 "eEmTOBs",
55 "eEmTOBs",
56 "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 137 of file eEmMultAlgTool.h.

137 {
138 this,
139 "enable_dump",
140 false,
141 "flag to enable debug dumps"
142 };

◆ 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 64 of file eEmMultAlgTool.h.

64 {
65 this,
66 "et_high",
67 "inf",
68 "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 58 of file eEmMultAlgTool.h.

58 {
59 this,
60 "et_low",
61 "0",
62 "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 76 of file eEmMultAlgTool.h.

76 {
77 this,
78 "eta_high",
79 "inf",
80 "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 70 of file eEmMultAlgTool.h.

70 {
71 this,
72 "eta_low",
73 "0",
74 "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 130 of file eEmMultAlgTool.h.

130 {
131 this,
132 "menu_name",
133 "unknown",
134 "name from json menu file"
135 };

◆ 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 88 of file eEmMultAlgTool.h.

88 {
89 this,
90 "phi_high",
91 "inf",
92 "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 82 of file eEmMultAlgTool.h.

82 {
83 this,
84 "phi_low",
85 "0",
86 "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 112 of file eEmMultAlgTool.h.

112 {
113 this,
114 "reta_op",
115 "unknown",
116 "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 106 of file eEmMultAlgTool.h.

106 {
107 this,
108 "reta",
109 "0",
110 "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 100 of file eEmMultAlgTool.h.

100 {
101 this,
102 "rhad_op",
103 "unknown",
104 "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 94 of file eEmMultAlgTool.h.

94 {
95 this,
96 "rhad",
97 "0",
98 "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 124 of file eEmMultAlgTool.h.

124 {
125 this,
126 "wstot_op",
127 "unknown",
128 "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 118 of file eEmMultAlgTool.h.

118 {
119 this,
120 "wstot",
121 "0",
122 "wstot lcut_value"};

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